anvil-core 0.5.0 → 0.6.0

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: d5d7e961a633411eb45ceb405a568842370a3eed
4
- data.tar.gz: 00a6cebfdbe8811e733670b064af7ccff0fc3642
3
+ metadata.gz: 94d46eb9c50ea48658144357fc8fec945cce7c63
4
+ data.tar.gz: 882a413b796643ee9ab59188514b92f2c8b730a7
5
5
  SHA512:
6
- metadata.gz: d40908e160de0e79fa3215722ba546117846db2afec7df5e02eebb669a7f85e17cae623b87fc5381877f0bdd82ab63e059cf51bdb22eb047d061b2dc7e5aae05
7
- data.tar.gz: 00b6901c779416e932aea2e02b91fe5d622d6c700a60033a6ab4bbb65909a8b8039999f11acea029b8934155905b2ad753e72cb04a1820e09ffcee726cecfcd2
6
+ metadata.gz: 2e4f7bb3ead0abe925224d4ff000fc00d33b19639a93c4dd6537bcabb39cf2c20e9465ab764e297889fa73aaf054e25de45216b6c247ae2a6353a8517bbf4566
7
+ data.tar.gz: 6997f3ad930c5179523d4d3de3891fb9a72791149c95a88bb61719e8c8bc45d6f6a3304617710adab92a60d1876aef192f98c43fff9d7ee10674833570ba7ddd
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
@@ -58,7 +58,7 @@ class Gem::BumpTask < Anvil::Task
58
58
  git.add 'VERSION'
59
59
  git.commit "Bump version v#{version}"
60
60
  git.add_tag "v#{version}"
61
- git.push
61
+ git.push('origin', git.current_branch)
62
62
  end
63
63
 
64
64
  def write_version(version)
@@ -72,7 +72,7 @@ class Gem::BumpTask < Anvil::Task
72
72
 
73
73
  def prepare_repo
74
74
  if clean? || force?
75
- git.pull
75
+ git.pull('origin', git.current_branch)
76
76
  else
77
77
  fail Anvil::RepoNotClean
78
78
  end
@@ -40,13 +40,15 @@ describe Gem::BumpTask do
40
40
 
41
41
  describe '#prepare_repo' do
42
42
  context 'on a clean repo' do
43
+ let(:git) { double(:git, current_branch: 'some-branch') }
44
+
43
45
  before do
44
46
  allow(subject).to receive(:clean?).and_return(true)
45
- allow(subject).to receive(:git).and_return(double)
47
+ allow(subject).to receive(:git).and_return(git)
46
48
  end
47
49
 
48
- it 'pulls' do
49
- expect(subject.send(:git)).to receive(:pull)
50
+ it 'pulls from current branch' do
51
+ expect(git).to receive(:pull).with('origin', git.current_branch)
50
52
  end
51
53
 
52
54
  after { subject.send :prepare_repo }
@@ -62,4 +64,22 @@ describe Gem::BumpTask do
62
64
  end
63
65
  end
64
66
  end
67
+
68
+ describe '#commit_and_tag' do
69
+ let(:version) { '1.0.0' }
70
+ let(:git) { double(:git, current_branch: 'some-branch') }
71
+
72
+ before do
73
+ allow(subject).to receive(:git).and_return(git)
74
+ end
75
+
76
+ it 'commits and tag the current branch' do
77
+ expect(git).to receive(:add).with('VERSION')
78
+ expect(git).to receive(:commit).with("Bump version v#{version}")
79
+ expect(git).to receive(:add_tag).with("v#{version}")
80
+ expect(git).to receive(:push).with('origin', git.current_branch)
81
+ end
82
+
83
+ after { subject.send :commit_and_tag, version }
84
+ end
65
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anvil-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fran Casas
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-16 00:00:00.000000000 Z
12
+ date: 2015-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: git
@@ -242,36 +242,36 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
242
  version: 2.1.0
243
243
  requirements: []
244
244
  rubyforge_project:
245
- rubygems_version: 2.4.3
245
+ rubygems_version: 2.4.5
246
246
  signing_key:
247
247
  specification_version: 4
248
248
  summary: Anvil is a tool for building tools. A tool that a real craftsmen uses to
249
249
  build its tools.
250
250
  test_files:
251
- - spec/spec_helper.rb
252
- - spec/lib/tasks/projects/add_task_spec.rb
253
- - spec/lib/tasks/projects/list_task_spec.rb
254
- - spec/lib/tasks/gem/release_task_spec.rb
255
- - spec/lib/tasks/gem/build_task_spec.rb
256
- - spec/lib/tasks/gem/bump_task_spec.rb
257
- - spec/lib/anvil/config_spec.rb
258
- - spec/lib/anvil/cli_spec.rb
259
- - spec/lib/anvil/task_spec.rb
260
- - spec/lib/anvil/extensions_manager_spec.rb
251
+ - spec/lib/anvil/assure_spec.rb
261
252
  - spec/lib/anvil/assures/directory_assure_spec.rb
262
253
  - spec/lib/anvil/assures/file_assure_spec.rb
254
+ - spec/lib/anvil/cli_spec.rb
255
+ - spec/lib/anvil/config_spec.rb
256
+ - spec/lib/anvil/extensions_manager_spec.rb
263
257
  - spec/lib/anvil/parser_spec.rb
264
- - spec/lib/anvil/versioner_spec.rb
265
- - spec/lib/anvil/task/projects_spec.rb
266
258
  - spec/lib/anvil/task/callback_spec.rb
267
259
  - spec/lib/anvil/task/naming_spec.rb
268
260
  - spec/lib/anvil/task/options_spec.rb
269
- - spec/lib/anvil/assure_spec.rb
270
- - spec/support/dummy_tasks/dummy_failed_assure.rb
271
- - spec/support/dummy_tasks/dummy_before_task.rb
272
- - spec/support/dummy_tasks/foo/dummy_task.rb
273
- - spec/support/dummy_tasks/dummy_task.rb
261
+ - spec/lib/anvil/task/projects_spec.rb
262
+ - spec/lib/anvil/task_spec.rb
263
+ - spec/lib/anvil/versioner_spec.rb
264
+ - spec/lib/tasks/gem/build_task_spec.rb
265
+ - spec/lib/tasks/gem/bump_task_spec.rb
266
+ - spec/lib/tasks/gem/release_task_spec.rb
267
+ - spec/lib/tasks/projects/add_task_spec.rb
268
+ - spec/lib/tasks/projects/list_task_spec.rb
269
+ - spec/spec_helper.rb
274
270
  - spec/support/dummy_tasks/dummy_after_task.rb
275
271
  - spec/support/dummy_tasks/dummy_assure.rb
272
+ - spec/support/dummy_tasks/dummy_before_task.rb
273
+ - spec/support/dummy_tasks/dummy_failed_assure.rb
274
+ - spec/support/dummy_tasks/dummy_task.rb
275
+ - spec/support/dummy_tasks/foo/dummy_task.rb
276
276
  - spec/support/fixtures/config.rb
277
277
  - spec/support/shared/config_mock.rb