hoe-seattlerb 1.2.9 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.txt +8 -0
- data/Manifest.txt +1 -0
- data/lib/hoe/email.rb +12 -0
- data/lib/hoe/history.rb +63 -0
- data/lib/hoe/perforce.rb +48 -0
- data/lib/hoe/seattlerb.rb +11 -2
- metadata +17 -16
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
=== 1.3.0 / 2013-04-09
|
2
|
+
|
3
|
+
* 3 minor enhancements:
|
4
|
+
|
5
|
+
* Added history rake task. Outputs (and caches) flog/flay data across releases.
|
6
|
+
* Added hoe/history.rb -- providing historical flog & flay numbers across releases.
|
7
|
+
* Hooked in history plugin to be on by default.
|
8
|
+
|
1
9
|
=== 1.2.9 / 2012-11-09
|
2
10
|
|
3
11
|
* 1 bug fix:
|
data/Manifest.txt
CHANGED
data/lib/hoe/email.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
##
|
2
|
+
# Email plugin for Hoe.
|
3
|
+
|
1
4
|
module Hoe::Email
|
2
5
|
|
3
6
|
Hoe::DEFAULT_CONFIG["email"] = {
|
@@ -10,14 +13,23 @@ module Hoe::Email
|
|
10
13
|
"tls" => nil,
|
11
14
|
}
|
12
15
|
|
16
|
+
##
|
17
|
+
# Who to send email to.
|
18
|
+
|
13
19
|
attr_reader :email_to
|
14
20
|
|
21
|
+
##
|
22
|
+
# Initialize the email plugin. Get the email/to from hoe's config.
|
23
|
+
|
15
24
|
def initialize_email
|
16
25
|
with_config do |config, _|
|
17
26
|
@email_to = config["email"]["to"] rescue nil
|
18
27
|
end
|
19
28
|
end
|
20
29
|
|
30
|
+
##
|
31
|
+
# Define email tasks.
|
32
|
+
|
21
33
|
def define_email_tasks
|
22
34
|
require 'net/smtp'
|
23
35
|
begin
|
data/lib/hoe/history.rb
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
##
|
2
|
+
# History plugin for Hoe. Allows you to calculate all of the flog &
|
3
|
+
# flay scores over the releases of your project in an SCM independent
|
4
|
+
# way.
|
5
|
+
|
6
|
+
module Hoe::History
|
7
|
+
def define_history_tasks # :nodoc:
|
8
|
+
# do nothing
|
9
|
+
end
|
10
|
+
|
11
|
+
##
|
12
|
+
# Calculate the flog and flay score for a Hoe project.
|
13
|
+
|
14
|
+
def flog_flay
|
15
|
+
flog = `flog -s -c $(cat Manifest.txt | grep -v txt$) 2>/dev/null`
|
16
|
+
flay = `flay -s $(cat Manifest.txt | grep -v txt$) 2>/dev/null`
|
17
|
+
|
18
|
+
flog_total = flog[/([\d\.]+): flog total/, 1].to_f
|
19
|
+
flog_avg = flog[/([\d\.]+): flog\/method average/, 1].to_f
|
20
|
+
flay_total = flay[/Total score .lower is better. = (\d+)/, 1].to_i
|
21
|
+
|
22
|
+
return flog_total, flog_avg, flay_total
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# Load cached history.
|
27
|
+
|
28
|
+
def load_history
|
29
|
+
require "yaml"
|
30
|
+
YAML.load_file(".history.yaml") rescue {}
|
31
|
+
end
|
32
|
+
|
33
|
+
##
|
34
|
+
# Save cached history.
|
35
|
+
|
36
|
+
def save_history data
|
37
|
+
require "yaml"
|
38
|
+
File.open ".history.yaml", "w" do |f|
|
39
|
+
YAML.dump data, f
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Calculate the history across all versions. Uses `versions` from an
|
45
|
+
# SCM plugin to figure out how to deal with the SCM.
|
46
|
+
|
47
|
+
def history versions
|
48
|
+
history = load_history
|
49
|
+
history.delete "dev" # FIX: this is p4 specific - make a variable?
|
50
|
+
|
51
|
+
flog_total = flog_avg = flay_total = nil
|
52
|
+
|
53
|
+
puts "version\tflog\tavg\tflay"
|
54
|
+
versions.each do |version|
|
55
|
+
history[version] = yield(version) unless history[version]
|
56
|
+
|
57
|
+
flog_total, flog_avg, flay_total = history[version]
|
58
|
+
puts "%s\t%.1f\t%.1f\t%d" % [version, flog_total, flog_avg, flay_total]
|
59
|
+
end
|
60
|
+
ensure
|
61
|
+
save_history history
|
62
|
+
end
|
63
|
+
end
|
data/lib/hoe/perforce.rb
CHANGED
@@ -26,12 +26,23 @@ require 'find'
|
|
26
26
|
# structure can accommodate either but the code below is implicit.
|
27
27
|
|
28
28
|
module Hoe::Perforce
|
29
|
+
|
30
|
+
##
|
31
|
+
# Files fore perforce to ignore. Probably not needed now that they
|
32
|
+
# support a dot-ignore file. I have yet to use that so... yeah.
|
33
|
+
|
29
34
|
attr_accessor :perforce_ignore
|
30
35
|
|
36
|
+
##
|
37
|
+
# Initializes the perforce plugin.
|
38
|
+
|
31
39
|
def initialize_perforce
|
32
40
|
self.perforce_ignore = []
|
33
41
|
end
|
34
42
|
|
43
|
+
##
|
44
|
+
# Defines tasks for the perforce plugin.
|
45
|
+
|
35
46
|
def define_perforce_tasks
|
36
47
|
warn :define_perforce_tasks if $DEBUG
|
37
48
|
|
@@ -60,6 +71,11 @@ module Hoe::Perforce
|
|
60
71
|
task :postrelease => :announce do
|
61
72
|
system 'rake clean'
|
62
73
|
end
|
74
|
+
|
75
|
+
desc "Generate historical flog/flay data for all releases"
|
76
|
+
task :history do
|
77
|
+
p4_history
|
78
|
+
end
|
63
79
|
end
|
64
80
|
|
65
81
|
##
|
@@ -73,6 +89,9 @@ module Hoe::Perforce
|
|
73
89
|
sh "#{cmd};"
|
74
90
|
end
|
75
91
|
|
92
|
+
##
|
93
|
+
# Audit the manifest file against files on the file system.
|
94
|
+
|
76
95
|
def validate_manifest_file manifest_dir
|
77
96
|
manifest_file = "#{manifest_dir}/Manifest.txt"
|
78
97
|
raise "#{manifest_file} does not exist" unless test ?f, manifest_file
|
@@ -113,18 +132,47 @@ module Hoe::Perforce
|
|
113
132
|
raise msg.join("\n") unless msg.empty?
|
114
133
|
end
|
115
134
|
|
135
|
+
##
|
136
|
+
# Revert the pending (release) directory.
|
137
|
+
|
116
138
|
def p4_revert dir
|
117
139
|
puts "reverting #{dir}"
|
118
140
|
p4sh "p4 revert #{dir}/..."
|
119
141
|
end
|
120
142
|
|
143
|
+
##
|
144
|
+
# Branch a release from +from+ to +to+.
|
145
|
+
|
121
146
|
def p4_integrate from, to
|
122
147
|
opened = `p4 opened ... 2>&1`
|
123
148
|
raise "You have files open" unless opened =~ /file\(s\) not opened/
|
124
149
|
p4sh "p4 integrate #{from}/... #{to}/..."
|
125
150
|
end
|
126
151
|
|
152
|
+
##
|
153
|
+
# Submit the current directory with a description message.
|
154
|
+
|
127
155
|
def p4_submit description
|
128
156
|
p4sh "p4 submit -d #{description.inspect} ..."
|
129
157
|
end
|
158
|
+
|
159
|
+
##
|
160
|
+
# Return all version directories (and dev).
|
161
|
+
|
162
|
+
def p4_versions
|
163
|
+
dirs = Dir["../[0-9]*"].sort_by { |s| Gem::Version.new(File.basename(s)) }
|
164
|
+
dirs << "../dev"
|
165
|
+
dirs.map { |d| File.basename d }
|
166
|
+
end
|
167
|
+
|
168
|
+
##
|
169
|
+
# Return the flog & flay history of all releases.
|
170
|
+
|
171
|
+
def p4_history
|
172
|
+
history p4_versions do |version|
|
173
|
+
Dir.chdir "../#{version}" do
|
174
|
+
flog_flay
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
130
178
|
end
|
data/lib/hoe/seattlerb.rb
CHANGED
@@ -1,7 +1,16 @@
|
|
1
|
-
Hoe.plugin :minitest, :perforce, :email
|
1
|
+
Hoe.plugin :minitest, :history, :perforce, :email
|
2
|
+
|
3
|
+
class Hoe; end # :nodoc: stfu rdoc... *sigh*
|
4
|
+
|
5
|
+
##
|
6
|
+
# Top level Seattlerb plugin for Hoe. Doesn't really do anything but
|
7
|
+
# pull in other default plugins.
|
2
8
|
|
3
9
|
module Hoe::Seattlerb
|
4
|
-
VERSION = "1.
|
10
|
+
VERSION = "1.3.0" # :nodoc:
|
11
|
+
|
12
|
+
##
|
13
|
+
# Define seattlerb's rdoc location.
|
5
14
|
|
6
15
|
def define_seattlerb_tasks
|
7
16
|
if Hoe.plugins.include? :publish then
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hoe-seattlerb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 1.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Davis
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
FBHgymkyj/AOSqKRIpXPhjC6
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date:
|
39
|
+
date: 2013-04-10 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
@@ -46,11 +46,11 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ~>
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
hash:
|
49
|
+
hash: 21
|
50
50
|
segments:
|
51
51
|
- 4
|
52
|
-
-
|
53
|
-
version: "4.
|
52
|
+
- 7
|
53
|
+
version: "4.7"
|
54
54
|
type: :development
|
55
55
|
version_requirements: *id001
|
56
56
|
- !ruby/object:Gem::Dependency
|
@@ -61,11 +61,11 @@ dependencies:
|
|
61
61
|
requirements:
|
62
62
|
- - ~>
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
hash:
|
64
|
+
hash: 27
|
65
65
|
segments:
|
66
|
-
-
|
67
|
-
-
|
68
|
-
version: "
|
66
|
+
- 4
|
67
|
+
- 0
|
68
|
+
version: "4.0"
|
69
69
|
type: :development
|
70
70
|
version_requirements: *id002
|
71
71
|
- !ruby/object:Gem::Dependency
|
@@ -76,11 +76,11 @@ dependencies:
|
|
76
76
|
requirements:
|
77
77
|
- - ~>
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
hash:
|
79
|
+
hash: 13
|
80
80
|
segments:
|
81
81
|
- 3
|
82
|
-
-
|
83
|
-
version: "3.
|
82
|
+
- 5
|
83
|
+
version: "3.5"
|
84
84
|
type: :development
|
85
85
|
version_requirements: *id003
|
86
86
|
description: |-
|
@@ -104,6 +104,7 @@ files:
|
|
104
104
|
- README.txt
|
105
105
|
- Rakefile
|
106
106
|
- lib/hoe/email.rb
|
107
|
+
- lib/hoe/history.rb
|
107
108
|
- lib/hoe/perforce.rb
|
108
109
|
- lib/hoe/seattlerb.rb
|
109
110
|
homepage: https://github.com/seattlerb/hoe-seattlerb
|
@@ -136,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
137
|
requirements: []
|
137
138
|
|
138
139
|
rubyforge_project: seattlerb
|
139
|
-
rubygems_version: 1.8.
|
140
|
+
rubygems_version: 1.8.25
|
140
141
|
signing_key:
|
141
142
|
specification_version: 3
|
142
143
|
summary: Hoe plugins providing tasks used by seattle.rb including minitest, perforce, and email providing full front-to-back release/annouce automation.
|
metadata.gz.sig
CHANGED
Binary file
|