Class: Wrench::CLI
- Inherits:
-
Thor
- Object
- Thor
- Wrench::CLI
- Defined in:
- lib/wrench/cli.rb
Instance Method Summary collapse
- #down(asset) ⇒ Object
-
#initialize(*args) ⇒ CLI
constructor
A new instance of CLI.
- #list ⇒ Object
- #test ⇒ Object
- #up(name) ⇒ Object
Constructor Details
#initialize(*args) ⇒ CLI
Returns a new instance of CLI.
5 6 7 8 9 10 11 |
# File 'lib/wrench/cli.rb', line 5 def initialize(*args) super @config = YAML.load_file( File.join( File.dirname(__FILE__), "../../config/config.yaml" ) ) end |
Instance Method Details
#down(asset) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/wrench/cli.rb', line 22 def down(asset) sel = @config[ASSETS].find {|a| a["name"] == asset } download(sel["url"]) unless sel.nil? end |
#list ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/wrench/cli.rb', line 31 def list @config[ASSETS].each do |a| puts " + #{a[NAME]}" end end |
#test ⇒ Object
40 41 42 43 44 |
# File 'lib/wrench/cli.rb', line 40 def test resource_ext("https://raw.github.com/douglascrockford/JSON-js/master/json2.js") end |
#up(name) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/wrench/cli.rb', line 14 def up(name) create_directories(name) create_files(name) end |