Skip to content
This repository has been archived by the owner on Aug 10, 2020. It is now read-only.

Commit

Permalink
Reword gem loading to work with Rails 2.x & 3.x,
Browse files Browse the repository at this point in the history
as well as letting the specs run properly.
Kindof tricky, hope I got it all right.
  • Loading branch information
jkrall committed Aug 7, 2011
1 parent dd8d934 commit e5e6c51
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 151 deletions.
16 changes: 0 additions & 16 deletions config/application.rb

This file was deleted.

13 changes: 0 additions & 13 deletions config/boot.rb

This file was deleted.

8 changes: 0 additions & 8 deletions config/environment.rb

This file was deleted.

26 changes: 0 additions & 26 deletions config/environments/development.rb

This file was deleted.

45 changes: 0 additions & 45 deletions config/environments/production.rb

This file was deleted.

38 changes: 0 additions & 38 deletions config/environments/test.rb

This file was deleted.

3 changes: 0 additions & 3 deletions config/routes.rb

This file was deleted.

1 change: 1 addition & 0 deletions lib/analytical.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require File.dirname(__FILE__)+'/analytical/rails/engine'
require File.dirname(__FILE__)+'/analytical/modules/base'
Dir.glob(File.dirname(__FILE__)+'/analytical/**/*.rb').each do |f|
require f
Expand Down
9 changes: 9 additions & 0 deletions lib/analytical/rails/engine.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if defined?(::Rails::Engine)
module Analytical
module Rails
class Engine < ::Rails::Engine
# auto wire
end
end
end
end
1 change: 1 addition & 0 deletions rails/init.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'analytical'
File renamed without changes.
14 changes: 12 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@

ENV["RAILS_ENV"] ||= 'test'

require "rails/application"
require File.expand_path("../../config/environment", __FILE__)
#require "rails/application"
#require File.expand_path("../../config/environment", __FILE__)

require 'active_support'
require 'active_support/core_ext'
require 'active_support/json'
require 'action_view'
require 'active_model'
require 'action_controller'
require 'rails'
require 'rspec/rails'

RSpec.configure do |config|
config.mock_with :rspec
config.expect_with :rspec
config.before do
Rails.stub(:root).and_return(Pathname.new(__FILE__).dirname)
end
end

require 'analytical'
Expand Down

0 comments on commit e5e6c51

Please sign in to comment.