rake-n-bake 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semver +1 -1
- data/.travis.yml +4 -1
- data/README.md +3 -0
- data/history.rdoc +4 -0
- data/lib/assistant_baker.rb +8 -0
- data/lib/version.rb +1 -1
- data/spec/assistant_baker_spec.rb +10 -0
- data/tasks/rails_best_practices.rake +20 -0
- data/tasks/version.rake +4 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1243bf5b247113e256bd942c777715a8a0cd4b70
|
4
|
+
data.tar.gz: d5ebe99924fc9a94a4b0f4fc599aab3afdbf62d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 310ce3a2af1d257c9c3d2f578adfe710bfdf56d1f586ddf6218a229d62f424b12b82e07263a13a95980099e756af75dd7fc3e54e0db705fb5881696b6369f27a
|
7
|
+
data.tar.gz: 98be3550eb38f18d2d9f072efbd9400a3d5b5df0003718f0166a767cb424904fcca0909954818ff5665d07ca079efbfcf521d61dd6a83129f2f1a602ad7af82b
|
data/.semver
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -84,6 +84,9 @@ Useful at the end of any Rake tasks which test your application, it prints `****
|
|
84
84
|
### :ok_rainbow
|
85
85
|
Run this task last to print a more magical version of `:ok`
|
86
86
|
|
87
|
+
### :rails_best_practices
|
88
|
+
Run this task to run the [Rails Best Practices](https://github.com/railsbp/rails_best_practices) metrics against your Rails project.
|
89
|
+
|
87
90
|
Handy Tips for new tasks
|
88
91
|
------------------------
|
89
92
|
- 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.
|
data/history.rdoc
CHANGED
data/lib/assistant_baker.rb
CHANGED
@@ -11,6 +11,14 @@ module RakeNBake
|
|
11
11
|
Term::ANSIColor.reset
|
12
12
|
end
|
13
13
|
|
14
|
+
def self.log_warn message
|
15
|
+
puts Term::ANSIColor.red +
|
16
|
+
Term::ANSIColor.underline +
|
17
|
+
'● ' +
|
18
|
+
message +
|
19
|
+
Term::ANSIColor.reset
|
20
|
+
end
|
21
|
+
|
14
22
|
def self.log_passed message
|
15
23
|
puts Term::ANSIColor.green +
|
16
24
|
message +
|
data/lib/version.rb
CHANGED
@@ -13,6 +13,16 @@ describe RakeNBake::AssistantBaker do
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
describe '#log_warn' do
|
17
|
+
it 'puts the given message' do
|
18
|
+
expect{described_class.log_warn 'Foo'}.to output(/Foo/).to_stdout
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'prints an attractive dot before the message' do
|
22
|
+
expect{described_class.log_warn 'Foo'}.to output(/● Foo/).to_stdout
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
16
26
|
describe '#log_passed' do
|
17
27
|
it 'puts the given message' do
|
18
28
|
expect{described_class.log_passed 'Foo'}.to output(/Foo/).to_stdout
|
@@ -0,0 +1,20 @@
|
|
1
|
+
begin
|
2
|
+
require 'rails_best_practices'
|
3
|
+
|
4
|
+
namespace :bake do
|
5
|
+
desc 'A code metric tool to check the quality of rails code'
|
6
|
+
task :rails_best_practices do
|
7
|
+
RakeNBake::AssistantBaker.log_step 'Running Rails Best Practices'
|
8
|
+
fail unless system('bundle exec rails_best_practices')
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
rescue LoadError
|
13
|
+
namespace :bake do
|
14
|
+
desc 'Rails Best Practices is not available (gem not installed)'
|
15
|
+
task :rails_best_practices do
|
16
|
+
$stdout.puts 'This task is not avaialble because the Rails Best Practices gem is not installed'
|
17
|
+
$stderr.puts "Try adding \"gem 'rails_best_practices'\" to your Gemfile and try again"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/tasks/version.rake
CHANGED
@@ -2,6 +2,7 @@ require_relative '../lib/versioning'
|
|
2
2
|
|
3
3
|
desc "Display the latest version (from history.rdoc)"
|
4
4
|
task :"bake:version" do
|
5
|
+
RakeNBake::AssistantBaker.log_warn "[DEPRECATION] `bake:version` is deprecated. Please use `bake:semver` instead."
|
5
6
|
puts "Latest version is #{RakeNBake::Versioning.latest_version}"
|
6
7
|
end
|
7
8
|
|
@@ -9,6 +10,7 @@ namespace :bake do
|
|
9
10
|
namespace :version do
|
10
11
|
desc "Increment the major version in history.rdoc (eg 1.2.3 => 2.0.0)"
|
11
12
|
task :major do
|
13
|
+
RakeNBake::AssistantBaker.log_warn "[DEPRECATION] `bake:version` is deprecated. Please use `bake:semver` instead."
|
12
14
|
new_version = RakeNBake::Versioning.latest_version
|
13
15
|
new_version[0] += 1
|
14
16
|
new_version[1,2] = 0, 0
|
@@ -17,6 +19,7 @@ namespace :bake do
|
|
17
19
|
|
18
20
|
desc "Increment the minor version in history.rdoc (eg 1.2.3 => 1.3.0)"
|
19
21
|
task :minor do
|
22
|
+
RakeNBake::AssistantBaker.log_warn "[DEPRECATION] `bake:version` is deprecated. Please use `bake:semver` instead."
|
20
23
|
new_version = RakeNBake::Versioning.latest_version
|
21
24
|
new_version[1] += 1
|
22
25
|
new_version[2] = 0
|
@@ -25,6 +28,7 @@ namespace :bake do
|
|
25
28
|
|
26
29
|
desc "Increment the patch version in history.rdoc (eg 1.2.3 => 1.2.4)"
|
27
30
|
task :patch do
|
31
|
+
RakeNBake::AssistantBaker.log_warn "[DEPRECATION] `bake:version` is deprecated. Please use `bake:semver` instead."
|
28
32
|
new_version = RakeNBake::Versioning.latest_version
|
29
33
|
new_version[2] += 1
|
30
34
|
RakeNBake::Versioning.update_to new_version
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Vickerstaff
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- tasks/code_quality.rake
|
94
94
|
- tasks/coverage.rake
|
95
95
|
- tasks/ok.rake
|
96
|
+
- tasks/rails_best_practices.rake
|
96
97
|
- tasks/rspec.rake
|
97
98
|
- tasks/semver.rake
|
98
99
|
- tasks/version.rake
|