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 CHANGED
@@ -1,5 +1,10 @@
1
1
  = Revision history for hen
2
2
 
3
+ == 0.0.4 [2008-01-07]
4
+
5
+ * Added Test::Unit and RSpec hens (tasks 'test' and 'spec')
6
+ * Removed HenError stuff
7
+
3
8
  == 0.0.3 [2008-01-04]
4
9
 
5
10
  * More cleanup and maturing.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to hen version 0.0.3
5
+ This documentation refers to hen version 0.0.4
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/example/.henrc CHANGED
@@ -21,4 +21,11 @@
21
21
  :append_svnversion: true
22
22
  :require_path: lib
23
23
 
24
+ :test:
25
+ :pattern: test/**/*_test.rb
26
+
27
+ :spec:
28
+ :pattern: spec/**/*_spec.rb
29
+ :options: spec.opts
30
+
24
31
  # vim: syntax=yaml
data/example/Rakefile CHANGED
@@ -6,18 +6,17 @@ end
6
6
 
7
7
  require 'lib/your_prog/version'
8
8
 
9
- task(:doc_spec) {{
10
- :title => 'your_prog Application documentation'
11
- }}
9
+ Hen.lay! {{
10
+ :rubyforge => {
11
+ :project => 'your_project',
12
+ :package => 'your_prog'
13
+ },
12
14
 
13
- task(:gem_spec) {{
14
- :name => 'your_prog',
15
- :version => YourProg::VERSION,
16
- :rubyforge_project => 'your_project',
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]
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 HenError => err
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. Raises HenError::ConfigRequired
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; raise if config is missing
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
@@ -32,7 +32,7 @@ class Hen
32
32
 
33
33
  MAJOR = 0
34
34
  MINOR = 0
35
- TINY = 3
35
+ TINY = 4
36
36
 
37
37
  class << self
38
38
 
@@ -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
@@ -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.3.151
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-04 00:00:00 +01:00
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