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



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

def self.banner(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, options)
end

#commandsObject



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, options)
end

#license(path = Dir.pwd) ⇒ Object



99
100
101
102
# File 'lib/falkorlib/cli/new.rb', line 99

def license(path = Dir.pwd)
  license = options[:license] ?  options[:license] : FalkorLib::Bootstrap.select_licence('none')
  FalkorLib::Bootstrap.license(path, license, '', options)
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 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

__



158
159
160
# File 'lib/falkorlib/cli/new.rb', line 158

def pyenv(path = '.')
  FalkorLib::Bootstrap.pyenv(path, options)
end

#readme(path = '.') ⇒ Object



230
231
232
# File 'lib/falkorlib/cli/new.rb', line 230

def readme(path = '.')
  FalkorLib::Bootstrap.readme(path, options)
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 = '.')
  options[:rvm] = true if options[:rake] || options[:gem]
  # _newrepo(name, options)
  FalkorLib::Bootstrap.repo(name, options)
end

#rvm(path = '.') ⇒ Object

__



200
201
202
# File 'lib/falkorlib/cli/new.rb', line 200

def rvm(path = '.')
  FalkorLib::Bootstrap.rvm(path, options)
end

#slides(path = Dir.pwd) ⇒ Object

method_option :dir, :aliases => ‘-d’, :desc => ‘Project directory (relative to the git root directory)’ _



169
170
171
# File 'lib/falkorlib/cli/new.rb', line 169

def slides(path = Dir.pwd)
  FalkorLib::Bootstrap.latex(path, :beamer, options)
end

#trash(path = Dir.pwd) ⇒ Object

__



176
177
178
# File 'lib/falkorlib/cli/new.rb', line 176

def trash(path = Dir.pwd)
  FalkorLib::Bootstrap.trash(path)
end

#versionfile(path = '.') ⇒ Object

_



213
214
215
# File 'lib/falkorlib/cli/new.rb', line 213

def versionfile(path = '.')
  FalkorLib::Bootstrap.versionfile(path, options)
end