Class: FalkorLib::CLI::New

Inherits:
Thor
  • Object
show all
Defined in:
lib/falkorlib/cli/new.rb

Overview

Thor class for all bootstrapping / initialization

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



20
21
22
# File 'lib/falkorlib/cli/new.rb', line 20

def self.banner(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 options[:help]
  FalkorLib::Bootstrap.latex(path, :article, options)
end

#commandsObject



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 options[:help]
  FalkorLib::Bootstrap.latex(path, :letter, options)
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 options[:help]
  license = options[:license] ?  options[:license] : FalkorLib::Bootstrap.select_licence('none')
  FalkorLib::Bootstrap.license(path, license, '', options)
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 options[:help]
  if options[:repo]
    FalkorLib::Bootstrap.makefile(dir)
  elsif (options[:latex] or options[:gnuplot] or options[:generic] or options[:images] or options[:src])
    FalkorLib::Bootstrap::Link.makefile(dir, options)
  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 options[:help]
  FalkorLib::Bootstrap.pyenv(path, options)
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 options[:help]  # pas boooooo
  FalkorLib::Bootstrap.readme(path, options)
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 options[:help]
  options[:rvm] = true if options[:rake] || options[:gem]
  # _newrepo(name, options)
  FalkorLib::Bootstrap.repo(name, options)
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 options[:help]
  FalkorLib::Bootstrap.rvm(path, options)
end

#slides(path = Dir.pwd) ⇒ Object

_



182
183
184
185
# File 'lib/falkorlib/cli/new.rb', line 182

def slides(path = Dir.pwd)
  (help(__method__) and exit 0) if options[:help]
  FalkorLib::Bootstrap.latex(path, :beamer, options)
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 options[: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, options)
end