contentator 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +2 -2
- data/Rakefile +26 -0
- data/VERSION +1 -0
- data/app/controllers/application_controller.rb +35 -0
- data/app/controllers/cms/admin/admin_controller.rb +3 -0
- data/app/controllers/cms/admin/file_attachments_controller.rb +53 -0
- data/app/controllers/cms/admin/page_content_blocks_controller.rb +77 -0
- data/app/controllers/cms/admin/pages_controller.rb +68 -0
- data/app/controllers/cms/content_controller.rb +25 -0
- data/app/helpers/application_helper.rb +29 -0
- data/app/helpers/cms/admin/pages_helper.rb +34 -0
- data/app/models/file_attachment.rb +4 -0
- data/app/models/page.rb +71 -0
- data/app/models/page_content_block.rb +10 -0
- data/app/views/cms/admin/_admin_toolbar.html.haml +10 -0
- data/app/views/cms/admin/file_attachments/_form.html.haml +17 -0
- data/app/views/cms/admin/page_content_blocks/_form.html.haml +23 -0
- data/app/views/cms/admin/pages/_form.html.haml +22 -0
- data/app/views/cms/admin/pages/edit.html.haml +10 -0
- data/app/views/cms/admin/pages/index.html.haml +13 -0
- data/app/views/cms/admin/pages/new.html.haml +7 -0
- data/app/views/cms/content/_file_attachment.html.haml +9 -0
- data/app/views/cms/content/_file_attachments_container.html.haml +16 -0
- data/app/views/cms/content/_page_content_block.html.haml +14 -0
- data/app/views/cms/content/_page_content_blocks_container.html.haml +15 -0
- data/app/views/cms/content/content.html.haml +4 -0
- data/app/views/cms/content/gallery.html.haml +4 -0
- data/app/views/cms/content/home.html.haml +4 -0
- data/app/views/layouts/application.html.haml +22 -0
- data/app/views/layouts/cms/admin/application.html.haml +44 -0
- data/config/boot.rb +110 -0
- data/config/environment.rb +54 -0
- data/config/environments/development.rb +17 -0
- data/config/environments/production.rb +28 -0
- data/config/environments/test.rb +28 -0
- data/config/geminstaller.local.yml +21 -0
- data/config/geminstaller.yml +22 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/inflections.rb +10 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/new_rails_defaults.rb +19 -0
- data/config/initializers/session_store.rb +15 -0
- data/config/locales/de.yml +49 -0
- data/config/locales/en.yml +49 -0
- data/config/routes.rb +13 -0
- data/contentator.gemspec +160 -0
- data/db/migrate/20091002165818_create_pages.rb +22 -0
- data/db/migrate/20091002211930_create_home_page.rb +10 -0
- data/db/migrate/20091007222703_create_page_content_blocks.rb +22 -0
- data/db/migrate/20091029204950_create_file_attachments.rb +17 -0
- data/lib/contentator.rb +2 -0
- data/lib/generators/content/content_generator.rb +118 -0
- data/lib/generators/content/templates/container.rb +16 -0
- data/lib/generators/content/templates/controller.rb +63 -0
- data/lib/generators/content/templates/factories.rb +6 -0
- data/lib/generators/content/templates/form.rb +12 -0
- data/lib/generators/content/templates/functional_test.rb +140 -0
- data/lib/generators/content/templates/item.rb +11 -0
- data/lib/generators/content/templates/migration.rb +17 -0
- data/lib/generators/content/templates/model.rb +5 -0
- data/lib/generators/content/templates/unit_test.rb +8 -0
- data/lib/generators/content/templates/view.rb +0 -0
- data/lib/template.rb +10 -0
- data/public/404.html +30 -0
- data/public/422.html +30 -0
- data/public/500.html +30 -0
- data/public/favicon.ico +0 -0
- data/public/images/admin_standard/content-header-bg.png +0 -0
- data/public/images/admin_standard/context-arrow.png +0 -0
- data/public/images/admin_standard/context-bg.png +0 -0
- data/public/images/admin_standard/crumb-bg-current.gif +0 -0
- data/public/images/admin_standard/crumb-bg.gif +0 -0
- data/public/images/admin_standard/crumb-divide-current.gif +0 -0
- data/public/images/admin_standard/crumb-divide.gif +0 -0
- data/public/images/admin_standard/drawer-end.png +0 -0
- data/public/images/admin_standard/drawer-middle.png +0 -0
- data/public/images/admin_standard/drawer-start.png +0 -0
- data/public/images/admin_standard/form-error.png +0 -0
- data/public/images/admin_standard/input-background.gif +0 -0
- data/public/images/admin_standard/shadow-bottom.png +0 -0
- data/public/images/admin_standard/shadow-right.png +0 -0
- data/public/images/admin_standard/subnavigation-bullet-1.png +0 -0
- data/public/images/admin_standard/subnavigation-bullet-2.png +0 -0
- data/public/images/admin_standard/tab-active-cap.png +0 -0
- data/public/images/admin_standard/tab-active.png +0 -0
- data/public/images/admin_standard/tab-inactive-cap.png +0 -0
- data/public/images/admin_standard/tab-inactive.png +0 -0
- data/public/images/blank.gif +0 -0
- data/public/images/icons/add.png +0 -0
- data/public/images/icons/cancel.png +0 -0
- data/public/images/icons/delete.png +0 -0
- data/public/images/icons/edit.png +0 -0
- data/public/images/icons/folder.png +0 -0
- data/public/images/icons/move.png +0 -0
- data/public/images/rails.png +0 -0
- data/public/robots.txt +5 -0
- data/public/stylesheets/admin_standard.css +877 -0
- data/public/stylesheets/application.css +33 -0
- data/rails_generators/contentator_files/contentator_files_generator.rb +127 -0
- data/rails_generators/contentator_files/templates/application.rb +5 -0
- metadata +111 -2
@@ -0,0 +1,10 @@
|
|
1
|
+
class PageContentBlock < ActiveRecord::Base
|
2
|
+
belongs_to :page
|
3
|
+
has_many :file_attachments, :as => :owner, :dependent => :destroy, :order => :position
|
4
|
+
|
5
|
+
translates :title, :text
|
6
|
+
|
7
|
+
has_attached_file :photo, :url => "/images/:attachment/:id/:style_:basename.:extension", :path => ":rails_root/public/images/:attachment/:id/:style_:basename.:extension"
|
8
|
+
|
9
|
+
named_scope :visible, :conditions => "visible = 1"
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
#admin_toolbar
|
2
|
+
= link_to t('cms.admin.toolbar.go_to_admin'), cms_admin_root_path
|
3
|
+
|
|
4
|
+
- case @page.template_name
|
5
|
+
|
6
|
+
- when 'gallery'
|
7
|
+
= link_to_remote(t('form_global.upload'), :update => "new_file_attachment", :url => new_cms_admin_file_attachment_path(:page_id => @page.id, :owner_type => @page.class, :owner_id => @page.id), :method => :get)
|
8
|
+
- else
|
9
|
+
= link_to_remote(t('cms.admin.toolbar.add_content'), :update => "new_page_content_block", :url => new_cms_admin_page_content_block_path(:page_id => @page.id), :method => :get)
|
10
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
%iframe#form_iframe{:name => 'form_iframe', :style => 'width:0;height:0;border:0;'}
|
2
|
+
|
3
|
+
.form_container
|
4
|
+
= link_to image_tag('icons/cancel.png'), content_path(@page.path), :id => 'cancel_button'
|
5
|
+
|
6
|
+
- form_for([:cms, :admin, @file_attachment], :before => "tinyMCE.triggerSave(true,true)", :html => {:multipart => true, :target => 'form_iframe'}) do |f|
|
7
|
+
= f.hidden_field :page_id, :value => @page.id
|
8
|
+
= f.hidden_field :owner_id, :value => @page.id
|
9
|
+
= f.hidden_field :owner_type, :value => @page.class
|
10
|
+
|
11
|
+
= f.label t('cms.admin.pages.visible')
|
12
|
+
= f.check_box :visible
|
13
|
+
|
14
|
+
= f.label t('cms.admin.page_content_blocks.file_upload')
|
15
|
+
= f.file_field :file
|
16
|
+
|
17
|
+
= submit_tag t('form_global.upload')
|
@@ -0,0 +1,23 @@
|
|
1
|
+
%iframe#form_iframe{:name => 'form_iframe', :style => 'width:0;height:0;border:0;'}
|
2
|
+
|
3
|
+
= tiny_mce_init
|
4
|
+
|
5
|
+
.form_container
|
6
|
+
= link_to image_tag('icons/cancel.png'), content_path(@page.path), :id => 'cancel_button'
|
7
|
+
|
8
|
+
- form_for([:cms, :admin, @page_content_block], :before => "tinyMCE.triggerSave(true,true)", :html => {:multipart => true, :target => 'form_iframe'}) do |f|
|
9
|
+
= f.hidden_field :page_id, :value => @page.id
|
10
|
+
|
11
|
+
= f.label t('cms.admin.page_content_blocks.title')
|
12
|
+
= f.text_field :title
|
13
|
+
|
14
|
+
= f.label t('cms.admin.page_content_blocks.text')
|
15
|
+
= f.text_area :text, :class => "mceEditor"
|
16
|
+
|
17
|
+
= f.label t('cms.admin.page_content_blocks.file_upload')
|
18
|
+
= f.file_field :photo
|
19
|
+
|
20
|
+
= label @page_content_block, t('cms.admin.page_content_blocks.remove_file')
|
21
|
+
= check_box_tag 'remove_image'
|
22
|
+
|
23
|
+
= submit_tag t('form_global.update')
|
@@ -0,0 +1,22 @@
|
|
1
|
+
= f.error_messages
|
2
|
+
|
3
|
+
= f.label t('cms.admin.pages.visible')
|
4
|
+
= f.check_box :visible
|
5
|
+
|
6
|
+
= f.label t('cms.admin.pages.in_navigation')
|
7
|
+
= f.check_box :in_navigation
|
8
|
+
|
9
|
+
= f.label t('cms.admin.pages.title')
|
10
|
+
= f.text_field :title
|
11
|
+
|
12
|
+
= f.label t('cms.admin.pages.subtitle')
|
13
|
+
= f.text_field :subtitle
|
14
|
+
|
15
|
+
- unless @page == Page.home_page
|
16
|
+
= f.label t('cms.admin.pages.parent')
|
17
|
+
= f.collection_select(:parent_id, @pages, :id, :title)
|
18
|
+
|
19
|
+
= f.label t('cms.admin.pages.template')
|
20
|
+
= f.select :template_name, Page::TEMPLATES
|
21
|
+
|
22
|
+
= f.submit button
|
@@ -0,0 +1,10 @@
|
|
1
|
+
%h1= t('cms.admin.pages.update_page')
|
2
|
+
|
3
|
+
- form_for([:cms, :admin, @page]) do |f|
|
4
|
+
= render :partial => 'form', :locals => { :f => f, :button => t('form_global.update') }
|
5
|
+
|
6
|
+
- content_for :smart_navigation do
|
7
|
+
= link_to t('form_global.back'), cms_admin_pages_path
|
8
|
+
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
- content_for :smart_navigation do
|
2
|
+
= link_to t('cms.admin.pages.new_page'), new_cms_admin_page_path
|
3
|
+
|
4
|
+
%h1= t('cms.admin.pages.pages_title')
|
5
|
+
|
6
|
+
%table.list
|
7
|
+
%tr
|
8
|
+
%th= t('cms.admin.pages.title')
|
9
|
+
|
10
|
+
%tr
|
11
|
+
%td
|
12
|
+
= sortable_tree @pages, 'page'
|
13
|
+
= sortable_element 'tree_root', { :tree => true, :url => update_page_tree_cms_admin_pages_path, :overlap => :vertical, :handle => t('form_global.move') }
|
@@ -0,0 +1,9 @@
|
|
1
|
+
- id = file_attachment.id
|
2
|
+
%a{:name => id}
|
3
|
+
%div{:id => "file_attachment_#{id}", :class => 'box file_attachment'}
|
4
|
+
- if current_user
|
5
|
+
.contentator-toolbar
|
6
|
+
= delete_link("file_attachment_#{id}", "#{cms_admin_file_attachment_path(id, 'page_id' => @page.id)}")
|
7
|
+
= image_tag('icons/move.png', :class => 'sort-handle')
|
8
|
+
.clear
|
9
|
+
= image_tag file_attachment.file.url, :class => 'content_image' if file_attachment.file.file?
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#new_file_attachment
|
2
|
+
|
3
|
+
- @page.file_attachments.each do |file_attachment|
|
4
|
+
= render :partial => 'cms/content/file_attachment', :locals => {:file_attachment => file_attachment}
|
5
|
+
|
6
|
+
- if current_user
|
7
|
+
:javascript
|
8
|
+
Sortable.create('file_attachments_container', {tag: 'div', handle: 'sort-handle',
|
9
|
+
only: 'box',
|
10
|
+
onUpdate: function() {
|
11
|
+
new Ajax.Request('#{sort_cms_admin_file_attachments_path}?page_id=#{@page.id}', {
|
12
|
+
method: 'get',
|
13
|
+
parameters: Sortable.serialize('file_attachments_container', {tag: 'div', name: 'file_attachment'})
|
14
|
+
});
|
15
|
+
}
|
16
|
+
});
|
@@ -0,0 +1,14 @@
|
|
1
|
+
- id = page_content_block.id
|
2
|
+
%div{ :id => "page_content_block_#{id}", :class => "box #{page_content_block.size}" }
|
3
|
+
- if current_user
|
4
|
+
.contentator-toolbar
|
5
|
+
= delete_link("page_content_block_#{id}", cms_admin_page_content_block_path(id))
|
6
|
+
= edit_link("page_content_block_#{id}", edit_cms_admin_page_content_block_path(id))
|
7
|
+
= image_tag('icons/move.png', :class => 'sort-handle')
|
8
|
+
.box-outter
|
9
|
+
.content
|
10
|
+
%h2
|
11
|
+
%div= page_content_block.title unless page_content_block.title.blank?
|
12
|
+
= image_tag page_content_block.photo.url, :align => 'left', :class => 'content_image' if page_content_block.photo.file?
|
13
|
+
.content-inner
|
14
|
+
= page_content_block.text
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#new_page_content_block
|
2
|
+
- @page.page_content_blocks.each do |page_content_block|
|
3
|
+
= render :partial => 'cms/content/page_content_block', :locals => { :page_content_block => page_content_block }
|
4
|
+
- if current_user
|
5
|
+
:javascript
|
6
|
+
Sortable.create('page_content_blocks_container', {tag: 'div', handle: 'sort-handle',
|
7
|
+
only: 'box',
|
8
|
+
onUpdate: function() {
|
9
|
+
new Ajax.Request('#{sort_cms_admin_page_content_blocks_path}?page_id=#{@page.id}', {
|
10
|
+
method: 'get',
|
11
|
+
parameters: Sortable.serialize('page_content_blocks_container', {tag: 'div', name: 'page_content_block'})
|
12
|
+
});
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
!!!
|
2
|
+
%html{'xml:lang' => 'en', :lang => 'en', :xmlns => 'http://www.w3.org/1999/xhtml' }
|
3
|
+
%head
|
4
|
+
%title Change Me
|
5
|
+
%meta{ :content => 'text/html; charset=UTF-8', 'http-equiv' => 'content-type' }
|
6
|
+
%meta{ :content => 'en', 'http-equiv' => 'content-language' }
|
7
|
+
%meta{ :content => 'no', 'http-equiv' => 'imagetoolbar' }
|
8
|
+
%meta{ :content => 'IE=8', 'http-equiv' => 'X-UA-Compatible' }
|
9
|
+
%meta{ :content => "", :name => 'Description' }
|
10
|
+
= stylesheet_link_tag 'application'
|
11
|
+
= javascript_include_tag :defaults
|
12
|
+
= include_tiny_mce_if_needed
|
13
|
+
= yield :head
|
14
|
+
%body
|
15
|
+
#admin_toolbar_container
|
16
|
+
= render :partial => 'cms/admin/admin_toolbar' if current_user
|
17
|
+
|
18
|
+
-if flash[:notice] || flash[:error]
|
19
|
+
#flash-notice= flash[:notice] if flash[:notice]
|
20
|
+
#flash-error= flash[:error] if flash[:error]
|
21
|
+
|
22
|
+
#content= yield
|
@@ -0,0 +1,44 @@
|
|
1
|
+
!!!
|
2
|
+
%html{ "xml:lang" => "en", :lang => "en", :xmlns => "http://www.w3.org/1999/xhtml" }
|
3
|
+
%head
|
4
|
+
%title= t('cms.admin.layout.title')
|
5
|
+
%meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "content-type" }
|
6
|
+
%meta{ :content => "en", "http-equiv" => "content-language" }
|
7
|
+
%meta{ :content => "no", "http-equiv" => "imagetoolbar" }
|
8
|
+
= stylesheet_link_tag 'admin_standard'
|
9
|
+
= javascript_include_tag :defaults
|
10
|
+
%body
|
11
|
+
#body
|
12
|
+
#body_wrapper
|
13
|
+
#logo
|
14
|
+
/ %img{ :src => "/images/admin_standard/logo.png" }
|
15
|
+
#utility
|
16
|
+
#settings
|
17
|
+
%span= "#{t('cms.admin.layout.welcome')} #{@current_user.nil? ? '' : @current_user.login} -"
|
18
|
+
/ = link_to t('cms.admin.layout.logout'), '/logout'
|
19
|
+
|
|
20
|
+
= link_to 'Home', content_path
|
21
|
+
#body_container
|
22
|
+
#context_wrapper
|
23
|
+
#context_container
|
24
|
+
/ - @content_for_subnavigation = tabbed_subnavigation_for :admin, :title => 'Management'
|
25
|
+
/ - if @content_for_context_navigation || @content_for_subnavigation
|
26
|
+
/ #subnavigation
|
27
|
+
/ .content= yield :subnavigation
|
28
|
+
/ - if @content_for_context_navigation
|
29
|
+
/ #context
|
30
|
+
/ #context_arrow
|
31
|
+
/ = yield :context_navigation
|
32
|
+
/ #context_container_end
|
33
|
+
#content_container
|
34
|
+
/ = tabbed_navigation :admin if current_user
|
35
|
+
#content_shadow_right
|
36
|
+
.content
|
37
|
+
/ - if logged_in?
|
38
|
+
/ = breadcrumbs ['Admin', '/admin'], @current_crumb || nil
|
39
|
+
#smart_navigation= yield :smart_navigation
|
40
|
+
#controller_content
|
41
|
+
= flash_messages
|
42
|
+
~ yield
|
43
|
+
.clear-right <br clear="all"/>
|
44
|
+
#footer= "#{t('cms.admin.layout.copyright')} #{Time.now.strftime('%Y')}"
|
data/config/boot.rb
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
# Don't change this file!
|
2
|
+
# Configure your app in config/environment.rb and config/environments/*.rb
|
3
|
+
|
4
|
+
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
5
|
+
|
6
|
+
module Rails
|
7
|
+
class << self
|
8
|
+
def boot!
|
9
|
+
unless booted?
|
10
|
+
preinitialize
|
11
|
+
pick_boot.run
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def booted?
|
16
|
+
defined? Rails::Initializer
|
17
|
+
end
|
18
|
+
|
19
|
+
def pick_boot
|
20
|
+
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
+
end
|
22
|
+
|
23
|
+
def vendor_rails?
|
24
|
+
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
+
end
|
26
|
+
|
27
|
+
def preinitialize
|
28
|
+
load(preinitializer_path) if File.exist?(preinitializer_path)
|
29
|
+
end
|
30
|
+
|
31
|
+
def preinitializer_path
|
32
|
+
"#{RAILS_ROOT}/config/preinitializer.rb"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class Boot
|
37
|
+
def run
|
38
|
+
load_initializer
|
39
|
+
Rails::Initializer.run(:set_load_path)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class VendorBoot < Boot
|
44
|
+
def load_initializer
|
45
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
|
+
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
+
Rails::GemDependency.add_frozen_gem_path
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class GemBoot < Boot
|
52
|
+
def load_initializer
|
53
|
+
self.class.load_rubygems
|
54
|
+
load_rails_gem
|
55
|
+
require 'initializer'
|
56
|
+
end
|
57
|
+
|
58
|
+
def load_rails_gem
|
59
|
+
if version = self.class.gem_version
|
60
|
+
gem 'rails', version
|
61
|
+
else
|
62
|
+
gem 'rails'
|
63
|
+
end
|
64
|
+
rescue Gem::LoadError => load_error
|
65
|
+
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
66
|
+
exit 1
|
67
|
+
end
|
68
|
+
|
69
|
+
class << self
|
70
|
+
def rubygems_version
|
71
|
+
Gem::RubyGemsVersion rescue nil
|
72
|
+
end
|
73
|
+
|
74
|
+
def gem_version
|
75
|
+
if defined? RAILS_GEM_VERSION
|
76
|
+
RAILS_GEM_VERSION
|
77
|
+
elsif ENV.include?('RAILS_GEM_VERSION')
|
78
|
+
ENV['RAILS_GEM_VERSION']
|
79
|
+
else
|
80
|
+
parse_gem_version(read_environment_rb)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def load_rubygems
|
85
|
+
min_version = '1.3.2'
|
86
|
+
require 'rubygems'
|
87
|
+
unless rubygems_version >= min_version
|
88
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
89
|
+
exit 1
|
90
|
+
end
|
91
|
+
|
92
|
+
rescue LoadError
|
93
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
94
|
+
exit 1
|
95
|
+
end
|
96
|
+
|
97
|
+
def parse_gem_version(text)
|
98
|
+
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
99
|
+
end
|
100
|
+
|
101
|
+
private
|
102
|
+
def read_environment_rb
|
103
|
+
File.read("#{RAILS_ROOT}/config/environment.rb")
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# All that for this:
|
110
|
+
Rails.boot!
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file
|
2
|
+
|
3
|
+
# Specifies gem version of Rails to use when vendor/rails is not present
|
4
|
+
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
|
5
|
+
|
6
|
+
# Bootstrap the Rails environment, frameworks, and default configuration
|
7
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
8
|
+
|
9
|
+
# We always need the test_process to get the uploaded file helpers
|
10
|
+
require 'action_controller'
|
11
|
+
require 'action_controller/test_process'
|
12
|
+
|
13
|
+
def load_geminstaller_config(path,config)
|
14
|
+
geminstaller_config = YAML.load_file(path)
|
15
|
+
geminstaller_config["gems"].each do |gem_def|
|
16
|
+
config.gem gem_def["name"], gem_def.symbolize_keys!
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
Rails::Initializer.run do |config|
|
21
|
+
load_geminstaller_config(File.join(Rails.root,'config','geminstaller.yml'),config)
|
22
|
+
|
23
|
+
# Settings in config/environments/* take precedence over those specified here.
|
24
|
+
# Application configuration should go into files in config/initializers
|
25
|
+
# -- all .rb files in that directory are automatically loaded.
|
26
|
+
|
27
|
+
# Add additional load paths for your own custom dirs
|
28
|
+
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
29
|
+
|
30
|
+
# Specify gems that this application depends on and have them installed with rake gems:install
|
31
|
+
# config.gem "bj"
|
32
|
+
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
|
33
|
+
# config.gem "sqlite3-ruby", :lib => "sqlite3"
|
34
|
+
# config.gem "aws-s3", :lib => "aws/s3"
|
35
|
+
|
36
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
37
|
+
# :all can be used as a placeholder for all plugins not explicitly named
|
38
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
39
|
+
|
40
|
+
# Skip frameworks you're not going to use. To use Rails without a database,
|
41
|
+
# you must remove the Active Record framework.
|
42
|
+
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
|
43
|
+
|
44
|
+
# Activate observers that should always be running
|
45
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
46
|
+
|
47
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
48
|
+
# Run "rake -D time" for a list of tasks for finding time zone names.
|
49
|
+
config.time_zone = 'UTC'
|
50
|
+
|
51
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
52
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
|
53
|
+
# config.i18n.default_locale = :de
|
54
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# In the development environment your application's code is reloaded on
|
4
|
+
# every request. This slows down response time but is perfect for development
|
5
|
+
# since you don't have to restart the webserver when you make code changes.
|
6
|
+
config.cache_classes = false
|
7
|
+
|
8
|
+
# Log error messages when you accidentally call methods on nil.
|
9
|
+
config.whiny_nils = true
|
10
|
+
|
11
|
+
# Show full error reports and disable caching
|
12
|
+
config.action_controller.consider_all_requests_local = true
|
13
|
+
config.action_view.debug_rjs = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|