hen 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to hen version 0.4.2
5
+ This documentation refers to hen version 0.4.3
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/Rakefile CHANGED
@@ -15,6 +15,6 @@ Hen.lay! {{
15
15
  :author => %q{Jens Wille},
16
16
  :email => %q{jens.wille@uni-koeln.de},
17
17
  :extra_files => FileList['lib/hens/*.rake'].to_a,
18
- :dependencies => [['ruby-nuggets', '>= 0.6.9'], 'highline']
18
+ :dependencies => [['ruby-nuggets', '>= 0.8.4'], 'highline']
19
19
  }
20
20
  }}
@@ -4,7 +4,7 @@ class Hen
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 4
7
- TINY = 2
7
+ TINY = 3
8
8
 
9
9
  class << self
10
10
 
@@ -2,7 +2,7 @@ Hen :gem => :rdoc do
2
2
  # Dependencies:
3
3
  # * rdoc -- Uses RDOC_OPTIONS and 'doc:publish' task
4
4
 
5
- gem_options = config[:gem].merge(
5
+ gem_options = {
6
6
  :files => FileList[
7
7
  'lib/**/*.rb',
8
8
  'bin/*'
@@ -18,7 +18,7 @@ Hen :gem => :rdoc do
18
18
  'ext/**/extconf.rb'
19
19
  ].to_a,
20
20
  :require_path => 'lib'
21
- )
21
+ }.update(config[:gem])
22
22
 
23
23
  gem_klass = begin
24
24
  raise LoadError if gem_options.delete(:legacy)
@@ -39,6 +39,8 @@ Hen :gem => :rdoc do
39
39
  gem_options[:rdoc_options] ||= RDOC_OPTIONS[:options]
40
40
  end
41
41
 
42
+ extension_options = gem_options.delete(:extension) || {}
43
+
42
44
  meta_gems = Array(gem_options.delete(:meta))
43
45
 
44
46
  gem_spec = Gem::Specification.new { |spec|
@@ -227,6 +229,38 @@ Hen :gem => :rdoc do
227
229
  end
228
230
  }
229
231
 
232
+ unless gem_spec.extensions.empty?
233
+ require 'rake/extensiontask'
234
+ require 'nuggets/util/ruby'
235
+
236
+ extension_options[:name] ||= "#{gem_spec.name}_native"
237
+
238
+ extension_options[:lib_dir] ||= File.join(['lib', gem_spec.name, ENV['FAT_DIR']].compact)
239
+ extension_options[:ext_dir] ||= File.join(['ext', gem_spec.name])
240
+
241
+ unless extension_options.has_key?(:cross_compile)
242
+ extension_options[:cross_compile] = true
243
+ end
244
+
245
+ if extension_options[:cross_compile]
246
+ extension_options[:cross_platform] ||= %w[x86-mswin32-60 x86-mingw32]
247
+ end
248
+
249
+ ruby_versions = extension_options.delete(:ruby_versions)
250
+
251
+ Rake::ExtensionTask.new(nil, gem_spec) { |ext|
252
+ set_options(ext, extension_options, 'Extension')
253
+ }
254
+
255
+ desc 'Build native gems'
256
+ task 'gem:native' do
257
+ ENV['RUBY_CC_VERSION'] ||= Array(ruby_versions).join(':') if ruby_versions
258
+
259
+ sh(Util::Ruby.rake_command, *%w[cross compile])
260
+ sh(Util::Ruby.rake_command, *%w[cross native gem])
261
+ end
262
+ end
263
+
230
264
  release_desc = "Release #{gem_spec.name} version #{gem_spec.version}"
231
265
  tag_desc = "Tag the #{gem_spec.name} release version #{gem_spec.version}"
232
266
 
@@ -234,7 +268,7 @@ Hen :gem => :rdoc do
234
268
 
235
269
  gem_path = File.join(pkg_task.package_dir, gem_spec.file_name)
236
270
 
237
- desc "Create the gem and install it"
271
+ desc 'Create the gem and install it'
238
272
  task 'gem:install' => :gem do
239
273
  rg_pool.call.install(gem_path)
240
274
  end
@@ -1,13 +1,13 @@
1
1
  Hen :rdoc do
2
2
 
3
- rdoc_options = config[:rdoc].merge(
3
+ rdoc_options = {
4
4
  :rdoc_dir => 'doc',
5
5
  :rdoc_files => %w[README COPYING ChangeLog lib/**/*.rb],
6
6
  :charset => 'UTF-8',
7
7
  :inline_source => true,
8
8
  :line_numbers => true,
9
9
  :all => true
10
- )
10
+ }.update(config[:rdoc])
11
11
 
12
12
  rdoc_klass = begin
13
13
  raise LoadError if rdoc_options.delete(:legacy)
@@ -1,10 +1,10 @@
1
1
  Hen :spec do
2
2
 
3
- spec_options = config[:spec].merge(
3
+ spec_options = {
4
4
  :pattern => 'spec/**/*_spec.rb',
5
5
  :helper => 'spec/spec_helper.rb',
6
6
  :options => 'spec/spec.opts'
7
- )
7
+ }.update(config[:spec])
8
8
 
9
9
  spec_klass = begin
10
10
  raise LoadError if spec_options.delete(:legacy)
@@ -66,6 +66,8 @@ Hen :spec do
66
66
  t.rcov = true
67
67
  t.rcov_opts = rcov_opts
68
68
  end
69
+
70
+ task :spec => :compile if have_task?(:compile)
69
71
  end
70
72
 
71
73
  end
@@ -2,9 +2,9 @@ Hen :test do
2
2
 
3
3
  require 'rake/testtask'
4
4
 
5
- test_options = config[:test].merge(
5
+ test_options = {
6
6
  :pattern => 'test/**/*_test.rb'
7
- )
7
+ }.update(config[:test])
8
8
 
9
9
  test_files = test_options.delete(:files) ||
10
10
  FileList[test_options.delete(:pattern)].to_a
@@ -16,6 +16,8 @@ Hen :test do
16
16
  t.test_files = test_files
17
17
  set_options(t, test_options, 'Test')
18
18
  }
19
+
20
+ task :test => :compile if have_task?(:compile)
19
21
  end
20
22
 
21
23
  end
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: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 2
10
- version: 0.4.2
9
+ - 3
10
+ version: 0.4.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jens Wille
@@ -25,12 +25,12 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- hash: 21
28
+ hash: 55
29
29
  segments:
30
30
  - 0
31
- - 6
32
- - 9
33
- version: 0.6.9
31
+ - 8
32
+ - 4
33
+ version: 0.8.4
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  - !ruby/object:Gem::Dependency
@@ -87,11 +87,11 @@ post_install_message:
87
87
  rdoc_options:
88
88
  - --main
89
89
  - README
90
- - --all
91
90
  - --charset
92
91
  - UTF-8
93
92
  - --title
94
- - hen Application documentation (v0.4.2)
93
+ - hen Application documentation (v0.4.3)
94
+ - --all
95
95
  - --line-numbers
96
96
  require_paths:
97
97
  - lib