necktie 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/necktie/rake.rb +11 -15
  2. data/necktie.gemspec +1 -1
  3. metadata +1 -1
data/lib/necktie/rake.rb CHANGED
@@ -14,26 +14,19 @@ module Necktie
14
14
  standard_exception_handling do
15
15
  init
16
16
  repo = File.expand_path(".necktie")
17
- unless File.exist?(repo)
17
+ if File.exist?(repo)
18
+ if options.pull
19
+ puts "Pulling latest updates ..."
20
+ sh "git pull origin #{ENV["BRANCH"] || "master"}", :verbose=>false
21
+ end
22
+ else
18
23
  git_url = ENV["GIT_URL"] or fail "Need GIT_URL variable to point to Git repository, can't clone without it"
19
24
  puts "Cloning #{git_url} to #{repo}"
20
- sh "git clone #{git_url} #{repo.inspect}"
21
- cloned = true
25
+ sh "git clone #{git_url} #{repo.inspect}", :verbose=>false
22
26
  end
23
-
24
27
  Dir.chdir repo do
25
28
  load_rakefile
26
- if options.show_tasks
27
- display_tasks_and_comments
28
- elsif options.show_prereqs
29
- display_prerequisites
30
- else
31
- unless cloned
32
- puts "Pulling latest updates to #{repo}"
33
- sh "git pull origin #{ENV["BRANCH"] || "master"}"
34
- end
35
- top_level_tasks.each { |task_name| invoke_task(task_name) }
36
- end
29
+ top_level
37
30
  end
38
31
  end
39
32
  end
@@ -90,6 +83,9 @@ module Necktie
90
83
  Rake::TaskManager.record_task_metadata = true
91
84
  }
92
85
  ],
86
+ ['--update', '-u', "Update .necktie directory (git pull)",
87
+ lambda { |value| options.pull = true }
88
+ ]
93
89
  ]
94
90
  end
95
91
 
data/necktie.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "necktie"
3
- spec.version = "0.3.1"
3
+ spec.version = "0.3.2"
4
4
  spec.author = "Assaf Arkin"
5
5
  spec.email = "assaf@labnotes.org"
6
6
  spec.homepage = ""
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: necktie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Assaf Arkin