disguise 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +26 -24
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/app/models/domain_theme.rb +1 -1
- data/app/models/theme.rb +4 -4
- data/app/views/admin/themes/_theme.html.erb +3 -3
- data/app/views/admin/themes/edit.html.erb +9 -2
- data/config/locales/ar.yml +20 -0
- data/config/locales/bg.yml +20 -0
- data/config/locales/ca.yml +20 -0
- data/config/locales/cs.yml +20 -0
- data/{locales → config/locales}/da.yml +8 -8
- data/config/locales/de.yml +20 -0
- data/config/locales/el.yml +20 -0
- data/{locales → config/locales}/en.yml +0 -0
- data/config/locales/es.yml +20 -0
- data/config/locales/et.yml +20 -0
- data/config/locales/fa.yml +20 -0
- data/config/locales/fi.yml +20 -0
- data/{locales → config/locales}/fr.yml +8 -8
- data/config/locales/gl.yml +20 -0
- data/config/locales/hi.yml +20 -0
- data/config/locales/hr.yml +20 -0
- data/config/locales/hu.yml +20 -0
- data/config/locales/id.yml +20 -0
- data/config/locales/it.yml +20 -0
- data/config/locales/iw.yml +20 -0
- data/config/locales/ja.yml +20 -0
- data/config/locales/ko.yml +20 -0
- data/config/locales/lt.yml +20 -0
- data/config/locales/lv.yml +20 -0
- data/config/locales/mt.yml +20 -0
- data/config/locales/nl.yml +20 -0
- data/config/locales/no.yml +21 -0
- data/config/locales/pl.yml +20 -0
- data/config/locales/pt-PT.yml +20 -0
- data/{locales → config/locales}/pt.yml +0 -0
- data/config/locales/ro.yml +20 -0
- data/config/locales/ru.yml +20 -0
- data/config/locales/sk.yml +20 -0
- data/config/locales/sl.yml +20 -0
- data/{locales → config/locales}/sq.yml +7 -7
- data/config/locales/sr.yml +20 -0
- data/config/locales/sv.yml +20 -0
- data/config/locales/th.yml +20 -0
- data/config/locales/tl.yml +20 -0
- data/config/locales/tr.yml +20 -0
- data/config/locales/uk.yml +20 -0
- data/config/locales/vi.yml +20 -0
- data/config/locales/zh-CN.yml +20 -0
- data/config/locales/zh-TW.yml +20 -0
- data/config/locales/zh.yml +20 -0
- data/config/routes.rb +6 -0
- data/disguise.gemspec +157 -181
- data/lib/disguise.rb +2 -10
- data/lib/disguise/config.rb +22 -9
- data/lib/disguise/controllers/disguise_application.rb +58 -0
- data/lib/disguise/engine.rb +14 -0
- data/lib/tasks/diguise.rake +9 -0
- data/test/{rails_root → rails_test}/.gitignore +0 -0
- data/test/{rails_root → rails_test}/.rake_tasks +0 -0
- data/test/rails_test/Gemfile +18 -0
- data/test/rails_test/Gemfile.lock +114 -0
- data/test/{rails_root → rails_test}/Rakefile +2 -4
- data/test/{rails_root → rails_test}/app/controllers/admin/domain_themes_controller.rb +0 -0
- data/test/{rails_root → rails_test}/app/controllers/admin/themes_controller.rb +0 -0
- data/test/{rails_root → rails_test}/app/controllers/application_controller.rb +0 -0
- data/test/{rails_root → rails_test}/app/controllers/default_controller.rb +0 -0
- data/test/{rails_root → rails_test}/app/models/.keep +0 -0
- data/test/rails_test/app/models/user.rb +3 -0
- data/test/{rails_root → rails_test}/app/views/default/index.html.erb +0 -0
- data/test/{rails_root → rails_test}/app/views/layouts/default.html.erb +0 -0
- data/test/rails_test/config.ru +4 -0
- data/test/rails_test/config/application.rb +42 -0
- data/test/rails_test/config/boot.rb +13 -0
- data/test/rails_test/config/database.yml +14 -0
- data/test/rails_test/config/environment.rb +5 -0
- data/test/rails_test/config/environments/development.rb +26 -0
- data/test/rails_test/config/environments/production.rb +49 -0
- data/test/rails_test/config/environments/test.rb +35 -0
- data/test/rails_test/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_test/config/initializers/disguise.rb +5 -0
- data/test/{rails_root → rails_test}/config/initializers/inflections.rb +2 -2
- data/test/{rails_root → rails_test}/config/initializers/mime_types.rb +0 -0
- data/test/rails_test/config/initializers/secret_token.rb +7 -0
- data/test/rails_test/config/initializers/session_store.rb +8 -0
- data/test/rails_test/config/routes.rb +3 -0
- data/test/{rails_root → rails_test}/db/.keep +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090530170040_create_themes.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090602041838_create_users.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090606153236_create_domain_themes.rb +0 -0
- data/test/{rails_root → rails_test}/features/step_definitions/webrat_steps.rb +0 -0
- data/test/{rails_root → rails_test}/features/support/env.rb +0 -0
- data/test/{rails_root → rails_test}/public/.htaccess +0 -0
- data/test/rails_test/public/404.html +26 -0
- data/test/rails_test/public/422.html +26 -0
- data/test/rails_test/public/500.html +26 -0
- data/test/{rails_root → rails_test}/public/dispatch.rb +1 -1
- data/test/{rails_root → rails_test}/public/favicon.ico +0 -0
- data/test/{rails_root → rails_test}/public/images/blue/preview.gif +0 -0
- data/test/rails_test/public/images/rails.png +0 -0
- data/test/{rails_root → rails_test}/public/javascripts/application.js +0 -0
- data/test/{rails_root → rails_test}/public/javascripts/controls.js +75 -73
- data/test/{rails_root → rails_test}/public/javascripts/dragdrop.js +171 -169
- data/test/{rails_root → rails_test}/public/javascripts/effects.js +180 -177
- data/test/rails_test/public/javascripts/prototype.js +6001 -0
- data/test/rails_test/public/javascripts/rails.js +175 -0
- data/test/rails_test/public/robots.txt +5 -0
- data/test/{rails_root/public/stylesheets/.keep → rails_test/public/stylesheets/.gitkeep} +0 -0
- data/test/{rails_root/test/functional/.keep → rails_test/public/stylesheets/application.css} +0 -0
- data/test/rails_test/script/rails +6 -0
- data/test/{rails_root → rails_test}/test/factories.rb +0 -0
- data/test/{rails_root/test/integration → rails_test/test/functional}/.keep +0 -0
- data/test/{rails_root → rails_test}/test/functional/admin/domain_themes_controller_test.rb +6 -6
- data/test/{rails_root → rails_test}/test/functional/admin/themes_controller_test.rb +6 -6
- data/test/{rails_root → rails_test}/test/functional/default_controller_test.rb +2 -2
- data/test/{rails_root/test/mocks/development → rails_test/test/integration}/.keep +0 -0
- data/test/{rails_root → rails_test}/test/test_helper.rb +6 -9
- data/test/{rails_root/test/mocks/test → rails_test/test/unit}/.keep +0 -0
- data/test/{rails_root → rails_test}/test/unit/domain_theme_test.rb +2 -1
- data/test/{rails_root → rails_test}/test/unit/theme_test.rb +4 -2
- data/test/{rails_root → rails_test}/themes/blue/description.txt +0 -0
- data/test/{rails_root → rails_test}/themes/blue/locales/blue.yml +0 -0
- data/test/{rails_root → rails_test}/themes/blue/locales/en.yml +0 -0
- data/test/{rails_root → rails_test}/themes/blue/views/default/index.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/blue/views/layouts/default.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/blue/views/layouts/global/_footer.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/blue/views/layouts/global/_head.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/blue/views/layouts/global/_header.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/red/description.txt +0 -0
- data/test/{rails_root → rails_test}/themes/red/locales/en.yml +0 -0
- data/test/{rails_root → rails_test}/themes/red/views/layouts/default.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/red/views/layouts/global/_footer.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/red/views/layouts/global/_head.html.erb +0 -0
- data/test/{rails_root → rails_test}/themes/red/views/layouts/global/_header.html.erb +0 -0
- metadata +159 -183
- data/config/disguise_routes.rb +0 -7
- data/lib/action_controller/disguise_application.rb +0 -61
- data/lib/disguise/initialize_routes.rb +0 -8
- data/lib/disguise/tasks.rb +0 -34
- data/locales/ar.yml +0 -20
- data/locales/bg.yml +0 -20
- data/locales/ca.yml +0 -20
- data/locales/cs.yml +0 -20
- data/locales/de.yml +0 -20
- data/locales/el.yml +0 -20
- data/locales/es.yml +0 -20
- data/locales/et.yml +0 -20
- data/locales/fa.yml +0 -20
- data/locales/fi.yml +0 -20
- data/locales/gl.yml +0 -20
- data/locales/hi.yml +0 -20
- data/locales/hr.yml +0 -20
- data/locales/hu.yml +0 -20
- data/locales/id.yml +0 -20
- data/locales/it.yml +0 -20
- data/locales/iw.yml +0 -20
- data/locales/ja.yml +0 -20
- data/locales/ko.yml +0 -20
- data/locales/lt.yml +0 -20
- data/locales/lv.yml +0 -20
- data/locales/mt.yml +0 -20
- data/locales/nl.yml +0 -20
- data/locales/no.yml +0 -21
- data/locales/pl.yml +0 -20
- data/locales/pt-PT.yml +0 -20
- data/locales/ro.yml +0 -20
- data/locales/ru.yml +0 -20
- data/locales/sk.yml +0 -20
- data/locales/sl.yml +0 -20
- data/locales/sr.yml +0 -20
- data/locales/sv.yml +0 -20
- data/locales/th.yml +0 -20
- data/locales/tl.yml +0 -20
- data/locales/tr.yml +0 -20
- data/locales/uk.yml +0 -20
- data/locales/vi.yml +0 -20
- data/locales/zh-CN.yml +0 -20
- data/locales/zh-TW.yml +0 -20
- data/locales/zh.yml +0 -20
- data/rails/init.rb +0 -2
- data/tasks/rails.rake +0 -2
- data/test/rails_root/Capfile +0 -3
- data/test/rails_root/app/models/user.rb +0 -9
- data/test/rails_root/config/amazon_s3.yml +0 -14
- data/test/rails_root/config/boot.rb +0 -109
- data/test/rails_root/config/database.yml +0 -14
- data/test/rails_root/config/environment.rb +0 -21
- data/test/rails_root/config/environments/development.rb +0 -19
- data/test/rails_root/config/environments/production.rb +0 -1
- data/test/rails_root/config/environments/test.rb +0 -33
- data/test/rails_root/config/global_config.yml +0 -18
- data/test/rails_root/config/initializers/disguise.rb +0 -2
- data/test/rails_root/config/initializers/requires.rb +0 -13
- data/test/rails_root/config/initializers/s3_credentials.rb +0 -9
- data/test/rails_root/config/initializers/session_store.rb +0 -8
- data/test/rails_root/config/routes.rb +0 -7
- data/test/rails_root/public/404.html +0 -30
- data/test/rails_root/public/422.html +0 -30
- data/test/rails_root/public/500.html +0 -30
- data/test/rails_root/public/images/rails.png +0 -0
- data/test/rails_root/public/images/red/preview.gif +0 -0
- data/test/rails_root/public/javascripts/builder.js +0 -136
- data/test/rails_root/public/javascripts/prototype.js +0 -4225
- data/test/rails_root/public/javascripts/scriptaculous.js +0 -58
- data/test/rails_root/public/javascripts/slider.js +0 -277
- data/test/rails_root/public/javascripts/sound.js +0 -60
- data/test/rails_root/public/robots.txt +0 -1
- data/test/rails_root/public/stylesheets/themes/blue/styles.css +0 -1
- data/test/rails_root/public/stylesheets/themes/red/styles.css +0 -1
- data/test/rails_root/script/about +0 -3
- data/test/rails_root/script/breakpointer +0 -3
- data/test/rails_root/script/console +0 -3
- data/test/rails_root/script/create_project.rb +0 -52
- data/test/rails_root/script/cucumber +0 -7
- data/test/rails_root/script/dbconsole +0 -3
- data/test/rails_root/script/destroy +0 -3
- data/test/rails_root/script/generate +0 -3
- data/test/rails_root/script/performance/benchmarker +0 -3
- data/test/rails_root/script/performance/profiler +0 -3
- data/test/rails_root/script/performance/request +0 -3
- data/test/rails_root/script/plugin +0 -3
- data/test/rails_root/script/process/inspector +0 -3
- data/test/rails_root/script/process/reaper +0 -3
- data/test/rails_root/script/process/spawner +0 -3
- data/test/rails_root/script/runner +0 -3
- data/test/rails_root/script/server +0 -3
- data/test/rails_root/test/unit/.keep +0 -0
data/lib/disguise.rb
CHANGED
@@ -1,11 +1,3 @@
|
|
1
1
|
require 'disguise/config'
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
I18n.load_path += Dir[ File.join(File.dirname(__FILE__), '..', 'locales', '*.{rb,yml}') ]
|
6
|
-
|
7
|
-
# Set defaults
|
8
|
-
Disguise::Config.themes_enabled = true
|
9
|
-
Disguise::Config.use_domain_for_themes = false
|
10
|
-
Disguise::Config.theme_path = 'themes'
|
11
|
-
Disguise::Config.theme_full_base_path = File.join(RAILS_ROOT, Disguise::Config.theme_path)
|
2
|
+
require 'disguise/controllers/disguise_application'
|
3
|
+
require 'disguise/engine'
|
data/lib/disguise/config.rb
CHANGED
@@ -1,13 +1,26 @@
|
|
1
|
+
# Configure disguise
|
2
|
+
#
|
1
3
|
module Disguise
|
2
|
-
class Config
|
3
|
-
|
4
|
-
class << self
|
5
|
-
attr_accessor :themes_enabled
|
6
|
-
attr_accessor :use_domain_for_themes
|
7
|
-
attr_accessor :theme_path
|
8
|
-
attr_accessor :theme_full_base_path
|
9
|
-
end
|
10
4
|
|
5
|
+
def self.configuration
|
6
|
+
# In case the user doesn't setup a configure block we can always return default settings:
|
7
|
+
@configuration ||= Configuration.new
|
11
8
|
end
|
12
9
|
|
13
|
-
|
10
|
+
def self.configure
|
11
|
+
self.configuration ||= Configuration.new
|
12
|
+
yield(configuration)
|
13
|
+
end
|
14
|
+
|
15
|
+
class Configuration
|
16
|
+
attr_accessor :themes_enabled
|
17
|
+
attr_accessor :use_domain_for_themes
|
18
|
+
attr_accessor :theme_full_base_path
|
19
|
+
|
20
|
+
def initialize
|
21
|
+
@themes_enabled = true
|
22
|
+
@use_domain_for_themes = false
|
23
|
+
@theme_full_base_path = File.join(::Rails.root.to_s, 'themes')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module ActionController
|
2
|
+
module DisguiseApplication
|
3
|
+
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
before_filter :setup_theme
|
8
|
+
helper_method :current_theme
|
9
|
+
end
|
10
|
+
|
11
|
+
module ClassMethods
|
12
|
+
end
|
13
|
+
|
14
|
+
def current_theme
|
15
|
+
if DomainTheme.use_domain_themes?
|
16
|
+
@theme ||= DomainTheme.get_theme(request)
|
17
|
+
else
|
18
|
+
@theme ||= Theme.first
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
protected
|
23
|
+
|
24
|
+
def setup_theme
|
25
|
+
return if !Disguise.configuration.themes_enabled
|
26
|
+
return if current_theme.blank? || current_theme.name.blank?
|
27
|
+
theme_view_path = File.join(Disguise.configuration.theme_full_base_path, current_theme.name, 'views')
|
28
|
+
if self.view_paths.first.to_path == theme_view_path
|
29
|
+
return
|
30
|
+
else
|
31
|
+
return if !theme_exists(theme_view_path)
|
32
|
+
clean_theme_view_path
|
33
|
+
self.prepend_view_path(ActionView::FileSystemResolver.new(theme_view_path))
|
34
|
+
clean_theme_locale
|
35
|
+
set_theme_locale
|
36
|
+
I18n.reload!
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def theme_exists(theme_view_path)
|
41
|
+
@themes_exists ||= {}
|
42
|
+
@themes_exists[theme_view_path] ||= File.exists?(theme_view_path)
|
43
|
+
end
|
44
|
+
|
45
|
+
def clean_theme_view_path
|
46
|
+
self.view_paths.delete_if {|view_path| view_path.to_path.index(Disguise.configuration.theme_full_base_path) == 0}
|
47
|
+
end
|
48
|
+
|
49
|
+
def clean_theme_locale
|
50
|
+
I18n.load_path.delete_if {|localization_path| localization_path.index(Disguise.configuration.theme_full_base_path) == 0}
|
51
|
+
end
|
52
|
+
|
53
|
+
def set_theme_locale
|
54
|
+
I18n.load_path += current_theme.locales
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'disguise'
|
2
|
+
require 'rails'
|
3
|
+
|
4
|
+
module Disguise
|
5
|
+
class Engine < ::Rails::Engine
|
6
|
+
|
7
|
+
initializer 'disguise.disguise_application' do |app|
|
8
|
+
ActiveSupport.on_load(:action_controller) do
|
9
|
+
include ActionController::DisguiseApplication
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gem "rails", "3.0.0"
|
4
|
+
gem "capybara", ">= 0.3.9"
|
5
|
+
gem 'mysql'
|
6
|
+
|
7
|
+
gem "disguise", :path => '../../'
|
8
|
+
|
9
|
+
if RUBY_VERSION < '1.9'
|
10
|
+
gem "ruby-debug"
|
11
|
+
end
|
12
|
+
|
13
|
+
group :test do
|
14
|
+
gem 'shoulda'
|
15
|
+
gem 'factory_girl'
|
16
|
+
gem 'mocha'
|
17
|
+
gem 'redgreen'
|
18
|
+
end
|
@@ -0,0 +1,114 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /Users/jbasdf/projects/disguise
|
3
|
+
specs:
|
4
|
+
disguise (3.0.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
abstract (1.0.0)
|
10
|
+
actionmailer (3.0.0)
|
11
|
+
actionpack (= 3.0.0)
|
12
|
+
mail (~> 2.2.5)
|
13
|
+
actionpack (3.0.0)
|
14
|
+
activemodel (= 3.0.0)
|
15
|
+
activesupport (= 3.0.0)
|
16
|
+
builder (~> 2.1.2)
|
17
|
+
erubis (~> 2.6.6)
|
18
|
+
i18n (~> 0.4.1)
|
19
|
+
rack (~> 1.2.1)
|
20
|
+
rack-mount (~> 0.6.12)
|
21
|
+
rack-test (~> 0.5.4)
|
22
|
+
tzinfo (~> 0.3.23)
|
23
|
+
activemodel (3.0.0)
|
24
|
+
activesupport (= 3.0.0)
|
25
|
+
builder (~> 2.1.2)
|
26
|
+
i18n (~> 0.4.1)
|
27
|
+
activerecord (3.0.0)
|
28
|
+
activemodel (= 3.0.0)
|
29
|
+
activesupport (= 3.0.0)
|
30
|
+
arel (~> 1.0.0)
|
31
|
+
tzinfo (~> 0.3.23)
|
32
|
+
activeresource (3.0.0)
|
33
|
+
activemodel (= 3.0.0)
|
34
|
+
activesupport (= 3.0.0)
|
35
|
+
activesupport (3.0.0)
|
36
|
+
arel (1.0.1)
|
37
|
+
activesupport (~> 3.0.0)
|
38
|
+
builder (2.1.2)
|
39
|
+
capybara (0.3.9)
|
40
|
+
culerity (>= 0.2.4)
|
41
|
+
mime-types (>= 1.16)
|
42
|
+
nokogiri (>= 1.3.3)
|
43
|
+
rack (>= 1.0.0)
|
44
|
+
rack-test (>= 0.5.4)
|
45
|
+
selenium-webdriver (>= 0.0.3)
|
46
|
+
columnize (0.3.1)
|
47
|
+
culerity (0.2.12)
|
48
|
+
erubis (2.6.6)
|
49
|
+
abstract (>= 1.0.0)
|
50
|
+
factory_girl (1.3.2)
|
51
|
+
ffi (0.6.3)
|
52
|
+
rake (>= 0.8.7)
|
53
|
+
i18n (0.4.1)
|
54
|
+
json_pure (1.4.6)
|
55
|
+
linecache (0.43)
|
56
|
+
mail (2.2.5)
|
57
|
+
activesupport (>= 2.3.6)
|
58
|
+
mime-types
|
59
|
+
treetop (>= 1.4.5)
|
60
|
+
mime-types (1.16)
|
61
|
+
mocha (0.9.8)
|
62
|
+
rake
|
63
|
+
mysql (2.8.1)
|
64
|
+
nokogiri (1.4.3.1)
|
65
|
+
polyglot (0.3.1)
|
66
|
+
rack (1.2.1)
|
67
|
+
rack-mount (0.6.13)
|
68
|
+
rack (>= 1.0.0)
|
69
|
+
rack-test (0.5.4)
|
70
|
+
rack (>= 1.0)
|
71
|
+
rails (3.0.0)
|
72
|
+
actionmailer (= 3.0.0)
|
73
|
+
actionpack (= 3.0.0)
|
74
|
+
activerecord (= 3.0.0)
|
75
|
+
activeresource (= 3.0.0)
|
76
|
+
activesupport (= 3.0.0)
|
77
|
+
bundler (~> 1.0.0)
|
78
|
+
railties (= 3.0.0)
|
79
|
+
railties (3.0.0)
|
80
|
+
actionpack (= 3.0.0)
|
81
|
+
activesupport (= 3.0.0)
|
82
|
+
rake (>= 0.8.4)
|
83
|
+
thor (~> 0.14.0)
|
84
|
+
rake (0.8.7)
|
85
|
+
redgreen (1.2.2)
|
86
|
+
ruby-debug (0.10.3)
|
87
|
+
columnize (>= 0.1)
|
88
|
+
ruby-debug-base (~> 0.10.3.0)
|
89
|
+
ruby-debug-base (0.10.3)
|
90
|
+
linecache (>= 0.3)
|
91
|
+
rubyzip (0.9.4)
|
92
|
+
selenium-webdriver (0.0.28)
|
93
|
+
ffi (>= 0.6.1)
|
94
|
+
json_pure
|
95
|
+
rubyzip
|
96
|
+
shoulda (2.11.3)
|
97
|
+
thor (0.14.0)
|
98
|
+
treetop (1.4.8)
|
99
|
+
polyglot (>= 0.3.1)
|
100
|
+
tzinfo (0.3.23)
|
101
|
+
|
102
|
+
PLATFORMS
|
103
|
+
ruby
|
104
|
+
|
105
|
+
DEPENDENCIES
|
106
|
+
capybara (>= 0.3.9)
|
107
|
+
disguise!
|
108
|
+
factory_girl
|
109
|
+
mocha
|
110
|
+
mysql
|
111
|
+
rails (= 3.0.0)
|
112
|
+
redgreen
|
113
|
+
ruby-debug
|
114
|
+
shoulda
|
@@ -1,12 +1,10 @@
|
|
1
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
2
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
3
|
|
4
|
-
require
|
5
|
-
|
4
|
+
require File.expand_path('../config/application', __FILE__)
|
6
5
|
require 'rake'
|
7
6
|
require 'rake/testtask'
|
8
7
|
require 'rake/rdoctask'
|
9
8
|
|
10
|
-
|
9
|
+
RailsTest::Application.load_tasks
|
11
10
|
|
12
|
-
require 'disguise/tasks'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# If you have a Gemfile, require the gems listed there, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
8
|
+
|
9
|
+
module RailsTest
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Settings in config/environments/* take precedence over those specified here.
|
12
|
+
# Application configuration should go into files in config/initializers
|
13
|
+
# -- all .rb files in that directory are automatically loaded.
|
14
|
+
|
15
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
16
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
17
|
+
|
18
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
19
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
20
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
21
|
+
|
22
|
+
# Activate observers that should always be running.
|
23
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
24
|
+
|
25
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
26
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
27
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
28
|
+
|
29
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
30
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
|
+
# config.i18n.default_locale = :de
|
32
|
+
|
33
|
+
# JavaScript files you want as :defaults (application.js is always included).
|
34
|
+
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
35
|
+
|
36
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
37
|
+
config.encoding = "utf-8"
|
38
|
+
|
39
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
40
|
+
config.filter_parameters += [:password]
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
# Set up gems listed in the Gemfile.
|
4
|
+
gemfile = File.expand_path('../../Gemfile', __FILE__)
|
5
|
+
begin
|
6
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
7
|
+
require 'bundler'
|
8
|
+
Bundler.setup
|
9
|
+
rescue Bundler::GemNotFound => e
|
10
|
+
STDERR.puts e.message
|
11
|
+
STDERR.puts "Try running `bundle install`."
|
12
|
+
exit!
|
13
|
+
end if File.exist?(gemfile)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
RailsTest::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the webserver when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_view.debug_rjs = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
|
20
|
+
# Print deprecation notices to the Rails logger
|
21
|
+
config.active_support.deprecation = :log
|
22
|
+
|
23
|
+
# Only use best-standards-support built into browsers
|
24
|
+
config.action_dispatch.best_standards_support = :builtin
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
RailsTest::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
3
|
+
|
4
|
+
# The production environment is meant for finished, "live" apps.
|
5
|
+
# Code is not reloaded between requests
|
6
|
+
config.cache_classes = true
|
7
|
+
|
8
|
+
# Full error reports are disabled and caching is turned on
|
9
|
+
config.consider_all_requests_local = false
|
10
|
+
config.action_controller.perform_caching = true
|
11
|
+
|
12
|
+
# Specifies the header that your server uses for sending files
|
13
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
14
|
+
|
15
|
+
# For nginx:
|
16
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
17
|
+
|
18
|
+
# If you have no front-end server that supports something like X-Sendfile,
|
19
|
+
# just comment this out and Rails will serve the files
|
20
|
+
|
21
|
+
# See everything in the log (default is :info)
|
22
|
+
# config.log_level = :debug
|
23
|
+
|
24
|
+
# Use a different logger for distributed setups
|
25
|
+
# config.logger = SyslogLogger.new
|
26
|
+
|
27
|
+
# Use a different cache store in production
|
28
|
+
# config.cache_store = :mem_cache_store
|
29
|
+
|
30
|
+
# Disable Rails's static asset server
|
31
|
+
# In production, Apache or nginx will already do this
|
32
|
+
config.serve_static_assets = false
|
33
|
+
|
34
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
35
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
36
|
+
|
37
|
+
# Disable delivery errors, bad email addresses will be ignored
|
38
|
+
# config.action_mailer.raise_delivery_errors = false
|
39
|
+
|
40
|
+
# Enable threaded mode
|
41
|
+
# config.threadsafe!
|
42
|
+
|
43
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
44
|
+
# the I18n.default_locale when a translation can not be found)
|
45
|
+
config.i18n.fallbacks = true
|
46
|
+
|
47
|
+
# Send deprecation notices to registered listeners
|
48
|
+
config.active_support.deprecation = :notify
|
49
|
+
end
|