Class: FalkorLib::CLI::New
- Inherits:
-
Thor
- Object
- Thor
- FalkorLib::CLI::New
- Defined in:
- lib/falkorlib/cli/new.rb
Overview
Thor class for all bootstrapping / initialization
Class Method Summary collapse
Instance Method Summary collapse
-
#article(path = Dir.pwd) ⇒ Object
_.
- #commands ⇒ Object
-
#letter(path = Dir.pwd) ⇒ Object
_.
- #license(path = Dir.pwd) ⇒ Object
- #make(dir = Dir.pwd) ⇒ Object
-
#pyenv(path = '.') ⇒ Object
__.
- #readme(path = '.') ⇒ Object
-
#repo(name = '.') ⇒ Object
method_option :octopress, :aliases => [‘-o’, ‘–www’], :type => :boolean, :desc => “Initiate an Octopress web site” _.
-
#rvm(path = '.') ⇒ Object
__.
-
#slides(path = Dir.pwd) ⇒ Object
_.
-
#trash(path = Dir.pwd) ⇒ Object
__.
-
#versionfile(path = '.') ⇒ Object
_.
Class Method Details
.banner(task, _namespace = true, subcommand = false) ⇒ Object
20 21 22 |
# File 'lib/falkorlib/cli/new.rb', line 20 def self.(task, _namespace = true, subcommand = false) "#{basename} #{task.formatted_usage(self, true, subcommand)}" end |
Instance Method Details
#article(path = Dir.pwd) ⇒ Object
_
87 88 89 90 |
# File 'lib/falkorlib/cli/new.rb', line 87 def article(path = Dir.pwd) (help(__method__) and exit 0) if [:help] FalkorLib::Bootstrap.latex(path, :article, ) end |
#commands ⇒ Object
28 29 30 |
# File 'lib/falkorlib/cli/new.rb', line 28 def commands puts New.all_commands.keys.sort - [ 'commands' ] end |
#letter(path = Dir.pwd) ⇒ Object
_
99 100 101 102 |
# File 'lib/falkorlib/cli/new.rb', line 99 def letter(path = Dir.pwd) (help(__method__) and exit 0) if [:help] FalkorLib::Bootstrap.latex(path, :letter, ) end |
#license(path = Dir.pwd) ⇒ Object
109 110 111 112 113 |
# File 'lib/falkorlib/cli/new.rb', line 109 def license(path = Dir.pwd) (help(__method__) and exit 0) if [:help] license = [:license] ? [:license] : FalkorLib::Bootstrap.select_licence('none') FalkorLib::Bootstrap.license(path, license, '', ) end |
#make(dir = Dir.pwd) ⇒ Object
130 131 132 133 134 135 136 137 138 139 |
# File 'lib/falkorlib/cli/new.rb', line 130 def make(dir = Dir.pwd) (help(__method__) and exit 0) if [:help] if [:repo] FalkorLib::Bootstrap.makefile(dir) elsif ([:latex] or [:gnuplot] or [:generic] or [:images] or [:src]) FalkorLib::Bootstrap::Link.makefile(dir, ) else FalkorLib::Common.error 'Kindly precize the type of Makefile you which to create' end end |
#pyenv(path = '.') ⇒ Object
__
170 171 172 173 |
# File 'lib/falkorlib/cli/new.rb', line 170 def pyenv(path = '.') (help(__method__) and exit 0) if [:help] FalkorLib::Bootstrap.pyenv(path, ) end |
#readme(path = '.') ⇒ Object
246 247 248 249 |
# File 'lib/falkorlib/cli/new.rb', line 246 def readme(path = '.') (help(__method__) and exit 0) if [:help] # pas boooooo FalkorLib::Bootstrap.readme(path, ) end |
#repo(name = '.') ⇒ Object
method_option :octopress, :aliases => [‘-o’, ‘–www’], :type => :boolean, :desc => “Initiate an Octopress web site” _
69 70 71 72 73 74 75 76 |
# File 'lib/falkorlib/cli/new.rb', line 69 def repo(name = '.') # TODO: find a generic way to handle help in subcommands # -- see https://github.com/erikhuda/thor/issues/532 (help(__method__) and exit 0) if [:help] [:rvm] = true if [:rake] || [:gem] # _newrepo(name, options) FalkorLib::Bootstrap.repo(name, ) end |
#rvm(path = '.') ⇒ Object
__
215 216 217 218 |
# File 'lib/falkorlib/cli/new.rb', line 215 def rvm(path = '.') (help(__method__) and exit 0) if [:help] FalkorLib::Bootstrap.rvm(path, ) end |
#slides(path = Dir.pwd) ⇒ Object
_
182 183 184 185 |
# File 'lib/falkorlib/cli/new.rb', line 182 def (path = Dir.pwd) (help(__method__) and exit 0) if [:help] FalkorLib::Bootstrap.latex(path, :beamer, ) end |
#trash(path = Dir.pwd) ⇒ Object
__
190 191 192 193 |
# File 'lib/falkorlib/cli/new.rb', line 190 def trash(path = Dir.pwd) (help(__method__) and exit 0) if [:help] FalkorLib::Bootstrap.trash(path) end |
#versionfile(path = '.') ⇒ Object
_
229 230 231 |
# File 'lib/falkorlib/cli/new.rb', line 229 def versionfile(path = '.') FalkorLib::Bootstrap.versionfile(path, ) end |