Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some Compiler methods depend on the rubygems version

  • Loading branch information...
commit ff25f92018cbd87ffb330b4b7274892fdc91885c 1 parent 8089576
Mark Rada authored
Showing with 17 additions and 8 deletions.
  1. +17 −8 lib/rubygems-compile/compiler.rb
25 lib/rubygems-compile/compiler.rb
View
@@ -24,9 +24,9 @@ def call gem
say gem_compilation_message if verbose
gem_files.each do |file|
- message = compile_file_msg(file)
- absolute_file_path = File.join(@spec.full_gem_path, file)
- if warning = unsafe?(absolute_file_path)
+ message = compile_file_message(file)
+ full_path = absolute_path(file)
+ if warning = unsafe?(full_path)
message << "\t\t\tSKIPPED: #{warning.message}"
else
MacRuby::Compiler.compile_file(full_path)
@@ -64,11 +64,20 @@ def gem_compilation_message
# level or test directory.
#
- def gem_files
- @spec.lib_files.select { |file| File.extname(file) == '.rb' }
- # files = @spec.files - @spec.test_files - @spec.extra_rdoc_files
- # files.reject { |file| file.match /^(?:test|spec)/ }
- # .select { |file| file.match /\.rb$/ }
+ if Gem::VERSION.to_f < 1.8
+ def gem_files
+ @spec.lib_files.select { |file| File.extname(file) == '.rb' }
+ end
+ def absolute_path file
+ File.join(@spec.full_gem_path, file)
+ end
+ else
+ def gem_files
+ Dir.glob("#{@spec.lib_dirs_glob}/**/*.rb")
+ end
+ def absolute_path file
+ file
+ end
end
def compile_file_message file
Please sign in to comment.
Something went wrong with that request. Please try again.