summaryrefslogtreecommitdiff
path: root/lib/leap_web_core
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-04-08 09:12:37 +0200
committerAzul <azul@leap.se>2014-04-08 09:12:37 +0200
commit53808b073f539ba2b442738b6abf97228488e311 (patch)
tree67e344defee90e4d0c5f91f6136f6619e97c4ace /lib/leap_web_core
parentcb6442c344d6bdaf52c3878b2de2fcf4d85f2648 (diff)
moving all of core into toplevel, tests fail.
Diffstat (limited to 'lib/leap_web_core')
-rw-r--r--lib/leap_web_core/dependencies.rb40
-rw-r--r--lib/leap_web_core/engine.rb9
-rw-r--r--lib/leap_web_core/ui_dependencies.rb11
3 files changed, 60 insertions, 0 deletions
diff --git a/lib/leap_web_core/dependencies.rb b/lib/leap_web_core/dependencies.rb
new file mode 100644
index 0000000..877e3d1
--- /dev/null
+++ b/lib/leap_web_core/dependencies.rb
@@ -0,0 +1,40 @@
+module LeapWebCore
+ class Dependencies
+ UI_DEV = {
+ "haml-rails" => "~> 0.3.4",
+ "sass-rails" => "~> 3.2.5",
+ "coffee-rails" => "~> 3.2.2",
+ "uglifier" => "~> 1.2.7"
+ }
+
+ UI = {
+ "haml" => "~> 3.1.7",
+ "jquery-rails" => nil,
+ "simple_form" => nil,
+ "bootswatch-rails", "~> 0.5.0"
+ }
+
+ def self.require_ui_gems
+ UI.keys.each {|dep| require dep}
+ if Rails.env == "development"
+ # This will be run in the app including plugins that run it.
+ # However not all development_dependencies might be present.
+ # So we better only require those that are.
+ available = Bundler.definition.specs.map(&:name)
+ gems_to_require = available & UI_DEV.keys
+ gems_to_require.each {|dep| require dep}
+ end
+ end
+
+ def self.add_ui_gems_to_spec(spec)
+ UI.each do |dep, version|
+ spec.add_dependency dep, version
+ end
+
+ UI_DEV.each do |dep, version|
+ spec.add_development_dependency dep, version
+ end
+ end
+
+ end
+end
diff --git a/lib/leap_web_core/engine.rb b/lib/leap_web_core/engine.rb
new file mode 100644
index 0000000..940b5e2
--- /dev/null
+++ b/lib/leap_web_core/engine.rb
@@ -0,0 +1,9 @@
+# thou shall require all your dependencies in an engine.
+require "couchrest"
+require "couchrest_model"
+
+module LeapWebCore
+ class Engine < ::Rails::Engine
+
+ end
+end
diff --git a/lib/leap_web_core/ui_dependencies.rb b/lib/leap_web_core/ui_dependencies.rb
new file mode 100644
index 0000000..2daee37
--- /dev/null
+++ b/lib/leap_web_core/ui_dependencies.rb
@@ -0,0 +1,11 @@
+require "haml"
+require "jquery-rails"
+require "simple_form"
+require "bootswatch-rails"
+
+if Rails.env == "development"
+ require "haml-rails"
+ require "sass-rails"
+ require "coffee-rails"
+ require "uglifier"
+end