Skip to content

Commit f5a2b22

Browse files
committed
updated to current gem require style
1 parent 5e60e89 commit f5a2b22

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pkg/*

CHANGELOG

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
* Updated tests to include new table to support union test
1919

2020
0.7.0
21-
* Updated dependency versions to get on ActiveRecord 2.x
21+
* Updated dependency versions to get on ActiveRecord 2.x. May not be compatible with Rails versions less than 2.x.

Rakefile

+17
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,21 @@ end
124124
desc "Publish the API documentation"
125125
task :pdoc => [:rdoc] do
126126
Rake::SshDirPublisher.new("[email protected]", "/var/www/gforge-projects/activewarehouse/rails_sql_views/rdoc", "rdoc").upload
127+
end
128+
129+
desc "Install the gem from a local generated package"
130+
task :install => [:package] do
131+
windows = RUBY_PLATFORM =~ /mswin/
132+
sudo = windows ? '' : 'sudo'
133+
gem = windows ? 'gem.bat' : 'gem'
134+
`#{sudo} #{gem} install pkg/#{PKG_NAME}-#{PKG_VERSION}`
135+
end
136+
137+
desc "Reinstall the gem from a local package copy"
138+
task :reinstall => [:package] do
139+
windows = RUBY_PLATFORM =~ /mswin/
140+
sudo = windows ? '' : 'sudo'
141+
gem = windows ? 'gem.bat' : 'gem'
142+
`#{sudo} #{gem} uninstall #{PKG_NAME} -x`
143+
`#{sudo} #{gem} install pkg/#{PKG_NAME}-#{PKG_VERSION}`
127144
end

lib/rails_sql_views.rb

+1-12
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,7 @@
2424
$:.unshift(File.dirname(__FILE__))
2525

2626
require 'rubygems'
27-
unless Kernel.respond_to?(:gem)
28-
Kernel.send :alias_method, :gem, :require_gem
29-
end
30-
31-
unless defined?(ActiveRecord)
32-
begin
33-
$:.unshift(File.dirname(__FILE__) + "/../../activerecord/lib")
34-
require 'active_record'
35-
rescue LoadError
36-
gem 'activerecord'
37-
end
38-
end
27+
require 'active_record'
3928

4029
require 'core_ext/module'
4130

0 commit comments

Comments
 (0)