rake_rack 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/rake_rack.gemspec +1 -1
- data/tasks/coverage.rake +21 -0
- data/tasks/karma.rake +10 -0
- data/tasks/version.rake +76 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b65801751087843be1a5b7cf93ad68d62461047
|
4
|
+
data.tar.gz: 94e94ca3102431e1a4ea4a3d38f763818bd9b778
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e444d755de582dbdcef0dd1aaa0f938ee7272dcda7147e3b87bf24eec078dc62764befc4579cf84d67b4404ca1c22bbbe7686faccce5559664e149cf7313a420
|
7
|
+
data.tar.gz: deb78cd8925f93b50fb40d7e81a6cf0d6f0488528e59f7274a25df056889a2fadce580d907638f93ef0fc4d2cbc6fdf952efe0dbd34d9f0c41fbd61fdc7918c7
|
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.0.
|
7
|
+
spec.version = '0.0.2'
|
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"
|
data/tasks/coverage.rake
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require "simplecov"
|
3
|
+
|
4
|
+
namespace :rake_rack do
|
5
|
+
namespace :coverage do
|
6
|
+
task :check_specs do
|
7
|
+
SimpleCov.coverage_dir 'log/coverage/spec'
|
8
|
+
coverage = SimpleCov.result.covered_percent
|
9
|
+
fail "Spec coverage was only #{coverage}%" if coverage < 100.0
|
10
|
+
end
|
11
|
+
|
12
|
+
task :check_cucumber do
|
13
|
+
SimpleCov.coverage_dir 'log/coverage/features'
|
14
|
+
coverage = SimpleCov.result.covered_percent
|
15
|
+
fail "Feature coverage was only #{coverage}%" if coverage < 100.0
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
rescue LoadError
|
20
|
+
$stderr.puts 'Warning: SimpleCov not available.'
|
21
|
+
end
|
data/tasks/karma.rake
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
namespace :rake_rack do
|
2
|
+
desc "Run JavaScript specs with Karma"
|
3
|
+
task :karma do
|
4
|
+
project_root = File.join(File.dirname(__FILE__), '../..')
|
5
|
+
karma = File.join(project_root, 'node_modules', 'karma', 'bin', 'karma')
|
6
|
+
File.exists?(karma) or fail "Karma not installed - did you run `npm install`?"
|
7
|
+
|
8
|
+
system "#{karma} start #{project_root}/spec/javascripts/karma.conf.js --single-run" or fail
|
9
|
+
end
|
10
|
+
end
|
data/tasks/version.rake
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
module Rake::Version
|
2
|
+
def self.current_history
|
3
|
+
File.read "history.rdoc"
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.latest_version
|
7
|
+
latest_version_string = current_history[/== ([\d\.]*)/, 1] || "0.0.0"
|
8
|
+
@latest_version ||= latest_version_string.split(".").map(&:to_i)
|
9
|
+
def @latest_version.to_s
|
10
|
+
join "."
|
11
|
+
end
|
12
|
+
@latest_version
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.update_to version
|
16
|
+
add_history_header version
|
17
|
+
commit version
|
18
|
+
tag version
|
19
|
+
branch = `git symbolic-ref HEAD`[%r{.*/(.*)}, 1]
|
20
|
+
puts "To push the new tag, use 'git push origin #{branch} --tags'"
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.add_history_header version
|
24
|
+
history = current_history
|
25
|
+
File.open "history.rdoc", "w" do |f|
|
26
|
+
f.puts "== #{version} (#{Time.now.strftime "%d %B %Y"})"
|
27
|
+
f.puts
|
28
|
+
f.print history
|
29
|
+
end
|
30
|
+
puts "Added version to history.rdoc"
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.commit version
|
34
|
+
`git commit history.rdoc -m'increment version to #{version}'`
|
35
|
+
puts "Committed change"
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.tag version
|
39
|
+
`git tag #{version}`
|
40
|
+
puts "Tagged with #{version}"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "Display the latest version (from history.rdoc)"
|
45
|
+
task :"rake_rack:version" do
|
46
|
+
puts "Latest version is #{Rake::Version.latest_version}"
|
47
|
+
end
|
48
|
+
|
49
|
+
namespace :rake_rack do
|
50
|
+
namespace :version do
|
51
|
+
namespace :increment do
|
52
|
+
desc "Increment the major version in history.rdoc (eg 1.2.3 => 2.0.0)"
|
53
|
+
task :major do
|
54
|
+
new_version = Rake::Version.latest_version
|
55
|
+
new_version[0] += 1
|
56
|
+
new_version[1,2] = 0, 0
|
57
|
+
Rake::Version.update_to new_version
|
58
|
+
end
|
59
|
+
|
60
|
+
desc "Increment the minor version in history.rdoc (eg 1.2.3 => 1.3.0)"
|
61
|
+
task :minor do
|
62
|
+
new_version = Rake::Version.latest_version
|
63
|
+
new_version[1] += 1
|
64
|
+
new_version[2] = 0
|
65
|
+
Rake::Version.update_to new_version
|
66
|
+
end
|
67
|
+
|
68
|
+
desc "Increment the patch version in history.rdoc (eg 1.2.3 => 1.2.4)"
|
69
|
+
task :patch do
|
70
|
+
new_version = Rake::Version.latest_version
|
71
|
+
new_version[2] += 1
|
72
|
+
Rake::Version.update_to new_version
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake_rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Vickerstaff
|
@@ -50,8 +50,11 @@ files:
|
|
50
50
|
- lib/rake_rack.rb
|
51
51
|
- rake_rack.gemspec
|
52
52
|
- tasks/code_quality.rake
|
53
|
+
- tasks/coverage.rake
|
54
|
+
- tasks/karma.rake
|
53
55
|
- tasks/ok.rake
|
54
56
|
- tasks/rspec.rake
|
57
|
+
- tasks/version.rake
|
55
58
|
homepage: https://github.com/RichardVickerstaff/rake_rack
|
56
59
|
licenses:
|
57
60
|
- MIT
|