trusty-cms 4.1.8 → 4.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +70 -73
  3. data/INSTALL.md +2 -0
  4. data/config/environments/development.rb +2 -0
  5. data/lib/generators/extension/USAGE +30 -0
  6. data/lib/generators/extension/extension_generator.rb +97 -0
  7. data/lib/generators/extension/templates/README.md +6 -0
  8. data/lib/generators/extension/templates/RSpecRakefile +109 -0
  9. data/lib/generators/extension/templates/Rakefile +25 -0
  10. data/lib/generators/extension/templates/cucumber.yml +1 -0
  11. data/lib/generators/extension/templates/cucumber_env.rb +11 -0
  12. data/lib/generators/extension/templates/cucumber_paths.rb +22 -0
  13. data/lib/generators/extension/templates/en.yml +3 -0
  14. data/lib/generators/extension/templates/extension.rb +21 -0
  15. data/lib/generators/extension/templates/functional_test.rb +15 -0
  16. data/lib/generators/extension/templates/gemspec.rb +29 -0
  17. data/lib/generators/extension/templates/lib.rb +8 -0
  18. data/lib/generators/extension/templates/migration.rb +9 -0
  19. data/lib/generators/extension/templates/radiant_config.rb +3 -0
  20. data/lib/generators/extension/templates/routes.rb +5 -0
  21. data/lib/generators/extension/templates/spec.opts +6 -0
  22. data/lib/generators/extension/templates/spec_helper.rb +42 -0
  23. data/lib/generators/extension/templates/tasks.rake +47 -0
  24. data/lib/generators/extension/templates/test_helper.rb +26 -0
  25. data/lib/generators/extension_controller/USAGE +36 -0
  26. data/lib/generators/extension_controller/extension_controller_generator.rb +84 -0
  27. data/lib/generators/extension_controller/templates/controller.rb +10 -0
  28. data/lib/generators/extension_controller/templates/controller_spec.rb +23 -0
  29. data/lib/generators/extension_controller/templates/functional_test.rb +11 -0
  30. data/lib/generators/extension_controller/templates/helper.rb +2 -0
  31. data/lib/generators/extension_controller/templates/helper_spec.rb +11 -0
  32. data/lib/generators/extension_controller/templates/helper_test.rb +4 -0
  33. data/lib/generators/extension_controller/templates/view.html.erb +2 -0
  34. data/lib/generators/extension_controller/templates/view_spec.rb +12 -0
  35. data/lib/generators/extension_mailer/USAGE +17 -0
  36. data/lib/generators/extension_mailer/extension_mailer_generator.rb +68 -0
  37. data/lib/generators/extension_mailer/templates/fixture.erb +3 -0
  38. data/lib/generators/extension_mailer/templates/mailer.rb +15 -0
  39. data/lib/generators/extension_mailer/templates/unit_test.rb +21 -0
  40. data/lib/generators/extension_mailer/templates/view.erb +3 -0
  41. data/lib/generators/extension_migration/USAGE +34 -0
  42. data/lib/generators/extension_migration/extension_migration_generator.rb +25 -0
  43. data/lib/generators/extension_migration/templates/migration.rb +11 -0
  44. data/lib/generators/extension_model/USAGE +35 -0
  45. data/lib/generators/extension_model/extension_model_generator.rb +68 -0
  46. data/lib/generators/extension_model/templates/fixtures.yml +19 -0
  47. data/lib/generators/extension_model/templates/migration.rb +16 -0
  48. data/lib/generators/extension_model/templates/model.rb +2 -0
  49. data/lib/generators/extension_model/templates/model_spec.rb +11 -0
  50. data/lib/generators/extension_model/templates/unit_test.rb +8 -0
  51. data/lib/generators/generator_base_extension.rb +18 -0
  52. data/lib/generators/instance/instance_generator.rb +148 -0
  53. data/lib/generators/instance/templates/databases/db2.yml +40 -0
  54. data/lib/generators/instance/templates/databases/mysql.yml +47 -0
  55. data/lib/generators/instance/templates/databases/postgresql.yml +44 -0
  56. data/lib/generators/instance/templates/databases/sqlite3.yml +16 -0
  57. data/lib/generators/instance/templates/databases/sqlserver.yml +21 -0
  58. data/lib/generators/instance/templates/instance_boot.rb +122 -0
  59. data/lib/generators/instance/templates/instance_config.ru +2 -0
  60. data/lib/generators/instance/templates/instance_environment.rb +93 -0
  61. data/lib/generators/instance/templates/instance_gemfile +78 -0
  62. data/lib/generators/instance/templates/instance_generate +6 -0
  63. data/lib/generators/instance/templates/instance_radiant_config.rb +16 -0
  64. data/lib/generators/instance/templates/instance_rakefile +3 -0
  65. data/lib/generators/instance/templates/instance_routes.rb +1 -0
  66. data/lib/generators/language_extension/USAGE +27 -0
  67. data/lib/generators/language_extension/language_extension_generator.rb +71 -0
  68. data/lib/generators/language_extension/templates/README +3 -0
  69. data/lib/generators/language_extension/templates/RSpecRakefile +123 -0
  70. data/lib/generators/language_extension/templates/Rakefile +25 -0
  71. data/lib/generators/language_extension/templates/available_tags.yml +553 -0
  72. data/lib/generators/language_extension/templates/cucumber.yml +1 -0
  73. data/lib/generators/language_extension/templates/cucumber_env.rb +16 -0
  74. data/lib/generators/language_extension/templates/cucumber_paths.rb +14 -0
  75. data/lib/generators/language_extension/templates/extension.rb +12 -0
  76. data/lib/generators/language_extension/templates/functional_test.rb +15 -0
  77. data/lib/generators/language_extension/templates/gemspec.rb +24 -0
  78. data/lib/generators/language_extension/templates/lang.yml +181 -0
  79. data/lib/generators/language_extension/templates/lib.rb +8 -0
  80. data/lib/generators/language_extension/templates/spec.opts +6 -0
  81. data/lib/generators/language_extension/templates/spec_helper.rb +36 -0
  82. data/lib/generators/language_extension/templates/tasks.rake +28 -0
  83. data/lib/generators/language_extension/templates/test_helper.rb +26 -0
  84. data/lib/generators/trusty_cms/USAGE +8 -0
  85. data/lib/generators/trusty_cms/templates/Rakefile.erb +7 -0
  86. data/lib/generators/trusty_cms/templates/application.rb.erb +149 -0
  87. data/lib/generators/trusty_cms/templates/boot.rb.erb +9 -0
  88. data/lib/generators/trusty_cms/templates/config.ru.erb +4 -0
  89. data/lib/generators/trusty_cms/templates/database.yml.erb +28 -0
  90. data/lib/generators/trusty_cms/templates/environment.rb.erb +5 -0
  91. data/lib/generators/trusty_cms/templates/environments/development.rb.erb +24 -0
  92. data/lib/generators/trusty_cms/templates/environments/production.rb.erb +26 -0
  93. data/lib/generators/trusty_cms/templates/environments/test.rb.erb +35 -0
  94. data/lib/generators/trusty_cms/templates/initializers/secret_token.rb.erb +13 -0
  95. data/lib/generators/trusty_cms/templates/initializers/session_store.rb.erb +8 -0
  96. data/lib/generators/trusty_cms/templates/initializers/trusty_cms_config.rb.erb +16 -0
  97. data/lib/generators/trusty_cms/templates/preinitializer.rb.erb +18 -0
  98. data/lib/generators/trusty_cms/templates/routes.rb.erb +0 -0
  99. data/lib/generators/trusty_cms/trusty_cms_generator.rb +32 -0
  100. data/lib/trusty_cms.rb +1 -1
  101. data/lib/trusty_cms/setup.rb +7 -7
  102. metadata +131 -60
  103. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/core.js +0 -126
  104. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/index.js +0 -4
  105. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/map.js +0 -56
  106. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/seq.js +0 -43
  107. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/failsafe/string.js +0 -28
  108. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/index.js +0 -36
  109. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/json.js +0 -76
  110. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/options.js +0 -23
  111. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/binary.js +0 -87
  112. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/index.js +0 -157
  113. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/omap.js +0 -142
  114. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/pairs.js +0 -81
  115. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/set.js +0 -114
  116. data/spec/spec/dummy/node_modules/yaml/browser/dist/tags/yaml-1.1/timestamp.js +0 -97
  117. data/spec/spec/dummy/node_modules/yaml/dist/tags/core.js +0 -114
  118. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/index.js +0 -17
  119. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/map.js +0 -37
  120. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/seq.js +0 -34
  121. data/spec/spec/dummy/node_modules/yaml/dist/tags/failsafe/string.js +0 -40
  122. data/spec/spec/dummy/node_modules/yaml/dist/tags/index.js +0 -62
  123. data/spec/spec/dummy/node_modules/yaml/dist/tags/json.js +0 -60
  124. data/spec/spec/dummy/node_modules/yaml/dist/tags/options.js +0 -35
  125. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/binary.js +0 -97
  126. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/index.js +0 -131
  127. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/omap.js +0 -105
  128. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/pairs.js +0 -80
  129. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/set.js +0 -91
  130. data/spec/spec/dummy/node_modules/yaml/dist/tags/yaml-1.1/timestamp.js +0 -93
@@ -0,0 +1 @@
1
+ default: --format progress features --tags ~@proposed,~@in_progress
@@ -0,0 +1,16 @@
1
+ # Sets up the Rails environment for Cucumber
2
+ ENV["Rails.env"] = "test"
3
+ # Extension root
4
+ extension_env = File.expand_path(File.dirname(__FILE__) + '/../../../../../config/environment')
5
+ require extension_env+'.rb'
6
+
7
+ Dir.glob(File.join(TRUSTY_CMS_ROOT, "features", "**", "*.rb")).each {|step| require step}
8
+
9
+ Cucumber::Rails::World.class_eval do
10
+ include Dataset
11
+ datasets_directory "#{TRUSTY_CMS_ROOT}/spec/datasets"
12
+ Dataset::Resolver.default = Dataset::DirectoryResolver.new("#{TRUSTY_CMS_ROOT}/spec/datasets", File.dirname(__FILE__) + '/../../spec/datasets', File.dirname(__FILE__) + '/../datasets')
13
+ self.datasets_database_dump_path = "#{Rails.root}/tmp/dataset"
14
+
15
+ # dataset :<%= file_name %>
16
+ end
@@ -0,0 +1,14 @@
1
+ def path_to(page_name)
2
+ case page_name
3
+
4
+ when /the homepage/i
5
+ root_path
6
+
7
+ when /login/i
8
+ login_path
9
+ # Add more page name => path mappings here
10
+
11
+ else
12
+ raise "Can't find mapping from \"#{page_name}\" to a path."
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # Uncomment this if you reference any of your controllers in activate
2
+ # require_dependency "application_controller"
3
+ require "radiant-<%= file_name %>_language_pack-extension"
4
+
5
+ class <%= class_name %> < TrustyCms::Extension
6
+ version TrustyCms<%= class_name %>::VERSION
7
+ description TrustyCms<%= class_name %>::DESCRIPTION
8
+ url TrustyCms<%= class_name %>::URL
9
+
10
+ def activate
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class <%= class_name %>Test < Test::Unit::TestCase
4
+
5
+ # Replace this with your real tests.
6
+ def test_this_extension
7
+ flunk
8
+ end
9
+
10
+ def test_initialization
11
+ assert_equal File.join(File.expand_path(Rails.root), 'vendor', 'extensions', '<%= file_name %>'), <%= class_name %>.root
12
+ assert_equal '<%= extension_name %>', <%= class_name %>.extension_name
13
+ end
14
+
15
+ end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "radiant-<%= file_name %>_language_pack-extension"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "radiant-<%= file_name %>_language_pack-extension"
7
+ s.version = TrustyCms<%= class_name %>::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = TrustyCms<%= class_name %>::AUTHORS
10
+ s.email = TrustyCms<%= class_name %>::EMAIL
11
+ s.homepage = TrustyCms<%= class_name %>::URL
12
+ s.summary = TrustyCms<%= class_name %>::SUMMARY
13
+ s.description = TrustyCms<%= class_name %>::DESCRIPTION
14
+
15
+ ignores = if File.exist?('.gitignore')
16
+ File.read('.gitignore').split("\n").inject([]) {|a,p| a + Dir[p] }
17
+ else
18
+ []
19
+ end
20
+ s.files = Dir['**/*'] - ignores
21
+ s.test_files = Dir['test/**/*','spec/**/*','features/**/*'] - ignores
22
+ # s.executables = Dir['bin/*'] - ignores
23
+ s.require_paths = ["lib"]
24
+ end
@@ -0,0 +1,181 @@
1
+ ---
2
+ <%= localization_name %>:
3
+ account: 'Account'
4
+ activerecord:
5
+ errors:
6
+ messages:
7
+ blank: 'this must not be blank' # required
8
+ invalid: 'this does not match the expected format' #invalid_format
9
+ not_a_number: 'this must be a number' # must be number
10
+ taken: 'this name is already in use' # name_in_use
11
+ too_long: 'this must not be longer than %{count} characters' # character_limit
12
+ too_short: 'this must be at least %{count} characters long' # character_minimum
13
+ models:
14
+ page:
15
+ attributes:
16
+ slug:
17
+ taken: 'slug already in use for child of parent' # slug_in_use
18
+ user:
19
+ attributes:
20
+ email:
21
+ invalid: 'invalid e-mail address' # invalid_email
22
+ login:
23
+ taken: 'login already in use' # login already in use
24
+ password:
25
+ confirmation: 'must match confirmation' # password_confirmation
26
+ add_child: 'Add Child'
27
+ add_part: 'Add Part'
28
+ add_tab: 'Add Tab'
29
+ admin: 'Administrator'
30
+ available_tags: 'Available Tags'
31
+ available_tags_for: 'Available Tags for'
32
+ body: 'Body'
33
+ breadcrumb: 'Breadcrumb'
34
+ buttons:
35
+ create: 'Create %{name}'
36
+ save_and_continue: 'Save and Continue Editing'
37
+ save_changes: 'Save Changes'
38
+ cancel: 'Cancel'
39
+ change: 'Change'
40
+ close: 'Close'
41
+ content: 'Content'
42
+ content_type: 'Content&#8209;Type'
43
+ creating_status: 'Creating %{model}&#8230;'
44
+ date:
45
+ abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
46
+ abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
47
+ day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
48
+ formats:
49
+ default: "%Y-%m-%d"
50
+ long: "%B %e, %Y"
51
+ only_day: "%e"
52
+ short: "%e %b"
53
+ month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
54
+ order: [ :year, :month, :day ]
55
+ delete_layout: 'Delete Layout'
56
+ delete_pages: 'Delete %{pages}'
57
+ delete_snippet: 'Delete Snippet'
58
+ delete_user: 'Delete User'
59
+ description: 'Description'
60
+ design: 'Design'
61
+ designer: 'Designer'
62
+ draft: 'Draft'
63
+ edit_layout: 'Edit Layout'
64
+ edit_page: 'Edit Page'
65
+ edit_snippet: 'Edit Snippet'
66
+ edit_user: 'Edit User'
67
+ email_address: 'E-mail Address'
68
+ extension: 'Extension'
69
+ extensions: 'Extensions'
70
+ filter: 'Filter'
71
+ hidden: 'Hidden'
72
+ hide: 'Hide'
73
+ keywords: 'Keywords'
74
+ language: 'Language'
75
+ layout: 'Layout'
76
+ layouts: 'Layouts'
77
+ log_out: 'Logout'
78
+ logged_in_as: 'Logged in as'
79
+ login: 'Login'
80
+ modify: 'Modify'
81
+ more: 'More'
82
+ name: 'Name'
83
+ new_layout: 'New Layout'
84
+ new_page: 'New Page'
85
+ new_password: 'New Password'
86
+ new_snippet: 'New Snippet'
87
+ new_user: 'New User'
88
+ no_pages: 'No Pages'
89
+ notes: 'Notes'
90
+ optional: 'Optional'
91
+ or: 'or'
92
+ page: 'Page'
93
+ page_page: 'Page Part'
94
+ page_title: 'Page Title'
95
+ page_type: 'Page Type'
96
+ pages: 'Pages'
97
+ pages_controller:
98
+ removed_many: "The pages were successfully removed from the site."
99
+ removed_one: "The page was successfully removed from the site."
100
+ saved: "Your page has been saved below."
101
+ password: 'Password'
102
+ password_confirmation: 'Confirm New Password'
103
+ personal: 'Personal'
104
+ personal_preferences: 'Personal Preferences'
105
+ please_login: 'Please Login'
106
+ powered_by: 'Powered by'
107
+ preferences: 'Preferences'
108
+ preferences_controller:
109
+ error_updating: 'There was an error updating your preferences.'
110
+ updated: 'Your preferences have been updated.'
111
+ published: 'Published'
112
+ published_at: 'Published at'
113
+ reference: 'Reference'
114
+ remember_me: 'Remember me'
115
+ remove: 'Remove'
116
+ remove_layout: 'Remove Layout'
117
+ remove_page: 'Remove Page'
118
+ remove_pages: 'Remove %{pages}'
119
+ remove_tab: 'Remove Tab'
120
+ remove_user: 'Remove user'
121
+ required: 'Required'
122
+ resource_controller:
123
+ not_found: "%{humanized_model_name} could not be found."
124
+ removed: "%{humanized_model_name} has been deleted."
125
+ saved: "%{humanized_model_name} saved below."
126
+ update_conflict: "%{humanized_model_name} has been modified since it was last loaded. Changes cannot be saved without potentially losing data."
127
+ validation_errors: "Validation errors occurred while processing this form. Please take a moment to review the form and correct any input errors before continuing."
128
+ reviewed: 'Reviewed'
129
+ roles: 'Roles'
130
+ saving_changes: Saving Changes
131
+ saving_preferences: Saving preferences
132
+ search_tags: 'Search Tags:'
133
+ select:
134
+ inherit: '<inherit>'
135
+ none: '<none>'
136
+ normal: '<normal>'
137
+ settings: 'Settings'
138
+ slug: 'Slug'
139
+ snippet: 'Snippet'
140
+ snippets: 'Snippets'
141
+ status: 'Status'
142
+ # Warnings and info text:
143
+ text:
144
+ layouts:
145
+ remove_warning: 'Are you sure you want to <strong class="warning">permanently remove</strong> the following layout?'
146
+ pages:
147
+ remove_warning: 'Are you sure you want to <strong class="warning">permanently remove</strong> the following %{pages}?'
148
+ snippets:
149
+ remove_warning: 'Are you sure you want to <strong class="warning">permanently remove</strong> the following snippet?'
150
+ users:
151
+ remove_warning: 'Are you sure you want to <strong class="warning">permanently remove</strong> the following user?'
152
+ this_file_language: "<%= file_name.capitalize %>"
153
+ time:
154
+ am: 'am'
155
+ formats:
156
+ datetime:
157
+ formats:
158
+ default: "%Y-%m-%dT%H:%M:%S%Z"
159
+ default: "%a %b %d %H:%M:%S %Z %Y"
160
+ long: "%B %d, %Y %H:%M"
161
+ only_second: "%S"
162
+ short: "%d %b %H:%M"
163
+ time: "%H:%M"
164
+ timestamp: "%I:%M %p on %B %d, %Y"
165
+ pm: 'pm'
166
+ timestamp:
167
+ at: 'at'
168
+ by: 'by'
169
+ last_updated: 'Last Updated'
170
+ user: 'User'
171
+ username: 'Username'
172
+ username_or_email: 'Username or E-mail Address'
173
+ users: 'Users'
174
+ users_controller:
175
+ cannot_delete_self: 'You cannot delete yourself.'
176
+ version: 'Version'
177
+ view_site: 'View Site'
178
+ website: 'Website'
179
+ welcome_controller:
180
+ invalid_user: 'Invalid username, e-mail address, or password.'
181
+ logged_out: 'You are now logged out.'
@@ -0,0 +1,8 @@
1
+ module TrustyCms<%= class_name %>
2
+ VERSION = "1.0.0"
3
+ SUMMARY = "<%= localization_name.capitalize %> language pack for TrustyCms CMS"
4
+ DESCRIPTION = "Adds <%= localization_name.capitalize %> translations to the TrustyCms CMS interface."
5
+ URL = "<%= homepage %>"
6
+ AUTHORS = ["<%= author_name %>"]
7
+ EMAIL = ["<%= author_email %>"]
8
+ end
@@ -0,0 +1,6 @@
1
+ --colour
2
+ --format
3
+ progress
4
+ --loadby
5
+ mtime
6
+ --reverse
@@ -0,0 +1,36 @@
1
+ unless defined? TRUSTY_CMS_ROOT
2
+ ENV["Rails.env"] = "test"
3
+ case
4
+ when ENV["RADIANT_ENV_FILE"]
5
+ require ENV["RADIANT_ENV_FILE"]
6
+ when File.dirname(__FILE__) =~ %r{vendor/trusty_cms/vendor/extensions}
7
+ require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
8
+ else
9
+ require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
10
+ end
11
+ end
12
+ require "#{TRUSTY_CMS_ROOT}/spec/spec_helper"
13
+
14
+ Dataset::Resolver.default << (File.dirname(__FILE__) + "/datasets")
15
+
16
+ if File.directory?(File.dirname(__FILE__) + "/matchers")
17
+ Dir[File.dirname(__FILE__) + "/matchers/*.rb"].each {|file| require file }
18
+ end
19
+
20
+ Spec::Runner.configure do |config|
21
+ # config.use_transactional_fixtures = true
22
+ # config.use_instantiated_fixtures = false
23
+ # config.fixture_path = Rails.root + '/spec/fixtures'
24
+
25
+ # You can declare fixtures for each behaviour like this:
26
+ # describe "...." do
27
+ # fixtures :table_a, :table_b
28
+ #
29
+ # Alternatively, if you prefer to declare them only once, you can
30
+ # do so here, like so ...
31
+ #
32
+ # config.global_fixtures = :table_a, :table_b
33
+ #
34
+ # If you declare global fixtures, be aware that they will be declared
35
+ # for all of your examples, even those that don't use them.
36
+ end
@@ -0,0 +1,28 @@
1
+ namespace :radiant do
2
+ namespace :extensions do
3
+ namespace :<%= file_name %> do
4
+
5
+ desc "Runs the migration of the <%= localization_name %> language pack"
6
+ task :migrate => :environment do
7
+ require 'trusty_cms/extension_migrator'
8
+ if ENV["VERSION"]
9
+ <%= class_name %>.migrator.migrate(ENV["VERSION"].to_i)
10
+ else
11
+ <%= class_name %>.migrator.migrate
12
+ end
13
+ end
14
+
15
+ desc "Copies public assets of the <%= localization_name %> language pack to the instance public/ directory."
16
+ task :update => :environments do
17
+ is_svn_or_dir = proc {|path| path =~ /\.svn/ || File.directory?(path) }
18
+ puts "Copying assets from <%= class_name %>"
19
+ Dir[<%= class_name %>.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file|
20
+ path = file.sub(<%= class_name %>.root, '')
21
+ directory = File.dirname(path)
22
+ mkdir_p Rails.root + directory, :verbose => false
23
+ cp file, Rails.root + path, :verbose => false
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,26 @@
1
+ require 'test/unit'
2
+ # Load the environment
3
+ unless defined? TRUSTY_CMS_ROOT
4
+ ENV["Rails.env"] = "test"
5
+ case
6
+ when ENV["RADIANT_ENV_FILE"]
7
+ require ENV["RADIANT_ENV_FILE"]
8
+ when File.dirname(__FILE__) =~ %r{vendor/trusty_cms/vendor/extensions}
9
+ require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
10
+ else
11
+ require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
12
+ end
13
+ end
14
+ require "#{TRUSTY_CMS_ROOT}/test/test_helper"
15
+
16
+ class Test::Unit::TestCase
17
+
18
+ # Include a helper to make testing Radius tags easier
19
+ test_helper :extension_tags
20
+
21
+ # Add the fixture directory to the fixture path
22
+ self.fixture_path << File.dirname(__FILE__) + "/fixtures"
23
+
24
+ # Add more helper methods to be used by all extension tests here...
25
+
26
+ end
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Generates a new Trusty CMS project.
3
+
4
+ Example:
5
+ rails generate trusty_cms [PROJECT NAME]
6
+
7
+ This will create:
8
+ A new Trusty CMS site with the name given in [PROJECT NAME]
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+ STDOUT.sync = true
7
+ TrustyCms::Application.load_tasks
@@ -0,0 +1,149 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+ require 'acts_as_tree'
5
+ require 'trusty_cms'
6
+ require 'ckeditor'
7
+ require 'radius'
8
+ require 'trusty_cms/extension_loader'
9
+ require 'trusty_cms/initializer'
10
+ require 'string_extensions/string_extensions'
11
+ require 'active_record_extensions/active_record_extensions'
12
+ require 'configuration_extensions/configuration_extensions'
13
+ require 'rack/cache'
14
+
15
+ if defined?(Bundler)
16
+ # If you precompile assets before deploying to production, use this line
17
+ Bundler.require(*Rails.groups(:assets => %w(development test)))
18
+ # If you want your assets lazily compiled in production, use this line
19
+ # Bundler.require(:default, :assets, Rails.env)
20
+ end
21
+
22
+ module TrustyCms
23
+ class Application < Rails::Application
24
+
25
+ attr_accessor :captcha_public_key, :captcha_private_key
26
+
27
+ include TrustyCms::Initializer
28
+
29
+ config.autoload_paths += %W(#{TRUSTY_CMS_ROOT}/lib)
30
+
31
+ # Initialize extension paths
32
+ config.initialize_extension_paths
33
+ extension_loader = ExtensionLoader.instance {|l| l.initializer = self }
34
+ extension_loader.paths(:load).reverse_each do |path, value|
35
+ config.autoload_paths.unshift path
36
+ $LOAD_PATH.unshift path
37
+ end
38
+ # config.add_plugin_paths(extension_loader.paths(:plugin))
39
+ radiant_locale_paths = Dir[File.join(TRUSTY_CMS_ROOT, 'config', 'locales', '*.{rb,yml}')]
40
+ config.i18n.load_path = radiant_locale_paths + extension_loader.paths(:locale)
41
+
42
+ config.encoding = 'utf-8'
43
+ # Skip frameworks you're not going to use (only works if using vendor/rails).
44
+ # To use Rails without a database, you must remove the Active Record framework
45
+ # config.frameworks -= [ :action_mailer ]
46
+
47
+ # Only load the extensions named here, in the order given. By default all
48
+ # extensions in vendor/extensions are loaded, in alphabetical order. :all
49
+ # can be used as a placeholder for all extensions not explicitly named.
50
+
51
+ # An example of how to add extensions:
52
+ # config.extensions = [ :snippets, :clipped, :layouts, :reorder, :multi_site, :rad_social]
53
+
54
+ config.extensions = [ ]
55
+
56
+ # By default, only English translations are loaded. Remove any of these from
57
+ # the list below if you'd like to provide any of the additional options
58
+ # config.ignore_extensions []
59
+
60
+ config.captcha_public_key = "6LcbvwsAAAAAACQjq3ZNqqBuDIHUR6gUthjhT9_Z"
61
+ config.captcha_private_key = "6LcbvwsAAAAAALftkG9kwwqbPCeThnSOyn-TK8n5"
62
+
63
+ # Your secret key for verifying cookie session data integrity.
64
+ # If you change this key, all old sessions will become invalid!
65
+ # Make sure the secret is at least 30 characters and all random,
66
+ # no regular words or you'll be exposed to dictionary attacks.
67
+
68
+ # Comment out this line if you want to turn off all caching, or
69
+ # add options to modify the behavior. In the majority of deployment
70
+ # scenarios it is desirable to leave TrustyCms's cache enabled and in
71
+ # the default configuration.
72
+ #
73
+ # Additional options:
74
+ # :use_x_sendfile => true
75
+ # Turns on X-Sendfile support for Apache with mod_xsendfile or lighttpd.
76
+ # :use_x_accel_redirect => '/some/virtual/path'
77
+ # Turns on X-Accel-Redirect support for nginx. You have to provide
78
+ # a path that corresponds to a virtual location in your webserver
79
+ # configuration.
80
+ # :entitystore => "radiant:tmp/cache/entity"
81
+ # Sets the entity store type (preceding the colon) and storage
82
+ # location (following the colon, relative to Rails.root).
83
+ # We recommend you use radiant: since this will enable manual expiration.
84
+ # :metastore => "radiant:tmp/cache/meta"
85
+ # Sets the meta store type and storage location. We recommend you use
86
+ # radiant: since this will enable manual expiration and acceleration headers.
87
+
88
+
89
+ # TODO: We're not sure this is actually working, but we can't really test this until the app initializes.
90
+ config.middleware.use Rack::Cache,
91
+ :private_headers => ['Authorization'],
92
+ :entitystore => "radiant:tmp/cache/entity",
93
+ :metastore => "radiant:tmp/cache/meta",
94
+ :verbose => false,
95
+ :allow_reload => false,
96
+ :allow_revalidate => false
97
+ # TODO: There's got to be a better place for this, but in order for assets to work fornow, we need ConditionalGet
98
+ # TODO: Workaround from: https://github.com/rtomayko/rack-cache/issues/80
99
+ config.middleware.insert_before(Rack::ConditionalGet, Rack::Cache)
100
+ config.assets.enabled = true
101
+
102
+
103
+
104
+ config.filter_parameters += [:password, :password_confirmation]
105
+
106
+ # Use the database for sessions instead of the cookie-based default,
107
+ # which shouldn't be used to store highly confidential information
108
+ # (create the session table with 'rake db:sessions:create')
109
+ # config.action_controller.session_store = :cookie_store DEPRECATED
110
+
111
+ # Activate observers that should always be running
112
+ config.active_record.observers = :user_action_observer
113
+
114
+ # The internationalization framework can be changed to have another default locale (standard is :en) or more load paths.
115
+ # All files from config/locales/*.rb,yml are added automatically.
116
+ # config.i18n.load_path << Dir[File.join(Rails.root, 'my', 'locales', '*.{rb,yml}')]
117
+ # config.i18n.default_locale = :'en'
118
+
119
+ # Make Active Record use UTC-base instead of local time
120
+ config.time_zone = 'UTC'
121
+
122
+ # Set the default field error proc
123
+ config.action_view.field_error_proc = Proc.new do |html, instance|
124
+ if html !~ /label/
125
+ %{<span class="error-with-fieldxxxx">#{html} <span class="error">#{[instance.error_message].flatten.first}</span></span>}.html_safe
126
+ else
127
+ html
128
+ end
129
+ end
130
+
131
+ config.after_initialize do
132
+ extension_loader.load_extensions
133
+ extension_loader.load_extension_initalizers
134
+
135
+ #Dir["#{TRUSTY_CMS_ROOT}/config/initializers/**/*.rb"].sort.each do |initializer|
136
+ # load(initializer)
137
+ #end
138
+
139
+ extension_loader.activate_extensions # also calls initialize_views
140
+ #config.add_controller_paths(extension_loader.paths(:controller))
141
+ #config.add_eager_load_paths(extension_loader.paths(:eager_load))
142
+
143
+ # Add new inflection rules using the following format:
144
+ ActiveSupport::Inflector.inflections do |inflect|
145
+ inflect.uncountable 'config'
146
+ end
147
+ end
148
+ end
149
+ end