hen 0.0.3.151 → 0.0.4.153
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +5 -0
- data/README +1 -1
- data/example/.henrc +7 -0
- data/example/Rakefile +12 -13
- data/lib/hen.rb +2 -3
- data/lib/hen/dsl.rb +4 -5
- data/lib/hen/version.rb +1 -1
- data/lib/hens/spec.rake +18 -0
- data/lib/hens/test.rake +18 -0
- metadata +9 -8
- data/lib/hen/errors.rb +0 -55
data/ChangeLog
CHANGED
data/README
CHANGED
data/example/.henrc
CHANGED
data/example/Rakefile
CHANGED
@@ -6,18 +6,17 @@ end
|
|
6
6
|
|
7
7
|
require 'lib/your_prog/version'
|
8
8
|
|
9
|
-
|
10
|
-
:
|
11
|
-
|
9
|
+
Hen.lay! {{
|
10
|
+
:rubyforge => {
|
11
|
+
:project => 'your_project',
|
12
|
+
:package => 'your_prog'
|
13
|
+
},
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
:dependencies => %w[hyper magic]
|
15
|
+
:gem => {
|
16
|
+
:version => YourProg::VERSION,
|
17
|
+
:summary => 'Your super duper sample prog',
|
18
|
+
:files => FileList['lib/**/*.rb', 'bin/*'].to_a,
|
19
|
+
:extra_files => FileList['[A-Z]*', 'example/*'].to_a,
|
20
|
+
:dependencies => %w[hyper magic]
|
21
|
+
}
|
21
22
|
}}
|
22
|
-
|
23
|
-
Hen.lay!
|
data/lib/hen.rb
CHANGED
@@ -33,7 +33,6 @@ require 'rubygems'
|
|
33
33
|
require 'nuggets/proc/bind'
|
34
34
|
|
35
35
|
require 'hen/dsl'
|
36
|
-
require 'hen/errors'
|
37
36
|
require 'hen/version'
|
38
37
|
|
39
38
|
class Hen
|
@@ -204,8 +203,8 @@ class Hen
|
|
204
203
|
}
|
205
204
|
|
206
205
|
block.bind(DSL).call
|
207
|
-
rescue
|
208
|
-
warn "#{name}: #{err}" if verbose
|
206
|
+
rescue => err
|
207
|
+
warn "#{name}: #{err} (#{err.class})" if verbose
|
209
208
|
end
|
210
209
|
|
211
210
|
# call-seq:
|
data/lib/hen/dsl.rb
CHANGED
@@ -33,17 +33,16 @@ class Hen
|
|
33
33
|
|
34
34
|
extend self
|
35
35
|
|
36
|
-
# The Hen configuration.
|
37
|
-
# if a required configuration is missing.
|
36
|
+
# The Hen configuration.
|
38
37
|
def config
|
39
38
|
config = Hen.config
|
40
39
|
|
41
40
|
# always return a duplicate for a value, hence making the
|
42
|
-
# configuration immutable
|
41
|
+
# configuration immutable
|
43
42
|
def config.[](key)
|
44
|
-
raise HenError::ConfigRequired.new(key) unless has_key?(key)
|
45
|
-
|
46
43
|
fetch(key).dup
|
44
|
+
rescue IndexError
|
45
|
+
{}
|
47
46
|
end
|
48
47
|
|
49
48
|
config
|
data/lib/hen/version.rb
CHANGED
data/lib/hens/spec.rake
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Hen :spec do
|
2
|
+
require 'spec/rake/spectask'
|
3
|
+
|
4
|
+
spec_options = config[:spec]
|
5
|
+
|
6
|
+
spec_files =
|
7
|
+
spec_options.delete(:files) || FileList[spec_options.delete(:pattern)]
|
8
|
+
|
9
|
+
if spec_files && !spec_files.empty?
|
10
|
+
Spec::Rake::SpecTask.new { |t|
|
11
|
+
t.spec_files = spec_files
|
12
|
+
t.spec_opts = spec_options.map { |option, value|
|
13
|
+
option = '--' << option.to_s.tr('_', '-')
|
14
|
+
value.is_a?(String) ? [option, value] : value ? option : nil
|
15
|
+
}.compact.flatten
|
16
|
+
}
|
17
|
+
end
|
18
|
+
end
|
data/lib/hens/test.rake
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Hen :test do
|
2
|
+
require 'rake/testtask'
|
3
|
+
|
4
|
+
test_options = config[:test]
|
5
|
+
|
6
|
+
test_files =
|
7
|
+
test_options.delete(:files) || FileList[test_options.delete(:pattern)]
|
8
|
+
|
9
|
+
if test_files && !test_files.empty?
|
10
|
+
Rake::TestTask.new { |t|
|
11
|
+
t.test_files = test_files
|
12
|
+
|
13
|
+
test_options.each { |option, value|
|
14
|
+
t.send("#{option}=", value)
|
15
|
+
}
|
16
|
+
}
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4.153
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Wille
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-01-
|
12
|
+
date: 2008-01-07 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -43,14 +43,15 @@ extra_rdoc_files:
|
|
43
43
|
files:
|
44
44
|
- lib/hen/version.rb
|
45
45
|
- lib/hen/dsl.rb
|
46
|
-
- lib/hen/errors.rb
|
47
46
|
- lib/hen.rb
|
48
47
|
- bin/hen
|
49
48
|
- COPYING
|
50
49
|
- README
|
51
50
|
- ChangeLog
|
52
51
|
- Rakefile
|
52
|
+
- lib/hens/spec.rake
|
53
53
|
- lib/hens/gem.rake
|
54
|
+
- lib/hens/test.rake
|
54
55
|
- lib/hens/rdoc.rake
|
55
56
|
- example/Rakefile
|
56
57
|
- example/.henrc
|
@@ -58,15 +59,15 @@ has_rdoc: true
|
|
58
59
|
homepage: http://prometheus.rubyforge.org/hen
|
59
60
|
post_install_message:
|
60
61
|
rdoc_options:
|
61
|
-
- --all
|
62
|
-
- --line-numbers
|
63
|
-
- --inline-source
|
64
|
-
- --main
|
65
|
-
- README
|
66
62
|
- --charset
|
67
63
|
- UTF-8
|
68
64
|
- --title
|
69
65
|
- hen Application documentation
|
66
|
+
- --main
|
67
|
+
- README
|
68
|
+
- --line-numbers
|
69
|
+
- --all
|
70
|
+
- --inline-source
|
70
71
|
require_paths:
|
71
72
|
- lib
|
72
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
data/lib/hen/errors.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
###############################################################################
|
3
|
-
# #
|
4
|
-
# A component of hen, the Rake helper. #
|
5
|
-
# #
|
6
|
-
# Copyright (C) 2007-2008 University of Cologne, #
|
7
|
-
# Albertus-Magnus-Platz, #
|
8
|
-
# 50932 Cologne, Germany #
|
9
|
-
# #
|
10
|
-
# Authors: #
|
11
|
-
# Jens Wille <jens.wille@uni-koeln.de> #
|
12
|
-
# #
|
13
|
-
# hen is free software; you can redistribute it and/or modify it under the #
|
14
|
-
# terms of the GNU General Public License as published by the Free Software #
|
15
|
-
# Foundation; either version 3 of the License, or (at your option) any later #
|
16
|
-
# version. #
|
17
|
-
# #
|
18
|
-
# hen is distributed in the hope that it will be useful, but WITHOUT ANY #
|
19
|
-
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
|
20
|
-
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more #
|
21
|
-
# details. #
|
22
|
-
# #
|
23
|
-
# You should have received a copy of the GNU General Public License along #
|
24
|
-
# with hen. If not, see <http://www.gnu.org/licenses/>. #
|
25
|
-
# #
|
26
|
-
###############################################################################
|
27
|
-
#++
|
28
|
-
|
29
|
-
class Hen
|
30
|
-
|
31
|
-
# Base class for Hen errors.
|
32
|
-
class HenError < StandardError
|
33
|
-
|
34
|
-
# Raised if a required configuration is missing.
|
35
|
-
class ConfigRequired < HenError
|
36
|
-
|
37
|
-
# call-seq:
|
38
|
-
# new(key)
|
39
|
-
#
|
40
|
-
def initialize(key)
|
41
|
-
@key = key
|
42
|
-
end
|
43
|
-
|
44
|
-
# call-seq:
|
45
|
-
# to_s
|
46
|
-
#
|
47
|
-
def to_s
|
48
|
-
"Required configuration missing for #{@key}"
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|