falkorlib 0.8.5 → 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/falkorlib/bootstrap/base.rb +20 -13
- data/lib/falkorlib/bootstrap/git.rb +5 -2
- data/lib/falkorlib/bootstrap/mkdocs.rb +3 -4
- data/lib/falkorlib/bootstrap/vagrant.rb +9 -3
- data/lib/falkorlib/cli.rb +34 -175
- data/lib/falkorlib/cli/link.rb +5 -1
- data/lib/falkorlib/cli/make.rb +15 -1
- data/lib/falkorlib/cli/new.rb +22 -5
- data/lib/falkorlib/tasks/rspec.rake +29 -9
- data/lib/falkorlib/version.rb +1 -1
- data/spec/falkorlib/bootstrap_spec.rb +26 -1
- data/spec/falkorlib/bootstrap_vagrant_spec.rb +14 -14
- data/templates/README/header_readme.erb +18 -21
- data/templates/README/readme_pyenv.erb +44 -0
- data/templates/mkdocs/docs/README.md.erb +7 -7
- data/templates/mkdocs/docs/contributing/setup.md.erb +3 -3
- data/templates/mkdocs/docs/layout.md.erb +25 -4
- data/templates/mkdocs/docs/setup.md.erb +315 -0
- data/templates/mkdocs/docs/vagrant.md.erb +85 -0
- data/templates/mkdocs/mkdocs.yml.erb +5 -4
- data/templates/vagrant/Vagrantfile.erb +73 -28
- data/templates/vagrant/vagrant/config.yaml.sample +8 -4
- data/templates/vagrant/vagrant/puppet/Makefile +40 -0
- data/templates/vagrant/vagrant/puppet/hiera.yaml +36 -0
- data/templates/vagrant/vagrant/puppet/hieradata/.gitignore +2 -0
- data/templates/vagrant/vagrant/puppet/hieradata/defaults.yaml +4 -0
- data/templates/vagrant/vagrant/puppet/hieradata/roles/example.yaml +13 -0
- data/templates/vagrant/vagrant/puppet/manifests/default.pp +23 -0
- data/templates/vagrant/vagrant/puppet/modules/.gitignore +3 -0
- data/templates/vagrant/vagrant/puppet/site/profiles/manifests/pxe/server.pp +12 -0
- data/templates/vagrant/vagrant/{bootstrap.sh → scripts/bootstrap.sh} +27 -30
- data/templates/vagrant/vagrant/shared/.gitignore +3 -0
- metadata +15 -6
- data/templates/mkdocs/docs/setup/README.md.erb +0 -6
- data/templates/mkdocs/docs/setup/install.md.erb +0 -61
- data/templates/mkdocs/docs/setup/preliminaries.md.erb +0 -73
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90a5f15ae97eb39936de7384fd80190a25ec572d3524e740f6d11fc9eeb46ded
|
4
|
+
data.tar.gz: 1f6f2e77ba4781fcae3cf069c144cb0ab85a2e347e54e1b2f464b31a84132e5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94800fe66c39db12b8052daf513de624299852372f95683e3a155d9da9f8bf5b3a0ee753d3386d3c572addd3246b602900445c86ea145715ed703949bfcb04f4
|
7
|
+
data.tar.gz: 41c9d9e4ab300564a5dff87b81bc43357f8a04f916b90b503b81c4752cf7beda5d3b656582228bc314384d54b220792f25502370126666779c7b58a5309e55d3
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
################################################################################
|
3
|
-
# Time-stamp: <
|
3
|
+
# Time-stamp: <Mon 2020-04-20 17:21 svarrette>
|
4
4
|
################################################################################
|
5
5
|
# Interface for the main Bootstrapping operations
|
6
6
|
#
|
@@ -29,11 +29,10 @@ module FalkorLib #:nodoc:
|
|
29
29
|
:hook => 'pre-commit.git-crypt.sh',
|
30
30
|
:ulhpc => [
|
31
31
|
#'0x5D08BCDD4F156AD7', # S. Varrette
|
32
|
-
#'0x3F3242C5B34D98C2', # V. Plugaru
|
33
32
|
'0x6429C2514EBC4737', # S. Peter
|
34
|
-
#'0x07FEA8BA69203C2D', # C. Parisot
|
35
33
|
'0x37183CEF550DF40B', # H. Cartiaux
|
36
|
-
|
34
|
+
'0x10717CE35947FEDF', # E. Kieffer
|
35
|
+
'0x710A74A36A99455A', # F. Pinel
|
37
36
|
],
|
38
37
|
# :hooks => {
|
39
38
|
# :precommit => 'https://gist.github.com/848c82daa63710b6c132bb42029b30ef.git',
|
@@ -62,9 +61,9 @@ module FalkorLib #:nodoc:
|
|
62
61
|
:institute => 'University of Luxembourg',
|
63
62
|
:department => 'Parallel Computing and Optimization Group',
|
64
63
|
:department_acro => 'PCOG',
|
65
|
-
:address => '
|
66
|
-
:zipcode => 'L-
|
67
|
-
:location => 'Luxembourg',
|
64
|
+
:address => '2, avenue de l\'Université',
|
65
|
+
:zipcode => 'L-4365',
|
66
|
+
:location => 'Esch-sur-Alzette, Luxembourg',
|
68
67
|
:phone => '(+352) 46 66 44 6600',
|
69
68
|
:twitter => 'svarrette',
|
70
69
|
:linkedin => 'svarrette',
|
@@ -139,6 +138,7 @@ module FalkorLib #:nodoc:
|
|
139
138
|
:domain => 'vagrant.dev',
|
140
139
|
:range => '10.10.1.0/24',
|
141
140
|
:boxes => {
|
141
|
+
:centos8 => 'generic/centos8', #'centos/8' is having issue - see https://github.com/dotless-de/vagrant-vbguest/issues/367
|
142
142
|
:centos7 => 'centos/7',
|
143
143
|
:debian8 => 'debian/contrib-jessie64',
|
144
144
|
:ubuntu14 => 'ubuntu/trusty64'
|
@@ -313,13 +313,17 @@ module FalkorLib
|
|
313
313
|
# Supported options:
|
314
314
|
# * :no_interaction [boolean]: do not interact
|
315
315
|
# * :force [boolean] force overwritting
|
316
|
-
# * :
|
317
|
-
# * :licensefile [string] License filename (default: LICENSE)
|
316
|
+
# * :gem [boolean] Ruby Gem
|
318
317
|
# * :latex [boolean] describe a LaTeX project
|
318
|
+
# * :license [string] License to use
|
319
|
+
# * :licensefile [string] License filename (default: LICENSE)
|
319
320
|
# * :octopress [boolean] octopress site
|
321
|
+
# * :pyenv [boolean] Python virtualenv/pyenv/direnv
|
322
|
+
# * :rvm [boolean] Ruby RVM
|
320
323
|
##
|
321
324
|
def readme(dir = Dir.pwd, options = {})
|
322
325
|
info "Bootstrap a README file for this project"
|
326
|
+
path = normalized_path(dir)
|
323
327
|
# get the local configuration
|
324
328
|
local_config = FalkorLib::Config.get(dir)
|
325
329
|
config = FalkorLib::Config::Bootstrap::DEFAULTS[:metadata].clone
|
@@ -381,7 +385,7 @@ module FalkorLib
|
|
381
385
|
when :author
|
382
386
|
(config[:by] == 'ULHPC') ? 'UL HPC Team' : config[:author]
|
383
387
|
when :mail
|
384
|
-
(config[:by] == 'ULHPC') ? 'hpc-
|
388
|
+
(config[:by] == 'ULHPC') ? 'hpc-team@uni.lu' : config[:mail]
|
385
389
|
when :description
|
386
390
|
(config[:description].empty?) ? (config[:summary]).to_s : (config[:description]).to_s
|
387
391
|
when :source
|
@@ -398,6 +402,7 @@ module FalkorLib
|
|
398
402
|
tags = ask("\tKeywords (comma-separated list of tags)", config[:tags].join(','))
|
399
403
|
config[:tags] = tags.split(',')
|
400
404
|
config[:license] = select_licence if config[:license].empty?
|
405
|
+
config[:rootdir] = path
|
401
406
|
# stack the ERB files required to generate the README
|
402
407
|
templatedir = File.join( FalkorLib.templates, 'README')
|
403
408
|
erbfiles = [ 'header_readme.erb' ]
|
@@ -409,6 +414,7 @@ module FalkorLib
|
|
409
414
|
erbfiles << "readme_gitflow.erb" if FalkorLib::GitFlow.init?(dir)
|
410
415
|
erbfiles << "readme_rvm.erb" if config[:type].include?(:rvm)
|
411
416
|
erbfiles << "readme_mkdocs.erb" if options[:mkdocs]
|
417
|
+
erbfiles << "readme_pyenv.erb" if config[:type].include?(:pyenv)
|
412
418
|
erbfiles << "footer_readme.erb"
|
413
419
|
|
414
420
|
content = ""
|
@@ -502,6 +508,9 @@ module FalkorLib
|
|
502
508
|
use_git = FalkorLib::Git.init?(path)
|
503
509
|
rootdir = (use_git) ? FalkorLib::Git.rootdir(path) : path
|
504
510
|
local_config = FalkorLib::Config.get(rootdir, :local)
|
511
|
+
if FalkorLib::GitFlow.init?(rootdir)
|
512
|
+
local_config[:project][:gitflow] = FalkorLib::GitFlow.guess_gitflow_config(rootdir) if local_config[:project]
|
513
|
+
end
|
505
514
|
return local_config[:project] if local_config[:project]
|
506
515
|
# Otherwise, guess the rest of the configuration
|
507
516
|
config = FalkorLib::Config::Bootstrap::DEFAULTS[:metadata].clone
|
@@ -538,9 +547,7 @@ module FalkorLib
|
|
538
547
|
if FalkorLib::GitFlow.init?(rootdir)
|
539
548
|
config[:gitflow] = FalkorLib::GitFlow.guess_gitflow_config(rootdir)
|
540
549
|
end
|
541
|
-
|
542
|
-
config[:rake] = File.exists?(File.join(rootdir, 'Rakefile'))
|
543
|
-
config
|
550
|
+
config
|
544
551
|
end # guess_project_config
|
545
552
|
|
546
553
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
################################################################################
|
3
|
-
# Time-stamp: <
|
3
|
+
# Time-stamp: <Mon 2020-04-20 16:13 svarrette>
|
4
4
|
################################################################################
|
5
5
|
# Interface for the main Bootstrapping operations
|
6
6
|
#
|
@@ -38,7 +38,7 @@ module FalkorLib
|
|
38
38
|
# * :gem [boolean] Initiate a Ruby gem project **NOT YET IMPLEMENTED**
|
39
39
|
# * :mkdocs [boolean] Initiate MkDocs within your project
|
40
40
|
# * :rvm [boolean] Initiate a RVM-based Ruby project
|
41
|
-
# * :pyenv [boolean] Initiate a pyenv-based Python project
|
41
|
+
# * :pyenv [boolean] Initiate a pyenv-based Python project
|
42
42
|
# * :octopress [boolean] Initiate an Octopress web site **NOT YET IMPLEMENTED**
|
43
43
|
##
|
44
44
|
def repo(name, options = {})
|
@@ -92,6 +92,9 @@ module FalkorLib
|
|
92
92
|
# === RVM ====
|
93
93
|
FalkorLib::Bootstrap.rvm(path, options) if options[:rvm]
|
94
94
|
|
95
|
+
# === Pyenv/Virtualenv/Direnv ====
|
96
|
+
FalkorLib::Bootstrap.pyenv(path, options) if options[:pyenv]
|
97
|
+
|
95
98
|
# === README ===
|
96
99
|
FalkorLib::Bootstrap.readme(path, options) # This should also save the project configuration
|
97
100
|
# collect the set options
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
################################################################################
|
3
|
-
# Time-stamp: <Mon
|
3
|
+
# Time-stamp: <Mon 2020-04-20 17:52 svarrette>
|
4
4
|
################################################################################
|
5
5
|
# Interface for Bootstrapping MkDocs
|
6
6
|
#
|
@@ -32,8 +32,8 @@ module FalkorLib
|
|
32
32
|
rootdir = (use_git) ? FalkorLib::Git.rootdir(path) : path
|
33
33
|
templatedir = File.join( FalkorLib.templates, 'mkdocs')
|
34
34
|
config = guess_project_config(rootdir, options)
|
35
|
-
config[:
|
36
|
-
|
35
|
+
config[:rootdir] = rootdir
|
36
|
+
config[:sitename] = ask("\tSite name: ", config[:name])
|
37
37
|
#FalkorLib::GitFlow.start('feature', 'mkdocs', rootdir) if (use_git && FalkorLib::GitFlow.init?(rootdir))
|
38
38
|
init_from_template(templatedir, rootdir, config,
|
39
39
|
:no_interaction => true,
|
@@ -41,7 +41,6 @@ module FalkorLib
|
|
41
41
|
Dir.chdir( File.join(rootdir, 'docs')) do
|
42
42
|
run %(ln -s README.md index.md )
|
43
43
|
run %(ln -s README.md contributing/index.md )
|
44
|
-
run %(ln -s README.md setup/index.md )
|
45
44
|
end
|
46
45
|
#exit_status.to_i
|
47
46
|
end # mkdocs
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
################################################################################
|
3
|
-
# Time-stamp: <
|
3
|
+
# Time-stamp: <Mon 2020-04-20 10:23 svarrette>
|
4
4
|
################################################################################
|
5
5
|
# Interface for Bootstrapping MkDocs
|
6
6
|
#
|
@@ -47,9 +47,15 @@ module FalkorLib
|
|
47
47
|
init_from_template(templatedir, rootdir, config,
|
48
48
|
:no_interaction => true,
|
49
49
|
:no_commit => true)
|
50
|
-
|
51
|
-
|
50
|
+
confdir = File.join(dir, 'vagrant')
|
51
|
+
[ 'config.yaml.sample' ].each do |f|
|
52
|
+
FalkorLib::Git.add(File.join(confdir, "#{f}")) if use_git
|
52
53
|
end
|
54
|
+
scriptsdir = File.join(confdir, 'scripts')
|
55
|
+
[ 'bootstrap.sh'].each do |f|
|
56
|
+
FalkorLib::Git.add(File.join(scriptsdir, "#{f}")) if use_git
|
57
|
+
end
|
58
|
+
#puppetdir = File.join(confdir, 'puppet')
|
53
59
|
Dir.chdir( rootdir ) do
|
54
60
|
run %(git ignore '.vagrant/' ) if command?('git-ignore')
|
55
61
|
# run %(ln -s README.md index.md )
|
data/lib/falkorlib/cli.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
################################################################################
|
3
|
-
# Time-stamp: <
|
3
|
+
# Time-stamp: <Mon 2020-04-20 17:04 svarrette>
|
4
4
|
################################################################################
|
5
5
|
# Interface for the CLI
|
6
6
|
#
|
@@ -17,15 +17,27 @@ require 'falkorlib/cli/link'
|
|
17
17
|
require 'falkorlib/cli/make'
|
18
18
|
|
19
19
|
|
20
|
-
|
21
20
|
module FalkorLib
|
22
21
|
# Falkor CLI Application, based on [Thor](http://whatisthor.com)
|
23
22
|
module CLI
|
24
23
|
# Main Application
|
25
24
|
class App < ::Thor
|
26
25
|
|
26
|
+
# https://stackoverflow.com/questions/49042591/how-to-add-help-h-flag-to-thor-command
|
27
|
+
def self.start(*args)
|
28
|
+
if (Thor::HELP_MAPPINGS & ARGV).any? and subcommands.grep(/^#{ARGV[0]}/).empty?
|
29
|
+
Thor::HELP_MAPPINGS.each do |cmd|
|
30
|
+
if match = ARGV.delete(cmd)
|
31
|
+
ARGV.unshift match
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
super
|
36
|
+
end
|
37
|
+
|
27
38
|
package_name 'Falkor[Lib]'
|
28
39
|
map %w(--version -V) => :version
|
40
|
+
map %w[--help -h] => :help
|
29
41
|
|
30
42
|
namespace :falkor
|
31
43
|
|
@@ -34,13 +46,13 @@ module FalkorLib
|
|
34
46
|
# include ZshCompletion::Command
|
35
47
|
|
36
48
|
#default_command :info
|
37
|
-
|
49
|
+
class_option :help, :aliases => ['-h', '--help'], type: :boolean
|
38
50
|
class_option :verbose, :aliases => '-v', :type => :boolean,
|
39
|
-
|
51
|
+
:desc => "Enable verbose output mode"
|
40
52
|
class_option :debug, :type => :boolean, :default => FalkorLib.config[:debug],
|
41
|
-
|
53
|
+
:desc => "Enable debug output mode"
|
42
54
|
class_option :dry_run, :aliases => '-n', :type => :boolean,
|
43
|
-
|
55
|
+
:desc => "Perform a trial run with (normally) no changes made"
|
44
56
|
|
45
57
|
###### commands ######
|
46
58
|
desc "commands", "Lists all available commands"
|
@@ -56,9 +68,9 @@ FalkorLib retrieves its configuration from the local repository (in '<git_rootdi
|
|
56
68
|
environment variables (NOT YET IMPLEMENTED), and the user's home directory (<home>/.falkor/config), in that order of priority.
|
57
69
|
CONFIG_LONG_DESC
|
58
70
|
method_option :global, :aliases => '-g', :type => :boolean,
|
59
|
-
|
71
|
+
:desc => 'Operate on the global configuration'
|
60
72
|
method_option :local, :aliases => '-l', :type => :boolean,
|
61
|
-
|
73
|
+
:desc => 'Operate on the local configuration of the repository'
|
62
74
|
def config(_key = '')
|
63
75
|
info "Thor options:"
|
64
76
|
puts options.to_yaml
|
@@ -66,7 +78,7 @@ CONFIG_LONG_DESC
|
|
66
78
|
puts FalkorLib.config.to_yaml
|
67
79
|
end # config
|
68
80
|
|
69
|
-
|
81
|
+
|
70
82
|
|
71
83
|
###### gitcrypt ######
|
72
84
|
method_option :owner, :aliases => '-o',
|
@@ -93,20 +105,20 @@ By default, <PATH> is '.' meaning that the repository will be initialized in the
|
|
93
105
|
INIT_LONG_DESC
|
94
106
|
#......................................................
|
95
107
|
method_option :git_flow, :default => true, :type => :boolean,
|
96
|
-
|
108
|
+
:desc => 'Bootstrap the repository with Git-glow'
|
97
109
|
method_option :make, :default => true, :type => :boolean,
|
98
|
-
|
110
|
+
:desc => 'Use a Makefile to pilot the repository actions'
|
99
111
|
method_option :rake, :type => :boolean,
|
100
|
-
|
112
|
+
:desc => 'Use a Rakefile (and FalkorLib) to pilot the repository actions'
|
101
113
|
method_option :interactive, :aliases => '-i', :default => true, :type => :boolean,
|
102
|
-
|
114
|
+
:desc => "Interactive mode, in particular to confirm Gitflow branch names"
|
103
115
|
method_option :remote_sync, :aliases => '-r', :type => :boolean,
|
104
|
-
|
116
|
+
:desc => "Operate a git remote synchronization with remote. By default, all commits stay local"
|
105
117
|
method_option :master, :default => 'production', :banner => 'BRANCH',
|
106
|
-
|
118
|
+
:desc => "Master Branch name for production releases"
|
107
119
|
method_option :develop, :aliases => [ '-b', '--branch', '--devel'],
|
108
|
-
|
109
|
-
|
120
|
+
:default => 'devel', :banner => 'BRANCH',
|
121
|
+
:desc => "Branch name for development commits"
|
110
122
|
# method_option :latex, :aliases => '-l', :type => :boolean, :desc => "Initiate a LaTeX project"
|
111
123
|
# #method_option :gem, :type => :boolean, :desc => "Initiate a Ruby gem project"
|
112
124
|
# method_option :rvm, :type => :boolean, :desc => "Initiate a RVM-based Ruby project"
|
@@ -140,11 +152,11 @@ By default, <PATH> is '.' meaning that the repository will be initialized in the
|
|
140
152
|
|
141
153
|
###### motd ######
|
142
154
|
method_option :file, :aliases => '-f', :default => '/etc/motd',
|
143
|
-
|
155
|
+
:desc => "File storing the message of the day"
|
144
156
|
method_option :width, :aliases => '-w', :default => 80, :type => :numeric,
|
145
|
-
|
157
|
+
:desc => "Width for the text"
|
146
158
|
method_option :title, :aliases => '-t',
|
147
|
-
|
159
|
+
:desc => "Title to be placed in the motd (using asciify/figlet)"
|
148
160
|
method_option :subtitle, :desc => "Eventual subtitle to place below the title"
|
149
161
|
method_option :hostname, :desc => "Hostname"
|
150
162
|
method_option :support, :aliases => '-s', :desc => "Support/Contact mail"
|
@@ -160,7 +172,9 @@ By default, <PATH> is '.' meaning that the repository will be initialized in the
|
|
160
172
|
desc "new <type> [<path>]", "Initialize the directory PATH with one of FalkorLib's template(s)"
|
161
173
|
subcommand "new", FalkorLib::CLI::New
|
162
174
|
|
175
|
+
|
163
176
|
###### vagrant ######
|
177
|
+
#method_option :help, :aliases => '-h'
|
164
178
|
method_option :force, :aliases => '-f', :default => false, :type => :boolean,
|
165
179
|
:desc => "Force generation (might overwrite files)"
|
166
180
|
#......................................
|
@@ -176,161 +190,6 @@ By default, <PATH> is '.' meaning that the repository will be initialized in the
|
|
176
190
|
end
|
177
191
|
|
178
192
|
end # class App
|
179
|
-
|
180
193
|
#puts Thor::ZshCompletion::Generator.new(App, "falkor").generate
|
181
194
|
end # module CLI
|
182
195
|
end
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
# require_relative "commands/init"
|
189
|
-
|
190
|
-
# module FalkorLib
|
191
|
-
# module CLI
|
192
|
-
# def self.const_missing(c)
|
193
|
-
# Object.const_get(c)
|
194
|
-
# end
|
195
|
-
# end
|
196
|
-
# end
|
197
|
-
|
198
|
-
# require 'falkorlib'
|
199
|
-
|
200
|
-
|
201
|
-
# require 'thor'
|
202
|
-
# require "thor/group"
|
203
|
-
|
204
|
-
|
205
|
-
#require "falkorlib/commands/init"
|
206
|
-
|
207
|
-
# require 'logger'
|
208
|
-
|
209
|
-
# # Declare a logger to log messages:
|
210
|
-
# LOGGER = Logger.new(STDERR)
|
211
|
-
# LOGGER.level = Logger::INFO
|
212
|
-
|
213
|
-
|
214
|
-
# module FalkorLib
|
215
|
-
# # Falkor CLI Application, based on [Thor](http://whatisthor.com)
|
216
|
-
|
217
|
-
# require_relative "commands/init"
|
218
|
-
|
219
|
-
# module CLI
|
220
|
-
|
221
|
-
# def self.const_missing(c)
|
222
|
-
# Object.const_get(c)
|
223
|
-
# end
|
224
|
-
|
225
|
-
|
226
|
-
# # Main CLI command for FalkorLib
|
227
|
-
# class Command < Thor
|
228
|
-
|
229
|
-
# class_option :verbose, :type => :boolean
|
230
|
-
|
231
|
-
# require "falkorlib/commands/init"
|
232
|
-
|
233
|
-
# # ----------
|
234
|
-
# # desc "init <PATH> [options]", "Initialize the directory PATH with FalkorLib's template(s)"
|
235
|
-
# # subcommand "init", FalkorLib::CLI::Init
|
236
|
-
|
237
|
-
# end # class FalkorLib::CLI::Command
|
238
|
-
# end
|
239
|
-
# end
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
# # Mercenary version
|
245
|
-
|
246
|
-
# module FalkorLib
|
247
|
-
|
248
|
-
# # Falkor CLI Application, based on (finally) [Mercenary](http://www.rubydoc.info/gems/mercenary)
|
249
|
-
# # instead of [Thor](http://whatisthor.com)
|
250
|
-
# class Command
|
251
|
-
|
252
|
-
# # Keep a list of subclasses of FalkorLib::Command every time it's inherited
|
253
|
-
# # Called automatically.
|
254
|
-
# #
|
255
|
-
# # base - the subclass
|
256
|
-
# #
|
257
|
-
# # Returns nothing
|
258
|
-
# def self.inherited(base)
|
259
|
-
# subclasses << base
|
260
|
-
# end
|
261
|
-
|
262
|
-
# # A list of subclasses of FalkorLib::Command
|
263
|
-
# def self.subclasses
|
264
|
-
# @subclasses ||= []
|
265
|
-
# end
|
266
|
-
|
267
|
-
# def init_with_program(p)
|
268
|
-
# raise NotImplementedError.new("")
|
269
|
-
# end
|
270
|
-
# end
|
271
|
-
# end
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
# module FalkorLib #:nodoc:
|
284
|
-
# module Config
|
285
|
-
|
286
|
-
# # Default configuration for FalkorLib::App
|
287
|
-
# module CLI
|
288
|
-
# # App defaults for FalkorLib
|
289
|
-
# DEFAULTS = {
|
290
|
-
# # command-line options
|
291
|
-
# :options => {},
|
292
|
-
# #:type => "latex"
|
293
|
-
# }
|
294
|
-
# end
|
295
|
-
# end
|
296
|
-
# end
|
297
|
-
|
298
|
-
|
299
|
-
# # ---------------------------
|
300
|
-
# # Command line parsing
|
301
|
-
# # ---------------------------
|
302
|
-
# module FalkorCLI
|
303
|
-
# class Init < Thor
|
304
|
-
# # # exit if bad parsing happen
|
305
|
-
# # def self.exit_on_failure?
|
306
|
-
# # true
|
307
|
-
# # end
|
308
|
-
|
309
|
-
# class_option :verbose,
|
310
|
-
# :type => :boolean,
|
311
|
-
# :default => false,
|
312
|
-
# :aliases => "-v",
|
313
|
-
# :desc => "Verbose mode"
|
314
|
-
# class_option :debug,
|
315
|
-
# :type => :boolean,
|
316
|
-
# :default => false,
|
317
|
-
# :aliases => "-d",
|
318
|
-
# :desc => "Debug mode"
|
319
|
-
|
320
|
-
|
321
|
-
# desc "init", "Initialise a given template"
|
322
|
-
# long_desc <<-LONGDESC
|
323
|
-
# Initialize a new directory according to <type> of template
|
324
|
-
# LONGDESC
|
325
|
-
# option :type,
|
326
|
-
# :required => true,
|
327
|
-
# :default => 'repo',
|
328
|
-
# :type => :string,
|
329
|
-
# :desc => "Type of template to use to initialize this repository"
|
330
|
-
# def init(type)
|
331
|
-
# LOGGER.level = Logger::DEBUG if options[:verbose]
|
332
|
-
# puts "Hello, world!"
|
333
|
-
|
334
|
-
# end
|
335
|
-
# end
|
336
|
-
# end # module FalkorLib
|