rake-n-bake 1.0.5 → 1.0.6

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: a818eee7cb0bf7959752aa34683da02ea1a8d82e
4
- data.tar.gz: fec60f1e1a9fdecbf4f1a657c76f4d280057432e
3
+ metadata.gz: 6c9a3152547c691ab0f75c2c26707b0b5b15d0a9
4
+ data.tar.gz: 23210b8c106d329f40ba501d9caab2af13f641e9
5
5
  SHA512:
6
- metadata.gz: 86c98341c780bc85870bf552356fbe7075cf07bbaa133168e05ef324b1e271311d0d799d127d3a61073db24fa2f67483e5c5305b612262e8d14f67826754ab8a
7
- data.tar.gz: 832f93811f23e84728f724cce3f5059f84d62e316472534259cb7b920f95465d646e99b33c2dca23b2c830a9d07c4de5f05f7516d706ee55c6415f2fac41da71
6
+ metadata.gz: e41f8ba588ef6461ee6c3256767c920a5d762389cc7bd5c18539624c2e0569c8ea68b1c38a0ae2c3586b07227a45658284a3a77017731f3eae87e162937239a3
7
+ data.tar.gz: 0adf454e7efed8c30b9edbc90938aaf832f1a984d8213ca1b9f5482a25d634446d45e681a1ae044e3ba30d7f484b093b7c8d21cd6acea67f6a83c8524f9550c0
data/Gemfile CHANGED
@@ -3,11 +3,12 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
- gem 'semver2'
6
+ gem 'bundler-audit'
7
+ gem 'cucumber'
7
8
  gem 'rake'
8
9
  gem 'rspec'
9
- gem 'bundler-audit'
10
+ gem 'semver2'
10
11
  gem 'simplecov'
11
- gem 'timecop'
12
12
  gem 'term-ansicolor', '~> 1.3'
13
+ gem 'timecop'
13
14
  end
data/history.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ == 1.0.6 (23 October 2014)
2
+
3
+ * SemVer now patches CHANGELOG.md as well as history.rdoc
4
+
1
5
  == 1.0.5 (21 October 2014)
2
6
 
3
7
  * Fix semver tasks to write to the correct file
@@ -52,16 +52,18 @@ module RakeNBake
52
52
  end
53
53
 
54
54
  def self.update_history_file
55
- history_file = 'history.rdoc'
56
- if File.exist? history_file
57
- current_history = File.read history_file
58
- File.open history_file, 'w' do |f|
59
- f.puts "== #{current_version} (#{Time.now.strftime "%d %B %Y"})"
60
- f.puts
61
- f.print current_history
55
+ supported_history_files = %w[ history.rdoc CHANGELOG.md ]
56
+ supported_history_files
57
+ .select {|histf| File.exist? histf}
58
+ .map do |histf|
59
+ current_history = File.read histf
60
+ File.open histf, 'w' do |f|
61
+ f.puts "== #{current_version} (#{Time.now.strftime "%d %B %Y"})"
62
+ f.puts
63
+ f.print current_history
64
+ end
65
+ `git add #{histf}`
62
66
  end
63
- `git add history.rdoc`
64
- end
65
67
  end
66
68
 
67
69
  def self.tag
data/rake-n-bake.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "rake-n-bake"
7
- spec.version = '1.0.5'
7
+ spec.version = '1.0.6'
8
8
  spec.authors = ["Richard Vickerstaff", "Adam Whittingham"]
9
9
  spec.email = ["m3akq@btinternet.com", "adam.whittingham@gmail.com"]
10
10
  spec.description = "Common rake tasks, baked to perfection and ready to serve!"
@@ -122,20 +122,39 @@ describe RakeNBake::SemverVersioning do
122
122
  it 'does nothing' do
123
123
  described_class.update_history_file
124
124
  expect(File.exist? '../history.rdoc').to eq false
125
+ expect(File.exist? '../CHANGELOG.md').to eq false
125
126
  end
126
127
  end
127
- context 'when there is a history file' do
128
+
129
+ context 'when there is a history.rdoc file' do
128
130
  before do
129
131
  File.write(File.join(File.dirname(__FILE__), '../.semver'), YAML.dump(version))
130
132
  File.write(File.join(File.dirname(__FILE__), '../history.rdoc'), '* Some changes')
131
133
  end
132
134
 
135
+ after { File.unlink(File.join(File.dirname(__FILE__), '../history.rdoc')) }
136
+
133
137
  it 'Adds the version number and date to the top of the file and adds it to git' do
134
138
  expect(Object).to receive(:`).with('git add history.rdoc')
135
139
  described_class.update_history_file
136
140
  expect(File.read(File.join(File.dirname(__FILE__), '../history.rdoc')).lines.first).to eq "== v1.2.3 (#{Time.now.strftime "%d %B %Y"})\n"
137
141
  end
138
142
  end
143
+
144
+ context 'when there is a CHANGELOG.md file' do
145
+ before do
146
+ File.write(File.join(File.dirname(__FILE__), '../.semver'), YAML.dump(version))
147
+ File.write(File.join(File.dirname(__FILE__), '../CHANGELOG.md'), '* Some changes')
148
+ end
149
+
150
+ after { File.unlink(File.join(File.dirname(__FILE__), '../CHANGELOG.md')) }
151
+
152
+ it 'Adds the version number and date to the top of the file and adds it to git' do
153
+ expect(Object).to receive(:`).with('git add CHANGELOG.md')
154
+ described_class.update_history_file
155
+ expect(File.read(File.join(File.dirname(__FILE__), '../CHANGELOG.md')).lines.first).to eq "== v1.2.3 (#{Time.now.strftime "%d %B %Y"})\n"
156
+ end
157
+ end
139
158
  end
140
159
 
141
160
  describe 'tag' do
@@ -7,6 +7,19 @@ begin
7
7
  Bundler::Audit::CLI.start
8
8
  end
9
9
  end
10
+
10
11
  rescue LoadError
11
- $stderr.puts 'Warning: bundler audit gem not available.'
12
+
13
+ tasks = %w[bundler_audit].map(&:to_sym)
14
+
15
+ namespace :bake do
16
+ tasks.each do |t|
17
+ desc "This task is not available"
18
+ task t do
19
+ $stderr.puts "This task is not available because '#{missing}' is not available."
20
+ $stderr.puts "Try adding \"gem 'bundler-audit'\" to your Gemfile or run `gem install bundler-audit` and try again."
21
+ abort
22
+ end
23
+ end
24
+ end
12
25
  end
data/tasks/coverage.rake CHANGED
@@ -17,5 +17,18 @@ begin
17
17
  end
18
18
  end
19
19
  rescue LoadError
20
- $stderr.puts 'Warning: SimpleCov not available.'
20
+
21
+ namespace :bake do
22
+ namespace :coverage do
23
+ %w[check_specs check_cucumber].map(&:to_sym).each do |t|
24
+ desc 'SimpleCov rake tasks are not available (gem not installed)'
25
+ task t do
26
+ $stdout.puts "This task is not available because the SimpleCov gem is not installed."
27
+ $stderr.puts "Try adding \"gem 'simplecov'\" to your Gemfile or run `gem install simplecov` and try again."
28
+ abort
29
+ end
30
+ end
31
+ end
32
+ end
33
+
21
34
  end
data/tasks/rspec.rake CHANGED
@@ -8,6 +8,18 @@ begin
8
8
  RSpec::Core::RakeTask.new(:"bake:rspec_test_prepare" => :"test:prepare") do |t|
9
9
  t.verbose = false
10
10
  end
11
+
11
12
  rescue LoadError
12
- $stderr.puts 'Warning: RSpec not available.'
13
+
14
+ namespace :bake do
15
+ %w[rspec rspec_test_prepare].map(&:to_sym).each do |t|
16
+ desc 'RSpec rake tasks are not available (gem not installed)'
17
+ task t do
18
+ $stdout.puts "This task is not available because the RSpec gem is not installed."
19
+ $stderr.puts "Try adding \"gem 'rspec'\" to your Gemfile or run `gem install rspec` and try again."
20
+ abort
21
+ end
22
+ end
23
+ end
24
+
13
25
  end
data/tasks/semver.rake CHANGED
@@ -53,6 +53,22 @@ begin
53
53
  end
54
54
  end
55
55
  end
56
+
56
57
  rescue LoadError
57
- $stderr.puts "Warning: Semver not avaialble"
58
+
59
+ tasks = %w[version major minor patch prerelease inc_prerelease release].map(&:to_sym)
60
+
61
+ namespace :bake do
62
+ namespace :semver do
63
+ tasks.each do |t|
64
+ desc 'SemVer rake tasks are not available (gem not installed)'
65
+ task t do
66
+ $stdout.puts "This task is not available because the SemVer2 gem is not installed."
67
+ $stderr.puts "Try adding \"gem 'semver2'\" to your Gemfile or run `gem semver2 rspec` and try again."
68
+ abort
69
+ end
70
+ end
71
+ end
72
+ end
73
+
58
74
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-n-bake
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Vickerstaff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-21 00:00:00.000000000 Z
12
+ date: 2014-10-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake