Skip to content

Commit

Permalink
Remove display manager completely
Browse files Browse the repository at this point in the history
  • Loading branch information
ianfixes committed Sep 7, 2018
1 parent e700e87 commit b67bfb5
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 290 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added

### Changed
* Refactored documentation
- Refactored documentation

### Deprecated

### Removed
- Display Manager became no longer necessary with Arduino 1.8.X

### Fixed

Expand Down
16 changes: 2 additions & 14 deletions lib/arduino_ci/arduino_cmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,6 @@ def set_pref(key, value)
success
end

# run the arduino command
# @return [bool] whether the command succeeded
def _run_and_output(*args, **kwargs)
raise "Ian needs to implement this in a subclass #{args} #{kwargs}"
end

# run the arduino command
# @return [Hash] keys for :success, :out, and :err
def _run_and_capture(*args, **kwargs)
raise "Ian needs to implement this in a subclass #{args} #{kwargs}"
end

def _wrap_run(work_fn, *args, **kwargs)
# do some work to extract & merge environment variables if they exist
has_env = !args.empty? && args[0].class == Hash
Expand All @@ -140,13 +128,13 @@ def _wrap_run(work_fn, *args, **kwargs)

# build and run the arduino command
def run_and_output(*args, **kwargs)
_wrap_run((proc { |*a, **k| _run_and_output(*a, **k) }), *args, **kwargs)
_wrap_run((proc { |*a, **k| Host.run_and_output(*a, **k) }), *args, **kwargs)
end

# run a command and capture its output
# @return [Hash] {:out => String, :err => String, :success => bool}
def run_and_capture(*args, **kwargs)
ret = _wrap_run((proc { |*a, **k| _run_and_capture(*a, **k) }), *args, **kwargs)
ret = _wrap_run((proc { |*a, **k| Host.run_and_capture(*a, **k) }), *args, **kwargs)
@last_err = ret[:err]
@last_out = ret[:out]
ret
Expand Down
15 changes: 1 addition & 14 deletions lib/arduino_ci/arduino_cmd_linux.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'arduino_ci/arduino_cmd'
require 'arduino_ci/display_manager'
require 'timeout'

module ArduinoCI

Expand All @@ -19,7 +19,6 @@ class ArduinoCmdLinux < ArduinoCmd
def initialize
super
@prefs_response_time = nil
@display_mgr = DisplayManager::instance
end

# fetch preferences in their raw form
Expand All @@ -38,18 +37,6 @@ def _lib_dir
File.join(get_pref("sketchbook.path"), "libraries")
end

# run the arduino command
# @return [bool] whether the command succeeded
def _run_and_output(*args, **kwargs)
@display_mgr.run_and_output(*args, **kwargs)
end

# run the arduino command
# @return [Hash] keys for :success, :out, and :err
def _run_and_capture(*args, **kwargs)
@display_mgr.run_and_capture(*args, **kwargs)
end

def run_with_gui_guess(message, *args, **kwargs)
# On Travis CI, we get an error message in the GUI instead of on STDERR
# so, assume that if we don't get a rapid reply that things are not installed
Expand Down
12 changes: 0 additions & 12 deletions lib/arduino_ci/arduino_cmd_linux_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ def _lib_dir
File.join(get_pref("sketchbook.path"), "libraries")
end

# run the arduino command
# @return [bool] whether the command succeeded
def _run_and_output(*args, **kwargs)
Host.run_and_output(*args, **kwargs)
end

# run the arduino command
# @return [Hash] keys for :success, :out, and :err
def _run_and_capture(*args, **kwargs)
Host.run_and_capture(*args, **kwargs)
end

end

end
12 changes: 0 additions & 12 deletions lib/arduino_ci/arduino_cmd_osx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ class ArduinoCmdOSX < ArduinoCmd
flag :install_library, "--install-library"
flag :verify, "--verify"

# run the arduino command
# @return [bool] whether the command succeeded
def _run_and_output(*args, **kwargs)
Host.run_and_output(*args, **kwargs)
end

# run the arduino command
# @return [Hash] keys for :success, :out, and :err
def _run_and_capture(*args, **kwargs)
Host.run_and_capture(*args, **kwargs)
end

def _lib_dir
File.join(ENV['HOME'], "Documents", "Arduino", "libraries")
end
Expand Down
12 changes: 0 additions & 12 deletions lib/arduino_ci/arduino_cmd_windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ class ArduinoCmdWindows < ArduinoCmd
flag :install_library, "--install-library"
flag :verify, "--verify"

# run the arduino command
# @return [bool] whether the command succeeded
def _run_and_output(*args, **kwargs)
Host.run_and_output(*args, **kwargs)
end

# run the arduino command
# @return [Hash] keys for :success, :out, and :err
def _run_and_capture(*args, **kwargs)
Host.run_and_capture(*args, **kwargs)
end

def _lib_dir
File.join(ENV['userprofile'], "Documents", "Arduino", "libraries")
end
Expand Down
188 changes: 0 additions & 188 deletions lib/arduino_ci/display_manager.rb

This file was deleted.

37 changes: 0 additions & 37 deletions spec/display_manager_spec.rb

This file was deleted.

0 comments on commit b67bfb5

Please sign in to comment.