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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82dd55dfc3c86d02f8b55d0d5a0185594c9f3d83
4
- data.tar.gz: f49055e5ace00e06457a4899fd0d8a099f192bff
3
+ metadata.gz: 92a5a6d2cd5ee6afb4e6d32f05dfc1da3f3eb8bf
4
+ data.tar.gz: 12b024ec3c832705ab94b305d3936eb41501e5c8
5
5
  SHA512:
6
- metadata.gz: 968058fde3cebd0977b9b294338408f5743237a6cb1cb62c762d6955d1ab09bd58e2c4ae7657be9030c33b154d0e80a23470bcbbf2c0c88068a43eb1e98dd78c
7
- data.tar.gz: ff452ed8445814f80c770fcbd837e99ce53d66a8428275a31e076866b9713a0f43ec6f97aa6e5b426d8640fcd71ef471fd981b6d0ed723ff8748bdf5f8f494f8
6
+ metadata.gz: 9557db029a9e12ec3ea8a47ffc21d2275dfa455af6828b9cdea93a57352e53f17d05080f9011f25cad8b7f0462e1d5c9d0cc41f9440e72189c42e1b78fccad30
7
+ data.tar.gz: e401bfa7fe772314f586423ec93fabaeec16b03181f06b2bb66105ee0c99bbfd9e47f543db313d9834a61b8ec50cdd33937c17b5b9cb197a2580404a54d35448
data/.semver CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
- :major: 0
3
- :minor: 0
4
- :patch: 0
2
+ :major: 1
3
+ :minor: 1
4
+ :patch: 3
5
5
  :special: ''
6
6
  :metadata: ''
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
- 1. Add `gem "rake-n-bake"` to your Gemfile and run bundle install.
21
+ - Add `gem "rake-n-bake"` to your Gemfile and run bundle install.
22
+
22
23
  or
23
- 2. Run `gem install rake-n-bake`
24
+
25
+ - Run `gem install rake-n-bake`
24
26
 
25
27
  Usage
26
28
  -----
27
- 1. Add `require "rake_n_bake"` to your Rakefile
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
@@ -1,5 +1,5 @@
1
1
  require 'rake/clean'
2
- require './lib/rake_n_bake'
2
+ require './lib/rake-n-bake'
3
3
 
4
4
  @external_dependencies = %w[ruby rake]
5
5
 
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
@@ -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
@@ -0,0 +1,7 @@
1
+ $:.unshift File.dirname(__FILE__)
2
+
3
+ require 'rake'
4
+ require_relative 'assistant_baker'
5
+
6
+ dir = File.expand_path("../tasks", File.dirname(__FILE__))
7
+ Dir.glob("#{dir}/*.rake").each { |r| import r}
data/lib/rake_n_bake.rb CHANGED
@@ -1,7 +1 @@
1
- $:.unshift File.dirname(__FILE__)
2
-
3
- require 'rake'
4
- require_relative 'assistant_baker'
5
-
6
- dir = File.expand_path("../tasks", File.dirname(__FILE__))
7
- Dir.glob("#{dir}/*.rake").each { |r| import r}
1
+ require_relative 'rake-n-bake'
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RakeNBake
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.3"
3
3
  end
@@ -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
@@ -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
- $stderr.puts "This task is not available because '#{missing}' is not available."
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
- $stdout.puts "This task is not available because the SimpleCov gem is not installed."
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
- $stdout.puts "This task is not available because the RSpec gem is not installed."
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.latest_version
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.0.0)'
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
- $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."
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::Version.update_to new_version
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::Version.update_to new_version
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.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-01-07 00:00:00.000000000 Z
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