Class: LLenv::CLI
- Inherits:
-
Thor
- Object
- Thor
- LLenv::CLI
- Defined in:
- lib/llenv/cli.rb
Instance Method Summary collapse
- #exec(*argv) ⇒ Object
-
#initialize(args = [], options = {}, config = {}) ⇒ CLI
constructor
A new instance of CLI.
- #install ⇒ Object
- #list ⇒ Object
- #update ⇒ Object
- #vendorpath ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(args = [], options = {}, config = {}) ⇒ CLI
Returns a new instance of CLI.
7 8 9 10 11 12 13 |
# File 'lib/llenv/cli.rb', line 7 def initialize(args = [], = {}, config = {}) @root_dir = ENV["LLENV_ROOT"] || File.("~/.llenv") @declare_repo = ENV["LLENV_DECLARE_URL"] || "https://github.com/riywo/llenv-declare.git" @env = ENV["LLENV_ENV"] || "" @declare = LLenv::Declare.new(@root_dir, @env) super end |
Instance Method Details
#exec(*argv) ⇒ Object
34 35 36 37 |
# File 'lib/llenv/cli.rb', line 34 def exec(*argv) check_root_dir! @declare.run(llenv, "exec", argv) end |
#install ⇒ Object
28 29 30 31 |
# File 'lib/llenv/cli.rb', line 28 def install check_root_dir! @declare.run(llenv, "install") end |
#list ⇒ Object
16 17 18 19 |
# File 'lib/llenv/cli.rb', line 16 def list check_root_dir! @declare.list end |
#update ⇒ Object
22 23 24 25 |
# File 'lib/llenv/cli.rb', line 22 def update check_root_dir! system("cd #{@root_dir}; git pull") end |
#vendorpath ⇒ Object
40 41 42 43 |
# File 'lib/llenv/cli.rb', line 40 def vendorpath check_root_dir! @declare.run(llenv, "vendorpath") end |