rake-n-bake 1.0.6 → 1.1.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: 6c9a3152547c691ab0f75c2c26707b0b5b15d0a9
4
- data.tar.gz: 23210b8c106d329f40ba501d9caab2af13f641e9
3
+ metadata.gz: 952bb7568d12e64bc8bb2e92468daf1975e1ad88
4
+ data.tar.gz: eb3d3abd30e2d592029bf248e5394c19c87c1bdb
5
5
  SHA512:
6
- metadata.gz: e41f8ba588ef6461ee6c3256767c920a5d762389cc7bd5c18539624c2e0569c8ea68b1c38a0ae2c3586b07227a45658284a3a77017731f3eae87e162937239a3
7
- data.tar.gz: 0adf454e7efed8c30b9edbc90938aaf832f1a984d8213ca1b9f5482a25d634446d45e681a1ae044e3ba30d7f484b093b7c8d21cd6acea67f6a83c8524f9550c0
6
+ metadata.gz: 4e3b7fe8cfb0a2559d6cf479fbb50472f180ebea8de36221e49317ce5bff3f837df509ed218aa7744e3c4e2f14f1660270385f0f1d61eaea6be5522d44e3d67c
7
+ data.tar.gz: 90a3977c4c2f4b18ca87c3089d89d982bea9237479c75bfac8299d0e328be67d95c673ae14d797868de256587dc2b1684055ebbc276194c59f25bb2f4660d284
data/.travis.yml CHANGED
@@ -5,6 +5,9 @@ rvm:
5
5
  - 1.9.3
6
6
  - ruby-head
7
7
  - jruby-1.7.12
8
+ env:
9
+ global:
10
+ - CODECLIMATE_REPO_TOKEN=6e1cff9fab6a2878c20e9935e9fbe551bb056ad03347f05faef813c058fc6f8f
8
11
  deploy:
9
12
  provider: rubygems
10
13
  api_key:
data/Gemfile CHANGED
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
+ gem "codeclimate-test-reporter", require: nil
6
7
  gem 'bundler-audit'
7
8
  gem 'cucumber'
8
9
  gem 'rake'
data/README.md CHANGED
@@ -8,6 +8,7 @@ Commonly used Rake tasks
8
8
 
9
9
  [![Build Status](https://travis-ci.org/RichardVickerstaff/rake-n-bake.svg?branch=master)](https://travis-ci.org/RichardVickerstaff/rake-n-bake)
10
10
  [![Gem Version](https://badge.fury.io/rb/rake-n-bake.svg)](http://badge.fury.io/rb/rake-n-bake)
11
+ [![Code Climate](https://codeclimate.com/github/RichardVickerstaff/rake-n-bake/badges/gpa.svg)](https://codeclimate.com/github/RichardVickerstaff/rake-n-bake)
11
12
 
12
13
  Rake-n-Bake is a collection of widely applicable Rake tasks used on many projects.
13
14
  They have been extracted into a gem to allow them to easily be reused and maintained.
@@ -70,6 +71,10 @@ Useful at the end of any Rake tasks which test your application, it prints `****
70
71
  ### :ok_rainbow
71
72
  Run this task last to print a more magical version of `:ok`
72
73
 
74
+ Handy Tips for new tasks
75
+ -----=------------------
76
+ - 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
+
73
78
  Contributing
74
79
  ------------
75
80
  1. Make a fork
data/Rakefile CHANGED
@@ -10,5 +10,5 @@ task :default => [
10
10
  :"bake:rspec",
11
11
  :"bake:coverage:check_specs",
12
12
  :"bake:bundler_audit",
13
- :"bake:ok",
13
+ :"bake:ok_rainbow",
14
14
  ]
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'cc-tddium-post-worker' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('codeclimate-test-reporter', 'cc-tddium-post-worker')
data/bin/cucumber ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'cucumber' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('cucumber', 'cucumber')
data/history.rdoc CHANGED
@@ -1,3 +1,5 @@
1
+ == 1.1.0 (09 December 2014)
2
+
1
3
  == 1.0.6 (23 October 2014)
2
4
 
3
5
  * SemVer now patches CHANGELOG.md as well as history.rdoc
@@ -0,0 +1,20 @@
1
+ # encoding: utf-8
2
+ require 'term/ansicolor'
3
+
4
+ module RakeNBake
5
+ class AssistantBaker
6
+ def self.log_step message
7
+ puts Term::ANSIColor.blue +
8
+ Term::ANSIColor.underline +
9
+ '● ' +
10
+ message +
11
+ Term::ANSIColor.reset
12
+ end
13
+
14
+ def self.log_passed message
15
+ puts Term::ANSIColor.green +
16
+ message +
17
+ Term::ANSIColor.reset
18
+ end
19
+ end
20
+ end
data/lib/rake_n_bake.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  $:.unshift File.dirname(__FILE__)
2
2
 
3
3
  require 'rake'
4
+ require_relative 'assistant_baker'
4
5
 
5
6
  dir = File.expand_path("../tasks", File.dirname(__FILE__))
6
7
  Dir.glob("#{dir}/*.rake").each { |r| import r}
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.6'
7
+ spec.version = '1.1.0'
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!"
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require production_code
4
+
5
+ describe RakeNBake::AssistantBaker do
6
+ describe '#log_step' do
7
+ it 'puts the given message' do
8
+ expect{described_class.log_step 'Foo'}.to output(/Foo/).to_stdout
9
+ end
10
+
11
+ it 'prints an attractive dot before the message' do
12
+ expect{described_class.log_step 'Foo'}.to output(/● Foo/).to_stdout
13
+ end
14
+ end
15
+
16
+ describe '#log_passed' do
17
+ it 'puts the given message' do
18
+ expect{described_class.log_passed 'Foo'}.to output(/Foo/).to_stdout
19
+ end
20
+
21
+ it 'prints the message in green' do
22
+ expect{described_class.log_passed 'Foo'}.to output("#{Term::ANSIColor.green}Foo#{Term::ANSIColor.reset}\n").to_stdout
23
+ end
24
+ end
25
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'simplecov'
2
2
  require 'timecop'
3
3
  require 'tempfile'
4
+ require "codeclimate-test-reporter"
5
+ CodeClimate::TestReporter.start
4
6
 
5
7
  def production_code
6
8
  spec = caller[0][/spec.+\.rb/]
@@ -4,6 +4,7 @@ begin
4
4
  namespace :bake do
5
5
  desc 'Check Gemfile.lock for security issues'
6
6
  task :bundler_audit do
7
+ RakeNBake::AssistantBaker.log_step 'Checking gems for known security warnings'
7
8
  Bundler::Audit::CLI.start
8
9
  end
9
10
  end
@@ -4,7 +4,7 @@ namespace :bake do
4
4
  task :check_external_dependencies do
5
5
  checker = RakeNBake::DependencyChecker.new(@external_dependencies)
6
6
 
7
- puts 'Checking external dependencies...'
7
+ RakeNBake::AssistantBaker.log_step 'Checking external dependencies'
8
8
  checker.check
9
9
  puts
10
10
 
data/tasks/coverage.rake CHANGED
@@ -3,19 +3,26 @@ begin
3
3
 
4
4
  namespace :bake do
5
5
  namespace :coverage do
6
+ desc 'Check coverage from RSpec'
6
7
  task :check_specs do
8
+ RakeNBake::AssistantBaker.log_step 'Checking spec coverage'
7
9
  SimpleCov.coverage_dir 'log/coverage/spec'
8
10
  coverage = SimpleCov.result.covered_percent
9
11
  fail "Spec coverage was only #{coverage}%" if coverage < 100.0
12
+ RakeNBake::AssistantBaker.log_passed "Spec coverage is at #{coverage}%"
10
13
  end
11
14
 
15
+ desc 'Check coverage from Cucumber'
12
16
  task :check_cucumber do
17
+ RakeNBake::AssistantBaker.log_step 'Checking feature coverage'
13
18
  SimpleCov.coverage_dir 'log/coverage/features'
14
19
  coverage = SimpleCov.result.covered_percent
15
20
  fail "Feature coverage was only #{coverage}%" if coverage < 100.0
21
+ RakeNBake::AssistantBaker.log_passed "Feature coverage is at #{coverage}%"
16
22
  end
17
23
  end
18
24
  end
25
+
19
26
  rescue LoadError
20
27
 
21
28
  namespace :bake do
data/tasks/rspec.rake CHANGED
@@ -3,6 +3,7 @@ begin
3
3
 
4
4
  RSpec::Core::RakeTask.new(:"bake:rspec") do |t|
5
5
  t.verbose = false
6
+ RakeNBake::AssistantBaker.log_step 'Running specs'
6
7
  end
7
8
 
8
9
  RSpec::Core::RakeTask.new(:"bake:rspec_test_prepare" => :"test:prepare") do |t|
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.6
4
+ version: 1.1.0
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-27 00:00:00.000000000 Z
12
+ date: 2014-12-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -58,9 +58,11 @@ files:
58
58
  - bin/bundle-audit
59
59
  - bin/bundler
60
60
  - bin/byebug
61
+ - bin/cc-tddium-post-worker
61
62
  - bin/cdiff
62
63
  - bin/coderay
63
64
  - bin/colortab
65
+ - bin/cucumber
64
66
  - bin/decolor
65
67
  - bin/htmldiff
66
68
  - bin/ldiff
@@ -72,12 +74,14 @@ files:
72
74
  - bin/term_mandel
73
75
  - bin/thor
74
76
  - history.rdoc
77
+ - lib/assistant_baker.rb
75
78
  - lib/dependency_checker.rb
76
79
  - lib/rake_n_bake.rb
77
80
  - lib/semver_versioning.rb
78
81
  - lib/version.rb
79
82
  - rake-n-bake.gemspec
80
83
  - spec/.keep
84
+ - spec/assistant_baker_spec.rb
81
85
  - spec/dependency_checker_spec.rb
82
86
  - spec/semver_versioning_spec.rb
83
87
  - spec/spec_helper.rb