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
- #readme(path = '.') ⇒ Object
-
#repo(name = '.') ⇒ Object
method_option :pyenv, :type => :boolean, :desc => “Initiate a pyenv-based Python project” method_option :octopress, :aliases => [‘-o’, ‘–www’], :type => :boolean, :desc => “Initiate an Octopress web site” _.
-
#rvm(path = '.') ⇒ Object
__.
-
#slides(path = Dir.pwd) ⇒ Object
method_option :dir, :aliases => ‘-d’, :desc => ‘Project directory (relative to the git root directory)’ _.
-
#trash(path = Dir.pwd) ⇒ Object
__.
-
#versionfile(path = '.') ⇒ Object
_.
Class Method Details
.banner(task, _namespace = true, subcommand = false) ⇒ Object
19 20 21 |
# File 'lib/falkorlib/cli/new.rb', line 19 def self.(task, _namespace = true, subcommand = false) "#{basename} #{task.formatted_usage(self, true, subcommand)}" end |
Instance Method Details
#article(path = Dir.pwd) ⇒ Object
_
79 80 81 |
# File 'lib/falkorlib/cli/new.rb', line 79 def article(path = Dir.pwd) FalkorLib::Bootstrap.latex(path, :article, ) end |
#commands ⇒ Object
25 26 27 |
# File 'lib/falkorlib/cli/new.rb', line 25 def commands puts New.all_commands.keys.sort - [ 'commands' ] end |
#letter(path = Dir.pwd) ⇒ Object
_
90 91 92 |
# File 'lib/falkorlib/cli/new.rb', line 90 def letter(path = Dir.pwd) FalkorLib::Bootstrap.latex(path, :letter, ) end |
#license(path = Dir.pwd) ⇒ Object
99 100 101 102 |
# File 'lib/falkorlib/cli/new.rb', line 99 def license(path = Dir.pwd) license = [:license] ? [:license] : FalkorLib::Bootstrap.select_licence('none') FalkorLib::Bootstrap.license(path, license, '', ) end |
#make(dir = Dir.pwd) ⇒ Object
119 120 121 122 123 124 125 126 127 |
# File 'lib/falkorlib/cli/new.rb', line 119 def make(dir = Dir.pwd) 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 |
#readme(path = '.') ⇒ Object
197 198 199 |
# File 'lib/falkorlib/cli/new.rb', line 197 def readme(path = '.') FalkorLib::Bootstrap.readme(path, ) end |
#repo(name = '.') ⇒ Object
method_option :pyenv, :type => :boolean, :desc => “Initiate a pyenv-based Python project” method_option :octopress, :aliases => [‘-o’, ‘–www’], :type => :boolean, :desc => “Initiate an Octopress web site” _
64 65 66 67 68 |
# File 'lib/falkorlib/cli/new.rb', line 64 def repo(name = '.') [:rvm] = true if [:rake] || [:gem] # _newrepo(name, options) FalkorLib::Bootstrap.repo(name, ) end |
#rvm(path = '.') ⇒ Object
__
167 168 169 |
# File 'lib/falkorlib/cli/new.rb', line 167 def rvm(path = '.') FalkorLib::Bootstrap.rvm(path, ) end |
#slides(path = Dir.pwd) ⇒ Object
method_option :dir, :aliases => ‘-d’, :desc => ‘Project directory (relative to the git root directory)’ _
136 137 138 |
# File 'lib/falkorlib/cli/new.rb', line 136 def (path = Dir.pwd) FalkorLib::Bootstrap.latex(path, :beamer, ) end |
#trash(path = Dir.pwd) ⇒ Object
__
143 144 145 |
# File 'lib/falkorlib/cli/new.rb', line 143 def trash(path = Dir.pwd) FalkorLib::Bootstrap.trash(path) end |
#versionfile(path = '.') ⇒ Object
_
180 181 182 |
# File 'lib/falkorlib/cli/new.rb', line 180 def versionfile(path = '.') FalkorLib::Bootstrap.versionfile(path, ) end |