hen 0.3.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog CHANGED
@@ -1,5 +1,27 @@
1
1
  = Revision history for hen
2
2
 
3
+ == 0.4.0 [2011-09-21]
4
+
5
+ * Use env ruby.
6
+ * New task 'gem:dependencies'.
7
+ * Don't undefine `object_id' for (pseudo-)objects.
8
+
9
+ == 0.3.9 [2011-05-24]
10
+
11
+ * Even more Rake 0.9.0/RubyGems 1.8.3 compatibility.
12
+
13
+ == 0.3.8 [2011-05-24]
14
+
15
+ * More Rake 0.9.0 compatibility.
16
+
17
+ == 0.3.7 [2011-05-24]
18
+
19
+ * Rake 0.9.0 compatibility.
20
+
21
+ == 0.3.6 [2011-04-29]
22
+
23
+ * Switched project and template license to Affero GPL.
24
+
3
25
  == 0.3.5 [2011-04-05]
4
26
 
5
27
  * RubyGems 1.7.0 deprecated Gem::Specification#has_rdoc=.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to hen version 0.3.9
5
+ This documentation refers to hen version 0.4.0
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/bin/hen CHANGED
@@ -1,4 +1,4 @@
1
- #! /usr/bin/ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  #--
4
4
  ###############################################################################
data/lib/hen/dsl.rb CHANGED
@@ -113,6 +113,19 @@ class Hen
113
113
  !!managed_files
114
114
  end
115
115
 
116
+ # Set +options+ on +object+ by calling the corresponding setter method
117
+ # for each option; warns about illegal options. Optionally, use +type+
118
+ # to describe +object+ (defaults to its class).
119
+ def set_options(object, options, type = object.class)
120
+ options.each { |option, value|
121
+ if object.respond_to?(setter = "#{option}=")
122
+ object.send(setter, value)
123
+ else
124
+ warn "Unknown #{type} option: #{option}"
125
+ end
126
+ }
127
+ end
128
+
116
129
  # Encapsulates tasks targeting at RubyForge, skipping those if no
117
130
  # RubyForge project is defined. Yields the RubyForge configuration
118
131
  # hash and, optionally, a proc to obtain RubyForge objects from (via
@@ -323,7 +336,7 @@ class Hen
323
336
  def pseudo_object
324
337
  extend_object(Object.new, block_given? ? Proc.new : nil) {
325
338
  instance_methods.each { |method|
326
- undef_method(method) unless method =~ /\A__/
339
+ undef_method(method) unless method =~ /\A__|\Aobject_id\z/
327
340
  }
328
341
  }
329
342
  end
data/lib/hen/version.rb CHANGED
@@ -3,8 +3,8 @@ class Hen
3
3
  module Version
4
4
 
5
5
  MAJOR = 0
6
- MINOR = 3
7
- TINY = 9
6
+ MINOR = 4
7
+ TINY = 0
8
8
 
9
9
  class << self
10
10
 
data/lib/hens/gem.rake CHANGED
@@ -118,14 +118,37 @@ Hen :gem => :rdoc do
118
118
 
119
119
  ### => set options!
120
120
 
121
- gem_options.each { |option, value|
122
- if spec.respond_to?(setter = "#{option}=")
123
- spec.send(setter, value)
124
- else
125
- warn "Unknown Gem option: #{option}"
121
+ set_options(spec, gem_options, 'Gem')
122
+
123
+ }
124
+
125
+ desc 'Check the gem dependencies'
126
+ task 'gem:dependencies' do
127
+ errors, $stdout.sync = [], true
128
+
129
+ gem_spec.dependencies.each { |dependency|
130
+ print 'Checking for %s dependency %s (%s)... ' % [
131
+ dependency.type, dependency.name, dependency.requirement
132
+ ]
133
+
134
+ sleep(0.2 + rand / 2) # ;)
135
+
136
+ begin
137
+ spec = dependency.to_spec
138
+ spec.activate
139
+
140
+ puts "found (#{spec.version})"
141
+ rescue Exception => err
142
+ errors << err
143
+
144
+ puts "not found (#{err.class})"
126
145
  end
127
146
  }
128
- }
147
+
148
+ errors.each { |err| warn "\n#{err}" } if $VERBOSE || Rake.verbose
149
+
150
+ exit 1 unless errors.empty?
151
+ end
129
152
 
130
153
  desc 'Display the gem specification'
131
154
  task 'gem:spec' do
data/lib/hens/test.rake CHANGED
@@ -14,10 +14,7 @@ Hen :test do
14
14
  unless test_files.empty?
15
15
  Rake::TestTask.new { |t|
16
16
  t.test_files = test_files
17
-
18
- test_options.each { |option, value|
19
- t.send("#{option}=", value)
20
- }
17
+ set_options(t, test_options, 'Test')
21
18
  }
22
19
  end
23
20
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hen
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 9
10
- version: 0.3.9
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jens Wille
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-24 00:00:00 Z
18
+ date: 2011-09-21 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: ruby-nuggets
@@ -58,41 +58,41 @@ extra_rdoc_files:
58
58
  - COPYING
59
59
  - ChangeLog
60
60
  files:
61
- - lib/hen/cli.rb
62
- - lib/hen/version.rb
63
61
  - lib/hen/dsl.rb
62
+ - lib/hen/version.rb
63
+ - lib/hen/cli.rb
64
64
  - lib/hen.rb
65
65
  - bin/hen
66
66
  - lib/hens/rdoc.rake
67
- - lib/hens/gem.rake
68
67
  - lib/hens/test.rake
68
+ - lib/hens/gem.rake
69
69
  - lib/hens/spec.rake
70
- - README
71
70
  - ChangeLog
72
- - Rakefile
73
71
  - COPYING
72
+ - README
73
+ - Rakefile
74
74
  - example/hens/sample.rake
75
75
  - example/_henrc
76
- - example/project/README
77
76
  - example/project/ChangeLog
78
- - example/project/Rakefile
79
- - example/project/lib/__progname__/version.rb
80
- - example/project/lib/__progname__.rb
81
77
  - example/project/_gitignore
82
78
  - example/project/COPYING
79
+ - example/project/lib/__progname__/version.rb
80
+ - example/project/lib/__progname__.rb
81
+ - example/project/README
82
+ - example/project/Rakefile
83
83
  homepage: http://prometheus.rubyforge.org/hen
84
84
  licenses: []
85
85
 
86
86
  post_install_message:
87
87
  rdoc_options:
88
+ - --main
89
+ - README
90
+ - --all
88
91
  - --charset
89
92
  - UTF-8
90
93
  - --title
91
- - hen Application documentation (v0.3.9)
92
- - --main
93
- - README
94
+ - hen Application documentation (v0.4.0)
94
95
  - --line-numbers
95
- - --all
96
96
  require_paths:
97
97
  - lib
98
98
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  requirements: []
117
117
 
118
118
  rubyforge_project: prometheus
119
- rubygems_version: 1.8.3
119
+ rubygems_version: 1.8.10
120
120
  signing_key:
121
121
  specification_version: 3
122
122
  summary: Hoe or Echoe? No, thanks! Just a Rake helper that fits my own personal style.