We may be able to streamline this so there are less files to
keep in sync at some point, but the idea is that we do regular
gem requires when loading the rails app instead of having bundler
do it. We keep the Gemfile and Gemfile.lock to allow non-fedora
contributors/users to get all the deps they need via 'bundle install',
but then do not interact with bundler any further.
The one caveat is that someone one a non-fedora platform would need
to uncomment the source line in the Gemfile, so it will pull from
rubygems.org. In the fedora case, we dont want that - you should have
installed everything via yum/rpm, and if you are adding a new dep, this
will make it obvious to you and your tester that a new rpms dep/package
is needed before your change can be pushed to master.
---
.gitignore | 2 -
aeolus-conductor.spec.in | 9 +-
src/Gemfile | 23 +++---
src/Gemfile.lock | 186 +++++++++++++++++++++++++++++++++++++++++++++
src/config/application.rb | 37 +++++++++-
src/config/boot.rb | 25 ++++---
src/spec/spec_helper.rb | 1 +
7 files changed, 252 insertions(+), 31 deletions(-)
create mode 100644 src/Gemfile.lock
diff --git a/.gitignore b/.gitignore
index ddf63d5..827f787 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,5 +17,3 @@ src/public/stylesheets/compiled
development.sqlite3
production.sqlite3
test.sqlite3
-
-Gemfile.lock
diff --git a/aeolus-conductor.spec.in b/aeolus-conductor.spec.in
index 90f7a91..f68e097 100644
--- a/aeolus-conductor.spec.in
+++ b/aeolus-conductor.spec.in
@@ -34,7 +34,6 @@ Requires: rubygem(rack-restful_submit)
Requires: rubygem(uuidtools)
Requires: rubygem(sqlite3)
Requires: rubygem(fastercsv)
-Requires: rubygem(warden)
Requires: rubygem(rails_warden)
Requires: rubygem(aeolus-image)
Requires: rubygem(pg)
@@ -84,12 +83,14 @@ Requires: rubygem(cucumber)
Requires: rubygem(rspec)
Requires: rubygem(timecop)
Requires: rubygem(cucumber-rails)
-Requires: rubygem(rspec-rails) >= 2.0.1
-Requires: rubygem(webrat) >= 0.7.2
+Requires: rubygem(rspec-rails) >= 2.6.1
+Requires: rubygem(capybara) >= 1.0.0
Requires: rubygem(database_cleaner) >= 0.5.0
Requires: rubygem(factory_girl)
Requires: rubygem(vcr)
Requires: rubygem(factory_girl_rails)
+Requires: rubygem(webmock)
+Requires: rubygem(launchy)
%description devel
Tests and other development tools for the Aeolus Conductor.
@@ -182,7 +183,6 @@ sass --style compact ./src/app/stylesheets/login.scss
%{buildroot}%{app_root}/pu
# misc files
%{__cp} src/Rakefile %{buildroot}%{app_root}
%{__cp} src/config.ru %{buildroot}%{app_root}
-%{__cp} src/Gemfile %{buildroot}%{app_root}
%{__mkdir} -p %{buildroot}%{app_root}/config
%{__cp} src/config/database.pg %{buildroot}%{app_root}/config
@@ -276,7 +276,6 @@ fi
%{app_root}/log
%{app_root}/public
%{app_root}/Rakefile
-%{app_root}/Gemfile
%config %{_sysconfdir}/%{name}
%doc AUTHORS COPYING
diff --git a/src/Gemfile b/src/Gemfile
index 887c0c3..d063047 100644
--- a/src/Gemfile
+++ b/src/Gemfile
@@ -1,4 +1,4 @@
-source 'http://rubygems.org'
+#source 'http://rubygems.org'
gem 'rails', ' >= 3.0.7'
@@ -19,19 +19,18 @@ gem 'thin'
gem 'json'
gem 'railties'
gem 'fastercsv'
-gem 'warden'
gem 'rails_warden'
gem 'ruby-net-ldap'
gem 'aeolus-image'
group :development, :test do
- #gem 'rspec-rails'
- #gem 'factory_girl_rails'
- #gem 'timecop'
- #gem 'capybara'
- #gem 'cucumber'
- #gem 'cucumber-rails'
- #gem 'database_cleaner'
- #gem 'vcr'
- #gem 'webmock'
- #gem 'launchy'
+ gem 'rspec-rails'
+ gem 'factory_girl_rails'
+ gem 'timecop'
+ gem 'capybara'
+ gem 'cucumber'
+ gem 'cucumber-rails'
+ gem 'database_cleaner'
+ gem 'vcr'
+ gem 'webmock'
+ gem 'launchy'
end
diff --git a/src/Gemfile.lock b/src/Gemfile.lock
new file mode 100644
index 0000000..0f3912b
--- /dev/null
+++ b/src/Gemfile.lock
@@ -0,0 +1,186 @@
+GEM
+ specs:
+ abstract (1.0.0)
+ actionmailer (3.0.9)
+ actionpack (= 3.0.9)
+ mail (~> 2.3.0)
+ actionpack (3.0.9)
+ activemodel (= 3.0.9)
+ activesupport (= 3.0.9)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.5.0)
+ rack (>= 1.2.1)
+ rack-mount (>= 0.6.14)
+ rack-test (>= 0.5.4)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.9)
+ activesupport (= 3.0.9)
+ builder (~> 2.1.2)
+ i18n (~> 0.5.0)
+ activerecord (3.0.9)
+ activemodel (= 3.0.9)
+ activesupport (= 3.0.9)
+ arel (~> 2.0.9)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.9)
+ activemodel (= 3.0.9)
+ activesupport (= 3.0.9)
+ activesupport (3.0.9)
+ addressable (2.2.6)
+ arel (2.0.9)
+ builder (2.1.2)
+ capybara (1.1.1)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 2.0)
+ xpath (~> 0.1.4)
+ childprocess (0.2.2)
+ ffi (~> 1.0.6)
+ crack (0.1.8)
+ cucumber (1.0.1)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.2)
+ gherkin (~> 2.4.5)
+ json (>= 1.4.6)
+ term-ansicolor (>= 1.0.5)
+ cucumber-rails (1.0.2)
+ capybara (>= 1.0.0)
+ cucumber (~> 1.0.0)
+ nokogiri (>= 1.4.6)
+ daemons (1.0.10)
+ database_cleaner (0.6.6)
+ deltacloud-client (0.4.0)
+ nokogiri (>= 1.4.3)
+ rest-client (>= 1.6.1)
+ diff-lcs (1.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ eventmachine (0.12.10)
+ factory_girl (2.0.5)
+ factory_girl_rails (1.1.0)
+ factory_girl (~> 2.0.0)
+ railties (>= 3.0.0)
+ fastercsv (1.5.1)
+ ffi (1.0.9)
+ gherkin (2.4.5)
+ json (>= 1.4.6)
+ haml (3.1.2)
+ i18n (0.5.0)
+ json (1.4.6)
+ json_pure (1.5.4)
+ spruz (~> 0.2.8)
+ launchy (2.0.5)
+ addressable (~> 2.2.6)
+ mail (2.3.0)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ nokogiri (1.5.0.beta.4)
+ pg (0.11.0)
+ polyglot (0.3.1)
+ rack (1.3.0)
+ rack-mount (0.7.1)
+ rack (>= 1.0.0)
+ regin (>= 0.3.7)
+ rack-restful_submit (1.1.2)
+ rack (~> 1.1)
+ rack-test (0.6.0)
+ rack (>= 1.0)
+ rails (3.0.9)
+ actionmailer (= 3.0.9)
+ actionpack (= 3.0.9)
+ activerecord (= 3.0.9)
+ activeresource (= 3.0.9)
+ activesupport (= 3.0.9)
+ bundler (~> 1.0)
+ railties (= 3.0.9)
+ rails_warden (0.5.2)
+ warden
+ railties (3.0.9)
+ actionpack (= 3.0.9)
+ activesupport (= 3.0.9)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.4)
+ rake (0.9.2)
+ rdoc (3.8)
+ regin (0.3.8)
+ rest-client (1.6.1)
+ mime-types (>= 1.16)
+ rspec-core (2.6.4)
+ rspec-rails (2.6.1)
+ actionpack (~> 3.0)
+ activesupport (~> 3.0)
+ railties (~> 3.0)
+ rspec-core (~> 2.6.0)
+ ruby-net-ldap (0.0.4)
+ rubyzip (0.9.4)
+ sass (3.1.4)
+ selenium-webdriver (2.3.2)
+ childprocess (>= 0.1.9)
+ ffi (>= 1.0.7)
+ json_pure
+ rubyzip
+ simple-navigation (3.0.0)
+ activesupport (>= 2.3.2)
+ spruz (0.2.13)
+ sqlite3 (1.3.3)
+ term-ansicolor (1.0.6)
+ thin (1.2.11)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
+ thor (0.14.6)
+ timecop (0.3.5)
+ treetop (1.4.9)
+ polyglot (>= 0.2.5)
+ typhoeus (0.2.0)
+ tzinfo (0.3.26)
+ uuidtools (2.1.1)
+ vcr (1.10.0)
+ warden (1.0.3)
+ rack (>= 1.0.0)
+ webmock (1.6.4)
+ addressable (> 2.2.5, ~> 2.2)
+ crack (>= 0.1.7)
+ will_paginate (3.0.pre2)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ capybara
+ cucumber
+ cucumber-rails
+ database_cleaner
+ deltacloud-client
+ factory_girl_rails
+ fastercsv
+ haml
+ json
+ launchy
+ nokogiri
+ pg
+ rack-restful_submit
+ rails (>= 3.0.7)
+ rails_warden
+ railties
+ rest-client
+ rspec-rails
+ ruby-net-ldap
+ sass
+ simple-navigation
+ sqlite3
+ thin
+ timecop
+ typhoeus
+ uuidtools
+ vcr
+ webmock
+ will_paginate (>= 3.0.pre1)
diff --git a/src/config/application.rb b/src/config/application.rb
index c557307..41d12e9 100644
--- a/src/config/application.rb
+++ b/src/config/application.rb
@@ -4,7 +4,42 @@ require 'rails/all'
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
-Bundler.require(:default, Rails.env) if defined?(Bundler)
+if ENV['USE_BUNDLER'] == 'yes'
+ puts "===== application.rb will try and use bundler ========="
+ Bundler.require(:default, Rails.env) if defined?(Bundler)
+else
+ puts 'Using gem require instead of bundler'
+ require 'rails_warden'
+ require 'net/ldap'
+ require 'deltacloud'
+ require 'sass'
+ require 'haml'
+ require 'will_paginate'
+ require 'nokogiri'
+ require 'simple-navigation'
+ require 'typhoeus'
+ require 'rest-client'
+ require 'rack-restful_submit'
+ require 'uuidtools'
+ require 'pg'
+ require 'thin'
+ require 'json'
+ require 'fastercsv'
+ #require 'railties'
+
+ if (ENV["RAILS_ENV"] == "cucumber" || ENV["RAILS_ENV"] ==
"test")
+ puts "========= cucumber/test env deps loaded... =========="
+ require 'rspec-rails'
+ require 'factory_girl_rails'
+ require 'timecop'
+ require 'capybara'
+ require 'cucumber'
+ require 'database_cleaner'
+ require 'vcr'
+ require 'webmock'
+ require 'launchy'
+ end
+end
$: << File.join(File.dirname(__FILE__), "../app")
diff --git a/src/config/boot.rb b/src/config/boot.rb
index ab6cb37..5a6bde0 100644
--- a/src/config/boot.rb
+++ b/src/config/boot.rb
@@ -1,13 +1,16 @@
require 'rubygems'
-# Set up gems listed in the Gemfile.
-gemfile = File.expand_path('../../Gemfile', __FILE__)
-begin
- ENV['BUNDLE_GEMFILE'] = gemfile
- require 'bundler'
- Bundler.setup
-rescue Bundler::GemNotFound => e
- STDERR.puts e.message
- STDERR.puts "Try running `bundle install`."
- exit!
-end if File.exist?(gemfile)
+if ENV['USE_BUNDLER'] == 'yes'
+ puts "===== boot.rb will try and use bundler ========="
+ # Set up gems listed in the Gemfile.
+ gemfile = File.expand_path('../../Gemfile', __FILE__)
+ begin
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+ rescue Bundler::GemNotFound => e
+ STDERR.puts e.message
+ STDERR.puts "Try running `bundle install`."
+ exit!
+ end if File.exist?(gemfile)
+end
diff --git a/src/spec/spec_helper.rb b/src/spec/spec_helper.rb
index 07aea3c..97ef9b9 100644
--- a/src/spec/spec_helper.rb
+++ b/src/spec/spec_helper.rb
@@ -41,6 +41,7 @@ RSpec.configure do |config|
# config.mock_with :flexmock
# config.mock_with :rr
#
+ config.mock_with :rspec
# == Notes
#
# For more information take a look at Spec::Runner::Configuration and Spec::Runner
--
1.7.6