chalk-rake 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +10 -0
- data/Rakefile +12 -0
- data/chalk-rake.gemspec +22 -0
- data/lib/chalk-rake.rb +4 -0
- data/lib/chalk-rake/gem_helper.rb +38 -0
- data/lib/chalk-rake/gem_tasks.rb +3 -0
- data/lib/chalk-rake/version.rb +5 -0
- metadata +109 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Stripe
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'chalk-rake/gem_tasks'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
Rake::TestTask.new do |t|
|
6
|
+
t.libs = ['lib']
|
7
|
+
# t.warning = true
|
8
|
+
t.verbose = true
|
9
|
+
t.test_files = FileList['test/**/*.rb'].reject do |file|
|
10
|
+
file.end_with?('_lib.rb') || file.include?('/_lib/')
|
11
|
+
end
|
12
|
+
end
|
data/chalk-rake.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'chalk-rake/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = 'chalk-rake'
|
8
|
+
gem.version = Chalk::Rake::VERSION
|
9
|
+
gem.authors = ['Stripe']
|
10
|
+
gem.email = ['oss@stripe.com']
|
11
|
+
gem.description = %q{Collection of helpful Rake tasks}
|
12
|
+
gem.summary = %q{Collection of helpful Rake tasks}
|
13
|
+
gem.homepage = 'https://github.com/stripe/chalk-rake'
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ['lib']
|
19
|
+
gem.add_development_dependency 'rake'
|
20
|
+
gem.add_development_dependency 'minitest'
|
21
|
+
gem.add_development_dependency 'mocha'
|
22
|
+
end
|
data/lib/chalk-rake.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
class Chalk::Rake::GemHelper
|
2
|
+
include Rake::DSL if defined? Rake::DSL
|
3
|
+
|
4
|
+
def self.install_tasks
|
5
|
+
self.new.install
|
6
|
+
end
|
7
|
+
|
8
|
+
def install
|
9
|
+
task :bump do |i|
|
10
|
+
glob = File.join(Dir.pwd, 'lib/*/version.rb')
|
11
|
+
version_files = Dir[glob]
|
12
|
+
if version_files.length == 0
|
13
|
+
raise "No version file found"
|
14
|
+
elsif version_files.length > 1
|
15
|
+
raise "Found #{version_files.length} version files: #{version_files.inspect}"
|
16
|
+
end
|
17
|
+
version_file = version_files.first
|
18
|
+
contents = File.read(version_file)
|
19
|
+
new = nil
|
20
|
+
contents = contents.gsub(/(VERSION = [\'\"])(\d+\.\d+\.)(\d+)/) do
|
21
|
+
bumped = $3.to_i + 1
|
22
|
+
new = $2 + bumped.to_s
|
23
|
+
$1 + new
|
24
|
+
end
|
25
|
+
if defined?(Bundler)
|
26
|
+
Bundler.ui.confirm("Bumping to #{new}")
|
27
|
+
else
|
28
|
+
puts "Bumping to #{new}"
|
29
|
+
end
|
30
|
+
File.open(version_file, 'w') {|f| f.write(contents)}
|
31
|
+
sh 'git', 'add', version_file
|
32
|
+
sh 'git', 'commit', '-m', 'Bump version'
|
33
|
+
# Would be nicer to just Rake::Task[:release].invoke, but we'd
|
34
|
+
# have to redefine the VERSION constant.
|
35
|
+
sh 'bundle', 'exec', 'rake', 'release'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: chalk-rake
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Stripe
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-12-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: minitest
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: mocha
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: Collection of helpful Rake tasks
|
63
|
+
email:
|
64
|
+
- oss@stripe.com
|
65
|
+
executables: []
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files: []
|
68
|
+
files:
|
69
|
+
- .gitignore
|
70
|
+
- Gemfile
|
71
|
+
- LICENSE.txt
|
72
|
+
- README.md
|
73
|
+
- Rakefile
|
74
|
+
- chalk-rake.gemspec
|
75
|
+
- lib/chalk-rake.rb
|
76
|
+
- lib/chalk-rake/gem_helper.rb
|
77
|
+
- lib/chalk-rake/gem_tasks.rb
|
78
|
+
- lib/chalk-rake/version.rb
|
79
|
+
homepage: https://github.com/stripe/chalk-rake
|
80
|
+
licenses: []
|
81
|
+
post_install_message:
|
82
|
+
rdoc_options: []
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ! '>='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
hash: -3648448381294280732
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
segments:
|
101
|
+
- 0
|
102
|
+
hash: -3648448381294280732
|
103
|
+
requirements: []
|
104
|
+
rubyforge_project:
|
105
|
+
rubygems_version: 1.8.25
|
106
|
+
signing_key:
|
107
|
+
specification_version: 3
|
108
|
+
summary: Collection of helpful Rake tasks
|
109
|
+
test_files: []
|