falkorlib 0.6.17 → 0.6.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +11 -0
- data/Gemfile.lock +11 -18
- data/bin/falkor +7 -6
- data/completion/.gitignore +1 -0
- data/completion/_falkor +203 -0
- data/falkorlib.gemspec +159 -214
- data/lib/falkorlib/bootstrap/base.rb +19 -9
- data/lib/falkorlib/bootstrap/link.rb +8 -4
- data/lib/falkorlib/cli/link.rb +47 -41
- data/lib/falkorlib/cli/new.rb +146 -141
- data/lib/falkorlib/cli.rb +14 -11
- data/lib/falkorlib/common.rb +3 -3
- data/lib/falkorlib/version.rb +1 -1
- data/templates/gems/Gemfile +3 -0
- data/templates/gems/LICENCE.md +22 -0
- data/templates/gems/README.md +192 -0
- data/templates/gems/Rakefile +39 -0
- data/templates/gems/lib/sysadmin-warrior/loader.rb +5 -0
- data/templates/gems/lib/sysadmin-warrior/version.rb +49 -0
- data/templates/gems/lib/sysadmin-warrior.rb +40 -0
- data/templates/gems/sysadmin-warrior.gemspec +200 -0
- data/templates/latex/.gitignore +1 -0
- data/templates/latex/letter/_content.md.erb +6 -3
- data/templates/latex/letter/main.tex.erb +23 -15
- metadata +19 -28
- data/completion/falkor.zsh +0 -25
data/falkorlib.gemspec
CHANGED
@@ -1,222 +1,167 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
# We require your library, mainly to have access to the VERSION number.
|
3
|
-
# Feel free to set $version manually.
|
4
2
|
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
5
3
|
require "falkorlib/version"
|
6
4
|
$version = FalkorLib::Version.to_s
|
7
5
|
|
8
|
-
#
|
9
|
-
# This is your Gem specification. Default values are provided so that your library
|
10
|
-
# should be correctly packaged given what you have described in the .noespec file.
|
11
|
-
#
|
12
6
|
Gem::Specification.new do |s|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
# The RubyGems version required by this gem
|
173
|
-
#
|
174
|
-
# s.required_rubygems_version = ">= 0"
|
175
|
-
|
176
|
-
# The platform this gem runs on. See Gem::Platform for details.
|
177
|
-
#
|
178
|
-
# s.platform = nil
|
179
|
-
|
180
|
-
# Extensions to build when installing the gem.
|
181
|
-
#
|
182
|
-
# Valid types of extensions are extconf.rb files, configure scripts
|
183
|
-
# and rakefiles or mkrf_conf files.
|
184
|
-
#
|
185
|
-
s.extensions = []
|
186
|
-
|
187
|
-
# External (to RubyGems) requirements that must be met for this gem to work.
|
188
|
-
# It’s simply information for the user.
|
189
|
-
#
|
190
|
-
s.requirements = nil
|
191
|
-
|
192
|
-
# A message that gets displayed after the gem is installed
|
193
|
-
#
|
194
|
-
# Uncomment and set this if you want to say something to the user
|
195
|
-
# after gem installation
|
196
|
-
#
|
197
|
-
s.post_install_message = "Thanks for installing FalkorLib.\n"
|
198
|
-
|
199
|
-
################################################################### SECURITY
|
200
|
-
|
201
|
-
# The key used to sign this gem. See Gem::Security for details.
|
202
|
-
#
|
203
|
-
#s.signing_key = "0xDD01D5C0"
|
204
|
-
|
205
|
-
# The certificate chain used to sign this gem. See Gem::Security for
|
206
|
-
# details.
|
207
|
-
#
|
208
|
-
# s.cert_chain = []
|
209
|
-
|
210
|
-
################################################################### RDOC
|
211
|
-
|
212
|
-
# An ARGV style array of options to RDoc
|
213
|
-
#
|
214
|
-
# See 'rdoc --help' about this
|
215
|
-
#
|
216
|
-
s.rdoc_options = []
|
217
|
-
|
218
|
-
# Extra files to add to RDoc such as README
|
219
|
-
#
|
220
|
-
s.extra_rdoc_files = Dir["README.md"] + Dir["CHANGELOG.md"] + Dir["LICENCE.md"]
|
7
|
+
s.name = "falkorlib"
|
8
|
+
s.version = $version
|
9
|
+
s.date = Time.now.strftime('%Y-%m-%d')
|
10
|
+
s.summary = "Sebastien Varrette aka Falkor's Common library to share Ruby code and {rake,cap} tasks"
|
11
|
+
s.description = "This is my personal library I use to share the Ruby tidbits and Rake tasks I made it for my various projects, and also to bootstrap easily several element of my daily workflow (new git repository, new beamer slides etc.).\nThis is also my first gem so any comments on the code/organization are welcome, I'm a newbie in this domain. \nNote that I used [Noe](https://github.com/blambeau/noe) to bootstrap this project and get a fully documented environment."
|
12
|
+
|
13
|
+
s.homepage = "https://github.com/Falkor/falkorlib"
|
14
|
+
s.licenses = 'MIT'
|
15
|
+
|
16
|
+
s.authors = ['Sebastien Varrette']
|
17
|
+
# The list of author names who wrote this gem.
|
18
|
+
s.email = ['Sebastien.Varrette@uni.lu']
|
19
|
+
|
20
|
+
# Paths in the gem to add to $LOAD_PATH when this gem is activated (required).
|
21
|
+
#
|
22
|
+
# The default 'lib' is typically sufficient.
|
23
|
+
s.require_paths = ["lib"]
|
24
|
+
|
25
|
+
# Files included in this gem.
|
26
|
+
#
|
27
|
+
# By default, we take all files included in the .Manifest.txt file on root
|
28
|
+
# of the project. Entries of the manifest are interpreted as Dir[...]
|
29
|
+
# patterns so that lazy people may use wilcards like lib/**/*
|
30
|
+
#
|
31
|
+
# here = File.expand_path(File.dirname(__FILE__))
|
32
|
+
# s.files = File.readlines(File.join(here, '.Manifest.txt')).
|
33
|
+
# inject([]){|files, pattern| files + Dir[File.join(here, pattern.strip)]}.
|
34
|
+
# collect{|x| x[(1+here.size)..-1]}
|
35
|
+
|
36
|
+
# Test files included in this gem.
|
37
|
+
#
|
38
|
+
s.test_files = Dir["test/**/*"] + Dir["spec/**/*"]
|
39
|
+
|
40
|
+
# Alternative:
|
41
|
+
s.files = `git ls-files`.split("\n")
|
42
|
+
#s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
43
|
+
#s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
44
|
+
|
45
|
+
# The path in the gem for executable scripts (optional)
|
46
|
+
#
|
47
|
+
#s.bindir = "bin"
|
48
|
+
|
49
|
+
s.executables = (Dir["bin/*"]).collect{|f| File.basename(f)}
|
50
|
+
|
51
|
+
################################################################### REQUIREMENTS & INSTALL
|
52
|
+
# Remember the gem version requirements operators and schemes:
|
53
|
+
# = Equals version
|
54
|
+
# != Not equal to version
|
55
|
+
# > Greater than version
|
56
|
+
# < Less than version
|
57
|
+
# >= Greater than or equal to
|
58
|
+
# <= Less than or equal to
|
59
|
+
# ~> Approximately greater than
|
60
|
+
#
|
61
|
+
# Don't forget to have a look at http://lmgtfy.com/?q=Ruby+Versioning+Policies
|
62
|
+
# for setting your gem version.
|
63
|
+
#
|
64
|
+
# For your requirements to other gems, remember that
|
65
|
+
# ">= 2.2.0" (optimistic: specify minimal version)
|
66
|
+
# ">= 2.2.0", "< 3.0" (pessimistic: not greater than the next major)
|
67
|
+
# "~> 2.2" (shortcut for ">= 2.2.0", "< 3.0")
|
68
|
+
# "~> 2.2.0" (shortcut for ">= 2.2.0", "< 2.3.0")
|
69
|
+
#
|
70
|
+
#s.add_dependency("rake", ">= 10.1.0")
|
71
|
+
s.add_runtime_dependency 'rake', '~> 10.1', '>= 10.1.0'
|
72
|
+
s.add_runtime_dependency 'git_remote_branch', '~> 0'
|
73
|
+
#s.add_runtime_dependency 'git', '~> 1.2', '>= 1.2.5'
|
74
|
+
s.add_runtime_dependency('minigit', '~> 0')
|
75
|
+
s.add_runtime_dependency("term-ansicolor", "~> 1.3")
|
76
|
+
s.add_runtime_dependency("configatron", "~> 3.2")
|
77
|
+
s.add_runtime_dependency("awesome_print", "~> 1.2")
|
78
|
+
s.add_runtime_dependency("json", "~> 1.8")
|
79
|
+
s.add_runtime_dependency("license-generator", '~> 0')
|
80
|
+
s.add_runtime_dependency("deep_merge", '~> 1.0.1')
|
81
|
+
s.add_runtime_dependency("diffy", '>= 3.0')
|
82
|
+
s.add_runtime_dependency("logger", '>= 1.2.8')
|
83
|
+
s.add_runtime_dependency("thor", '>= 0.19')
|
84
|
+
s.add_runtime_dependency("artii", '>= 2.1')
|
85
|
+
s.add_runtime_dependency("facter", '~> 2.4.1')
|
86
|
+
|
87
|
+
#s.add_runtime_dependency("mercenary", '>= 0.3.5')
|
88
|
+
|
89
|
+
#
|
90
|
+
#
|
91
|
+
# One call to add_dependency('gem_name', 'gem version requirement') for each
|
92
|
+
# runtime dependency. These gems will be installed with your gem.
|
93
|
+
# One call to add_development_dependency('gem_name', 'gem version requirement')
|
94
|
+
# for each development dependency. These gems are required for developers
|
95
|
+
#
|
96
|
+
#s.add_development_dependency("rake", ">= 10.1.0") #"~> 0.9.2")
|
97
|
+
s.add_development_dependency("bundler", "~> 1.0")
|
98
|
+
#s.add_development_dependency 'rspec', '~> 2.7', '>= 2.7.0'
|
99
|
+
s.add_development_dependency("pry", "~> 0.9")
|
100
|
+
s.add_development_dependency("yard", "~> 0.8")
|
101
|
+
#s.add_development_dependency("minitest", "~> 5.3")
|
102
|
+
s.add_development_dependency("rubygems-tasks", "~> 0.2")
|
103
|
+
s.add_development_dependency("travis", "~> 1.6")
|
104
|
+
s.add_development_dependency("travis-lint", "~> 1.8")
|
105
|
+
|
106
|
+
s.add_development_dependency("codeclimate-test-reporter", '~> 0') #, group: :test, require: nil)
|
107
|
+
#s.add_development_dependency("bluecloth", "~> 2.2.0")
|
108
|
+
#s.add_development_dependency("wlang", "~> 0.10.2")
|
109
|
+
|
110
|
+
|
111
|
+
# The version of ruby required by this gem
|
112
|
+
#
|
113
|
+
# Uncomment and set this if your gem requires specific ruby versions.
|
114
|
+
#
|
115
|
+
# s.required_ruby_version = ">= 0"
|
116
|
+
|
117
|
+
# The RubyGems version required by this gem
|
118
|
+
#
|
119
|
+
# s.required_rubygems_version = ">= 0"
|
120
|
+
|
121
|
+
# The platform this gem runs on. See Gem::Platform for details.
|
122
|
+
#
|
123
|
+
# s.platform = nil
|
124
|
+
|
125
|
+
# Extensions to build when installing the gem.
|
126
|
+
#
|
127
|
+
# Valid types of extensions are extconf.rb files, configure scripts
|
128
|
+
# and rakefiles or mkrf_conf files.
|
129
|
+
#
|
130
|
+
s.extensions = []
|
131
|
+
|
132
|
+
# External (to RubyGems) requirements that must be met for this gem to work.
|
133
|
+
# It’s simply information for the user.
|
134
|
+
#
|
135
|
+
s.requirements = nil
|
136
|
+
|
137
|
+
# A message that gets displayed after the gem is installed
|
138
|
+
#
|
139
|
+
# Uncomment and set this if you want to say something to the user
|
140
|
+
# after gem installation
|
141
|
+
#
|
142
|
+
s.post_install_message = "Thanks for installing FalkorLib.\n"
|
143
|
+
|
144
|
+
################################################################### SECURITY
|
145
|
+
|
146
|
+
# The key used to sign this gem. See Gem::Security for details.
|
147
|
+
#
|
148
|
+
#s.signing_key = "0xDD01D5C0"
|
149
|
+
|
150
|
+
# The certificate chain used to sign this gem. See Gem::Security for
|
151
|
+
# details.
|
152
|
+
#
|
153
|
+
# s.cert_chain = []
|
154
|
+
|
155
|
+
################################################################### RDOC
|
156
|
+
|
157
|
+
# An ARGV style array of options to RDoc
|
158
|
+
#
|
159
|
+
# See 'rdoc --help' about this
|
160
|
+
#
|
161
|
+
s.rdoc_options = []
|
162
|
+
|
163
|
+
# Extra files to add to RDoc such as README
|
164
|
+
#
|
165
|
+
s.extra_rdoc_files = Dir["README.md"] + Dir["CHANGELOG.md"] + Dir["LICENCE.md"]
|
221
166
|
|
222
167
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
################################################################################
|
3
|
-
# Time-stamp: <
|
3
|
+
# Time-stamp: <Sat 2016-10-15 23:44 svarrette>
|
4
4
|
################################################################################
|
5
5
|
# Interface for the main Bootstrapping operations
|
6
6
|
#
|
@@ -28,12 +28,13 @@ module FalkorLib #:nodoc:
|
|
28
28
|
},
|
29
29
|
:latex => {
|
30
30
|
:name => '',
|
31
|
-
:author =>
|
32
|
-
:mail =>
|
31
|
+
:author => %x( git config user.name ).chomp,
|
32
|
+
:mail => %x( git config user.email ).chomp,
|
33
33
|
:title => 'Title',
|
34
|
-
:subtitle => '',
|
34
|
+
:subtitle => 'Overview and Open Challenges',
|
35
35
|
:image => 'images/logo_ULHPC.pdf',
|
36
|
-
:logo => 'images/logo_UL.pdf'
|
36
|
+
:logo => 'images/logo_UL.pdf',
|
37
|
+
:url => 'http://csc.uni.lu/sebastien.varrette'
|
37
38
|
},
|
38
39
|
:letter => {
|
39
40
|
:author_title => 'PhD',
|
@@ -44,6 +45,10 @@ module FalkorLib #:nodoc:
|
|
44
45
|
:zipcode => 'L-1359',
|
45
46
|
:location => 'Luxembourg',
|
46
47
|
:phone => '(+352) 46 66 44 6600',
|
48
|
+
:twitter => 'svarrette',
|
49
|
+
:linkedin => 'svarrette',
|
50
|
+
:skype => 'sebastien.varrette',
|
51
|
+
:scholar => '6PTStIcAAAAJ'
|
47
52
|
},
|
48
53
|
:metadata => {
|
49
54
|
:name => '',
|
@@ -531,6 +536,11 @@ module FalkorLib
|
|
531
536
|
print_error_and_exit "Unsupported type" unless [ :beamer, :article, :letter ].include?( type )
|
532
537
|
path = normalized_path(dir)
|
533
538
|
config = FalkorLib::Config::Bootstrap::DEFAULTS[:latex].clone
|
539
|
+
if type == :letter
|
540
|
+
config.merge!(FalkorLib::Config::Bootstrap::DEFAULTS[:letter].clone)
|
541
|
+
[ :title, :subtitle, :image ].each { |k| config.delete k }
|
542
|
+
end
|
543
|
+
config.deep_merge!(FalkorLib::Config::Bootstrap::DEFAULTS[:letter].clone) if type == :letter
|
534
544
|
# initiate the repository if needed
|
535
545
|
unless File.directory?( path )
|
536
546
|
warn "The directory '#{path}' does not exists and will be created"
|
@@ -561,7 +571,7 @@ module FalkorLib
|
|
561
571
|
else
|
562
572
|
default_project_dir += "/#{config[:name]}" unless default_project_dir =~ /#{config[:name]}$/
|
563
573
|
end
|
564
|
-
project_dir = ask("\tLaTeX Sources directory (relative to the Git root directory)", "#{default_project_dir}")
|
574
|
+
project_dir = options[:dir] ? options[:dir] : ask("\tLaTeX Sources directory (relative to the Git root directory)", "#{default_project_dir}")
|
565
575
|
raise FalkorLib::ExecError "Empty project directory" if project_dir.empty?
|
566
576
|
src_project_dir = File.join(project_dir, 'src')
|
567
577
|
srcdir = File.join(rootdir, src_project_dir)
|
@@ -585,7 +595,7 @@ module FalkorLib
|
|
585
595
|
end
|
586
596
|
info "populating '#{src_project_dir}'"
|
587
597
|
#FalkorLib::Bootstrap::Link.root(srcdir, { :verbose => true} )
|
588
|
-
FalkorLib::Bootstrap::Link.makefile(srcdir)
|
598
|
+
FalkorLib::Bootstrap::Link.makefile(srcdir, { :no_interaction => true })
|
589
599
|
[ '_style.sty', '.gitignore' ].each do |f|
|
590
600
|
Dir.chdir( srcdir ) do
|
591
601
|
dst = ".makefile.d/latex/#{f}"
|
@@ -640,10 +650,10 @@ module FalkorLib
|
|
640
650
|
run %{ ln -s ../.root .root } unless File.exists?(File.join(images, '.root'))
|
641
651
|
#run %{ ln -s .root/#{images_makefile_src} Makefile } unless File.exists?(File.join(images, 'Makefile'))
|
642
652
|
end
|
643
|
-
FalkorLib::Bootstrap::Link.makefile(images, { :images => true } )
|
653
|
+
FalkorLib::Bootstrap::Link.makefile(images, { :images => true, :no_interaction => true } )
|
644
654
|
|
645
655
|
# Prepare the src/ directory
|
646
|
-
FalkorLib::Bootstrap::Link.makefile(File.join(rootdir, project_dir), { :src => true } )
|
656
|
+
FalkorLib::Bootstrap::Link.makefile(File.join(rootdir, project_dir), { :src => true, :no_interaction => true } )
|
647
657
|
|
648
658
|
|
649
659
|
# default_project_dir = case type
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
################################################################################
|
3
|
-
# Time-stamp: <
|
3
|
+
# Time-stamp: <Sat 2016-10-15 22:55 svarrette>
|
4
4
|
################################################################################
|
5
5
|
# Interface for Bootstrapping various symlinks within your project
|
6
6
|
#
|
@@ -28,8 +28,12 @@ module FalkorLib
|
|
28
28
|
# * :markdown [boolean] Makefile to convert Markdown files to HTML
|
29
29
|
# * :refdir [string] Path to Falkor's Makefile repository
|
30
30
|
# * :src [boolean] Path to latex_src
|
31
|
+
# * :no_interaction [boolean] do not interact
|
31
32
|
##
|
32
|
-
def makefile(dir = Dir.pwd,
|
33
|
+
def makefile(dir = Dir.pwd,
|
34
|
+
options = {
|
35
|
+
:no_interaction => false
|
36
|
+
})
|
33
37
|
path = normalized_path(dir)
|
34
38
|
rootdir = FalkorLib::Git.rootdir(path)
|
35
39
|
info "Create a symlink to one of Falkor's Makefile"
|
@@ -67,7 +71,7 @@ module FalkorLib
|
|
67
71
|
dst = File.join(makefile_d, type, makefile)
|
68
72
|
unless File.exists?( File.join(path, 'Makefile'))
|
69
73
|
info "Bootstrapping #{type.capitalize} Makefile (as symlink to Falkor's Makefile)"
|
70
|
-
really_continue?
|
74
|
+
really_continue? unless options[:no_interaction]
|
71
75
|
Dir.chdir( path ) do
|
72
76
|
run %{ ln -s #{dst} Makefile }
|
73
77
|
end
|
@@ -89,7 +93,7 @@ module FalkorLib
|
|
89
93
|
relative_path_to_root = (Pathname.new( FalkorLib::Git.rootdir(dir) ).relative_path_from Pathname.new( File.realpath(path)))
|
90
94
|
if "#{relative_path_to_root}" == "."
|
91
95
|
FalkorLib::Common.warning "Already at the root directory of the Git repository"
|
92
|
-
FalkorLib::Common.really_continue?
|
96
|
+
FalkorLib::Common.really_continue? unless options[:no_interaction]
|
93
97
|
end
|
94
98
|
target = options[:name] ? options[:name] : '.root'
|
95
99
|
puts "Entering '#{relative_path_to_root}'"
|
data/lib/falkorlib/cli/link.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
################################################################################
|
3
|
-
# Time-stamp: <
|
3
|
+
# Time-stamp: <Sat 2016-10-15 18:28 svarrette>
|
4
4
|
################################################################################
|
5
5
|
|
6
6
|
require 'thor'
|
@@ -9,44 +9,50 @@ require 'falkorlib'
|
|
9
9
|
#require "falkorlib/bootstrap"
|
10
10
|
|
11
11
|
module FalkorLib
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
12
|
+
module CLI
|
13
|
+
|
14
|
+
# Thor class for symlink creation
|
15
|
+
class Link < ::Thor
|
16
|
+
|
17
|
+
include FalkorLib::Common
|
18
|
+
|
19
|
+
###### commands ######
|
20
|
+
desc "commands", "Lists all available commands", :hide => true
|
21
|
+
def commands
|
22
|
+
puts Link.all_commands.keys.sort - [ 'commands' ]
|
23
|
+
end
|
24
|
+
|
25
|
+
###### rootdir (root beeing reserved) ######
|
26
|
+
method_option :name, :aliases => ['--target', '-t', '-n'], :default => '.root', :desc => "Name of the symlink"
|
27
|
+
#......................................
|
28
|
+
desc "rootdir [options]", "Create a symlink '.root' which targets the root of the repository"
|
29
|
+
def rootdir(dir = Dir.pwd)
|
30
|
+
FalkorLib::Bootstrap::Link.root(dir, options)
|
31
|
+
end # rootdir
|
32
|
+
|
33
|
+
|
34
|
+
###### make ######
|
35
|
+
method_option :latex, :default => true, :type => :boolean, :aliases => '-l',
|
36
|
+
:desc => "Makefile to compile LaTeX documents"
|
37
|
+
method_option :gnuplot, :type => :boolean, :aliases => ['--plot', '-p'],
|
38
|
+
:desc => "Makefile to compile GnuPlot scripts"
|
39
|
+
method_option :generic, :type => :boolean, :aliases => '-g',
|
40
|
+
:desc => "Generic Makefile for sub directory"
|
41
|
+
method_option :markdown, :type => :boolean, :aliases => '-m',
|
42
|
+
:desc => "Makefile to convert Markdown files to HTML"
|
43
|
+
method_option :images, :type => :boolean, :aliases => [ '-i', '--img' ],
|
44
|
+
:desc => "Makefile to optimize images"
|
45
|
+
method_option :refdir, :default => "#{FalkorLib.config[:git][:submodulesdir]}/Makefiles",
|
46
|
+
:aliases => '-d', :desc => "Path to Falkor's Makefile repository (Relative to Git root dir)"
|
47
|
+
method_option :src, :type => :boolean, :aliases => [ '--src', '-s' ],
|
48
|
+
:desc => "Path to Falkor's Makefile for latex_src"
|
49
|
+
#......................................
|
50
|
+
desc "make [options]", "Create a symlink to one of Falkor's Makefile, set as Git submodule"
|
51
|
+
def make(dir = Dir.pwd)
|
52
|
+
FalkorLib::Bootstrap::Link.makefile(dir, options)
|
53
|
+
end # make
|
54
|
+
|
55
|
+
|
56
|
+
end # class Link
|
57
|
+
end # module CLI
|
52
58
|
end # module FalkorLib
|