Please review pull request #24: (#14124) Load rake tasks directly to fix tests for Ruby 1.9.x opened by (kbarber)
Description:
The way we loaded rake tasks was not compatible with Ruby 1.9.x, as it relied
on the fact that Ruby 1.8.x included . in its load path. This patch loads our
rake tasks directly instead.
- Opened: Sat Apr 21 23:50:08 UTC 2012
- Based on: puppetlabs:master (54be04bb999004d34f19a0482299d017556604af)
- Requested merge: kbarber:ticket/master/14124_ruby19_broken_rake (2df319abc05b1ca0492d7a987c4c3e39ad803a6c)
Diff follows:
diff --git a/Rakefile b/Rakefile
index df450c4..1b14e7e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,8 +1,8 @@
require 'rubygems'
require 'rubygems/package_task'
require 'rspec/core/rake_task'
-require 'tasks/release'
+Dir['tasks/**/*.rake'].each { |t| load t }
spec = Gem::Specification.new do |s|
s.name = "hiera-puppet"
diff --git a/tasks/release.rake b/tasks/release.rake
new file mode 100644
index 0000000..c61a94f
--- /dev/null
+++ b/tasks/release.rake
@@ -0,0 +1,23 @@
+
+VERSION_FILE = 'lib/hiera.rb'
+
+def get_current_version
+ File.open( VERSION_FILE ) {|io| io.grep(/VERSION = /)}[0].split()[-1]
+end
+
+def described_version
+ # This ugly bit removes the gSHA1 portion of the describe as that causes failing tests
+ %x{git describe}.gsub('-', '.').split('.')[0..3].join('.').to_s.gsub('v', '')
+end
+
+namespace :pkg do
+
+ desc "Build Package"
+ task :release => [ :default ] do
+ Rake::Task[:package].invoke
+ end
+
+end # namespace
+
+task :clean => [ :clobber_package ] do
+end
diff --git a/tasks/release.rb b/tasks/release.rb
deleted file mode 100644
index c61a94f..0000000
--- a/tasks/release.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-
-VERSION_FILE = 'lib/hiera.rb'
-
-def get_current_version
- File.open( VERSION_FILE ) {|io| io.grep(/VERSION = /)}[0].split()[-1]
-end
-
-def described_version
- # This ugly bit removes the gSHA1 portion of the describe as that causes failing tests
- %x{git describe}.gsub('-', '.').split('.')[0..3].join('.').to_s.gsub('v', '')
-end
-
-namespace :pkg do
-
- desc "Build Package"
- task :release => [ :default ] do
- Rake::Task[:package].invoke
- end
-
-end # namespace
-
-task :clean => [ :clobber_package ] do
-end
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
