summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-10-11 10:22:34 +0200
committerAzul <azul@leap.se>2012-10-11 10:22:34 +0200
commitadd8d015c87a00626b739080bd75c7e7aeb9c1df (patch)
treeb972daa7d2574c38910e91aea4ac98b7663e69ca
parent00b7b36516d1d07300870029ad5190f06122a493 (diff)
moved core dependency into */Gemfile with :path
In order to get the rails generators and the like to work properly in engines we need to require all the dependencies in the engine.rb file. Since I want to keep that list of engines in a centralized place we still need core and we need to require it from the other engines. We don't want to require the core gem to be installed so I added it with :path option to the Gemfile.
-rw-r--r--.gitignore1
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock18
-rw-r--r--certs/Gemfile3
-rw-r--r--certs/lib/leap_web_certs.rb1
-rw-r--r--certs/lib/leap_web_certs/engine.rb2
-rw-r--r--core/lib/leap_web_core.rb2
-rw-r--r--core/lib/leap_web_core/ui_dependencies.rb11
-rw-r--r--help/Gemfile3
-rw-r--r--help/lib/leap_web_help.rb1
-rw-r--r--help/lib/leap_web_help/engine.rb2
-rw-r--r--users/Gemfile3
-rw-r--r--users/lib/leap_web_users.rb2
-rw-r--r--users/lib/leap_web_users/engine.rb3
14 files changed, 42 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index bdcb017..7993150 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,4 @@
/pkg
/*/pkg
/log
+*/Gemfile.lock
diff --git a/Gemfile b/Gemfile
index 6d28e3d..10c661a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -6,6 +6,7 @@ eval(File.read(File.dirname(__FILE__) + '/ui_dependencies.rb'))
# EITHER fetch all of the leap_web gems in one go
# gem 'leap_web'
# OR use the local versions for development instead:
+gem "leap_web_core", :path => 'core'
gem 'leap_web_users', :path => 'users'
gem 'leap_web_certs', :path => 'certs'
# gem 'leap_web_help', :path => 'help'
diff --git a/Gemfile.lock b/Gemfile.lock
index 955c637..fe49476 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -2,11 +2,23 @@ PATH
remote: certs
specs:
leap_web_certs (0.1.0)
+ leap_web_core (= 0.1.0)
+
+PATH
+ remote: core
+ specs:
+ leap_web_core (0.1.0)
+ couchrest (~> 1.1.3)
+ couchrest_model (~> 2.0.0.beta2)
+ couchrest_session_store (~> 0.0.1)
+ json
+ rails (~> 3.2.8)
PATH
remote: users
specs:
leap_web_users (0.1.0)
+ leap_web_core (= 0.1.0)
ruby-srp (~> 0.1.1)
GEM
@@ -156,17 +168,13 @@ PLATFORMS
DEPENDENCIES
bootstrap-sass (~> 2.0.4)
coffee-rails (~> 3.2.2)
- couchrest (~> 1.1.3)
- couchrest_model (~> 2.0.0.beta2)
- couchrest_session_store (~> 0.0.1)
haml (~> 3.1.7)
haml-rails (~> 0.3.4)
jquery-rails
- json
leap_web_certs!
+ leap_web_core!
leap_web_users!
mocha
- rails (~> 3.2.8)
ruby-debug
sass-rails (~> 3.2.5)
simple_form
diff --git a/certs/Gemfile b/certs/Gemfile
index ab2aa7a..951d1b7 100644
--- a/certs/Gemfile
+++ b/certs/Gemfile
@@ -2,6 +2,9 @@ source "http://rubygems.org"
eval(File.read(File.dirname(__FILE__) + '/../common_dependencies.rb'))
+# We require leap_web_core from here so we can use the path option.
+gem "leap_web_core", :path => '../core'
+
# Declare your gem's dependencies in leap_web_users.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
diff --git a/certs/lib/leap_web_certs.rb b/certs/lib/leap_web_certs.rb
index 129d1a9..beb683d 100644
--- a/certs/lib/leap_web_certs.rb
+++ b/certs/lib/leap_web_certs.rb
@@ -1,4 +1,3 @@
-require "leap_web_core"
require "leap_web_certs/engine"
module LeapWebCerts
diff --git a/certs/lib/leap_web_certs/engine.rb b/certs/lib/leap_web_certs/engine.rb
index 33a446e..3c8948a 100644
--- a/certs/lib/leap_web_certs/engine.rb
+++ b/certs/lib/leap_web_certs/engine.rb
@@ -1,3 +1,5 @@
+require "leap_web_core"
+
module LeapWebCerts
class Engine < ::Rails::Engine
diff --git a/core/lib/leap_web_core.rb b/core/lib/leap_web_core.rb
index 5b53978..8826880 100644
--- a/core/lib/leap_web_core.rb
+++ b/core/lib/leap_web_core.rb
@@ -1,4 +1,4 @@
-require "rails/all"
+require "rails"
require "couchrest"
require "couchrest_model"
diff --git a/core/lib/leap_web_core/ui_dependencies.rb b/core/lib/leap_web_core/ui_dependencies.rb
new file mode 100644
index 0000000..e0a0b86
--- /dev/null
+++ b/core/lib/leap_web_core/ui_dependencies.rb
@@ -0,0 +1,11 @@
+require "haml"
+require "bootstrap-sass"
+require "jquery-rails"
+require "simple_form"
+
+if Rails.env == "development"
+ require "haml-rails"
+ require "sass-rails"
+ require "coffee-rails"
+ require "uglifier"
+end
diff --git a/help/Gemfile b/help/Gemfile
index bfd760e..5e895e9 100644
--- a/help/Gemfile
+++ b/help/Gemfile
@@ -3,6 +3,9 @@ source "http://rubygems.org"
eval(File.read(File.dirname(__FILE__) + '/../common_dependencies.rb'))
eval(File.read(File.dirname(__FILE__) + '/..//ui_dependencies.rb'))
+# We require leap_web_core from here so we can use the path option.
+gem "leap_web_core", :path => '../core'
+
# Declare your gem's dependencies in leap_web_users.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
diff --git a/help/lib/leap_web_help.rb b/help/lib/leap_web_help.rb
index 89dabcf..f5b04aa 100644
--- a/help/lib/leap_web_help.rb
+++ b/help/lib/leap_web_help.rb
@@ -1,4 +1,3 @@
-require "leap_web_core"
require "leap_web_help/engine"
module LeapWebHelp
diff --git a/help/lib/leap_web_help/engine.rb b/help/lib/leap_web_help/engine.rb
index 1006c29..4146dfc 100644
--- a/help/lib/leap_web_help/engine.rb
+++ b/help/lib/leap_web_help/engine.rb
@@ -1,4 +1,6 @@
# thou shall require all your dependencies in an engine.
+require "leap_web_core"
+require "leap_web_core/ui_dependencies"
module LeapWebHelp
class Engine < ::Rails::Engine
diff --git a/users/Gemfile b/users/Gemfile
index 81b0ae8..e30033a 100644
--- a/users/Gemfile
+++ b/users/Gemfile
@@ -3,6 +3,9 @@ source "http://rubygems.org"
eval(File.read(File.dirname(__FILE__) + '/../common_dependencies.rb'))
eval(File.read(File.dirname(__FILE__) + '/../ui_dependencies.rb'))
+# We require leap_web_core from here so we can use the path option.
+gem "leap_web_core", :path => '../core'
+
# Declare your gem's dependencies in leap_web_users.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
diff --git a/users/lib/leap_web_users.rb b/users/lib/leap_web_users.rb
index 1ea1c40..e1b7b1f 100644
--- a/users/lib/leap_web_users.rb
+++ b/users/lib/leap_web_users.rb
@@ -1,5 +1,3 @@
-require "leap_web_core"
-require "leap_web_core/ui_dependencies"
require "leap_web_users/engine"
module LeapWebUsers
diff --git a/users/lib/leap_web_users/engine.rb b/users/lib/leap_web_users/engine.rb
index 734564b..9b7545e 100644
--- a/users/lib/leap_web_users/engine.rb
+++ b/users/lib/leap_web_users/engine.rb
@@ -1,6 +1,7 @@
# thou shall require all your dependencies in an engine.
+require "leap_web_core"
+require "leap_web_core/ui_dependencies"
require "ruby-srp"
-require "haml-rails"
module LeapWebUsers
class Engine < ::Rails::Engine