rake-n-bake 1.1.1 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semver +3 -3
- data/README.md +17 -4
- data/Rakefile +1 -1
- data/history.rdoc +7 -0
- data/lib/assistant_baker.rb +12 -0
- data/lib/rake-n-bake.rb +7 -0
- data/lib/rake_n_bake.rb +1 -7
- data/lib/version.rb +1 -1
- data/spec/assistant_baker_spec.rb +11 -0
- data/tasks/bundler_audit.rake +1 -2
- data/tasks/coverage.rake +1 -2
- data/tasks/rspec.rake +1 -2
- data/tasks/semver.rake +3 -4
- data/tasks/version.rake +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92a5a6d2cd5ee6afb4e6d32f05dfc1da3f3eb8bf
|
4
|
+
data.tar.gz: 12b024ec3c832705ab94b305d3936eb41501e5c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9557db029a9e12ec3ea8a47ffc21d2275dfa455af6828b9cdea93a57352e53f17d05080f9011f25cad8b7f0462e1d5c9d0cc41f9440e72189c42e1b78fccad30
|
7
|
+
data.tar.gz: e401bfa7fe772314f586423ec93fabaeec16b03181f06b2bb66105ee0c99bbfd9e47f543db313d9834a61b8ec50cdd33937c17b5b9cb197a2580404a54d35448
|
data/.semver
CHANGED
data/README.md
CHANGED
@@ -18,14 +18,27 @@ Rake-n-Bake tasks are used on the project itself, so you can always take a peek
|
|
18
18
|
Installation
|
19
19
|
------------
|
20
20
|
Either:
|
21
|
-
|
21
|
+
- Add `gem "rake-n-bake"` to your Gemfile and run bundle install.
|
22
|
+
|
22
23
|
or
|
23
|
-
|
24
|
+
|
25
|
+
- Run `gem install rake-n-bake`
|
24
26
|
|
25
27
|
Usage
|
26
28
|
-----
|
27
|
-
1. Add `require "
|
29
|
+
1. Add `require "rake-n-bake"` to your Rakefile
|
28
30
|
2. Call the tasks that you want, just as with your usual Rake tasks (examples below!).
|
31
|
+
For example:
|
32
|
+
```ruby
|
33
|
+
task :default => [
|
34
|
+
:clean,
|
35
|
+
:"bake:code_quality:all",
|
36
|
+
:"bake:rspec",
|
37
|
+
:"bake:coverage:check_specs",
|
38
|
+
:"bake:bundler_audit",
|
39
|
+
:"bake:ok_rainbow",
|
40
|
+
]
|
41
|
+
```
|
29
42
|
|
30
43
|
Tasks
|
31
44
|
-----
|
@@ -72,7 +85,7 @@ Useful at the end of any Rake tasks which test your application, it prints `****
|
|
72
85
|
Run this task last to print a more magical version of `:ok`
|
73
86
|
|
74
87
|
Handy Tips for new tasks
|
75
|
-
|
88
|
+
------------------------
|
76
89
|
- All tasks loaded by `lib/rake_n_bake.rb` will have access to the `RakeNBake::AssistantBaker`. This is intended for truely common things, like logging out when a particular step runs or passes.
|
77
90
|
|
78
91
|
Contributing
|
data/Rakefile
CHANGED
data/history.rdoc
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== v1.1.3 (22 March 2015)
|
2
|
+
* Extract missing gem messages for consistant styling.
|
3
|
+
|
4
|
+
== 1.1.2 (10 February 2015)
|
5
|
+
* Allow the gem to be required with 'rake-n-bake' to match the gem name
|
6
|
+
* Add alias so old projects can still require 'rake_n_bake'
|
7
|
+
|
1
8
|
== 1.1.1 (05 January 2015)
|
2
9
|
|
3
10
|
* SemVer now uses integers instead of strings for major, minor and patch
|
data/lib/assistant_baker.rb
CHANGED
@@ -16,5 +16,17 @@ module RakeNBake
|
|
16
16
|
message +
|
17
17
|
Term::ANSIColor.reset
|
18
18
|
end
|
19
|
+
|
20
|
+
def self.log_missing_gem gem_name, tool_name = gem_name
|
21
|
+
$stderr.puts \
|
22
|
+
Term::ANSIColor.yellow +
|
23
|
+
Term::ANSIColor.underline +
|
24
|
+
"! This task is not available because '#{tool_name}' is not available." +
|
25
|
+
Term::ANSIColor.reset
|
26
|
+
|
27
|
+
$stderr.puts \
|
28
|
+
"Try adding \"gem '#{gem_name}'\" to your Gemfile or run `gem install #{gem_name}` and try again." +
|
29
|
+
Term::ANSIColor.reset
|
30
|
+
end
|
19
31
|
end
|
20
32
|
end
|
data/lib/rake-n-bake.rb
ADDED
data/lib/rake_n_bake.rb
CHANGED
data/lib/version.rb
CHANGED
@@ -22,4 +22,15 @@ describe RakeNBake::AssistantBaker do
|
|
22
22
|
expect{described_class.log_passed 'Foo'}.to output("#{Term::ANSIColor.green}Foo#{Term::ANSIColor.reset}\n").to_stdout
|
23
23
|
end
|
24
24
|
end
|
25
|
+
|
26
|
+
describe '#log_missing_gem' do
|
27
|
+
it 'puts a message asking for the gem to be installed' do
|
28
|
+
expect{described_class.log_missing_gem 'foo'}.to output(/Try adding "gem 'foo'"/).to_stderr
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'can optionally take a different name for the tool' do
|
32
|
+
expect{described_class.log_missing_gem 'foo', 'Bar'}.to output(/'Bar' is not available/).to_stderr
|
33
|
+
expect{described_class.log_missing_gem 'foo', 'Bar'}.to output(/Try adding "gem 'foo'"/).to_stderr
|
34
|
+
end
|
35
|
+
end
|
25
36
|
end
|
data/tasks/bundler_audit.rake
CHANGED
@@ -17,8 +17,7 @@ rescue LoadError
|
|
17
17
|
tasks.each do |t|
|
18
18
|
desc "This task is not available"
|
19
19
|
task t do
|
20
|
-
|
21
|
-
$stderr.puts "Try adding \"gem 'bundler-audit'\" to your Gemfile or run `gem install bundler-audit` and try again."
|
20
|
+
RakeNBake::AssistantBaker.log_missing_gem 'bundler-audit'
|
22
21
|
abort
|
23
22
|
end
|
24
23
|
end
|
data/tasks/coverage.rake
CHANGED
@@ -30,8 +30,7 @@ rescue LoadError
|
|
30
30
|
%w[check_specs check_cucumber].map(&:to_sym).each do |t|
|
31
31
|
desc 'SimpleCov rake tasks are not available (gem not installed)'
|
32
32
|
task t do
|
33
|
-
|
34
|
-
$stderr.puts "Try adding \"gem 'simplecov'\" to your Gemfile or run `gem install simplecov` and try again."
|
33
|
+
RakeNBake::AssistantBaker.log_missing_gem 'simplecov', 'SimpleCov'
|
35
34
|
abort
|
36
35
|
end
|
37
36
|
end
|
data/tasks/rspec.rake
CHANGED
@@ -16,8 +16,7 @@ rescue LoadError
|
|
16
16
|
%w[rspec rspec_test_prepare].map(&:to_sym).each do |t|
|
17
17
|
desc 'RSpec rake tasks are not available (gem not installed)'
|
18
18
|
task t do
|
19
|
-
|
20
|
-
$stderr.puts "Try adding \"gem 'rspec'\" to your Gemfile or run `gem install rspec` and try again."
|
19
|
+
RakeNBake::AssistantBaker.log_missing_gem 'rspec', 'RSpec'
|
21
20
|
abort
|
22
21
|
end
|
23
22
|
end
|
data/tasks/semver.rake
CHANGED
@@ -5,7 +5,7 @@ begin
|
|
5
5
|
|
6
6
|
desc "Display the latest version (from .semver)"
|
7
7
|
task :version do
|
8
|
-
RakeNBake::SemverVersioning.
|
8
|
+
RakeNBake::SemverVersioning.current_version
|
9
9
|
end
|
10
10
|
|
11
11
|
desc 'Increment major version in .semver (eg 1.2.3 => 2.0.0)'
|
@@ -22,7 +22,7 @@ begin
|
|
22
22
|
RakeNBake::SemverVersioning.tag
|
23
23
|
end
|
24
24
|
|
25
|
-
desc 'Increment patch version in .semver (eg 1.2.3 => 2.
|
25
|
+
desc 'Increment patch version in .semver (eg 1.2.3 => 1.2.4)'
|
26
26
|
task :patch do
|
27
27
|
RakeNBake::SemverVersioning.inc_patch
|
28
28
|
RakeNBake::SemverVersioning.update_history_file
|
@@ -63,8 +63,7 @@ rescue LoadError
|
|
63
63
|
tasks.each do |t|
|
64
64
|
desc 'SemVer rake tasks are not available (gem not installed)'
|
65
65
|
task t do
|
66
|
-
|
67
|
-
$stderr.puts "Try adding \"gem 'semver2'\" to your Gemfile or run `gem semver2 rspec` and try again."
|
66
|
+
RakeNBake::AssistantBaker 'semver2'
|
68
67
|
abort
|
69
68
|
end
|
70
69
|
end
|
data/tasks/version.rake
CHANGED
@@ -12,7 +12,7 @@ namespace :bake do
|
|
12
12
|
new_version = RakeNBake::Versioning.latest_version
|
13
13
|
new_version[0] += 1
|
14
14
|
new_version[1,2] = 0, 0
|
15
|
-
RakeNBake::
|
15
|
+
RakeNBake::Versioning.update_to new_version
|
16
16
|
end
|
17
17
|
|
18
18
|
desc "Increment the minor version in history.rdoc (eg 1.2.3 => 1.3.0)"
|
@@ -20,7 +20,7 @@ namespace :bake do
|
|
20
20
|
new_version = RakeNBake::Versioning.latest_version
|
21
21
|
new_version[1] += 1
|
22
22
|
new_version[2] = 0
|
23
|
-
RakeNBake::
|
23
|
+
RakeNBake::Versioning.update_to new_version
|
24
24
|
end
|
25
25
|
|
26
26
|
desc "Increment the patch version in history.rdoc (eg 1.2.3 => 1.2.4)"
|
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.1.
|
4
|
+
version: 1.1.3
|
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: 2015-
|
12
|
+
date: 2015-03-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- history.rdoc
|
77
77
|
- lib/assistant_baker.rb
|
78
78
|
- lib/dependency_checker.rb
|
79
|
+
- lib/rake-n-bake.rb
|
79
80
|
- lib/rake_n_bake.rb
|
80
81
|
- lib/semver_versioning.rb
|
81
82
|
- lib/version.rb
|