slim_scrooge 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.textile +2 -2
- data/Rakefile +1 -1
- data/VERSION.yml +1 -1
- data/ext/Rakefile +42 -0
- data/ext/extconf.rb +0 -2
- metadata +4 -3
data/README.textile
CHANGED
@@ -20,7 +20,7 @@ In future releases I expect further gains.
|
|
20
20
|
|
21
21
|
h2. Installation
|
22
22
|
|
23
|
-
Requirements: Rails 2.2 or above, Ruby 1.8.6 or above.
|
23
|
+
Requirements: Rails 2.2 or above, Ruby 1.8.6 or above.
|
24
24
|
|
25
25
|
<pre>
|
26
26
|
# if you haven't already, add gemcutter to your gem sources
|
@@ -30,7 +30,7 @@ Requirements: Rails 2.2 or above, Ruby 1.8.6 or above. (Ruby 1.9 to be tested)
|
|
30
30
|
sudo gem install slim_scrooge
|
31
31
|
</pre>
|
32
32
|
|
33
|
-
|
33
|
+
Note that the C extension will only build in MRI Ruby 1.8 on non-windows at present, but do not worry, for other platforms the backup callsite mechanism is used.
|
34
34
|
|
35
35
|
Next add this to your Rails::Initializer section in environment.rb:
|
36
36
|
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ begin
|
|
20
20
|
s.description = "Slim scrooge boosts speed in Rails ActiveRecord Models by only querying the database for what is needed."
|
21
21
|
s.authors = ["Stephen Sykes"]
|
22
22
|
s.files = FileList["[A-Z]*", "{ext,lib,test}/**/*"]
|
23
|
-
s.extensions = "ext/
|
23
|
+
s.extensions = "ext/Rakefile"
|
24
24
|
end
|
25
25
|
Jeweler::GemcutterTasks.new
|
26
26
|
rescue LoadError
|
data/VERSION.yml
CHANGED
data/ext/Rakefile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
task :default=>[:build]
|
2
|
+
|
3
|
+
task :build do
|
4
|
+
# only try to install extension on non windows / MRI 1.8
|
5
|
+
unless /mswin/ =~ RUBY_PLATFORM || RUBY_VERSION >= "1.9" || defined?(RUBY_ENGINE) && RUBY_ENGINE != "ruby"
|
6
|
+
require 'rbconfig'
|
7
|
+
|
8
|
+
ruby = File.join(Config::CONFIG["bindir"],
|
9
|
+
Config::CONFIG["RUBY_INSTALL_NAME"])
|
10
|
+
ruby << Config::CONFIG["EXEEXT"]
|
11
|
+
|
12
|
+
# escape string in case path to ruby executable contain spaces.
|
13
|
+
ruby.sub!(/.*\s.*/m, '"\&"')
|
14
|
+
|
15
|
+
results = `#{ruby} extconf.rb`
|
16
|
+
|
17
|
+
unless File.exist? 'Makefile'
|
18
|
+
raise "Makefile not found:\n\n#{results.join "\n"}"
|
19
|
+
end
|
20
|
+
|
21
|
+
dest_path = ENV["RUBYARCHDIR"]
|
22
|
+
|
23
|
+
mf = File.read('Makefile')
|
24
|
+
mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$[^$]*/, "RUBYARCHDIR = #{dest_path}")
|
25
|
+
mf = mf.gsub(/^RUBYLIBDIR\s*=\s*\$[^$]*/, "RUBYLIBDIR = #{dest_path}")
|
26
|
+
|
27
|
+
File.open('Makefile', 'wb') {|f| f.print mf}
|
28
|
+
|
29
|
+
make_program = ENV['make']
|
30
|
+
unless make_program
|
31
|
+
make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
|
32
|
+
end
|
33
|
+
|
34
|
+
['', ' install'].each do |target|
|
35
|
+
cmd = "#{make_program}#{target}"
|
36
|
+
results << cmd + "\n"
|
37
|
+
results << `#{cmd}`
|
38
|
+
|
39
|
+
raise "make#{target} failed:\n\n#{results}" unless $?.success?
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/ext/extconf.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slim_scrooge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Sykes
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-02-15 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -18,13 +18,14 @@ email: sdsykes@gmail.com
|
|
18
18
|
executables: []
|
19
19
|
|
20
20
|
extensions:
|
21
|
-
- ext/
|
21
|
+
- ext/Rakefile
|
22
22
|
extra_rdoc_files:
|
23
23
|
- README.textile
|
24
24
|
files:
|
25
25
|
- README.textile
|
26
26
|
- Rakefile
|
27
27
|
- VERSION.yml
|
28
|
+
- ext/Rakefile
|
28
29
|
- ext/callsite_hash.c
|
29
30
|
- ext/extconf.rb
|
30
31
|
- lib/slim_scrooge.rb
|