hen 0.8.0 → 0.8.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4072e13f1feb0d60af5d5cc34da7241534729021
4
- data.tar.gz: f928a7f50cf2fa8792e21b74f5b89bc003d48ca4
3
+ metadata.gz: cd310f44a48870b4c354e0d3aa4cbe63b3445226
4
+ data.tar.gz: 240426572bc45989bdcf3566df93ede9d735ec38
5
5
  SHA512:
6
- metadata.gz: 21ab42db487595edd0efac73bef24ac27b63839f7c4cec703552a850eb30d9bf7c05dfebaaabe2d8ec12c2e4675f6831f42c4ae73fe398151f6d75ec238a8dfa
7
- data.tar.gz: 928c0691dfcd088104f2dc253b6939873b92477bdfa5e1ea105c3edb0910eb1eeb3c95d55439d5ee38fb6ffc4b937130f7d9139c7419bd0e3facec8d6e6b2516
6
+ metadata.gz: 4b4982093bd2c157239287e937db7453969ef4633853289363ee77852fdbf444297fbb1e1fcb2a9cb21793e719088305a54a9f9aa3d65bb0ef5114d3ed518672
7
+ data.tar.gz: e137da6c94932a56766bce7404dafb2117647403c63f667de09a94b40ea48c43619a2dceee5c73b90d05a8d2bfe360089f0f847e0fc8e8e1fc53dc24b7383546
data/ChangeLog CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  = Revision history for hen
4
4
 
5
+ == 0.8.1 [2014-12-19]
6
+
7
+ * Removed workaround for RDoc issue 330. Implemented in RDoc 4.2.0.
8
+ * Renamed cross compile option +ruby_versions+ to +cross_ruby_versions+;
9
+ defaults to all versions defined in rake-compiler's <tt>config.yml</tt>.
10
+ * When +cross_config_options+ given, cross compilation is implicitly disabled
11
+ when they are empty or enabled when they are non-empty; override by setting
12
+ +cross_compile+ explicitly.
13
+ * Added support for <tt>with_cross_<library></tt> options; specify a proc that
14
+ accepts the <tt>WITH_CROSS_<LIBRARY></tt> environment variable, if set, and
15
+ returns a single directory for <tt>--with-<library>-dir</tt> or an array for
16
+ <tt>--with-<library>-include</tt> and <tt>--with-<library>-lib</tt> to be
17
+ added to +cross_config_options+.
18
+ * Added support for +cross_compiling+ option.
19
+ * Added support for +local_files+ option, i.e., generated files that should be
20
+ included in the package but not under version control.
21
+ * When determining the +ext_name+ option, a possible <tt>ruby-</tt> prefix is
22
+ ignored.
23
+
5
24
  == 0.8.0 [2014-10-31]
6
25
 
7
26
  * Removed support for legacy versions of RDoc, RSpec and RubyGems.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to hen version 0.8.0
5
+ This documentation refers to hen version 0.8.1
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/lib/hen.rb CHANGED
@@ -29,6 +29,7 @@
29
29
  #++
30
30
 
31
31
  require 'rake'
32
+ require 'rake/clean'
32
33
  require 'safe_yaml/load'
33
34
  require 'nuggets/env/user_home'
34
35
  require 'nuggets/hash/deep_merge'
@@ -266,8 +267,10 @@ class Hen
266
267
 
267
268
  block.bind(DSL).call
268
269
  rescue => err
269
- warn "#{name}: #{err} (#{err.class})" if $DEBUG || verbose
270
- warn err.backtrace.join("\n ") if $DEBUG
270
+ trace = $DEBUG || Rake.application.options.trace
271
+
272
+ warn "#{name}: #{err} (#{err.class})" if trace || verbose
273
+ warn err.backtrace.join("\n ") if trace
271
274
  end
272
275
 
273
276
  private
data/lib/hen/version.rb CHANGED
@@ -4,7 +4,7 @@ class Hen
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 8
7
- TINY = 0
7
+ TINY = 1
8
8
 
9
9
  class << self
10
10
 
data/lib/hens/gem.rake CHANGED
@@ -82,6 +82,15 @@ Hen gem: :rdoc do
82
82
  :extra_rdoc_files, :files, :executables, :extensions
83
83
  ))
84
84
 
85
+ unless (local_files = Array(gem_options.delete(:local_files))).empty?
86
+ gem_options[:files].concat(local_files)
87
+
88
+ task :pkg => local_files
89
+ task :compile => local_files
90
+
91
+ CLOBBER.include(*local_files)
92
+ end
93
+
85
94
  unless gem_options[:executables].empty?
86
95
  gem_options[:bindir] ||= File.dirname(gem_options[:executables].first)
87
96
  gem_options[:executables].map! { |executable| File.basename(executable) }
@@ -300,11 +309,12 @@ Hen gem: :rdoc do
300
309
  end
301
310
 
302
311
  if Rake.const_defined?(:ExtensionTask)
303
- # gem_name | extension name | ext_name
312
+ # gem_name | ext_name | extension name
304
313
  # ---------------------------------------
305
- # libcdb-ruby | libcdb_ruby | libcdb
306
- # rb-gsl | gsl_native | gsl
307
- # unicode | unicode_native | unicode
314
+ # unicode | unicode | unicode_native
315
+ # libcdb-ruby | libcdb | libcdb_ruby
316
+ # ruby-filemagic | filemagic | ruby_filemagic
317
+ # rb-gsl | gsl | gsl_native
308
318
 
309
319
  gem_name_parts = gem_name.split('-')
310
320
  gem_name_parts.shift if gem_name_parts.first == 'rb'
@@ -312,27 +322,61 @@ Hen gem: :rdoc do
312
322
 
313
323
  extension_options[:name] ||= gem_name_parts.join('_')
314
324
 
315
- ext_name = extension_options.delete(:ext_name) { gem_name_parts.first }
325
+ ext_name = extension_options.delete(:ext_name) {
326
+ gem_name_parts.find { |part| part != 'ruby' } }
316
327
 
317
328
  extension_options[:lib_dir] ||= File.join(['lib', ext_name, ENV['FAT_DIR']].compact)
318
329
  extension_options[:ext_dir] ||= File.join(['ext', ext_name].compact)
319
330
 
331
+ cross_config_options = nil
332
+
333
+ extension_options.delete_if { |key, val|
334
+ key =~ /\Awith_cross_(\w+)\z/ or next false
335
+ dir = ENV[key.to_s.upcase] or next true
336
+
337
+ cross_config_options ||= []
338
+
339
+ case res = val[dir]
340
+ when Array
341
+ inc, lib = res; lib = inc if res.size == 1
342
+
343
+ cross_config_options << "--with-#{$1}-include=#{inc}" if inc
344
+ cross_config_options << "--with-#{$1}-lib=#{lib}" if lib
345
+ when String
346
+ cross_config_options << "--with-#{$1}-dir=#{res}"
347
+ end
348
+ }
349
+
350
+ if cross_config_options
351
+ extension_options[:cross_config_options] ||= []
352
+ extension_options[:cross_config_options].concat(cross_config_options)
353
+ end
354
+
320
355
  unless extension_options.key?(:cross_compile)
321
- extension_options[:cross_compile] = true
356
+ extension_options[:cross_compile] =
357
+ extension_options[:cross_config_options].is_a?(Array) ?
358
+ !extension_options[:cross_config_options].empty? : true
322
359
  end
323
360
 
324
361
  if extension_options[:cross_compile]
325
362
  extension_options[:cross_platform] ||= %w[x86-mswin32-60 x86-mingw32]
326
363
 
327
- if ruby_versions = extension_options.delete(:ruby_versions)
364
+ if ruby_versions = extension_options.delete(:cross_ruby_versions)
328
365
  ENV['RUBY_CC_VERSION'] ||= Array(ruby_versions).join(':')
329
366
  end
330
367
 
368
+ if File.exist?(rc_config = File.expand_path('~/.rake-compiler/config.yml'))
369
+ ENV['RUBY_CC_VERSION'] ||= SafeYAML.load_file(rc_config).keys.
370
+ map { |k| k.split('-').last }.uniq.join(':')
371
+ end
372
+
331
373
  desc 'Build native gems'
332
374
  task 'gem:native' => %w[cross compile rake:native gem]
333
375
  end
334
376
 
335
377
  extension_task = Rake::ExtensionTask.new(nil, gem_spec) { |ext|
378
+ ext.cross_compiling(&extension_options.delete(:cross_compiling))
379
+
336
380
  set_options(ext, extension_options, 'Extension')
337
381
  }
338
382
 
data/lib/hens/rdoc.rake CHANGED
@@ -61,21 +61,9 @@ Hen :rdoc do
61
61
  options: rdoc_opts
62
62
  }
63
63
 
64
- unless rdoc_files.empty? && rdoc_files_local.empty?
64
+ unless rdoc_files.empty?
65
65
  require 'rdoc/task'
66
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
77
-
78
- unless rdoc_files.empty?
79
67
  RDoc::Task.new(:doc) { |rdoc|
80
68
  rdoc.rdoc_dir = rdoc_dir
81
69
  rdoc.rdoc_files = rdoc_files
@@ -88,6 +76,8 @@ Hen :rdoc do
88
76
  end
89
77
 
90
78
  unless rdoc_files_local.empty?
79
+ require 'rdoc/task'
80
+
91
81
  RDoc::Task.new('doc:local') { |rdoc|
92
82
  rdoc.rdoc_dir = rdoc_dir + '.local'
93
83
  rdoc.rdoc_files = rdoc_files_local
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.8.0
4
+ version: 0.8.1
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-31 00:00:00.000000000 Z
11
+ date: 2014-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -106,15 +106,28 @@ licenses:
106
106
  metadata: {}
107
107
  post_install_message: |2+
108
108
 
109
- hen-0.8.0 [2014-10-31]:
109
+ hen-0.8.1 [2014-12-19]:
110
110
 
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]).
111
+ * Removed workaround for RDoc issue 330. Implemented in RDoc 4.2.0.
112
+ * Renamed cross compile option +ruby_versions+ to +cross_ruby_versions+;
113
+ defaults to all versions defined in rake-compiler's <tt>config.yml</tt>.
114
+ * When +cross_config_options+ given, cross compilation is implicitly disabled
115
+ when they are empty or enabled when they are non-empty; override by setting
116
+ +cross_compile+ explicitly.
117
+ * Added support for <tt>with_cross_<library></tt> options; specify a proc that
118
+ accepts the <tt>WITH_CROSS_<LIBRARY></tt> environment variable, if set, and
119
+ returns a single directory for <tt>--with-<library>-dir</tt> or an array for
120
+ <tt>--with-<library>-include</tt> and <tt>--with-<library>-lib</tt> to be
121
+ added to +cross_config_options+.
122
+ * Added support for +cross_compiling+ option.
123
+ * Added support for +local_files+ option, i.e., generated files that should be
124
+ included in the package but not under version control.
125
+ * When determining the +ext_name+ option, a possible <tt>ruby-</tt> prefix is
126
+ ignored.
114
127
 
115
128
  rdoc_options:
116
129
  - "--title"
117
- - hen Application documentation (v0.8.0)
130
+ - hen Application documentation (v0.8.1)
118
131
  - "--charset"
119
132
  - UTF-8
120
133
  - "--line-numbers"
@@ -135,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
148
  version: '0'
136
149
  requirements: []
137
150
  rubyforge_project:
138
- rubygems_version: 2.4.2
151
+ rubygems_version: 2.4.5
139
152
  signing_key:
140
153
  specification_version: 4
141
154
  summary: Just another project helper that integrates with Rake.