Class: Strobe::CLI
- Inherits:
-
Thor
- Object
- Thor
- Strobe::CLI
- Defined in:
- lib/strobe/cli.rb
Instance Method Summary collapse
- #deploy ⇒ Object
- #help(command) ⇒ Object
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #preview ⇒ Object
- #signup ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
10 11 12 13 14 15 16 17 18 |
# File 'lib/strobe/cli.rb', line 10 def initialize(*) super opts = {"path" => Strobe.root}.merge() self. = Thor::CoreExt::HashWithIndifferentAccess.new(opts) use_shell = ["no-color"] ? Thor::Shell::Basic.new : shell Strobe.ui = UI::Shell.new(use_shell) end |
Instance Method Details
#deploy ⇒ Object
26 27 28 |
# File 'lib/strobe/cli.rb', line 26 def deploy Deploy.new([:path]).deploy end |
#help(command) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/strobe/cli.rb', line 35 def help(command) case command when "gemfile" then command = "gemfile.5" when nil then command = "bundle" else command = "bundle-#{cli}" end root = File.("../man", __FILE__) if manpages.include?(command) if have_groff? groff = "groff -Wall -mtty-char -mandoc -Tascii" pager = ENV['MANPAGER'] || ENV['PAGER'] || 'more' Kernel.exec "#{groff} #{root}/#{command} | #{pager}" else puts File.read("#{root}/#{command}.txt") end else super end end |