falkorlib 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24b688866a7028d56fb245d36207f12b727484ed
4
- data.tar.gz: 3ceb29d135eeb2f9273fb51bd5c9efd560897337
3
+ metadata.gz: 98c462c237a49684f2aebb25a3ead3f6a83c1ed6
4
+ data.tar.gz: c8c24c9e37728bfdf99f1fbcb51f7d87ccbe7e64
5
5
  SHA512:
6
- metadata.gz: 9dab597ad919ab7b58606cd89d295f463a7a3c05e4e132cdebea876bed110286ce640c21d63acf0a3f01084c29419c02ec638fdee859cc00fe43fd23171d0611
7
- data.tar.gz: b330a6ec0382afd5035005a95caa940a2a0a4440b67409d35312edf6181b549afa0de3a7aff6717b17431174ada84b8b50ed783d290e0b0365837ced27d67328
6
+ metadata.gz: 36126336adf06eef2be266a4e07ef8fbe6a872a6bc90af032a4f17d90908a89ab75234288c9e78be45acf69e41b9b9df6b9f0e423824bed22198bc2c87e2c6b8
7
+ data.tar.gz: 91587779a881a63bb07e16c4c093de1ff6eb6b3f036d38e2eca0869f6b4e8b9ff89ea623cb1f2741535ef784706a88ffd7ad4f6a4b3c7b0d2c43f4c7be338039
data/.travis.yml CHANGED
@@ -3,7 +3,7 @@ cache: bundler
3
3
  bundler_args: "--without=release doc"
4
4
  before_install:
5
5
  - sudo apt-get update -qq
6
- - sudo apt-get install -y git-flow git-core
6
+ - sudo apt-get install -qq git-flow git-core
7
7
  rvm:
8
8
  - 1.9.2
9
9
  - 1.9.3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- falkorlib (0.4.3)
4
+ falkorlib (0.4.4)
5
5
  artii (>= 2.1)
6
6
  awesome_print (~> 1.2)
7
7
  configatron (~> 3.2)
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  ################################################################################
3
- # Time-stamp: <Mer 2015-02-25 00:02 svarrette>
3
+ # Time-stamp: <Lun 2015-03-09 17:07 svarrette>
4
4
  ################################################################################
5
5
  # Interface for the main Bootstrapping operations
6
6
  #
@@ -182,33 +182,39 @@ module FalkorLib
182
182
  # Initialize a Git repository for a project with my favorite layout
183
183
  # Supported options:
184
184
  # * :no_interaction [boolean]: do not interact
185
- # :interactive [boolean] Confirm Gitflow branch names
186
- # :master [string] Branch name for production releases
187
- # :develop [string] Branch name for development commits
188
- # :make [boolean] Use a Makefile to pilot the repository actions
189
- # :rake [boolean] Use a Rakefile (and FalkorLib) to pilot the repository action
190
- # :remote_sync [boolean] Operate a git remote synchronization
191
- # :latex [boolean] Initiate a LaTeX project
192
- # :gem [boolean] Initiate a Ruby gem project
193
- # :rvm [boolean] Initiate a RVM-based Ruby project
194
- # :pyenv [boolean] Initiate a pyenv-based Python project
195
- # :octopress [boolean] Initiate an Octopress web site
185
+ # * :gitflow [boolean]: bootstrap with git-flow
186
+ # * :interactive [boolean] Confirm Gitflow branch names
187
+ # * :master [string] Branch name for production releases
188
+ # * :develop [string] Branch name for development commits
189
+ # * :make [boolean] Use a Makefile to pilot the repository actions
190
+ # * :rake [boolean] Use a Rakefile (and FalkorLib) to pilot the repository action
191
+ # * :remote_sync [boolean] Operate a git remote synchronization
192
+ # * :latex [boolean] Initiate a LaTeX project
193
+ # * :gem [boolean] Initiate a Ruby gem project
194
+ # * :rvm [boolean] Initiate a RVM-based Ruby project
195
+ # * :pyenv [boolean] Initiate a pyenv-based Python project
196
+ # * :octopress [boolean] Initiate an Octopress web site
196
197
  ##
197
198
  def repo(name, options = {})
198
199
  ap options if options[:debug]
199
200
  path = normalized_path(name)
200
201
  project = File.basename(path)
201
202
  use_git = FalkorLib::Git.init?(path)
203
+ options[:make] = false if options[:rake]
202
204
  info "Bootstrap a [Git] repository for the project '#{project}'"
203
205
  if use_git
204
206
  warning "Git is already initialized for the repository '#{name}'"
205
207
  really_continue? unless options[:force]
206
208
  end
207
- info " ==> initialize Git flow in #{path}"
208
- FalkorLib::GitFlow.init(path, options)
209
- gitflow_branches = {}
210
- [ :master, :develop ].each do |t|
211
- gitflow_branches[t.to_sym] = FalkorLib::GitFlow.branches(t, path)
209
+ if options[:git_flow]
210
+ info " ==> initialize Git flow in #{path}"
211
+ FalkorLib::GitFlow.init(path, options)
212
+ gitflow_branches = {}
213
+ [ :master, :develop ].each do |t|
214
+ gitflow_branches[t.to_sym] = FalkorLib::GitFlow.branches(t, path)
215
+ end
216
+ else
217
+ FalkorLib::Git.init(path, options)
212
218
  end
213
219
  # === prepare Git submodules ===
214
220
  info " ==> prepare the relevant Git submodules"
@@ -245,12 +251,23 @@ module FalkorLib
245
251
  end
246
252
  end
247
253
  if options[:rake]
248
- warning "TODO: setup Rakefile"
254
+ info " ==> prepare Root Rakefile"
255
+ rakefile = File.join(path, "Rakefile")
256
+ unless File.exist?( rakefile )
257
+ templatedir = File.join( FalkorLib.templates, 'Rakefile')
258
+ erbfiles = [ 'header_rakefile.erb' ]
259
+ erbfiles << 'rakefile_gitflow.erb' if FalkorLib::GitFlow.init?(path)
260
+ erbfiles << 'footer_rakefile.erb'
261
+ write_from_erb_template(erbfiles, rakefile, {}, { :srcdir => "#{templatedir}" })
262
+ end
249
263
  end
250
264
 
251
265
  # === VERSION file ===
252
266
  FalkorLib::Bootstrap.versionfile(path, :tag => 'v0.0.0')
253
267
 
268
+ # === RVM ====
269
+ FalkorLib::Bootstrap.rvm(path, options) if options[:rvm]
270
+
254
271
  # === README ===
255
272
  FalkorLib::Bootstrap.readme(path, options)
256
273
 
@@ -365,7 +382,7 @@ module FalkorLib
365
382
  #next unless [ :name, :summary, :description ].include?(k.to_sym)
366
383
  default_answer = case k
367
384
  when :description
368
- config[:description].empty? ? "#{config[:summary]}" : "#{config[:description]}"
385
+ config[:description].empty? ? "#{config[:summary]}" : "#{config[:description]}"
369
386
  when :source
370
387
  config[:source].empty? ? default_source : "#{config[:source]}"
371
388
  when :project_page
@@ -375,7 +392,7 @@ module FalkorLib
375
392
  else
376
393
  config[k.to_sym].empty? ? v : config[k.to_sym]
377
394
  end
378
- config[k.to_sym] = ask( "\t" + sprintf("Project %-20s", "#{k}"), default_answer)
395
+ config[k.to_sym] = ask( "\t" + sprintf("Project %-20s", "#{k}"), default_answer)
379
396
  end
380
397
  tags = ask("\tKeywords (comma-separated list of tags)", config[:tags].join(','))
381
398
  config[:tags] = tags.split(',')
@@ -448,7 +465,7 @@ module FalkorLib
448
465
  # Return a Markdown-formatted string for a badge to display, typically in a README.
449
466
  # Based on http://shields.io/
450
467
  # Supported options:
451
- # * :style [string] style of the badge, Elligible: ['plastic', 'flat', 'flat-square']
468
+ # * :style [string] style of the badge, Elligible: ['plastic', 'flat', 'flat-square']
452
469
  ##
453
470
  def get_badge(subject, status, color = 'blue', options = {})
454
471
  st = status.gsub(/-/, '--').gsub(/_/, '__')
data/lib/falkorlib/cli.rb CHANGED
@@ -1,15 +1,17 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  ################################################################################
3
- # Time-stamp: <Mar 2015-02-24 11:04 svarrette>
3
+ # Time-stamp: <Lun 2015-03-09 11:57 svarrette>
4
4
  ################################################################################
5
5
  # Interface for the CLI
6
6
  #
7
7
 
8
8
  require 'thor'
9
9
  require 'thor/actions'
10
+ require 'thor/group'
10
11
  require "falkorlib"
11
12
 
12
13
  require "falkorlib/cli/new"
14
+ require "falkorlib/cli/link"
13
15
 
14
16
 
15
17
 
@@ -37,14 +39,21 @@ module FalkorLib
37
39
  class_option :dry_run, :aliases => '-n', :type => :boolean
38
40
 
39
41
  ###### commands ######
40
- desc "commands", "Lists all available commands", :hide => true
41
- def commands
42
- puts App.all_commands.keys - ["commands", "completions"]
43
- end
42
+ # desc "commands", "Lists all available commands", :hide => true
43
+ # def commands
44
+ # puts App.all_commands.keys - ["commands", "completions"]
45
+ # end
44
46
 
45
47
  ###### config ######
46
- desc "config", "Print the current configuration of FalkorLib" #, :hide => true
47
- def config
48
+ desc "config [option] [KEY]", "Print the current configuration of FalkorLib" #, :hide => true
49
+ long_desc <<-CONFIG_LONG_DESC
50
+ This command allows you to interact with FalkorLib's configuration system.
51
+ FalkorLib retrieves its configuration from the local repository (in '<git_rootdir>/.falkor/config'),
52
+ environment variables (NOT YET IMPLEMENTED), and the user's home directory (~/.falkor/config), in that order of priority.
53
+ CONFIG_LONG_DESC
54
+ method_option :global, :aliases => '-g', :type => :boolean, :desc => 'Operate on the global configuration (in ~/.falkor/config)'
55
+ method_option :local, :aliases => '-l', :type => :boolean, :desc => 'Operate on the local configuration of the repository (in <git_rootdir>/.falkor/config)'
56
+ def config(key = '')
48
57
  info "Thor options:"
49
58
  puts options.to_yaml
50
59
  info "FalkorLib internal configuration:"
@@ -54,10 +63,13 @@ module FalkorLib
54
63
 
55
64
  # map %w[--help -h] => :help
56
65
 
57
- ###### init ######
58
- desc "new TYPE", "Initialize the directory PATH with FalkorLib's template(s)"
66
+ ###### new ######
67
+ desc "new <type> [<path>]", "Initialize the directory PATH with FalkorLib's template(s)"
59
68
  subcommand "new", FalkorLib::CLI::New
60
69
 
70
+ ###### link ######
71
+ desc "link <type> [<path>]", "Initialize a special symlink in <path> (the current directory by default)"
72
+ subcommand "link", FalkorLib::CLI::Link
61
73
 
62
74
 
63
75
  map %w[--version -V] => :version
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  ################################################################################
3
- # Time-stamp: <Mar 2015-02-24 11:04 svarrette>
3
+ # Time-stamp: <Ven 2015-02-27 20:59 svarrette>
4
4
  ################################################################################
5
5
  # Management of the configuration specializations
6
6
  #
@@ -13,6 +13,7 @@ module FalkorLib
13
13
  class Config #< ::Thor
14
14
 
15
15
 
16
+
16
17
 
17
18
 
18
19
 
@@ -0,0 +1,42 @@
1
+ # -*- encoding: utf-8 -*-
2
+ ################################################################################
3
+ # Time-stamp: <Lun 2015-03-09 12:03 svarrette>
4
+ ################################################################################
5
+
6
+ require 'thor'
7
+ require 'falkorlib'
8
+ #require 'falkorlib/cli/init/repo'
9
+ #require "falkorlib/bootstrap"
10
+
11
+ module FalkorLib
12
+ module CLI
13
+
14
+ # Thor class for symlink creation
15
+ class Link < ::Thor
16
+
17
+ include FalkorLib::Common
18
+
19
+ ###### rootdir (root beeing reserved) ######
20
+ method_option :name, :aliases => ['--target', '-t', '-n'], :default => '.root', :desc => "Name of the symlink"
21
+ #......................................
22
+ desc "rootdir [options]", "Create a symlink '.root' which targets the root of the repository"
23
+ def rootdir(dir = Dir.pwd)
24
+ raise FalkorLib::ExecError "Not used in a Git repository" unless FalkorLib::Git.init?
25
+ path = normalized_path(dir)
26
+ relative_path_to_root = Pathname.new( FalkorLib::Git.rootdir(dir) ).relative_path_from Pathname.new( File.realpath(path))
27
+ FalkorLib::Common.error "Already at the root directory of the Git repository" if "#{relative_path_to_root}" == "."
28
+ target = options[:name] ? options[:name] : '.root'
29
+ unless File.exists?( File.join(path, target))
30
+ warning "creating the symboling link '#{target}' which points to '#{relative_path_to_root}'" if options[:verbose]
31
+ # Format: ln_s(old, new, options = {}) -- Creates a symbolic link new which points to old.
32
+ FileUtils.ln_s "#{relative_path_to_root}", "#{target}"
33
+ end
34
+ end # rootdir
35
+
36
+
37
+
38
+
39
+
40
+ end # class Link
41
+ end # module CLI
42
+ end # module FalkorLib
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  ################################################################################
3
- # Time-stamp: <Mer 2015-02-25 00:05 svarrette>
3
+ # Time-stamp: <Lun 2015-03-09 12:09 svarrette>
4
4
  ################################################################################
5
5
 
6
6
  require 'thor'
@@ -9,14 +9,23 @@ require 'falkorlib'
9
9
  require "falkorlib/bootstrap"
10
10
 
11
11
  module FalkorLib
12
- module CLI
12
+ module CLI
13
13
 
14
- # Thor class for all bootstrapping / initialization
15
- class New < ::Thor
14
+ # Thor class for all bootstrapping / initialization
15
+ class New < ::Thor
16
16
 
17
- ###### repo ######
18
- desc "repo NAME [options]", "Bootstrap a Git Repository"
19
- long_desc <<-REPO_LONG_DESC
17
+
18
+ #map %w[--help -h] => :help
19
+
20
+ ###### commands ######
21
+ # desc "commands", "Lists available commands" #, :hide => true
22
+ # def commands
23
+ # puts App.all_commands.to_yaml #.keys - ["commands", "completions"]
24
+ # end
25
+
26
+ ###### repo ######
27
+ desc "repo NAME [options]", "Bootstrap a Git Repository"
28
+ long_desc <<-REPO_LONG_DESC
20
29
  Initiate a Git repository according to my classical layout.
21
30
  \x5 * the repository will be configured according to the guidelines of [Git Flow]
22
31
  \x5 * the high-level operations will be piloted either by a Makefile (default) or a Rakefile
@@ -24,91 +33,92 @@ Initiate a Git repository according to my classical layout.
24
33
  By default, NAME is '.' meaning that the repository will be initialized in the current directory.
25
34
  \x5Otherwise, the NAME subdirectory will be created and bootstraped accordingly.
26
35
  REPO_LONG_DESC
27
- #......................................................
28
- method_option :make, :default => true,
29
- :type => :boolean, :desc => 'Use a Makefile to pilot the repository actions'
30
- method_option :rake,
31
- :type => :boolean, :desc => 'Use a Rakefile (and FalkorLib) to pilot the repository actions'
32
- method_option :interactive, :aliases => '-i',
33
- :type => :boolean, :desc => "Interactive mode"
34
- method_option :remote_sync, :aliases => '-r',
35
- :type => :boolean, :desc => "Operate a git remote synchronization with remote. By default, all commits stay local"
36
- method_option :master,
37
- :default => 'production', :banner => 'BRANCH', :desc => "Master Branch name for production releases"
38
- method_option :develop, :aliases => [ '-b', '--branch', '--devel'],
39
- :default => 'devel', :banner => 'BRANCH', :desc => "Branch name for development commits"
40
- method_option :latex, :aliases => '-l', :type => :boolean, :desc => "Initiate a LaTeX project"
41
- method_option :gem, :type => :boolean, :desc => "Initiate a Ruby gem project"
42
- method_option :rvm, :type => :boolean, :desc => "Initiate a RVM-based Ruby project"
43
- method_option :pyenv, :type => :boolean, :desc => "Initiate a pyenv-based Python project"
44
- method_option :octopress, :aliases => ['-o', '--www'], :type => :boolean, :desc => "Initiate an Octopress web site"
45
- #___________________
46
- def repo(name = '.')
47
- # _newrepo(name, options)
48
- FalkorLib::Bootstrap.repo(name, options)
49
- end # repo
36
+ #......................................................
37
+ method_option :git_flow, :default => true, :type => :boolean, :desc => 'Bootstrap the repository with Git-glow'
38
+ method_option :make, :default => true, :type => :boolean, :desc => 'Use a Makefile to pilot the repository actions'
39
+ method_option :rake, :type => :boolean, :desc => 'Use a Rakefile (and FalkorLib) to pilot the repository actions'
40
+ method_option :interactive, :aliases => '-i', :default => true,
41
+ :type => :boolean, :desc => "Interactive mode, in particular to confirm Gitflow branch names"
42
+ method_option :remote_sync, :aliases => '-r',
43
+ :type => :boolean, :desc => "Operate a git remote synchronization with remote. By default, all commits stay local"
44
+ method_option :master, :default => 'production', :banner => 'BRANCH', :desc => "Master Branch name for production releases"
45
+ method_option :develop, :aliases => [ '-b', '--branch', '--devel'],
46
+ :default => 'devel', :banner => 'BRANCH', :desc => "Branch name for development commits"
47
+ method_option :latex, :aliases => '-l', :type => :boolean, :desc => "Initiate a LaTeX project"
48
+ #method_option :gem, :type => :boolean, :desc => "Initiate a Ruby gem project"
49
+ method_option :rvm, :type => :boolean, :desc => "Initiate a RVM-based Ruby project"
50
+ method_option :ruby, :default => '1.9.3', :desc => "Ruby version to configure for RVM"
51
+ #method_option :pyenv, :type => :boolean, :desc => "Initiate a pyenv-based Python project"
52
+ #method_option :octopress, :aliases => ['-o', '--www'], :type => :boolean, :desc => "Initiate an Octopress web site"
53
+ #___________________
54
+ def repo(name = '.')
55
+ options[:rvm] = true if options[:rake] or options[:gem]
56
+ # _newrepo(name, options)
57
+ FalkorLib::Bootstrap.repo(name, options)
58
+ end # repo
50
59
 
51
60
 
52
- ###### trash ######
53
- desc "trash PATH", "Add a Trash directory"
54
- #________________________
55
- def trash(path = Dir.pwd)
56
- FalkorLib::Bootstrap.trash(path)
57
- end # trash
61
+ ###### trash ######
62
+ desc "trash PATH", "Add a Trash directory"
63
+ #________________________
64
+ def trash(path = Dir.pwd)
65
+ FalkorLib::Bootstrap.trash(path)
66
+ end # trash
58
67
 
59
- ###### rvm ######
60
- desc "rvm PATH [options]", "Initialize RVM"
61
- long_desc <<-RVM_LONG_DESC
68
+ ###### rvm ######
69
+ desc "rvm PATH [options]", "Initialize RVM"
70
+ long_desc <<-RVM_LONG_DESC
62
71
  Initialize Ruby Version Manager (RVM) for the current directory (or at the root directory of the Git repository).
63
72
  It consists of two files:
64
73
  \x5 * `.ruby-version`: Project file hosting a single line for the ruby version
65
74
  \x5 * `.ruby-gemset`: Gemset file hosting a single line for the gemset to use for this project
66
75
 
67
76
  These files will be committed in Git to ensure a consistent environment for the project.
68
- RVM_LONG_DESC
69
- method_option :force, :aliases => '-f',
70
- :type => :boolean, :desc => 'Force overwritting the RVM config'
71
- method_option :ruby, :banner => 'VERSION',
72
- :desc => 'Ruby version to configure / install for RVM'
73
- method_option :versionfile, :banner => 'FILE',
74
- :default => FalkorLib.config[:rvm][:versionfile], :desc => 'RVM ruby version file'
75
- method_option :gemset, :desc => 'RVM gemset to configure for this directory'
76
- method_option :gemsetfile, :banner => 'FILE',
77
- :default => FalkorLib.config[:rvm][:gemsetfile], :desc => 'RVM gemset file'
78
- #____________________
79
- def rvm(path = '.')
80
- FalkorLib::Bootstrap.rvm(path, options)
81
- end # rvm
77
+ RVM_LONG_DESC
78
+ method_option :force, :aliases => '-f',
79
+ :type => :boolean, :desc => 'Force overwritting the RVM config'
80
+ method_option :ruby, :banner => 'VERSION',
81
+ :desc => 'Ruby version to configure / install for RVM'
82
+ method_option :versionfile, :banner => 'FILE',
83
+ :default => FalkorLib.config[:rvm][:versionfile], :desc => 'RVM ruby version file'
84
+ method_option :gemset, :desc => 'RVM gemset to configure for this directory'
85
+ method_option :gemsetfile, :banner => 'FILE',
86
+ :default => FalkorLib.config[:rvm][:gemsetfile], :desc => 'RVM gemset file'
87
+ #____________________
88
+ def rvm(path = '.')
89
+ FalkorLib::Bootstrap.rvm(path, options)
90
+ end # rvm
82
91
 
83
- ###### versionfile ######
84
- desc "versionfile PATH [options]", "initiate a VERSION file"
85
- method_option :file, :aliases => '-f',
86
- :desc => "Set the VERSION filename"
87
- method_option :tag, :aliases => '-t',
88
- :desc => "Git tag to use"
89
- method_option :version, :aliases => '-v',
90
- :desc => "Set the version to initialize in the version file"
91
- #_______________
92
- def versionfile(path = '.')
93
- FalkorLib::Bootstrap.versionfile(path, options)
94
- end # versionfile
92
+ ###### versionfile ######
93
+ desc "versionfile PATH [options]", "initiate a VERSION file"
94
+ method_option :file, :aliases => '-f',
95
+ :desc => "Set the VERSION filename"
96
+ method_option :tag, :aliases => '-t',
97
+ :desc => "Git tag to use"
98
+ method_option :version, :aliases => '-v',
99
+ :desc => "Set the version to initialize in the version file"
100
+ #_______________
101
+ def versionfile(path = '.')
102
+ FalkorLib::Bootstrap.versionfile(path, options)
103
+ end # versionfile
95
104
 
96
105
 
97
- ###### readme ######
98
- method_option :make, :default => true,
99
- :type => :boolean, :desc => 'Use a Makefile to pilot the repository actions'
100
- method_option :rake,
101
- :type => :boolean, :desc => 'Use a Rakefile (and FalkorLib) to pilot the repository actions'
102
- method_option :latex, :aliases => '-l', :type => :boolean, :desc => "Describe a LaTeX project"
103
- method_option :gem, :type => :boolean, :desc => "Describe a Ruby gem project"
104
- method_option :rvm, :type => :boolean, :desc => "Describe a RVM-based Ruby project"
105
- method_option :pyenv, :type => :boolean, :desc => "Describe a pyenv-based Python project"
106
- method_option :octopress, :aliases => '--www', :type => :boolean, :desc => "Describe an Octopress web site"
107
- #......................................
108
- desc "readme PATH [options]", "Initiate a README file in the PATH directory ('./' by default)"
109
- def readme(path = '.')
110
- FalkorLib::Bootstrap.readme(path, options)
111
- end # readme
112
- end # class Init
113
- end # module CLI
106
+ ###### readme ######
107
+ method_option :make, :default => true,
108
+ :type => :boolean, :desc => 'Use a Makefile to pilot the repository actions'
109
+ method_option :rake,
110
+ :type => :boolean, :desc => 'Use a Rakefile (and FalkorLib) to pilot the repository actions'
111
+ method_option :latex, :aliases => '-l', :type => :boolean, :desc => "Describe a LaTeX project"
112
+ method_option :gem, :type => :boolean, :desc => "Describe a Ruby gem project"
113
+ method_option :rvm, :type => :boolean, :desc => "Describe a RVM-based Ruby project"
114
+ method_option :pyenv, :type => :boolean, :desc => "Describe a pyenv-based Python project"
115
+ method_option :octopress, :aliases => '--www', :type => :boolean, :desc => "Describe an Octopress web site"
116
+ #......................................
117
+ desc "readme PATH [options]", "Initiate a README file in the PATH directory ('./' by default)"
118
+ def readme(path = '.')
119
+ FalkorLib::Bootstrap.readme(path, options)
120
+ end # readme
121
+
122
+ end # class New
123
+ end # module CLI
114
124
  end # module FalkorLib
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  ################################################################################
3
- # Time-stamp: <Mar 2015-02-24 23:50 svarrette>
3
+ # Time-stamp: <Lun 2015-03-09 17:02 svarrette>
4
4
  ################################################################################
5
5
 
6
6
  require "falkorlib"
@@ -335,14 +335,26 @@ module FalkorLib #:nodoc:
335
335
  # ERB generation of the file `outfile` using the source template file `erbfile`
336
336
  # Supported options:
337
337
  # :no_interaction [boolean]: do not interact
338
+ # :srcdir [string]: source dir for all considered ERB files
338
339
  def write_from_erb_template(erbfile, outfile, config = {},
339
340
  options = {
340
- :no_interaction => false
341
+ :no_interaction => false,
341
342
  })
342
- error "Unable to find the template file #{erbfile}" unless File.exists? (erbfile )
343
- template = File.read("#{erbfile}")
344
- output = ERB.new(template, nil, '<>')
345
- content = output.result(binding)
343
+ erbfiles = erbfile.is_a?(Array) ? erbfile : [ erbfile ]
344
+ content = ""
345
+ erbfiles.each do |f|
346
+ erb = options[:srcdir].nil? ? f : File.join(options[:srcdir], f)
347
+ unless File.exists? (erb)
348
+ warning "Unable to find the template ERBfile '#{erb}'"
349
+ really_continue? unless options[:no_interaction]
350
+ next
351
+ end
352
+ content += ERB.new(File.read("#{erb}"), nil, '<>').result(binding)
353
+ end
354
+ # error "Unable to find the template file #{erbfile}" unless File.exists? (erbfile )
355
+ # template = File.read("#{erbfile}")
356
+ # output = ERB.new(template, nil, '<>')
357
+ # content = output.result(binding)
346
358
  show_diff_and_write(content, outfile, options)
347
359
  end
348
360
 
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  ################################################################################
3
- # Time-stamp: <Mer 2015-02-25 00:19 svarrette>
3
+ # Time-stamp: <Lun 2015-03-09 12:02 svarrette>
4
4
  ################################################################################
5
5
  # FalkorLib Configuration
6
6
  #
@@ -123,7 +123,8 @@ module FalkorLib #:nodoc:
123
123
  conffile = config_file(dir,type,options)
124
124
  confdir = File.dirname( conffile )
125
125
  unless File.directory?( confdir )
126
- really_continue? "about to create the configuration directory #{confdir}" unless options[:no_interaction]
126
+ warning "about to create the configuration directory #{confdir}"
127
+ really_continue? unless options[:no_interaction]
127
128
  run %{ mkdir -p #{confdir} }
128
129
  end
129
130
  store_config(conffile, config, options)
@@ -19,7 +19,7 @@ module FalkorLib #:nodoc:
19
19
  # MAJOR: Defines the major version
20
20
  # MINOR: Defines the minor version
21
21
  # PATCH: Defines the patch version
22
- MAJOR, MINOR, PATCH = 0, 4, 3
22
+ MAJOR, MINOR, PATCH = 0, 4, 4
23
23
 
24
24
  module_function
25
25
 
@@ -2,7 +2,7 @@
2
2
  #########################################
3
3
  # bootstrap_spec.rb
4
4
  # @author Sebastien Varrette <Sebastien.Varrette@uni.lu>
5
- # Time-stamp: <Mer 2015-02-25 00:03 svarrette>
5
+ # Time-stamp: <Lun 2015-03-09 17:09 svarrette>
6
6
  #
7
7
  # @description Check the Bootstrapping operations
8
8
  #
@@ -160,7 +160,7 @@ describe FalkorLib::Bootstrap do
160
160
 
161
161
  it '#repo' do
162
162
  FalkorLib.config[:no_interaction] = true
163
- FalkorLib::Bootstrap.repo(dir, { :no_interaction => true })
163
+ FalkorLib::Bootstrap.repo(dir, { :no_interaction => true, :git_flow => false })
164
164
  FalkorLib.config[:no_interaction] = false
165
165
  end
166
166
 
@@ -0,0 +1,2 @@
1
+
2
+ require 'falkorlib/tasks/git'
@@ -0,0 +1,21 @@
1
+ ##############################################################################
2
+ # Rakefile - Configuration file for rake (http://rake.rubyforge.org/)
3
+ # Time-stamp: <Lun 2015-03-09 16:53 svarrette>
4
+ #
5
+ # Copyright (c) <%= Time.now.year %> <%= ENV['GIT_AUTHOR_NAME'] %> <<%= ENV['GIT_AUTHOR_EMAIL'] %>>
6
+ # ____ _ __ _ _
7
+ # | _ \ __ _| | _____ / _(_) | ___
8
+ # | |_) / _` | |/ / _ \ |_| | |/ _ \
9
+ # | _ < (_| | < __/ _| | | __/
10
+ # |_| \_\__,_|_|\_\___|_| |_|_|\___|
11
+ #
12
+ # Use 'rake -T' to list the available actions
13
+ #
14
+ # Resources:
15
+ # * http://www.stuartellis.eu/articles/rake/
16
+ ##############################################################################
17
+ require 'falkorlib'
18
+
19
+ ## placeholder for custom configuration of FalkorLib.config.*
20
+ ## See https://github.com/Falkor/falkorlib
21
+
@@ -0,0 +1,8 @@
1
+
2
+ # Git flow customization
3
+ FalkorLib.config.gitflow do |c|
4
+ c[:branches] = {
5
+ :master => '<%= FalkorLib::GitFlow.branches(:master) %>',
6
+ :develop => '<%= FalkorLib::GitFlow.branches(:develop) %>'
7
+ }
8
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: falkorlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastien Varrette
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-24 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -351,6 +351,7 @@ files:
351
351
  - lib/falkorlib/bootstrap/base.rb
352
352
  - lib/falkorlib/cli.rb
353
353
  - lib/falkorlib/cli/config.rb
354
+ - lib/falkorlib/cli/link.rb
354
355
  - lib/falkorlib/cli/new.rb
355
356
  - lib/falkorlib/common.rb
356
357
  - lib/falkorlib/config.rb
@@ -396,6 +397,9 @@ files:
396
397
  - templates/README/readme_gitflow.erb
397
398
  - templates/README/readme_latex.erb
398
399
  - templates/README/readme_rvm.erb
400
+ - templates/Rakefile/footer_rakefile.erb
401
+ - templates/Rakefile/header_rakefile.erb
402
+ - templates/Rakefile/rakefile_gitflow.erb
399
403
  - templates/puppet/modules/.gitignore
400
404
  - templates/puppet/modules/.vagrant_init.rb
401
405
  - templates/puppet/modules/Gemfile