vendorificator 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTE1OGVlNWQzNzgzOWExZWYzMDIzOWVkMDI4MDJhYWVjN2JjM2Y1NQ==
4
+ MzgxYzI5ZDQxNjE5M2Q2NDhmYWQ1OTY4N2EwYjg0YzFmOTU2MzcxMA==
5
5
  data.tar.gz: !binary |-
6
- MjJkYjE2OTM1MjYwMGZlNzI0MGNkMzRhMWRiYmY5ZDRmYWQyNDAyOA==
6
+ NzhjZWY3NDg0NWUyY2M2NGFhMDk3YWY5ODMzNmI3YjM0MDQ3ZWMwOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YWY2OTYwYTdmYTRjMGVlNmZlNmVlNDYyZWE2YTg3M2Q0NDM3NTE2MjdmNzY5
10
- N2Y2MDM2ZDhkYTUyNmVmNzlmNDk2NGYxZTA1YzZlOWE5MzQ3NGMxZjFlYjhk
11
- ZmE2Njc0YmIxYjE4ZGJiZjk4YTU5ZGM4NDg4OTAzMmJlYThlM2Y=
9
+ N2I2MzRkZDk5MjM0ZWYwYmU4YjNkNjIxZWRkNzdmNGU5M2E4NTk0ZWE3MDMx
10
+ N2NkZDk1MjI5ODhkZTY3M2NmODQ1OTI4YWI3OTQ1MDEzN2Q1MjUzYTYwNDVh
11
+ MDA0ZGY1MTJkMzVkOWQyZWRiYTMxNjJhN2YyOTBiMGM1MTFmNDg=
12
12
  data.tar.gz: !binary |-
13
- ZTYzZThiNWZmYzE3MTI1OGFlNTRkOTM0ODhjYzk4Nzc0YTMwODcwYTczYWJm
14
- ODY3OTQ2MGQyZTY0N2YxMGQ2M2JjNDI3MTI5ODFlMjE1NDkzYjBlYmY1Y2Ey
15
- YTFjN2FhNmViODYwZmVhYTJhZjFkNGUwOGIyZmZkNmE3YjliYjE=
13
+ ODZmYzQzMzY4ZTdhZDgzY2RlY2NmMmUyMjNhODkzNjcwOGE1MjBkYTMzZDA4
14
+ YjNjM2U4ZTJlYjZmZWZkMjY1OTU2MTZlY2IwZWVmODQ3ZDA2OWQ1M2I1ODQ1
15
+ NjMyNjM5MDg1YWVjOGFlMDBmZWRhYzVlM2U4ZGExZDk5NjZhNGE=
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+ ## 0.5.2
4
+
5
+ - Fixed `vendor push`
6
+ - Added `--pull` and `--push` switches to `vendor update`
7
+
3
8
  ## 0.5.1
4
9
 
5
10
  - Correctly specify ref for specs/extras in tool.
@@ -75,8 +75,12 @@ module Vendorificator
75
75
  end
76
76
 
77
77
  desc :update, "Update installed vendor files"
78
+ method_option :pull, :type => :boolean, :default => false
79
+ method_option :push, :type => :boolean, :default => false
78
80
  def update(*modules)
81
+ pull if options[:pull]
79
82
  environment.sync options.merge(:segments => modules, :update => true)
83
+ push if options[:push]
80
84
  rescue DirtyRepoError
81
85
  fail! 'Repository is not clean.'
82
86
  end
@@ -95,6 +95,13 @@ module Vendorificator
95
95
  merged_tag && merged_tag[(1 + tag_name_base.length)..-1]
96
96
  end
97
97
 
98
+
99
+ def head
100
+ git.capturing.rev_parse({:verify => true, :quiet => true}, "refs/heads/#{branch_name}").strip
101
+ rescue MiniGit::GitError
102
+ nil
103
+ end
104
+
98
105
  private
99
106
 
100
107
  def config
@@ -129,12 +136,6 @@ module Vendorificator
129
136
  to_yaml
130
137
  end
131
138
 
132
- def head
133
- git.capturing.rev_parse({:verify => true, :quiet => true}, "refs/heads/#{branch_name}").strip
134
- rescue MiniGit::GitError
135
- nil
136
- end
137
-
138
139
  def in_branch(branch = branch_name, options = {}, &block)
139
140
  Dir.mktmpdir do |tmpdir|
140
141
  tmpgit = create_temp_git_repo(branch, options, tmpdir)
@@ -1,3 +1,3 @@
1
1
  module Vendorificator
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -2,12 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  module Vendorificator
4
4
  describe Environment do
5
- let(:environment) do
6
- Environment.new Thor::Shell::Basic.new, :quiet, nil do
7
- vendor 'name', :option => 'value'
8
- vendor 'other_name', :option => 'other_value'
9
- end
10
- end
5
+ let(:environment) { Environment.new(Thor::Shell::Basic.new, :quiet, nil){} }
11
6
 
12
7
  before do
13
8
  environment.git.capturing.stubs(:remote).returns("origin\n")
@@ -47,8 +42,6 @@ module Vendorificator
47
42
  end
48
43
 
49
44
  describe '#pull' do
50
- let(:environment){ Environment.new(Thor::Shell::Basic.new, :quiet, nil){} }
51
-
52
45
  before do
53
46
  environment.git.expects(:fetch).with('origin')
54
47
  environment.git.expects(:fetch).with({:tags => true}, 'origin')
@@ -85,8 +78,6 @@ module Vendorificator
85
78
  end
86
79
 
87
80
  describe '#push' do
88
- let(:environment){ Environment.new(Thor::Shell::Basic.new, :quiet, nil){} }
89
-
90
81
  it "handles git error on pushing empty notes" do
91
82
  environment.stubs(:ensure_clean!)
92
83
 
@@ -109,8 +100,6 @@ module Vendorificator
109
100
  end
110
101
 
111
102
  describe '#segments' do
112
- let(:environment){ Environment.new Thor::Shell::Basic.new, :default, nil }
113
-
114
103
  it 'is initialized on a new environment' do
115
104
  assert { environment.segments == [] }
116
105
  end
@@ -15,6 +15,22 @@ module Vendorificator
15
15
  end
16
16
  end
17
17
 
18
+ describe '#head' do
19
+ let(:seg) { Vendor.new(basic_environment, 'test').segment }
20
+ let(:rev_parse) { basic_environment.git.capturing.expects(:rev_parse).with({:verify => true, :quiet => true}, "refs/heads/vendor/test") }
21
+ it "returns SHA1 of segment's head" do
22
+ rev_parse.returns "a2745fdf2d7e51f139f9417c5ca045b389fa939f\n"
23
+ head = seg.head
24
+ assert { head == 'a2745fdf2d7e51f139f9417c5ca045b389fa939f' }
25
+ end
26
+
27
+ it "returns nil when segment's branch does not exist" do
28
+ rev_parse.raises MiniGit::GitError
29
+ head = seg.head
30
+ assert { head.nil? }
31
+ end
32
+ end
33
+
18
34
  describe '#branch_name' do
19
35
  it 'includes vendor group' do
20
36
  uncategorized = Vendor.new(basic_environment, 'test').segment
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vendorificator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Pasternacki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-19 00:00:00.000000000 Z
11
+ date: 2014-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: escape