rake-n-bake 1.0.0 → 1.0.1

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: 6ff216e7fab259ec79e7ccd090789f4a5f26337d
4
- data.tar.gz: f26df9d8663f920a778884062d093496b26c6551
3
+ metadata.gz: 85dd926b6901ddb75159e2a9839944100771cfc2
4
+ data.tar.gz: 0e8fbba86a6dcb5b271d4f292f8714e4dd6b9532
5
5
  SHA512:
6
- metadata.gz: 2df06a130628ba279c406ea3e92e9694fca673e1c9fea26f7938e3702f0016bd1db7a482bf50ad64d328f98e643ce597b63e59719ac1b230328c8f8d0209de17
7
- data.tar.gz: ac4be1fd167deb03e7a9990c132e6f0e98a982131cdb4c6e27ce40b760c219cf31ff3548e59f11c9368366aef4d670f33d0020adb9d1c2185966e3bf5bcdf556
6
+ metadata.gz: d9708ecc039177c4a0410969459e1f7d6bab7fc752356532816a975a54e2fa705980a225ae3eedd5bd90fff9eee60582f717166810c10a6e74fe6b1b8f81b96e
7
+ data.tar.gz: af0915cbc44051baf2dd2a6e42a3b2999852541a5e9f8014504cb9c346e97e4231931c0c05af3fa6a97f43b34d031fb131657306280623bbf55fea406f14ac66
data/.semver ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 0
4
+ :patch: 0
5
+ :special: ''
6
+ :metadata: ''
data/.travis.yml CHANGED
@@ -9,8 +9,8 @@ deploy:
9
9
  provider: rubygems
10
10
  api_key:
11
11
  secure: RmGYn4yb1PPjZxdWxgwUWTENnRaqp/PXUMfieJoAE0Dw1JrwkjxI3qhy/I6p36KusLsrFxrh4UdATj78QsWdtZVLJ9tvjONOsrAUjIszBwRmOXDWRkH8eLGCCmIYfYMZaRYvlQhPR2t5CC6BwfHS6W1AU5YtU5SSpk0HT+SRzII=
12
- gem: rake_rack
12
+ gem: rake-n-bake
13
13
  on:
14
14
  tags: true
15
- repo: RichardVickerstaff/rake_rack
15
+ repo: RichardVickerstaff/rake-n-bake
16
16
  all_branches: true
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake-n-bake (1.0.0)
4
+ rake-n-bake (1.0.1)
5
5
  rake (~> 10)
6
6
  term-ansicolor (~> 1.3)
7
7
 
data/bin/byebug ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'byebug' 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('byebug', 'byebug')
data/bin/coderay ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'coderay' 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('coderay', 'coderay')
data/bin/pry ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'pry' 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('pry', 'pry')
data/history.rdoc CHANGED
@@ -1,41 +1,17 @@
1
- == 1.1.0 (16 October 2014)
1
+ == 1.0.1 (21 October 2014)
2
2
 
3
- == 1.0.1 (05 September 2014)
3
+ * Require libs in tasks and only require gems in them
4
+ * Import RakeRack
4
5
 
5
- == 1.0.0 (05 September 2014)
6
+ == 1.0.0 (20 October 2014)
6
7
 
7
8
  * Remove broken Karma task
8
-
9
- == 0.2.1 (05 September 2014)
10
-
11
9
  * Change the way colours are used on term
12
10
  * Add new Rainbow OK task
13
-
14
- == 0.2.0 (04 September 2014)
15
-
16
11
  * Add :check_external_dependencies for checking external dependencies are present
17
-
18
- == 0.1.2 (20 August 2014)
19
-
20
12
  * Suppress grep errors if no folder
21
-
22
- == 0.1.1 (24 July 2014)
23
-
24
- == 0.1.0 (18 July 2014)
25
-
26
- == 0.0.6 (17 July 2014)
27
-
28
13
  * Extract version logic into a class
29
14
  * Allow all tags to push to RubyGems
30
-
31
- == 0.0.5 (16 July 2014)
32
-
33
15
  * Change version tack so it can update gem version
34
-
35
- == 0.0.4 (16 July 2014)
36
-
37
16
  * Allow Travis to push gem on tag
38
-
39
- == 0.0.3 (14 July 2014)
40
-
41
17
  * Introduce history file
@@ -1,8 +1,9 @@
1
1
  require 'term/ansicolor'
2
2
 
3
- class RakeNBake
3
+ module RakeNBake
4
4
  class DependencyChecker
5
- include Term::ANSIColor
5
+
6
+ C = Term::ANSIColor
6
7
 
7
8
  def initialize dependencies
8
9
  @dependencies = Array(dependencies)
@@ -12,7 +13,7 @@ class RakeNBake
12
13
  @results = @dependencies.each_with_object({}) do |dep, results|
13
14
  results[dep] = system "which #{dep} >/dev/null"
14
15
  unless silent
15
- results[dep] ? print(".".green) : print("F".red)
16
+ results[dep] ? print(C.green, ".", C.clear) : print(C.red, "F", C.clear)
16
17
  end
17
18
  end
18
19
  end
data/lib/rake_n_bake.rb CHANGED
@@ -2,8 +2,5 @@ $:.unshift File.dirname(__FILE__)
2
2
 
3
3
  require 'rake'
4
4
 
5
- lib = File.expand_path("../lib", File.dirname(__FILE__))
6
- Dir.glob("#{lib}/*.rb").each{|l| require l}
7
-
8
5
  dir = File.expand_path("../tasks", File.dirname(__FILE__))
9
6
  Dir.glob("#{dir}/*.rake").each { |r| import r}
@@ -1,5 +1,5 @@
1
1
  require 'semver'
2
- class RakeNBake
2
+ module RakeNBake
3
3
  class SemverVersioning
4
4
  def self.current_version
5
5
  if File.exist? SemVer.file_name
@@ -7,7 +7,7 @@ class RakeNBake
7
7
  else
8
8
  version = SemVer.new
9
9
  version.save SemVer.file_name
10
- version
10
+ SemVer.find
11
11
  end
12
12
  end
13
13
 
@@ -53,7 +53,7 @@ class RakeNBake
53
53
 
54
54
  def self.tag
55
55
  v = current_version.to_s
56
- `git add .semver && git commit -m 'Increment version to #{v}' && git tag #{v}`
56
+ `git add .semver && git commit -m 'Increment version to #{v}' && git tag #{v} -a -m '#{Time.now}'`
57
57
  branch = `git symbolic-ref HEAD`[%r{.*/(.*)}, 1]
58
58
  puts "To push the new tag, use 'git push origin #{branch} --tags'"
59
59
  end
data/lib/version.rb CHANGED
@@ -1,4 +1,4 @@
1
- class RakeNBake
1
+ module RakeNBake
2
2
  class Version
3
3
  HISTORY_FILE = "history.rdoc"
4
4
  def self.current_history history_file
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.0'
7
+ spec.version = '1.0.1'
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!"
@@ -1,6 +1,5 @@
1
1
  require 'spec_helper'
2
- require 'term/ansicolor'
3
- include Term::ANSIColor
2
+ require production_code
4
3
 
5
4
  describe RakeNBake::DependencyChecker do
6
5
 
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require production_code
2
3
  require 'yaml'
3
4
 
4
5
  describe RakeNBake::SemverVersioning do
@@ -108,12 +109,20 @@ describe RakeNBake::SemverVersioning do
108
109
  end
109
110
  end
110
111
 
112
+ describe '#update_history_file' do
113
+ context 'when there is no history file' do
114
+ it 'does nothing' do
115
+
116
+ end
117
+ end
118
+ end
119
+
111
120
  describe 'tag' do
112
121
  before do
113
122
  File.write(File.join(File.dirname(__FILE__), '../.semver'), YAML.dump(version))
114
123
  end
115
124
  it 'tags with the curren semver release and outputs push instructions' do
116
- expect(Object).to receive(:`).with("git add .semver && git commit -m 'Increment version to v1.2.3' && git tag v1.2.3")
125
+ expect(Object).to receive(:`).with("git add .semver && git commit -m 'Increment version to v1.2.3' && git tag v1.2.3 -a -m '#{Time.now}'")
117
126
  expect(Object).to receive(:`).with('git symbolic-ref HEAD').and_return 'refs/heads/master'
118
127
  expect(Object).to receive(:puts).with("To push the new tag, use 'git push origin master --tags'")
119
128
  described_class.tag
data/spec/spec_helper.rb CHANGED
@@ -2,10 +2,13 @@ require 'simplecov'
2
2
  require 'timecop'
3
3
  require 'tempfile'
4
4
 
5
+ def production_code
6
+ spec = caller[0][/spec.+\.rb/]
7
+ './'+ spec.gsub('_spec','').gsub(/spec/, 'lib')
8
+ end
9
+
5
10
  SimpleCov.start do
6
11
  add_filter '/vendor/'
7
12
  add_filter '/spec/'
8
13
  coverage_dir 'log/coverage/spec'
9
14
  end
10
-
11
- require_relative '../lib/rake_n_bake'
data/spec/version_spec.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require production_code
2
3
 
3
4
  describe RakeNBake::Version do
4
5
  before do
@@ -1,8 +1,7 @@
1
- require 'term/ansicolor'
1
+ require_relative '../lib/dependency_checker'
2
2
 
3
3
  namespace :bake do
4
4
  task :check_external_dependencies do
5
- include Term::ANSIColor
6
5
  checker = RakeNBake::DependencyChecker.new(@external_dependencies)
7
6
 
8
7
  puts 'Checking external dependencies...'
data/tasks/ok.rake CHANGED
@@ -1,23 +1,25 @@
1
1
  require 'term/ansicolor'
2
2
 
3
3
  namespace :bake do
4
- include Term::ANSIColor
4
+ C = Term::ANSIColor
5
5
 
6
6
  desc 'Print the "ALL TESTS PASSED" message'
7
7
  task :ok do
8
8
  puts
9
9
  print [
10
- "*".bold.red,
11
- "*".bold.yellow,
12
- "*".bold.green,
13
- "*".bold.blue,
14
- "*".bold.magenta,
15
- " ALL TESTS PASSED ".bold.green,
16
- "*".bold.magenta,
17
- "*".bold.blue,
18
- "*".bold.green,
19
- "*".bold.yellow,
20
- "*".bold.red,
10
+ C.bold,
11
+ C.red, "*",
12
+ C.yellow, "*",
13
+ C.green, "*",
14
+ C.blue, "*",
15
+ C.magenta, "*",
16
+ C.green, " ALL TESTS PASSED ",
17
+ C.magenta, "*",
18
+ C.blue, "*",
19
+ C.green, "*",
20
+ C.yellow, "*",
21
+ C.red, "*",
22
+ C.clear
21
23
  ].join
22
24
  puts
23
25
  end
@@ -25,13 +27,13 @@ namespace :bake do
25
27
  desc 'Print the "ALL TESTS PASSED" message WITH A SWEET RAINBOW!!!'
26
28
  task :ok_rainbow do
27
29
  puts
28
- print " ", " ", " ", " ".on_red, " ", " ", " ", "\n"
29
- print " ", " ", " ".on_red, " ".on_yellow, " ".on_red, " ", " ", "\n"
30
- print " ", " ".on_red, " ".on_yellow, " ".on_green, " ".on_yellow, " ".on_red, " ", "\n"
31
- print " ".on_red, " ".on_yellow, " ".on_green, " ".on_blue, " ".on_green, " ".on_yellow, " ".on_red, "\n"
32
- print " ".on_yellow, " ".on_green, " ".on_blue, " ".on_magenta, " ".on_blue, " ".on_green, " ".on_yellow, "\n"
33
- print " ".on_green, " ".on_blue, " ".on_magenta, " ", " ".on_magenta, " ".on_blue, " ".on_green, "\n"
34
- print " ".on_blue, " ".on_magenta, " ", " ALL TESTS PASSED".bold.green, " ".green, " ".on_magenta, " ".on_blue, "\n"
35
- puts
30
+ print C.clear( " "), C.clear( " "), C.clear( " "), C.on_red( " "), C.clear( " "), C.clear( " "), C.clear( " "),"\n"
31
+ print C.clear( " "), C.clear( " "), C.on_red( " "), C.on_yellow( " "), C.on_red( " "), C.clear( " "), C.clear( " "),"\n"
32
+ print C.clear( " "), C.on_red( " "), C.on_yellow( " "), C.on_green( " "), C.on_yellow( " "), C.on_red( " "), C.clear( " "),"\n"
33
+ print C.on_red( " "), C.on_yellow( " "), C.on_green( " "), C.on_blue( " "), C.on_green( " "), C.on_yellow( " "), C.on_red( " "),"\n"
34
+ print C.on_yellow(" "), C.on_green( " "), C.on_blue( " "), C.on_magenta(" "), C.on_blue( " "), C.on_green( " "), C.on_yellow( " "),"\n"
35
+ print C.on_green( " "), C.on_blue( " "), C.on_magenta(" "), C.clear( " "), C.on_magenta(" "), C.on_blue( " "), C.on_green( " "),"\n"
36
+ print C.on_blue( " "), C.on_magenta(" "), C.clear( " "), C.bold, C.green( " ALL TESTS PASSED "), C.clear( " "), C.on_magenta(" "), C.on_blue( " "),"\n"
37
+ puts C.reset
36
38
  end
37
39
  end
data/tasks/rspec.rake CHANGED
@@ -8,6 +8,5 @@ begin
8
8
  RSpec::Core::RakeTask.new(:"bake:rspec_test_prepare" => :"test:prepare") do |t|
9
9
  t.verbose = false
10
10
  end
11
- rescue LoadError
12
11
  $stderr.puts 'Warning: RSpec not available.'
13
12
  end
data/tasks/semver.rake CHANGED
@@ -1,5 +1,5 @@
1
1
  begin
2
- require 'semver'
2
+ require_relative '../lib/semver_versioning'
3
3
  namespace :bake do
4
4
  namespace :semver do
5
5
 
data/tasks/version.rake CHANGED
@@ -1,3 +1,5 @@
1
+ require_relative '../lib/version'
2
+
1
3
  desc "Display the latest version (from history.rdoc)"
2
4
  task :"bake:version" do
3
5
  puts "Latest version is #{RakeNBake::Version.latest_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.0.0
4
+ version: 1.0.1
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-20 00:00:00.000000000 Z
12
+ date: 2014-10-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -50,6 +50,7 @@ files:
50
50
  - ".bundle/config"
51
51
  - ".gitignore"
52
52
  - ".ruby-version"
53
+ - ".semver"
53
54
  - ".travis.yml"
54
55
  - Gemfile
55
56
  - Gemfile.lock
@@ -57,11 +58,14 @@ files:
57
58
  - Rakefile
58
59
  - bin/bundle-audit
59
60
  - bin/bundler
61
+ - bin/byebug
60
62
  - bin/cdiff
63
+ - bin/coderay
61
64
  - bin/colortab
62
65
  - bin/decolor
63
66
  - bin/htmldiff
64
67
  - bin/ldiff
68
+ - bin/pry
65
69
  - bin/rake
66
70
  - bin/rspec
67
71
  - bin/semver