Class: C11n::Executable::Runner
- Inherits:
-
Object
- Object
- C11n::Executable::Runner
- Defined in:
- lib/c11n/executable/runner.rb
Instance Method Summary collapse
- #config_hash ⇒ Object
-
#initialize(options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #load_config_file ⇒ Object
- #run ⇒ Object
- #synchronizer ⇒ Object
- #task ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Runner
Returns a new instance of Runner.
7 8 9 |
# File 'lib/c11n/executable/runner.rb', line 7 def initialize( = {}) = end |
Instance Method Details
#config_hash ⇒ Object
28 29 30 31 32 |
# File 'lib/c11n/executable/runner.rb', line 28 def config_hash if [:config_file_path] @config_hash ||= YAML.load(File.open([:config_file_path]).read) end end |
#load_config_file ⇒ Object
34 35 36 |
# File 'lib/c11n/executable/runner.rb', line 34 def load_config_file C11n::Configuration.instance.load_from_hash(config_hash) if config_hash end |
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/c11n/executable/runner.rb', line 11 def run load_config_file case task when 'push' synchronizer.upload when 'pull' synchronizer.download when 'setup' synchronizer.setup end end |
#synchronizer ⇒ Object
38 39 40 |
# File 'lib/c11n/executable/runner.rb', line 38 def synchronizer C11n::Synchronizer.new(configuration: C11n::Configuration.instance) end |
#task ⇒ Object
24 25 26 |
# File 'lib/c11n/executable/runner.rb', line 24 def task [:task] end |