rubygems-compile 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rubygems-compile/analyzer.rb +1 -1
- data/lib/rubygems-compile/commands/compile_command.rb +4 -0
- data/lib/rubygems-compile/commands/uncompile_command.rb +4 -0
- data/lib/rubygems-compile/compiler.rb +30 -14
- data/lib/rubygems-compile/post_install_hook.rb +1 -0
- data/lib/rubygems_plugin.rb +7 -13
- metadata +21 -15
- data/lib/rubygems-compile/commands.rb +0 -8
@@ -16,7 +16,7 @@ class Gem::Analyzer < Ripper::SexpBuilder
|
|
16
16
|
def on_kw token
|
17
17
|
# Related to MacRuby ticket #721
|
18
18
|
if token == '__FILE__'
|
19
|
-
raise Warning, '
|
19
|
+
raise Warning, '__FILE__ keyword is used (MacRuby ticket #721)'
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -1,4 +1,7 @@
|
|
1
1
|
require 'rubygems/dependency_list'
|
2
|
+
require 'rubygems/version_option'
|
3
|
+
require 'rubygems-compile/common_methods'
|
4
|
+
|
2
5
|
|
3
6
|
##
|
4
7
|
# Use the MacRuby compiler to compile installed gems.
|
@@ -44,6 +47,7 @@ class Gem::Commands::CompileCommand < Gem::Command
|
|
44
47
|
alert 'This could take a while; you might want to take a coffee break'
|
45
48
|
end
|
46
49
|
|
50
|
+
require 'rubygems-compile/compiler'
|
47
51
|
compiler = Gem::Compiler.new
|
48
52
|
gems.each { |gem| compiler.compile(gem) }
|
49
53
|
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'rubygems/version_option'
|
2
|
+
require 'rubygems-compile/common_methods'
|
3
|
+
|
1
4
|
class Gem::Commands::UncompileCommand < Gem::Command
|
2
5
|
include Gem::VersionOption
|
3
6
|
include Gem::CompileMethods
|
@@ -32,6 +35,7 @@ class Gem::Commands::UncompileCommand < Gem::Command
|
|
32
35
|
# an uncompiler object for each of them.
|
33
36
|
|
34
37
|
def execute
|
38
|
+
require 'rubygems-compile/uncompiler'
|
35
39
|
uncompiler = Gem::Uncompiler.new
|
36
40
|
execution_list.each { |gem| uncompiler.uncompile(gem) }
|
37
41
|
end
|
@@ -2,6 +2,12 @@ class Gem::Compiler
|
|
2
2
|
include Gem::UserInteraction
|
3
3
|
|
4
4
|
def initialize
|
5
|
+
require 'rbconfig'
|
6
|
+
unless MacRuby.const_defined?(:Compiler)
|
7
|
+
load File.join(RbConfig::CONFIG['bindir'], 'macrubyc')
|
8
|
+
end
|
9
|
+
require 'rubygems-compile/analyzer'
|
10
|
+
|
5
11
|
@current_directory = []
|
6
12
|
@config = Gem.configuration
|
7
13
|
end
|
@@ -10,21 +16,25 @@ class Gem::Compiler
|
|
10
16
|
@spec = gem.is_a?(Gem::Specification) ? gem : gem.spec
|
11
17
|
|
12
18
|
if @spec.name == 'rubygems-compile'
|
13
|
-
alert_info 'You cannot compile rubygems-compile' if
|
19
|
+
alert_info 'You cannot compile rubygems-compile' if really_verbose
|
14
20
|
return
|
15
21
|
end
|
16
22
|
|
17
|
-
say compilation_message if
|
23
|
+
say compilation_message if verbose
|
18
24
|
|
19
25
|
gem_files.each do |file|
|
20
|
-
|
26
|
+
message = compile_file_msg(file)
|
21
27
|
absolute_file_path = File.join(@spec.full_gem_path, file)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
+
if warning = unsafe?(absolute_file_path)
|
29
|
+
message << "\t\t\tSKIPPED: #{warning.message}"
|
30
|
+
else
|
31
|
+
MacRuby::Compiler.new(
|
32
|
+
bundle: true,
|
33
|
+
output: "#{absolute_file_path}o",
|
34
|
+
files: [absolute_file_path]
|
35
|
+
).run
|
36
|
+
end
|
37
|
+
say message if really_verbose
|
28
38
|
end
|
29
39
|
end
|
30
40
|
alias_method :compile, :call
|
@@ -37,13 +47,11 @@ class Gem::Compiler
|
|
37
47
|
Gem::Analyzer.new(File.read(file)).parse
|
38
48
|
false
|
39
49
|
rescue Gem::Analyzer::Warning => e
|
40
|
-
|
41
|
-
say 'Compilation of this file will be skipped'
|
42
|
-
true
|
50
|
+
e
|
43
51
|
end
|
44
52
|
|
45
53
|
def compilation_message
|
46
|
-
slash =
|
54
|
+
slash = really_verbose ? '/' : ''
|
47
55
|
"Compiling #{@spec.full_name}#{slash}"
|
48
56
|
end
|
49
57
|
|
@@ -74,11 +82,19 @@ class Gem::Compiler
|
|
74
82
|
dirs.each_with_index do |dir, index|
|
75
83
|
unless @current_directory[index] == dir
|
76
84
|
@current_directory[index] = dir
|
77
|
-
say( "\t" * (index + 1) + dir + File::SEPARATOR)
|
85
|
+
say( "\t" * (index + 1) + dir + File::SEPARATOR) if really_verbose
|
78
86
|
end
|
79
87
|
end
|
80
88
|
|
81
89
|
"#{tabs}#{name} => #{name}o"
|
82
90
|
end
|
83
91
|
|
92
|
+
def verbose
|
93
|
+
@config.verbose
|
94
|
+
end
|
95
|
+
|
96
|
+
def really_verbose
|
97
|
+
@config.really_verbose
|
98
|
+
end
|
99
|
+
|
84
100
|
end
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -6,19 +6,13 @@ unless MACRUBY_REVISION.match /^git commit/
|
|
6
6
|
|
7
7
|
else
|
8
8
|
|
9
|
-
require 'rbconfig'
|
10
|
-
require 'fileutils'
|
11
|
-
require 'rubygems/version_option'
|
12
|
-
|
13
|
-
unless MacRuby.const_defined?(:Compiler)
|
14
|
-
load File.join(RbConfig::CONFIG['bindir'], 'macrubyc')
|
15
|
-
end
|
16
|
-
|
17
|
-
require 'rubygems-compile/common_methods'
|
18
|
-
require 'rubygems-compile/analyzer'
|
19
|
-
require 'rubygems-compile/compiler'
|
20
|
-
require 'rubygems-compile/uncompiler'
|
21
|
-
require 'rubygems-compile/commands'
|
22
9
|
require 'rubygems-compile/post_install_hook'
|
10
|
+
require 'rubygems-compile/commands/compile_command'
|
11
|
+
require 'rubygems-compile/commands/uncompile_command'
|
12
|
+
require 'rubygems-compile/commands/autocompile_command'
|
13
|
+
|
14
|
+
Gem::CommandManager.instance.register_command :compile
|
15
|
+
Gem::CommandManager.instance.register_command :uncompile
|
16
|
+
Gem::CommandManager.instance.register_command :auto_compile
|
23
17
|
|
24
18
|
end
|
metadata
CHANGED
@@ -1,28 +1,34 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygems-compile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.1
|
5
4
|
prerelease:
|
5
|
+
version: 1.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mark Rada
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-02-02 00:00:00 -05:00
|
13
|
+
default_executable:
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: minitest
|
16
|
-
|
17
|
+
prerelease: false
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
17
19
|
none: false
|
18
20
|
requirements:
|
19
|
-
- -
|
21
|
+
- - ~>
|
20
22
|
- !ruby/object:Gem::Version
|
21
|
-
version: 2.
|
23
|
+
version: "2.11"
|
22
24
|
type: :development
|
23
|
-
|
24
|
-
|
25
|
-
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: "2.11"
|
31
|
+
description: 'A trio of rubygems commands that interface with the MacRuby compiler.
|
26
32
|
|
27
33
|
'
|
28
34
|
email: mrada@marketcircle.com
|
@@ -36,7 +42,6 @@ files:
|
|
36
42
|
- lib/rubygems-compile/commands/autocompile_command.rb
|
37
43
|
- lib/rubygems-compile/commands/compile_command.rb
|
38
44
|
- lib/rubygems-compile/commands/uncompile_command.rb
|
39
|
-
- lib/rubygems-compile/commands.rb
|
40
45
|
- lib/rubygems-compile/common_methods.rb
|
41
46
|
- lib/rubygems-compile/compiler.rb
|
42
47
|
- lib/rubygems-compile/post_install_hook.rb
|
@@ -52,10 +57,11 @@ files:
|
|
52
57
|
- .gemtest
|
53
58
|
- LICENSE.txt
|
54
59
|
- README.markdown
|
60
|
+
has_rdoc: true
|
55
61
|
homepage: http://github.com/ferrous26/rubygems-compile
|
56
62
|
licenses:
|
57
63
|
- MIT
|
58
|
-
post_install_message:
|
64
|
+
post_install_message: "\n***********************************************************\n\nPlease
|
59
65
|
uninstall previous versions of this gem, or else\nrubygems will try to load each
|
60
66
|
version of the gem.\n\nThis version of rubygems-compile requires MacRuby 0.11 or\nnewer;
|
61
67
|
the functionality has changed significantly since\npre-1.0 releases, see the README:\n\n
|
@@ -66,18 +72,18 @@ require_paths:
|
|
66
72
|
required_ruby_version: !ruby/object:Gem::Requirement
|
67
73
|
none: false
|
68
74
|
requirements:
|
69
|
-
- -
|
75
|
+
- - '>='
|
70
76
|
- !ruby/object:Gem::Version
|
71
|
-
version:
|
77
|
+
version: "0"
|
72
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
79
|
none: false
|
74
80
|
requirements:
|
75
|
-
- -
|
81
|
+
- - '>='
|
76
82
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
83
|
+
version: "0"
|
78
84
|
requirements: []
|
79
85
|
rubyforge_project:
|
80
|
-
rubygems_version: 1.
|
86
|
+
rubygems_version: 1.4.2
|
81
87
|
signing_key:
|
82
88
|
specification_version: 3
|
83
89
|
summary: A trio of rubygems commands that interface with the MacRuby compiler
|
@@ -1,8 +0,0 @@
|
|
1
|
-
require 'rubygems-compile/commands/compile_command'
|
2
|
-
Gem::CommandManager.instance.register_command :compile
|
3
|
-
|
4
|
-
require 'rubygems-compile/commands/uncompile_command'
|
5
|
-
Gem::CommandManager.instance.register_command :uncompile
|
6
|
-
|
7
|
-
require 'rubygems-compile/commands/autocompile_command'
|
8
|
-
Gem::CommandManager.instance.register_command :auto_compile
|