rake_rack 0.1.2 → 0.2.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: cff9f0e8ef039b2792dd81fe620ffab2533343e1
4
- data.tar.gz: 8e77b4449bedb1a273b384ecb331c0081374200b
3
+ metadata.gz: 53966a5928c9b6ff9f7b17c5138816166f6007dd
4
+ data.tar.gz: b7249ea2753da53638ecfda1dc27901b711147c9
5
5
  SHA512:
6
- metadata.gz: 28c973320cda62db99c3b6041863697d1c364d6b946ef9c7e2843c79d3bfd96370e91422cb16cdbff2d29ee4738a79d6787db8f3cad97e49c696a88d75a459dd
7
- data.tar.gz: 5fb3807604d6ae0a59df16dfd73aa70209c8bd54a7b39dc0f6f13324e769a077b9aab33d720ab5132240083ae0066579a12da4229fa171cd8f25fa87b542468f
6
+ metadata.gz: 089eae39020803dd39aa686d483ec7f85f66d891ebe64e858218f6bff5f265a39a3c60c533e84ea578464ec68201d17ab07cd1296646f7d4dd88ea71e4ce3276
7
+ data.tar.gz: efd64ea0dd5063d897760afaf296e207a801e2f94efcfb3384184393d12c9e7ebefc46b9260f865be6b6f6478dc2f2184ded992cbfefdb9b1e8ff471d861c6da
data/Gemfile CHANGED
@@ -4,3 +4,4 @@ gem 'rspec'
4
4
  gem 'rake'
5
5
  gem 'simplecov'
6
6
  gem 'timecop'
7
+ gem 'term-ansicolor', '~> 1.3'
data/Gemfile.lock CHANGED
@@ -22,7 +22,10 @@ GEM
22
22
  multi_json
23
23
  simplecov-html (~> 0.8.0)
24
24
  simplecov-html (0.8.0)
25
+ term-ansicolor (1.3.0)
26
+ tins (~> 1.0)
25
27
  timecop (0.7.1)
28
+ tins (1.3.2)
26
29
 
27
30
  PLATFORMS
28
31
  ruby
@@ -31,4 +34,5 @@ DEPENDENCIES
31
34
  rake
32
35
  rspec
33
36
  simplecov
37
+ term-ansicolor (~> 1.3)
34
38
  timecop
data/README.md CHANGED
@@ -19,6 +19,13 @@ You can then call them like you would any other rake task.
19
19
 
20
20
  All tasks are namespaced with `:rake_rack` to prevent clashing with other tasks
21
21
 
22
+ ### :check_external_dependencies
23
+ Check that each command in the `@external_dependencies` array is present on the system path (and fails the task if it isn't)
24
+ For example:
25
+ ```ruby
26
+ @external_dependencies = ['ruby', 'postgres', 'foo']
27
+ ```
28
+
22
29
  ### :code_quality
23
30
  #### :all
24
31
  Runs `[:trailing_spaces, :shoulds, :debugger, :pry, :console_log]` tasks. It does not run `:time_check`
@@ -45,6 +52,10 @@ Look at SimpleCov results for Cucumber coverage in `log/coverage/features` and f
45
52
  ### :ok
46
53
  Run this task last to print `***** ALL TESTS PASSED *****` showing you rake has passed.
47
54
 
55
+ ### :ok_rainbow
56
+ Run this task last to print a more magical version of the 'ALL TESTS PASSED' message
57
+
58
+
48
59
  ToDo
49
60
  ----
50
61
  1. Add a list of all the rake tasks to the Readme
data/Rakefile CHANGED
@@ -1,11 +1,13 @@
1
1
  require 'rake/clean'
2
2
  require './lib/rake_rack'
3
3
 
4
+ @external_dependencies = %w[ruby rake tput]
5
+
4
6
  task :default => [
5
7
  :clean,
8
+ :"rake_rack:check_external_dependencies",
6
9
  :"rake_rack:code_quality:all",
7
10
  :"rake_rack:rspec",
8
11
  :"rake_rack:coverage:check_specs",
9
12
  :"rake_rack:ok",
10
13
  ]
11
-
data/history.rdoc CHANGED
@@ -1,3 +1,12 @@
1
+ == 0.2.1 (05 September 2014)
2
+
3
+ * Change the way colours are used on term
4
+ * Add new Rainbow OK task
5
+
6
+ == 0.2.0 (04 September 2014)
7
+
8
+ * Add :check_external_dependencies for checking external dependencies are present
9
+
1
10
  == 0.1.2 (20 August 2014)
2
11
 
3
12
  * Suppress grep errors if no folder
data/rake_rack.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_rack"
7
- spec.version = '0.1.2'
7
+ spec.version = '0.2.1'
8
8
  spec.authors = ["Richard Vickerstaff"]
9
9
  spec.email = ["m3akq@btinternet.com"]
10
10
  spec.description = "A set of rake tasks I commonly use - Formerly known as pool_net"
@@ -16,4 +16,5 @@ Gem::Specification.new do |spec|
16
16
 
17
17
  spec.add_runtime_dependency "rake", "~> 10"
18
18
  spec.add_runtime_dependency "rspec", "~> 3.0"
19
+ spec.add_runtime_dependency "term-ansicolor", "~> 1.3"
19
20
  end
@@ -0,0 +1,23 @@
1
+ namespace :rake_rack do
2
+ task :check_external_dependencies do
3
+ puts 'Checking external dependencies...'
4
+ green = `tput setaf 2`
5
+ red = `tput setaf 1`
6
+ reset = `tput sgr0`
7
+
8
+ results = Array(@external_dependencies).each_with_object({}) do |exe, status|
9
+ system "which #{exe} > /dev/null"
10
+ status[exe] = if($? == 0)
11
+ print "#{green}.#{reset}"
12
+ true
13
+ else
14
+ print "#{red}F#{reset}"
15
+ false
16
+ end
17
+ end
18
+ puts
19
+ missing = results.select{|k,v| v == false}
20
+ fail "The following dependencies are missing: \n#{missing.keys.join(%Q[\n])}" unless missing.empty?
21
+ 2.times{puts}
22
+ end
23
+ end
data/tasks/ok.rake CHANGED
@@ -1,12 +1,34 @@
1
1
  namespace :rake_rack do
2
+ require 'term/ansicolor'
3
+ include Term::ANSIColor
4
+
2
5
  task :ok do
3
- red = "\e[31m"
4
- yellow = "\e[33m"
5
- green = "\e[32m"
6
- blue = "\e[34m"
7
- purple = "\e[35m"
8
- bold = "\e[1m"
9
- normal = "\e[0m"
10
- puts "", "#{bold}#{red}*#{yellow}*#{green}*#{blue}*#{purple}*#{green} ALL TESTS PASSED #{purple}*#{blue}*#{green}*#{yellow}*#{red}*#{normal}"
6
+ puts
7
+ print [
8
+ "*".bold.red,
9
+ "*".bold.yellow,
10
+ "*".bold.green,
11
+ "*".bold.blue,
12
+ "*".bold.magenta,
13
+ " ALL TESTS PASSED ".bold.green,
14
+ "*".bold.magenta,
15
+ "*".bold.blue,
16
+ "*".bold.green,
17
+ "*".bold.yellow,
18
+ "*".bold.red,
19
+ ].join
20
+ puts
21
+ end
22
+
23
+ task :ok_rainbow do
24
+ puts
25
+ print " ", " ", " ", " ".on_red, " ", " ", " ", "\n"
26
+ print " ", " ", " ".on_red, " ".on_yellow, " ".on_red, " ", " ", "\n"
27
+ print " ", " ".on_red, " ".on_yellow, " ".on_green, " ".on_yellow, " ".on_red, " ", "\n"
28
+ print " ".on_red, " ".on_yellow, " ".on_green, " ".on_blue, " ".on_green, " ".on_yellow, " ".on_red, "\n"
29
+ print " ".on_yellow, " ".on_green, " ".on_blue, " ".on_magenta, " ".on_blue, " ".on_green, " ".on_yellow, "\n"
30
+ print " ".on_green, " ".on_blue, " ".on_magenta, " ", " ".on_magenta, " ".on_blue, " ".on_green, "\n"
31
+ print " ".on_blue, " ".on_magenta, " ", " ALL TESTS PASSED".bold.green, " ".green, " ".on_magenta, " ".on_blue, "\n"
32
+ puts
11
33
  end
12
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Vickerstaff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-26 00:00:00.000000000 Z
11
+ date: 2014-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: term-ansicolor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
41
55
  description: A set of rake tasks I commonly use - Formerly known as pool_net
42
56
  email:
43
57
  - m3akq@btinternet.com
@@ -59,6 +73,7 @@ files:
59
73
  - spec/.keep
60
74
  - spec/spec_helper.rb
61
75
  - spec/version_spec.rb
76
+ - tasks/check_external_deps.rake
62
77
  - tasks/code_quality.rake
63
78
  - tasks/coverage.rake
64
79
  - tasks/karma.rake