rubygems-compile 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +8 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +46 -0
- data/lib/rubygems_plugin.rb +14 -0
- data/test/helper.rb +19 -0
- metadata +122 -0
data/.yardopts
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Mark Rada
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
rubygems-compile
|
2
|
+
============
|
3
|
+
|
4
|
+
A post-install hook for `macgem` to automatically compile rubygems
|
5
|
+
when you install them.
|
6
|
+
|
7
|
+
All you need to do is:
|
8
|
+
|
9
|
+
gem install rubygems-compile
|
10
|
+
|
11
|
+
And then you're off to the races! When you install gems you should get
|
12
|
+
a bunch of output about files being compiled.
|
13
|
+
|
14
|
+
Caveats
|
15
|
+
=======
|
16
|
+
|
17
|
+
* Large gems will take a long time to compile
|
18
|
+
* This has only been tested on a few gems
|
19
|
+
* Some gems specifically require a file with the extension defeating
|
20
|
+
the purpose of having a compiled version of the file
|
21
|
+
|
22
|
+
TODO
|
23
|
+
====
|
24
|
+
|
25
|
+
- make the compilation an install option
|
26
|
+
- add an option to replace the original file with the compiled version
|
27
|
+
+ I can't remove the original and leave *.rbo files because of how
|
28
|
+
rubygems identifies gems unless I modify gemspec files
|
29
|
+
|
30
|
+
Contributing to rubygems-compile
|
31
|
+
=======================
|
32
|
+
|
33
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
34
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
35
|
+
* Fork the project
|
36
|
+
* Start a feature/bugfix branch
|
37
|
+
* Commit and push until you are happy with your contribution
|
38
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
39
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
40
|
+
|
41
|
+
Copyright
|
42
|
+
=======
|
43
|
+
|
44
|
+
Copyright (c) 2011 Mark Rada. See LICENSE.txt for
|
45
|
+
further details.
|
46
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Gem.post_install do |gem|
|
2
|
+
|
3
|
+
spec = gem.spec
|
4
|
+
dir = gem.gem_home + '/gems/' + spec.name + '-' + spec.version.version
|
5
|
+
files = spec.files - spec.test_files - spec.extra_rdoc_files
|
6
|
+
|
7
|
+
files.each do |file|
|
8
|
+
next unless file.match /\.rb$/
|
9
|
+
puts "Compiling #{file} to #{file}o"
|
10
|
+
file = "#{dir}/#{file}"
|
11
|
+
`macrubyc -C '#{file}' -o '#{file}o'`
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'minitest/unit'
|
11
|
+
|
12
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
require 'rubygems-compile'
|
15
|
+
|
16
|
+
class MiniTest::Unit::TestCase
|
17
|
+
end
|
18
|
+
|
19
|
+
MiniTest::Unit.autorun
|
metadata
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubygems-compile
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mark Rada
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-02-16 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rake
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.8.7
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 0.8.7
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: minitest
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ~>
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 2.0.2
|
39
|
+
type: :development
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 2.0.2
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: yard
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.6.4
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 0.6.4
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: bluecloth
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ~>
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 2.0.11
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ~>
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 2.0.11
|
79
|
+
description: 'A rubygems post-install hook compile the gem using the MacRuby compiler.
|
80
|
+
|
81
|
+
'
|
82
|
+
email: mrada@marketcircle.com
|
83
|
+
executables: []
|
84
|
+
extensions: []
|
85
|
+
extra_rdoc_files:
|
86
|
+
- LICENSE.txt
|
87
|
+
- README.markdown
|
88
|
+
- .yardopts
|
89
|
+
files:
|
90
|
+
- lib/rubygems_plugin.rb
|
91
|
+
- LICENSE.txt
|
92
|
+
- README.markdown
|
93
|
+
- .yardopts
|
94
|
+
- test/helper.rb
|
95
|
+
has_rdoc: yard
|
96
|
+
homepage: http://github.com/ferrous26/rubygems-compile
|
97
|
+
licenses:
|
98
|
+
- MIT
|
99
|
+
post_install_message:
|
100
|
+
rdoc_options: []
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
105
|
+
requirements:
|
106
|
+
- - '>='
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: "0"
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - '>='
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: 1.4.2
|
115
|
+
requirements: []
|
116
|
+
rubyforge_project:
|
117
|
+
rubygems_version: 1.4.2
|
118
|
+
signing_key:
|
119
|
+
specification_version: 3
|
120
|
+
summary: A rubygems post-install hook compile the gem
|
121
|
+
test_files:
|
122
|
+
- test/helper.rb
|