hen 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +6 -0
- data/README +1 -1
- data/lib/hen/dsl.rb +2 -14
- data/lib/hen/version.rb +2 -2
- data/lib/hens/gem.rake +3 -13
- data/lib/hens/rdoc.rake +36 -37
- data/lib/hens/spec.rake +5 -54
- data/lib/hens/test.rake +2 -2
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4072e13f1feb0d60af5d5cc34da7241534729021
|
4
|
+
data.tar.gz: f928a7f50cf2fa8792e21b74f5b89bc003d48ca4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21ab42db487595edd0efac73bef24ac27b63839f7c4cec703552a850eb30d9bf7c05dfebaaabe2d8ec12c2e4675f6831f42c4ae73fe398151f6d75ec238a8dfa
|
7
|
+
data.tar.gz: 928c0691dfcd088104f2dc253b6939873b92477bdfa5e1ea105c3edb0910eb1eeb3c95d55439d5ee38fb6ffc4b937130f7d9139c7419bd0e3facec8d6e6b2516
|
data/ChangeLog
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
= Revision history for hen
|
4
4
|
|
5
|
+
== 0.8.0 [2014-10-31]
|
6
|
+
|
7
|
+
* Removed support for legacy versions of RDoc, RSpec and RubyGems.
|
8
|
+
* Included workaround to make RDoc labels cross-browser compatible (issue
|
9
|
+
330[https://github.com/rdoc/rdoc/pull/330]).
|
10
|
+
|
5
11
|
== 0.7.1 [2014-10-17]
|
6
12
|
|
7
13
|
* Specify default dependency for hen with pessimistic version constraint.
|
data/README
CHANGED
data/lib/hen/dsl.rb
CHANGED
@@ -152,12 +152,6 @@ class Hen
|
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
-
# DEPRECATED: Use #rubygems instead.
|
156
|
-
def gemcutter(&block)
|
157
|
-
warn "#{self}#gemcutter is deprecated; use `rubygems' instead."
|
158
|
-
rubygems(&block)
|
159
|
-
end
|
160
|
-
|
161
155
|
# Encapsulates tasks targeting at Git, skipping those if the current
|
162
156
|
# project is not controlled by Git. Yields a Git object via #init_git.
|
163
157
|
def git
|
@@ -187,14 +181,8 @@ class Hen
|
|
187
181
|
# Loads the RubyGems +push+ command, giving
|
188
182
|
# a nicer error message if it's not found.
|
189
183
|
def have_rubygems?
|
190
|
-
|
191
|
-
|
192
|
-
require 'rubygems/commands/push_command'
|
193
|
-
rescue LoadError
|
194
|
-
# rubygems < 1.3.6, gemcutter < 0.4.0
|
195
|
-
require 'commands/abstract_command'
|
196
|
-
require 'commands/push'
|
197
|
-
end
|
184
|
+
require 'rubygems/command_manager'
|
185
|
+
require 'rubygems/commands/push_command'
|
198
186
|
|
199
187
|
Gem::Commands::PushCommand
|
200
188
|
rescue LoadError, NameError
|
data/lib/hen/version.rb
CHANGED
data/lib/hens/gem.rake
CHANGED
@@ -20,20 +20,10 @@ Hen gem: :rdoc do
|
|
20
20
|
require_path: 'lib'
|
21
21
|
}.update(config[:gem])
|
22
22
|
|
23
|
-
|
24
|
-
raise LoadError if gem_options.delete(:legacy)
|
25
|
-
|
26
|
-
require 'rubygems/package_task'
|
27
|
-
Gem::PackageTask
|
28
|
-
rescue LoadError
|
29
|
-
require 'rake/gempackagetask'
|
30
|
-
Rake::GemPackageTask
|
31
|
-
end
|
23
|
+
require 'rubygems/package_task'
|
32
24
|
|
33
25
|
if Object.const_defined?(:RDOC_OPTIONS)
|
34
26
|
rdoc_files = RDOC_OPTIONS[:rdoc_files]
|
35
|
-
gem_options[:has_rdoc] = !rdoc_files.empty? if Gem::VERSION < '1.7'
|
36
|
-
|
37
27
|
gem_options[:rdoc_options] ||= RDOC_OPTIONS[:options]
|
38
28
|
end
|
39
29
|
|
@@ -269,7 +259,7 @@ Hen gem: :rdoc do
|
|
269
259
|
|
270
260
|
}
|
271
261
|
|
272
|
-
pkg_task =
|
262
|
+
pkg_task = Gem::PackageTask.new(gem_spec) { |pkg|
|
273
263
|
pkg.need_tar_gz = true
|
274
264
|
pkg.need_zip = true
|
275
265
|
|
@@ -280,7 +270,7 @@ Hen gem: :rdoc do
|
|
280
270
|
|
281
271
|
meta_gem_specs.each { |meta_gem_spec|
|
282
272
|
|
283
|
-
meta_pkg_task =
|
273
|
+
meta_pkg_task = Gem::PackageTask.new(meta_gem_spec)
|
284
274
|
|
285
275
|
taskname = meta_gem_spec.taskname
|
286
276
|
|
data/lib/hens/rdoc.rake
CHANGED
@@ -1,44 +1,25 @@
|
|
1
1
|
Hen :rdoc do
|
2
2
|
|
3
3
|
rdoc_options = {
|
4
|
-
rdoc_dir:
|
5
|
-
rdoc_files:
|
6
|
-
title:
|
7
|
-
charset:
|
8
|
-
|
9
|
-
|
10
|
-
all: true
|
4
|
+
rdoc_dir: 'doc',
|
5
|
+
rdoc_files: %w[README COPYING ChangeLog lib/**/*.rb ext/**/*.c],
|
6
|
+
title: '{name:%s }Application documentation{version: (v%s)}',
|
7
|
+
charset: 'UTF-8',
|
8
|
+
line_numbers: true,
|
9
|
+
all: true
|
11
10
|
}.update(config[:rdoc])
|
12
11
|
|
13
|
-
rdoc_klass = begin
|
14
|
-
raise LoadError if rdoc_options.delete(:legacy)
|
15
|
-
|
16
|
-
require 'rdoc/task'
|
17
|
-
|
18
|
-
rdoc_options.delete(:inline_source) # deprecated
|
19
|
-
RDoc::Task
|
20
|
-
rescue LoadError
|
21
|
-
begin
|
22
|
-
require 'rake/rdoctask'
|
23
|
-
Rake::RDocTask
|
24
|
-
rescue LoadError => err
|
25
|
-
load_error = err
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
12
|
info = {
|
30
13
|
'name' => config[:gem][:name],
|
31
14
|
'version' => config[:gem][:version],
|
32
15
|
'date' => Date.today.to_s
|
33
16
|
}
|
34
17
|
|
35
|
-
rdoc_options[:title].gsub!(/\{(\w+):(.*?)\}/) { i = info[$1] and $2 % i }
|
36
|
-
|
37
18
|
### rdoc_dir
|
38
19
|
|
39
20
|
rdoc_dir = rdoc_options.delete(:rdoc_dir)
|
40
21
|
|
41
|
-
### rdoc_files
|
22
|
+
### rdoc_files
|
42
23
|
|
43
24
|
rdoc_files = FileList[[
|
44
25
|
rdoc_options.delete(:rdoc_files),
|
@@ -55,6 +36,8 @@ Hen :rdoc do
|
|
55
36
|
rdoc_files_local = []
|
56
37
|
end
|
57
38
|
|
39
|
+
### main
|
40
|
+
|
58
41
|
rdoc_options.delete(:main) unless rdoc_files.include?(
|
59
42
|
File.join(rdoc_options.values_at(:root, :main).compact))
|
60
43
|
|
@@ -63,6 +46,10 @@ Hen :rdoc do
|
|
63
46
|
main_candidates.grep(%r{\Areadme[^/]*\z}i).first || main_candidates.first
|
64
47
|
end
|
65
48
|
|
49
|
+
### title
|
50
|
+
|
51
|
+
rdoc_options[:title].gsub!(/\{(\w+):(.*?)\}/) { i = info[$1] and $2 % i }
|
52
|
+
|
66
53
|
### rdoc_options
|
67
54
|
|
68
55
|
rdoc_opts = map_options(rdoc_options)
|
@@ -74,24 +61,34 @@ Hen :rdoc do
|
|
74
61
|
options: rdoc_opts
|
75
62
|
}
|
76
63
|
|
77
|
-
unless rdoc_files.empty?
|
78
|
-
|
64
|
+
unless rdoc_files.empty? && rdoc_files_local.empty?
|
65
|
+
require 'rdoc/task'
|
66
|
+
|
67
|
+
class RDoc::Markup::ToLabel
|
68
|
+
|
69
|
+
alias_method :_hen_original_convert, :convert
|
70
|
+
|
71
|
+
def convert(*args)
|
72
|
+
_hen_original_convert(*args).gsub('%', '-').sub(/^-/, '')
|
73
|
+
end
|
74
|
+
|
75
|
+
end if defined?(RDoc::Markup::ToLabel)
|
76
|
+
end
|
79
77
|
|
80
|
-
|
78
|
+
unless rdoc_files.empty?
|
79
|
+
RDoc::Task.new(:doc) { |rdoc|
|
81
80
|
rdoc.rdoc_dir = rdoc_dir
|
82
81
|
rdoc.rdoc_files = rdoc_files
|
83
82
|
rdoc.options = rdoc_opts
|
84
83
|
}
|
85
84
|
else
|
86
85
|
task :doc do
|
87
|
-
warn 'No files to generate documentation for
|
86
|
+
warn 'No files to generate documentation for...'
|
88
87
|
end
|
89
88
|
end
|
90
89
|
|
91
90
|
unless rdoc_files_local.empty?
|
92
|
-
|
93
|
-
|
94
|
-
rdoc_klass.new('doc:local') { |rdoc|
|
91
|
+
RDoc::Task.new('doc:local') { |rdoc|
|
95
92
|
rdoc.rdoc_dir = rdoc_dir + '.local'
|
96
93
|
rdoc.rdoc_files = rdoc_files_local
|
97
94
|
rdoc.options = rdoc_opts
|
@@ -104,10 +101,12 @@ Hen :rdoc do
|
|
104
101
|
def rerdoc_task_description; local_description(super); end
|
105
102
|
}
|
106
103
|
}
|
104
|
+
else
|
105
|
+
task 'doc:local' do
|
106
|
+
warn 'No files to generate documentation for...'
|
107
|
+
end
|
107
108
|
end
|
108
109
|
|
109
|
-
publish_desc = 'Publish RDoc documentation'
|
110
|
-
|
111
110
|
git do |git|
|
112
111
|
|
113
112
|
git_branch = 'gh-pages'
|
@@ -132,14 +131,14 @@ Hen :rdoc do
|
|
132
131
|
git.checkout_fetched_branch pages_url, git_branch
|
133
132
|
|
134
133
|
rm_r Dir['*']
|
135
|
-
cp_r Dir["../#{
|
134
|
+
cp_r Dir["../#{rdoc_dir}/*"], '.'
|
136
135
|
|
137
136
|
git.add_and_commit 'Updated documentation.'
|
138
137
|
git.push pages_url, git_branch
|
139
138
|
}
|
140
139
|
end
|
141
140
|
|
142
|
-
desc
|
141
|
+
desc 'Publish RDoc documentation'
|
143
142
|
task 'doc:publish' => 'doc:publish:github'
|
144
143
|
|
145
144
|
elsif clone_url # still git repo, but no gh-pages branch
|
data/lib/hens/spec.rake
CHANGED
@@ -6,46 +6,19 @@ Hen :spec do
|
|
6
6
|
options: 'spec/spec.opts'
|
7
7
|
}.update(config[:spec])
|
8
8
|
|
9
|
-
spec_klass = begin
|
10
|
-
raise LoadError if spec_options.delete(:legacy)
|
11
|
-
|
12
|
-
require 'rspec/core/rake_task'
|
13
|
-
RSpec::Core::RakeTask
|
14
|
-
rescue LoadError
|
15
|
-
begin
|
16
|
-
require 'spec/rake/spectask'
|
17
|
-
Spec::Rake::SpecTask
|
18
|
-
rescue LoadError => err
|
19
|
-
load_error = err
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
9
|
spec_files = spec_options.delete(:files) ||
|
24
10
|
FileList[spec_options.delete(:pattern)].to_a
|
25
11
|
|
26
12
|
mangle_files!(spec_files, managed: false)
|
27
13
|
|
28
14
|
unless spec_files.empty?
|
29
|
-
|
15
|
+
require 'rspec/core/rake_task'
|
30
16
|
|
31
17
|
spec_helper = spec_options.delete(:helper)
|
32
18
|
|
33
19
|
if spec_helper && File.readable?(spec_helper)
|
34
20
|
spec_files.delete(spec_helper)
|
35
|
-
|
36
|
-
begin
|
37
|
-
require 'rspec/core/version'
|
38
|
-
|
39
|
-
# RSpec began sorting test files in version 2.12.0 (c76c1e6)
|
40
|
-
curr_version = Gem::Version.new(RSpec::Core::Version::STRING)
|
41
|
-
sort_version = Gem::Version.new('2.12.0')
|
42
|
-
|
43
|
-
raise LoadError if curr_version < sort_version
|
44
|
-
|
45
|
-
(spec_options[:require] ||= []) << File.basename(spec_helper, '.rb')
|
46
|
-
rescue LoadError, NameError
|
47
|
-
spec_files.unshift(spec_helper)
|
48
|
-
end
|
21
|
+
(spec_options[:require] ||= []) << File.basename(spec_helper, '.rb')
|
49
22
|
end
|
50
23
|
|
51
24
|
opts_file = spec_options.delete(:options)
|
@@ -55,31 +28,9 @@ Hen :spec do
|
|
55
28
|
File.readlines(opts_file).each { |line| spec_opts << line.chomp }
|
56
29
|
end
|
57
30
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
t.spec_opts = spec_opts
|
62
|
-
else
|
63
|
-
t.pattern = spec_files
|
64
|
-
t.rspec_opts = spec_opts
|
65
|
-
end
|
66
|
-
}
|
67
|
-
|
68
|
-
spec_klass.new(&spec_block)
|
69
|
-
|
70
|
-
rcov_opts = ['--exclude', spec_files.join(',')]
|
71
|
-
rcov_file = File.join(spec_files.first[%r{[^/.]+}], 'rcov.opts')
|
72
|
-
|
73
|
-
if rcov_file && File.readable?(rcov_file)
|
74
|
-
File.readlines(rcov_file).each { |line| rcov_opts << line.chomp }
|
75
|
-
end
|
76
|
-
|
77
|
-
#desc "Run specs with RCov"
|
78
|
-
spec_klass.new('spec:rcov') { |t|
|
79
|
-
spec_block[t]
|
80
|
-
|
81
|
-
t.rcov = true
|
82
|
-
t.rcov_opts = rcov_opts
|
31
|
+
RSpec::Core::RakeTask.new { |t|
|
32
|
+
t.pattern = spec_files
|
33
|
+
t.rspec_opts = spec_opts
|
83
34
|
}
|
84
35
|
end
|
85
36
|
|
data/lib/hens/test.rake
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
Hen :test do
|
2
2
|
|
3
|
-
require 'rake/testtask'
|
4
|
-
|
5
3
|
test_options = {
|
6
4
|
pattern: 'test/**/*_test.rb'
|
7
5
|
}.update(config[:test])
|
@@ -12,6 +10,8 @@ Hen :test do
|
|
12
10
|
mangle_files!(test_files, managed: false)
|
13
11
|
|
14
12
|
unless test_files.empty?
|
13
|
+
require 'rake/testtask'
|
14
|
+
|
15
15
|
Rake::TestTask.new { |t|
|
16
16
|
t.test_files = test_files
|
17
17
|
set_options(t, test_options, 'Test')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Wille
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -106,16 +106,15 @@ licenses:
|
|
106
106
|
metadata: {}
|
107
107
|
post_install_message: |2+
|
108
108
|
|
109
|
-
hen-0.
|
109
|
+
hen-0.8.0 [2014-10-31]:
|
110
110
|
|
111
|
-
*
|
112
|
-
*
|
113
|
-
|
114
|
-
* Prefer +README+ as +main+ file.
|
111
|
+
* Removed support for legacy versions of RDoc, RSpec and RubyGems.
|
112
|
+
* Included workaround to make RDoc labels cross-browser compatible (issue
|
113
|
+
330[https://github.com/rdoc/rdoc/pull/330]).
|
115
114
|
|
116
115
|
rdoc_options:
|
117
116
|
- "--title"
|
118
|
-
- hen Application documentation (v0.
|
117
|
+
- hen Application documentation (v0.8.0)
|
119
118
|
- "--charset"
|
120
119
|
- UTF-8
|
121
120
|
- "--line-numbers"
|