Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rework messaging when skipping compilation of a file

  • Loading branch information...
commit a7c7cfbf54fd8232992ed21992c63e7c0e95ddb0 1 parent beba16b
Mark Rada authored
Showing with 13 additions and 11 deletions.
  1. +1 −1  lib/rubygems-compile/analyzer.rb
  2. +12 −10 lib/rubygems-compile/compiler.rb
2  lib/rubygems-compile/analyzer.rb
View
@@ -16,7 +16,7 @@ class Warning < Exception
def on_kw token
# Related to MacRuby ticket #721
if token == '__FILE__'
- raise Warning, 'The __FILE__ keyword is used in this file'
+ raise Warning, '__FILE__ keyword is used (MacRuby ticket #721)'
end
end
22 lib/rubygems-compile/compiler.rb
View
@@ -17,14 +17,18 @@ def call gem
say compilation_message if @config.verbose
gem_files.each do |file|
- say compile_file_msg(file) if @config.really_verbose
+ message = compile_file_msg(file)
absolute_file_path = File.join(@spec.full_gem_path, file)
- next if unsafe?(absolute_file_path)
- MacRuby::Compiler.new(
- bundle: true,
- output: "#{absolute_file_path}o",
- files: [absolute_file_path]
- ).run
+ if warning = unsafe?(absolute_file_path)
+ message << "\t\t\tSKIPPED: #{warning.message}"
+ else
+ MacRuby::Compiler.new(
+ bundle: true,
+ output: "#{absolute_file_path}o",
+ files: [absolute_file_path]
+ ).run
+ end
+ say message if @config.really_verbose
end
end
alias_method :compile, :call
@@ -37,9 +41,7 @@ def unsafe? file
Gem::Analyzer.new(File.read(file)).parse
false
rescue Gem::Analyzer::Warning => e
- say "WARNING: #{e.message}"
- say 'Compilation of this file will be skipped'
- true
+ e
end
def compilation_message
Please sign in to comment.
Something went wrong with that request. Please try again.