falkorlib 0.6.19 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +88 -0
  4. data/.travis.yml +56 -4
  5. data/Gemfile +4 -4
  6. data/Gemfile.lock +55 -27
  7. data/Rakefile +12 -8
  8. data/Vagrantfile +68 -0
  9. data/completion/_falkor +55 -7
  10. data/falkorlib.gemspec +14 -12
  11. data/lib/falkorlib.rb +22 -21
  12. data/lib/falkorlib/bootstrap.rb +5 -1
  13. data/lib/falkorlib/bootstrap/base.rb +385 -693
  14. data/lib/falkorlib/bootstrap/git.rb +137 -0
  15. data/lib/falkorlib/bootstrap/latex.rb +186 -0
  16. data/lib/falkorlib/bootstrap/link.rb +108 -96
  17. data/lib/falkorlib/bootstrap/ruby.rb +102 -0
  18. data/lib/falkorlib/cli.rb +82 -26
  19. data/lib/falkorlib/cli/config.rb +8 -8
  20. data/lib/falkorlib/cli/link.rb +8 -9
  21. data/lib/falkorlib/cli/new.rb +25 -39
  22. data/lib/falkorlib/common.rb +425 -425
  23. data/lib/falkorlib/config.rb +114 -110
  24. data/lib/falkorlib/error.rb +27 -16
  25. data/lib/falkorlib/gem_tasks.rb +12 -11
  26. data/lib/falkorlib/git.rb +3 -4
  27. data/lib/falkorlib/git/base.rb +439 -396
  28. data/lib/falkorlib/git/flow.rb +163 -165
  29. data/lib/falkorlib/git_tasks.rb +31 -31
  30. data/lib/falkorlib/loader.rb +1 -1
  31. data/lib/falkorlib/puppet.rb +3 -5
  32. data/lib/falkorlib/puppet/base.rb +10 -15
  33. data/lib/falkorlib/puppet/modules.rb +367 -365
  34. data/lib/falkorlib/puppet_tasks.rb +11 -8
  35. data/lib/falkorlib/tasks.rb +51 -54
  36. data/lib/falkorlib/tasks/gem.rake +42 -43
  37. data/lib/falkorlib/tasks/gem.rb +12 -11
  38. data/lib/falkorlib/tasks/git.rake +101 -107
  39. data/lib/falkorlib/tasks/git.rb +31 -31
  40. data/lib/falkorlib/tasks/gitflow.rake +131 -141
  41. data/lib/falkorlib/tasks/puppet.rb +11 -8
  42. data/lib/falkorlib/tasks/puppet_modules.rake +143 -154
  43. data/lib/falkorlib/tasks/rspec.rake +94 -59
  44. data/lib/falkorlib/tasks/yard.rake +35 -39
  45. data/lib/falkorlib/version.rb +55 -55
  46. data/lib/falkorlib/versioning.rb +169 -167
  47. data/spec/falkorlib/bootstrap_helpers_spec.rb +106 -56
  48. data/spec/falkorlib/bootstrap_latex_spec.rb +145 -0
  49. data/spec/falkorlib/bootstrap_link_spec.rb +137 -0
  50. data/spec/falkorlib/bootstrap_ruby_spec.rb +118 -0
  51. data/spec/falkorlib/bootstrap_spec.rb +112 -129
  52. data/spec/falkorlib/git_spec.rb +94 -22
  53. data/spec/falkorlib/gitflow_spec.rb +54 -42
  54. data/spec/falkorlib/puppet_modules_spec.rb +35 -26
  55. data/spec/falkorlib/versioning_puppet_module_spec.rb +94 -90
  56. data/spec/falkorlib_spec.rb +5 -0
  57. data/spec/spec_helper.rb +88 -47
  58. data/templates/latex/article-ieee/main.tex.erb +509 -0
  59. data/templates/latex/article/_abstract.tex.erb +19 -0
  60. data/templates/latex/article/_acronyms.tex.erb +116 -0
  61. data/templates/latex/article/_conclusion.tex.erb +25 -0
  62. data/templates/latex/article/_context.tex.erb +17 -0
  63. data/templates/latex/article/_experiments.tex.erb +27 -0
  64. data/templates/latex/article/_implem.tex.erb +17 -0
  65. data/templates/latex/article/_introduction.tex.erb +39 -0
  66. data/templates/latex/article/_related_works.tex.erb +19 -0
  67. data/templates/latex/article/biblio.bib.erb +28 -0
  68. data/templates/latex/article/template.tex.erb +16 -0
  69. data/templates/latex/ieee/IEEEtran.bst +2409 -0
  70. data/templates/latex/ieee/IEEEtran.cls +6347 -0
  71. data/templates/motd/motd.erb +2 -1
  72. metadata +82 -2
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  ################################################################################
3
- # Time-stamp: <Lun 2014-08-25 21:46 svarrette>
3
+ # Time-stamp: <Fri 2016-11-11 14:45 svarrette>
4
4
  ################################################################################
5
5
  #
6
6
  # FalkorLib rake tasks to pilot Puppet operations
@@ -11,14 +11,17 @@ require 'falkorlib'
11
11
  require 'falkorlib/tasks'
12
12
 
13
13
  module FalkorLib #:nodoc:
14
- class PuppetTasks
15
- include Rake::DSL if defined? Rake::DSL
14
+ # Puppet tasks for Rake
15
+ class PuppetTasks
16
16
 
17
- # Install the puppet tasks for Rake
18
- def install_tasks
19
- load 'falkorlib/tasks/puppet_modules.rake'
20
- end
21
- end
17
+ include Rake::DSL if defined? Rake::DSL
18
+
19
+ # Install the puppet tasks for Rake
20
+ def install_tasks
21
+ load 'falkorlib/tasks/puppet_modules.rake'
22
+ end
23
+
24
+ end
22
25
  end
23
26
 
24
27
  FalkorLib::PuppetTasks.new.install_tasks
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  ################################################################################
3
- # Time-stamp: <Tue 2015-05-19 17:59 svarrette>
3
+ # Time-stamp: <Tue 2016-11-08 23:50 svarrette>
4
4
  ################################################################################
5
5
  #
6
6
  # Default FalkorLib rake tasks
@@ -16,66 +16,64 @@ FalkorLib.config.debug = ARGV.include?('DEBUG')
16
16
 
17
17
  #.....................
18
18
  namespace :falkorlib do
19
- ########### falkorlib:conf ###########
20
- desc "Print the current configuration of FalkorLib"
21
- task :conf do
22
- puts FalkorLib.config.to_yaml
23
- end
19
+ ########### falkorlib:conf ###########
20
+ desc "Print the current configuration of FalkorLib"
21
+ task :conf do
22
+ puts FalkorLib.config.to_yaml
23
+ end
24
24
 
25
- ########### falkorlib:upgrade ###########
26
- desc "Upgrade FalkorLib to the latest version using Bundle"
27
- task :upgrade do |t|
28
- info "#{t.comment}"
29
- error "Unable to find the 'bundle' command" unless command?('bundle')
30
- run %{ bundle update falkorlib }
31
- if FalkorLib::Git.init?
32
- gemfile_lock = File.join(FalkorLib::Git.rootdir, 'Gemfile.lock')
33
- run %{git commit -s -m "Upgrade FalkorLib to the latest version" #{gemfile_lock} } if File.exist?(gemfile_lock)
34
- end
25
+ ########### falkorlib:upgrade ###########
26
+ desc "Upgrade FalkorLib to the latest version using Bundle"
27
+ task :upgrade do |t|
28
+ info(t.comment).to_s
29
+ error "Unable to find the 'bundle' command" unless command?('bundle')
30
+ run %( bundle update falkorlib )
31
+ if FalkorLib::Git.init?
32
+ gemfile_lock = File.join(FalkorLib::Git.rootdir, 'Gemfile.lock')
33
+ run %(git commit -s -m "Upgrade FalkorLib to the latest version" #{gemfile_lock} ) if File.exist?(gemfile_lock)
35
34
  end
36
-
35
+ end
37
36
  end # namespace falkorlib
38
37
 
39
38
 
40
39
  #.....................
41
40
  namespace :bootstrap do
42
- ########### bootstrap:bundler ###########
43
- task :bundler do
44
- info "Bootstrap Bundler -- see http://bundler.io/"
45
- error "Unable to find the 'bundle' command" unless command?('bundle')
46
- run %{ bundle }
47
- end
41
+ ########### bootstrap:bundler ###########
42
+ task :bundler do
43
+ info "Bootstrap Bundler -- see http://bundler.io/"
44
+ error "Unable to find the 'bundle' command" unless command?('bundle')
45
+ run %( bundle )
46
+ end
48
47
 
49
- ########### rvm ###########
50
- task :rvm do
51
- info "Boostrap RVM for this repository -- see https://rvm.io"
52
- error "RVM is not installed -- see https://rvm.io/rvm/install for instructions" unless command?('rvm')
53
- init_rvm(Dir.pwd)
54
- # ['version', 'gemset'].each do |t|
55
- # error "unable to find the .ruby-#{t} file" unless File.exists?(".ruby-#{t}")
56
- # end
57
- info "=> initialize RVM -- see http://rvm.io"
58
- run %{ rvm install `cat .ruby-version` }
59
- rvm_current = `rvm current`.chomp
60
- rvm_version = `cat .ruby-version`.chomp
61
- rvm_gemset = `cat .ruby-gemset`.chomp
62
- if rvm_current.empty? or rvm_current !~ /#{rvm_version}[^@]*@#{rvm_gemset}/
63
- warn "You need to manually force the reloading of the RVM configuration."
64
- warn "To do that, simply run \n\t\tcd .. && cd -"
65
- error "manual RVM reloading required"
66
- end
67
- #rvmenv = %x( rvm env --path -- `cat .ruby-version`@`cat .ruby-gemset`)
68
- # info "=> Force reloading RVM configuration within $PWD"
69
- # run %{
70
- # bash -l -c 'rvm use `cat .ruby-version`'
71
- # bash -l -c 'rvm gemset use `cat .ruby-gemset`'
72
- # bash -l -c 'rvm list && rvm gemset list'
73
- # }
74
-
75
- info "=> installing the Bundler gem -- see http://bundler.io"
76
- run %{ gem install bundler }
77
- end
48
+ ########### rvm ###########
49
+ task :rvm do
50
+ info "Boostrap RVM for this repository -- see https://rvm.io"
51
+ error "RVM is not installed -- see https://rvm.io/rvm/install for instructions" unless command?('rvm')
52
+ init_rvm(Dir.pwd)
53
+ # ['version', 'gemset'].each do |t|
54
+ # error "unable to find the .ruby-#{t} file" unless File.exists?(".ruby-#{t}")
55
+ # end
56
+ info "=> initialize RVM -- see http://rvm.io"
57
+ run %( rvm install `cat .ruby-version` )
58
+ rvm_current = `rvm current`.chomp
59
+ rvm_version = `cat .ruby-version`.chomp
60
+ rvm_gemset = `cat .ruby-gemset`.chomp
61
+ if rvm_current.empty? || rvm_current !~ /#{rvm_version}[^@]*@#{rvm_gemset}/
62
+ warn "You need to manually force the reloading of the RVM configuration."
63
+ warn "To do that, simply run \n\t\tcd .. && cd -"
64
+ error "manual RVM reloading required"
65
+ end
66
+ #rvmenv = %x( rvm env --path -- `cat .ruby-version`@`cat .ruby-gemset`)
67
+ # info "=> Force reloading RVM configuration within $PWD"
68
+ # run %{
69
+ # bash -l -c 'rvm use `cat .ruby-version`'
70
+ # bash -l -c 'rvm gemset use `cat .ruby-gemset`'
71
+ # bash -l -c 'rvm list && rvm gemset list'
72
+ # }
78
73
 
74
+ info "=> installing the Bundler gem -- see http://bundler.io"
75
+ run %( gem install bundler )
76
+ end
79
77
  end # namespace bootstrap
80
78
 
81
79
 
@@ -84,7 +82,6 @@ desc "Setup the repository"
84
82
  task :setup => ['bootstrap:rvm', 'bootstrap:bundler']
85
83
 
86
84
 
87
- # Empty task debug
85
+ # Empty task debug
88
86
  task :DEBUG do
89
87
  end
90
-
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  ################################################################################
3
3
  # gem.rake - Special tasks for the management of Gem operations
4
- # Time-stamp: <Lun 2015-01-12 21:14 svarrette>
4
+ # Time-stamp: <Fri 2016-11-11 15:40 svarrette>
5
5
  #
6
6
  # Copyright (c) 2014 Sebastien Varrette <Sebastien.Varrette@uni.lu>
7
7
  # http://varrette.gforge.uni.lu
@@ -14,48 +14,47 @@ require 'rubygems/tasks'
14
14
 
15
15
  #.....................
16
16
  namespace :gem do
17
- Gem::Tasks::Console.new(:command => 'pry')
18
-
19
- ########### gem:release ###########
20
- desc "Release the gem "
21
- task :release => [ :build ] do |t|
22
- pkgdir = Gem::Tasks::Project::PKG_DIR
23
- Dir.glob("*.gemspec") do |gemspecfile|
24
- spec = Gem::Specification::load(gemspecfile)
25
- name = spec.name
26
- version = spec.version
27
- gem = File.join( pkgdir , "#{name}-#{version}.gem")
28
- unless File.exists?( gem )
29
- warn "Unable to find the built gem '#{gem}'... Thus exiting."
30
- next
31
- end
32
- info t.comment + " '#{gem}'"
33
- really_continue?
34
- a = run %{
17
+ Gem::Tasks::Console.new(:command => 'pry')
18
+
19
+ ########### gem:release ###########
20
+ desc "Release the gem "
21
+ task :release => [ :build ] do |t|
22
+ pkgdir = Gem::Tasks::Project::PKG_DIR
23
+ Dir.glob("*.gemspec") do |gemspecfile|
24
+ spec = Gem::Specification.load(gemspecfile)
25
+ name = spec.name
26
+ version = spec.version
27
+ gem = File.join( pkgdir, "#{name}-#{version}.gem")
28
+ unless File.exist?( gem )
29
+ warn "Unable to find the built gem '#{gem}'... Thus exiting."
30
+ next
31
+ end
32
+ info t.comment + " '#{gem}'"
33
+ really_continue?
34
+ a = run %(
35
35
  gem push #{gem}
36
- }
37
- error "Unable to publish the gem '#{gem}'" if a.to_i != 0
38
- end
39
- end # task gem:release
40
- task :publish, :release
41
-
42
- ########### info ###########
43
- desc "Informations on the gem"
44
- task :info do |t|
45
- require "rubygems"
46
- Dir.glob("*.gemspec") do |gemspecfile|
47
- spec = Gem::Specification::load(gemspecfile)
48
- info t.comment + " '#{spec.name}' (version #{spec.version})"
49
- puts <<-eos
36
+ )
37
+ error "Unable to publish the gem '#{gem}'" if a.to_i.nonzero?
38
+ end
39
+ end # task gem:release
40
+ task :publish, :release
41
+
42
+ ########### info ###########
43
+ desc "Informations on the gem"
44
+ task :info do |t|
45
+ require "rubygems"
46
+ Dir.glob("*.gemspec") do |gemspecfile|
47
+ spec = Gem::Specification.load(gemspecfile)
48
+ info t.comment + " '#{spec.name}' (version #{spec.version})"
49
+ puts <<-eos
50
50
  - Summary: #{spec.summary}
51
51
  - Author: #{spec.author} #{spec.email}
52
52
  - Licence: #{spec.license}
53
53
  - Homepage: #{spec.homepage}
54
54
  - Description: #{spec.description}
55
55
  eos
56
- end
57
- end # task info
58
-
56
+ end
57
+ end # task info
59
58
  end # namespace gem
60
59
 
61
60
  # Until [Issue#13](https://github.com/postmodern/rubygems-tasks/issues/13) it solved,
@@ -72,13 +71,13 @@ Rake::Task['build'].enhance do
72
71
  end
73
72
  end
74
73
 
75
- [ 'major', 'minor', 'patch' ].each do |level|
76
- Rake::Task["version:bump:#{level}"].enhance do
77
- warn "about to run the rspec tests to ensure the release can be done"
78
- really_continue?
79
- Rake::Task['rspec'].invoke
80
- end
81
- end
74
+ %w(major minor patch).each do |level|
75
+ Rake::Task["version:bump:#{level}"].enhance do
76
+ warn "about to run the rspec tests to ensure the release can be done"
77
+ really_continue?
78
+ Rake::Task['rspec'].invoke
79
+ end
80
+ end
82
81
 
83
82
 
84
83
 
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  ################################################################################
3
- # Time-stamp: <Ven 2014-06-20 00:10 svarrette>
3
+ # Time-stamp: <Fri 2016-11-11 14:28 svarrette>
4
4
  ################################################################################
5
5
  #
6
6
  # FalkorLib rake tasks to pilot Gem operations
@@ -11,18 +11,19 @@ require 'falkorlib'
11
11
  require 'falkorlib/tasks'
12
12
 
13
13
  module FalkorLib #:nodoc:
14
+ # Rake tasks to pilot Gem operations
15
+ class GemTasks
14
16
 
15
- # Rake tasks to pilot Gem operations
16
- class GemTasks
17
- include Rake::DSL if defined? Rake::DSL
17
+ include Rake::DSL if defined? Rake::DSL
18
18
 
19
- # Install the gem tasks for Rake
20
- def install_tasks
21
- load 'falkorlib/tasks/gem.rake'
22
- load 'falkorlib/tasks/yard.rake'
23
- load 'falkorlib/tasks/rspec.rake'
24
- end
25
- end # class FalkorLib::GemTasks
19
+ # Install the gem tasks for Rake
20
+ def install_tasks
21
+ load 'falkorlib/tasks/gem.rake'
22
+ load 'falkorlib/tasks/yard.rake'
23
+ load 'falkorlib/tasks/rspec.rake'
24
+ end
25
+
26
+ end # class FalkorLib::GemTasks
26
27
  end # module FalkorLib
27
28
 
28
29
  # Now install them ;)
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  ################################################################################
3
3
  # git.rake - Special tasks for the management of Git operations
4
- # Time-stamp: <Tue 2016-06-28 19:14 svarrette>
4
+ # Time-stamp: <Fri 2016-11-11 15:41 svarrette>
5
5
  #
6
6
  # Copyright (c) 2014 Sebastien Varrette <Sebastien.Varrette@uni.lu>
7
7
  # http://varrette.gforge.uni.lu
@@ -13,118 +13,112 @@ require 'falkorlib/git'
13
13
 
14
14
  #.....................
15
15
  namespace :git do
16
-
17
- include FalkorLib::Common
18
- git_root_dir = FalkorLib::Git.rootdir
19
- remotes = FalkorLib::Git.remotes
20
- #ap remotes
21
-
22
-
23
- ########### git:fetch ###########
24
- #desc "Fetch the latest changes on remotes"
25
- task :fetch do |t|
26
- info "Fetch the latest changes on remotes" # t.comment
27
- FalkorLib::Git.fetch()
28
- end # task fetch
29
-
30
- [ 'up', 'push' ].each do |op|
31
-
32
- description = case op
33
- when 'up'; "Update your local copy of the repository from GIT server"
34
- when 'push'; "Push your modifications onto the remote branches"
35
- end
36
- ########### git:{up,push} ###########
37
- #desc "#{description}"
38
- task op.to_sym do |t|
39
- info description # t.comment
40
- if remotes.empty? || ! remotes.include?( 'origin' )
41
- warn "No git remote configured... Exiting #{t}"
42
- next
43
- end
44
- cmd = ( op == 'up') ? 'pull' : op
45
- branch = FalkorLib::Git.branch?
46
- if FalkorLib::Git.list_branch.include? "remotes/origin/#{branch}"
47
- status = run %{
16
+ include FalkorLib::Common
17
+ git_root_dir = FalkorLib::Git.rootdir
18
+ remotes = FalkorLib::Git.remotes
19
+ #ap remotes
20
+
21
+
22
+ ########### git:fetch ###########
23
+ #desc "Fetch the latest changes on remotes"
24
+ task :fetch do |_t|
25
+ info "Fetch the latest changes on remotes" # t.comment
26
+ FalkorLib::Git.fetch
27
+ end # task fetch
28
+
29
+ %w(up push).each do |op|
30
+ description = case op
31
+ when 'up' then "Update your local copy of the repository from GIT server"
32
+ when 'push' then "Push your modifications onto the remote branches"
33
+ end
34
+ ########### git:{up,push} ###########
35
+ #desc "#{description}"
36
+ task op.to_sym do |t|
37
+ info description # t.comment
38
+ if remotes.empty? || !remotes.include?( 'origin' )
39
+ warn "No git remote configured... Exiting #{t}"
40
+ next
41
+ end
42
+ cmd = ( op == 'up') ? 'pull' : op
43
+ branch = FalkorLib::Git.branch?
44
+ if FalkorLib::Git.list_branch.include? "remotes/origin/#{branch}"
45
+ status = run %(
48
46
  git #{cmd} origin
49
- }
50
- if (status.to_i != 0)
51
- warn("The command '#{cmd}' failed with exit status #{status.to_i}")
52
- warn("This may be due to the fact that you're not connected to the internet")
53
- really_continue?('no')
54
- end
55
- else
56
- warn "The current branch '#{branch} is not currently tracked on the remote 'origin'."
57
- warn "=> exiting"
58
- next
59
- end
47
+ )
48
+ if (status.to_i.nonzero?)
49
+ warn("The command '#{cmd}' failed with exit status #{status.to_i}")
50
+ warn("This may be due to the fact that you're not connected to the internet")
51
+ really_continue?('no')
60
52
  end
53
+ else
54
+ warn "The current branch '#{branch} is not currently tracked on the remote 'origin'."
55
+ warn "=> exiting"
56
+ next
57
+ end
61
58
  end
62
-
63
- if (! FalkorLib.config.git[:submodules].empty?) or File.exists?("#{git_root_dir}/.gitmodules")
64
- #.....................
65
- namespace :submodules do
66
- ########### init ###########
67
- desc "Initialize the Git submodules (as defined in FalkorLib.config.git[:submodules] or .gitmodules)"
68
- task :init do |t|
69
- info t.full_comment
70
- FalkorLib::Git.submodule_init(git_root_dir)
71
- end # task submodules:init
72
-
73
- end # namespace submodules
74
- end
75
-
76
- if File.exists?("#{git_root_dir}/.gitmodules")
77
- #.....................
78
- namespace :submodules do
79
-
80
- ########### git:submodules:update ###########
81
- #desc "Update the git submodules from '#{git_root_dir}'"
82
- task :update do |t|
83
- info "Update the git submodules from '#{git_root_dir}'" # t.comment
84
- FalkorLib::Git.submodule_update( git_root_dir )
85
- end
86
-
87
- ########### git:submodules:upgrade ###########
88
- desc "Upgrade the git submodules to the latest HEAD commit -- USE WITH CAUTION"
89
- task :upgrade => [ :update] do |t|
90
- info t.comment
91
- FalkorLib::Git.submodule_upgrade( git_root_dir )
92
- end
93
- end # namespace git:submodules
94
- end
95
-
96
- unless FalkorLib.config.git[:subtrees].empty?
97
- #.....................
98
- namespace :subtrees do
99
- ########### git:subtrees:init ###########
100
- desc "Initialize the Git subtrees defined in FalkorLib.config.git[:subtrees]"
101
- task :init do
102
- FalkorLib::Git.subtree_init(git_root_dir)
103
- end # task git:subtree:init
104
-
105
- if FalkorLib::Git.subtree_init?(git_root_dir)
106
- ########### git:subtrees:diff ###########
107
- desc "Show difference between local subtree(s) and their remotes"
108
- task :diff do
109
- FalkorLib::Git.subtree_diff(git_root_dir)
110
- end # task git:subtree:diff
111
-
112
- ########### git:subtrees:up ###########
113
- desc "Pull the latest changes from the remote to the local subtree(s)"
114
- task :up do
115
- FalkorLib::Git.subtree_up(git_root_dir)
116
- end # task git:subtree:diff
117
- end
118
-
119
- end # namespace git:subtrees
120
- end
121
-
59
+ end
60
+
61
+ if (!FalkorLib.config.git[:submodules].empty?) || File.exist?("#{git_root_dir}/.gitmodules")
62
+ #.....................
63
+ namespace :submodules do
64
+ ########### init ###########
65
+ desc "Initialize the Git submodules (as defined in FalkorLib.config.git[:submodules] or .gitmodules)"
66
+ task :init do |t|
67
+ info t.full_comment
68
+ FalkorLib::Git.submodule_init(git_root_dir)
69
+ end # task submodules:init
70
+ end # namespace submodules
71
+ end
72
+
73
+ if File.exist?("#{git_root_dir}/.gitmodules")
74
+ #.....................
75
+ namespace :submodules do
76
+ ########### git:submodules:update ###########
77
+ #desc "Update the git submodules from '#{git_root_dir}'"
78
+ task :update do |_t|
79
+ info "Update the git submodules from '#{git_root_dir}'" # t.comment
80
+ FalkorLib::Git.submodule_update( git_root_dir )
81
+ end
82
+
83
+ ########### git:submodules:upgrade ###########
84
+ desc "Upgrade the git submodules to the latest HEAD commit -- USE WITH CAUTION"
85
+ task :upgrade => [ :update] do |t|
86
+ info t.comment
87
+ FalkorLib::Git.submodule_upgrade( git_root_dir )
88
+ end
89
+ end # namespace git:submodules
90
+ end
91
+
92
+ unless FalkorLib.config.git[:subtrees].empty?
93
+ #.....................
94
+ namespace :subtrees do
95
+ ########### git:subtrees:init ###########
96
+ desc "Initialize the Git subtrees defined in FalkorLib.config.git[:subtrees]"
97
+ task :init do
98
+ FalkorLib::Git.subtree_init(git_root_dir)
99
+ end # task git:subtree:init
100
+
101
+ if FalkorLib::Git.subtree_init?(git_root_dir)
102
+ ########### git:subtrees:diff ###########
103
+ desc "Show difference between local subtree(s) and their remotes"
104
+ task :diff do
105
+ FalkorLib::Git.subtree_diff(git_root_dir)
106
+ end # task git:subtree:diff
107
+
108
+ ########### git:subtrees:up ###########
109
+ desc "Pull the latest changes from the remote to the local subtree(s)"
110
+ task :up do
111
+ FalkorLib::Git.subtree_up(git_root_dir)
112
+ end # task git:subtree:diff
113
+ end
114
+ end # namespace git:subtrees
115
+ end
122
116
  end # namespace git
123
117
 
124
118
  task :setup => [ 'git:init' ]
125
- if (! FalkorLib.config.git[:submodules].empty?) or File.exists?("#{FalkorLib::Git.rootdir}/.gitmodules")
126
- task :setup => [ 'git:submodules:init' ]
119
+ if (!FalkorLib.config.git[:submodules].empty?) || File.exist?("#{FalkorLib::Git.rootdir}/.gitmodules")
120
+ task :setup => [ 'git:submodules:init' ]
127
121
  end
128
122
  unless FalkorLib.config.git[:subtrees].empty?
129
- task :setup => [ 'git:subtrees:init' ]
123
+ task :setup => [ 'git:subtrees:init' ]
130
124
  end