Class: Rares::Command
- Inherits:
-
Object
- Object
- Rares::Command
- Defined in:
- lib/rares/command.rb
Constant Summary collapse
- DEFAULT_HOST =
'http://rampagerecipes.com'
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ Command
Returns a new instance of Command.
10 11 12 |
# File 'lib/rares/command.rb', line 10 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/rares/command.rb', line 6 def @options end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rares/command.rb', line 14 def run if [:remote_id] id = [:remote_id] directory = File.join Dir.pwd, "tmp", "rares", id FileUtils.rm_rf File.join Dir.pwd, "tmp", "rares" FileUtils.mkdir_p(directory) download_and_extract_recipe!([:remote_host] || DEFAULT_HOST, id, directory) Rares::Main.new(directory, Dir.pwd).perform elsif [:local_path] puts "Using local folder #{[:local_path]}" Rares::Main.new([:local_path], Dir.pwd).perform else puts "Should provide remote id or local path" end end |