rake_tasks 5.0.0 → 5.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: a389f0ae81431f5b7a5a8f495d61623bb95af2bf
4
- data.tar.gz: 256ba4b0f5b413cb6e1528533a0225796cd0e908
3
+ metadata.gz: dab3f2b83d70518e3b6cc6d0b8c525d7f3aec7d8
4
+ data.tar.gz: 7a0f3a6effae75a9d2dbbfb415bffbb2be4c2ae9
5
5
  SHA512:
6
- metadata.gz: 1e99e3b934422635633e1bc7250947726085e891783394ebf9d938849eb75b0853ea0fe871440bbcc008e4517073be2f12fab45c349a15a55cf86a23abc16b48
7
- data.tar.gz: a920d595e64d7b81e42d0c69d650350e48f1be37cd657872941b7ed1edcf1744878b13b98a16df1317d553e000cafee18984c3809f2e9c52ab9d0b098e5cafae
6
+ metadata.gz: 39a3b5ab2ff10b5cb2337d1d6372b449f9be695af234130b2b0a385a648b37a854877cc998ae9e600ff248e75bea38dcbb923745d3ccb4450b2d03150637bf43
7
+ data.tar.gz: c3570ae78ff713103020b5e0ea10c10f6e6606025461d0455ed099846465c68df5bb21301be3315c080e82173498b05030af59a741e1e25f8a88ac7092c8a26a
@@ -1,7 +1,18 @@
1
+ # frozen_string_literal: true
1
2
  module RakeTasks
2
3
  module Dependency
3
4
  extend self
4
5
 
6
+ def require_politely(lib, title, stream = STDOUT)
7
+ begin
8
+ Kernel.require lib
9
+ rescue LoadError => e
10
+ stream.puts e.message
11
+ stream.puts "#{lib} could not be required."
12
+ stream.puts "Please ensure that #{title} is included in the Gemfile."
13
+ end
14
+ end
15
+
5
16
  def loaded?(constant, requirement)
6
17
  if ::Kernel::const_defined?(constant.match(/\w+/).to_s)
7
18
  return true
@@ -51,7 +51,7 @@ module RakeTasks
51
51
 
52
52
  def scrub!
53
53
  return if @scrubbed
54
- @marks = @marks.select { |m| m.class == Fixnum }
54
+ @marks = @marks.select { |m| m.is_a?(Integer) }
55
55
  @scrubbed = true
56
56
  end
57
57
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  if RakeTasks::Dependency.loaded?('Cane', 'cane')
2
3
  require 'cane/rake_task'
3
4
 
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+ desc 'show a sample of all colors available in a 16 color console'
3
+ task :colors do
4
+ RakeTasks::Dependency.require_politely 'colorize', 'Colorize'
5
+ exit unless RakeTasks::Dependency.loaded?('Colorize', 'colorize')
6
+ [
7
+ :blue,
8
+ :red,
9
+ :green,
10
+ :yellow,
11
+ :magenta,
12
+ :black,
13
+ :white,
14
+ :cyan,
15
+ nil,
16
+ ].each do |color|
17
+ colors = [color]
18
+ colors << "light_#{color}".to_sym if color
19
+
20
+ colors.each do |clr|
21
+ puts "This is a complete sentence in #{clr.inspect}.".colorize(clr)
22
+ end
23
+ end
24
+ end
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
1
2
  Gem::Specification.new do |s|
2
3
  s.name = 'rake_tasks'
3
- s.version = '5.0.0'
4
+ s.version = '5.1.0'
4
5
 
5
6
  s.summary = 'Basic rake tasks. You know you want some.'
6
7
  s.description =%Q{
@@ -43,6 +44,7 @@ mmmm yummy
43
44
  s.add_development_dependency 'mocha'
44
45
  s.add_development_dependency 'travis-yaml'
45
46
  s.add_development_dependency 'wwtd'
47
+ s.add_development_dependency 'colorize'
46
48
 
47
49
  s.has_rdoc = true
48
50
  end
@@ -47,6 +47,7 @@ Require the tasks that you want to use:
47
47
  require 'rake\_tasks/tasks/test' # Run TestUnit tests - may get removed
48
48
  require 'rake\_tasks/tasks/travis_ci_lint' # Lint .travis.yml
49
49
  require 'rake\_tasks/tasks/release' # Prepare a gem (and repo) for release
50
+ require 'rake\_tasks/tasks/colors' # Show examples of the 16 colors
50
51
 
51
52
  If you want `RakeTasks` to load all of your tasks for you,
52
53
  add `RakeTasks.load_tasks` to your `rakefile`.
@@ -77,6 +78,15 @@ If it is required prior to requiring the console task,
77
78
  the task will not be loaded.
78
79
 
79
80
 
81
+ ### Colors task
82
+
83
+ #### Dependencies
84
+
85
+ * [Colorize][colorize]
86
+
87
+ RakeTaks will attempt to load [Colorize][colorize] when the task is invoked.
88
+
89
+
80
90
  ### Cane Tasks
81
91
 
82
92
  #### Dependencies
@@ -303,6 +313,8 @@ It will have all pre-requisites, plus run the specs.
303
313
  Updates
304
314
  -------
305
315
 
316
+ 5.1.0 added colors rake task
317
+
306
318
  5.0.0 console task uses root folder
307
319
  instead of matching files to folders in lib.
308
320
  The previous behavior assumed only one file/folder would match.
@@ -451,3 +463,4 @@ RakeTasks is released under the LGPLv3 license.
451
463
  [tasks]: #Tasks
452
464
  [wwtd]: https://github.com/grosser/wwtd
453
465
  [travisci]: https://travis-ci.org
466
+ [colorize]: https://github.com/fazibear/colorize
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Herrick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-01 00:00:00.000000000 Z
11
+ date: 2017-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: colorize
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: |-
140
154
  RakeTasks provides basic rake tasks for generating documentation,
141
155
  building and installing gems, and running tests.
@@ -162,6 +176,7 @@ files:
162
176
  - lib/rake_tasks/system.rb
163
177
  - lib/rake_tasks/tasks/cane.rb
164
178
  - lib/rake_tasks/tasks/checksum.rb
179
+ - lib/rake_tasks/tasks/colors.rb
165
180
  - lib/rake_tasks/tasks/console.rb
166
181
  - lib/rake_tasks/tasks/doc.rb
167
182
  - lib/rake_tasks/tasks/gem.rb
@@ -205,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
220
  version: '0'
206
221
  requirements: []
207
222
  rubyforge_project:
208
- rubygems_version: 2.5.1
223
+ rubygems_version: 2.6.8
209
224
  signing_key:
210
225
  specification_version: 4
211
226
  summary: Basic rake tasks. You know you want some.