trusty-cms 4.1.2 → 4.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +25 -25
  4. data/Rakefile +7 -7
  5. data/app/assets/stylesheets/admin/partials/_content.scss +1 -2
  6. data/app/controllers/admin/assets_controller.rb +22 -21
  7. data/app/controllers/admin/configuration_controller.rb +9 -11
  8. data/app/controllers/admin/extensions_controller.rb +3 -3
  9. data/app/controllers/admin/layouts_controller.rb +3 -4
  10. data/app/controllers/admin/page_attachments_controller.rb +5 -5
  11. data/app/controllers/admin/page_fields_controller.rb +3 -4
  12. data/app/controllers/admin/page_parts_controller.rb +4 -5
  13. data/app/controllers/admin/pages_controller.rb +55 -56
  14. data/app/controllers/admin/references_controller.rb +1 -1
  15. data/app/controllers/admin/resource_controller.rb +132 -130
  16. data/app/controllers/admin/sites_controller.rb +4 -4
  17. data/app/controllers/admin/snippets_controller.rb +3 -4
  18. data/app/controllers/admin/users_controller.rb +16 -16
  19. data/app/controllers/application_controller.rb +47 -48
  20. data/app/controllers/site_controller.rb +51 -48
  21. data/app/controllers/social_mailer_controller.rb +13 -16
  22. data/app/helpers/admin/configuration_helper.rb +19 -20
  23. data/app/helpers/admin/layouts_helper.rb +0 -1
  24. data/app/helpers/admin/node_helper.rb +27 -24
  25. data/app/helpers/admin/pages_helper.rb +2 -2
  26. data/app/helpers/admin/preferences_helper.rb +0 -1
  27. data/app/helpers/admin/references_helper.rb +9 -10
  28. data/app/helpers/admin/regions_helper.rb +3 -3
  29. data/app/helpers/application_helper.rb +32 -33
  30. data/app/helpers/rad_social_helper.rb +8 -11
  31. data/app/helpers/scoped_helper.rb +1 -3
  32. data/app/helpers/sites_helper.rb +4 -4
  33. data/app/mailers/devise_mailer.rb +3 -4
  34. data/app/mailers/rad_social_mailer.rb +8 -8
  35. data/app/models/asset.rb +62 -63
  36. data/app/models/asset_type.rb +38 -39
  37. data/app/models/deprecated_tags.rb +3 -4
  38. data/app/models/file_not_found_page.rb +1 -3
  39. data/app/models/haml_filter.rb +1 -1
  40. data/app/models/layout.rb +4 -5
  41. data/app/models/legacy_user.rb +2 -2
  42. data/app/models/menu_renderer.rb +16 -18
  43. data/app/models/page.rb +96 -93
  44. data/app/models/page_attachment.rb +1 -2
  45. data/app/models/page_context.rb +11 -12
  46. data/app/models/page_part.rb +3 -4
  47. data/app/models/rails_page.rb +10 -12
  48. data/app/models/site.rb +22 -21
  49. data/app/models/snippet.rb +6 -8
  50. data/app/models/snippet_finder.rb +3 -3
  51. data/app/models/snippet_tags.rb +4 -4
  52. data/app/models/standard_tags.rb +258 -252
  53. data/app/models/status.rb +8 -8
  54. data/app/models/trusty_cms/config.rb +25 -25
  55. data/app/models/trusty_cms/page_response_cache_director.rb +2 -3
  56. data/app/models/user.rb +15 -14
  57. data/app/models/user_action_observer.rb +3 -3
  58. data/bin/rails +4 -4
  59. data/bin/trusty_cms +3 -5
  60. data/config.ru +1 -1
  61. data/config/application.rb +14 -15
  62. data/config/boot.rb +1 -2
  63. data/config/environment.rb +1 -1
  64. data/config/environments/production.rb +0 -1
  65. data/config/environments/test.rb +1 -2
  66. data/config/initializers/devise.rb +1 -1
  67. data/config/initializers/kraken.rb +2 -2
  68. data/config/initializers/tmp.rb +1 -1
  69. data/config/initializers/trusty_cms_config.rb +48 -48
  70. data/config/routes.rb +6 -6
  71. data/lib/active_record_extensions/active_record_extensions.rb +1 -2
  72. data/lib/annotatable.rb +3 -5
  73. data/lib/configuration_extensions/configuration_extensions.rb +1 -1
  74. data/lib/inheritable_class_attributes.rb +13 -9
  75. data/lib/login_system.rb +73 -73
  76. data/lib/method_observer.rb +13 -12
  77. data/lib/ostruct.rb +7 -10
  78. data/lib/simpleton.rb +0 -4
  79. data/lib/string_extensions/string_extensions.rb +3 -3
  80. data/lib/symbol_extensions/symbol_extensions.rb +1 -1
  81. data/lib/tasks/database.rake +28 -28
  82. data/lib/tasks/extensions.rake +18 -18
  83. data/lib/tasks/framework.rake +68 -68
  84. data/lib/tasks/radiant_config.rake +4 -4
  85. data/lib/tasks/snippets_extension_tasks.rake +11 -11
  86. data/lib/tasks/translate.rake +14 -14
  87. data/lib/tasks/upgrade_to_devise.rake +1 -1
  88. data/lib/translation_support.rb +22 -22
  89. data/lib/trusty_cms.rb +2 -2
  90. data/lib/trusty_cms/admin_ui.rb +19 -16
  91. data/lib/trusty_cms/admin_ui/region_partials.rb +4 -3
  92. data/lib/trusty_cms/admin_ui/region_set.rb +4 -5
  93. data/lib/trusty_cms/available_locales.rb +2 -4
  94. data/lib/trusty_cms/config/definition.rb +11 -8
  95. data/lib/trusty_cms/engine.rb +14 -14
  96. data/lib/trusty_cms/extension.rb +14 -16
  97. data/lib/trusty_cms/extension_loader.rb +6 -6
  98. data/lib/trusty_cms/extension_migrator.rb +42 -41
  99. data/lib/trusty_cms/extension_path.rb +20 -19
  100. data/lib/trusty_cms/initializer.rb +5 -8
  101. data/lib/trusty_cms/pagination/controller.rb +7 -10
  102. data/lib/trusty_cms/pagination/link_renderer.rb +2 -2
  103. data/lib/trusty_cms/resource_responses.rb +3 -3
  104. data/lib/trusty_cms/setup.rb +130 -132
  105. data/lib/trusty_cms/taggable.rb +19 -22
  106. data/lib/trusty_cms/task_support.rb +9 -6
  107. data/public/dispatch.fcgi +1 -1
  108. data/public/dispatch.rb +2 -2
  109. data/script/extension +1 -1
  110. data/script/rails +2 -2
  111. data/trusty_cms.gemspec +23 -23
  112. metadata +32 -32
@@ -8,15 +8,17 @@ module TrustyCms
8
8
  ActiveRecord::Base.establish_connection(env_connection)
9
9
  end
10
10
  end
11
+
11
12
  def config_export(path = "#{Rails.root}/config/trusty_config.yml")
12
- self.establish_connection
13
+ establish_connection
13
14
  FileUtils.mkdir_p(File.dirname(path))
14
- if File.open(File.expand_path(path), 'w') { |f| YAML.dump(TrustyCms::Config.to_hash.to_yaml,f) }
15
+ if File.open(File.expand_path(path), 'w') { |f| YAML.dump(TrustyCms::Config.to_hash.to_yaml, f) }
15
16
  puts "TrustyCms::Config saved to #{path}"
16
17
  end
17
18
  end
19
+
18
20
  def config_import(path = "#{Rails.root}/config/trusty_config.yml", clear = nil)
19
- self.establish_connection
21
+ establish_connection
20
22
  if File.exist?(path)
21
23
  begin
22
24
  TrustyCms::Config.transaction do
@@ -40,12 +42,13 @@ module TrustyCms
40
42
  # Write the combined content of files in dir into cache_file in the same dir.
41
43
  #
42
44
  def cache_files(dir, files, cache_file)
43
- cache_content = files.collect { |f|
44
- File.read(File.join(dir, f)) }.join("\n\n")
45
+ cache_content = files.collect do |f|
46
+ File.read(File.join(dir, f))
47
+ end .join("\n\n")
45
48
 
46
49
  cache_path = File.join(dir, cache_file)
47
50
  File.delete(cache_path) if File.exists?(cache_path)
48
- File.open(cache_path, "w+") { |f| f.write(cache_content) }
51
+ File.open(cache_path, 'w+') { |f| f.write(cache_content) }
49
52
  end
50
53
 
51
54
  # Reads through the layout file and returns an array of JS filenames
@@ -18,7 +18,7 @@
18
18
  # # Custom log path, normal GC behavior.
19
19
  # RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
20
20
  #
21
- require File.dirname(__FILE__) + "/../config/environment"
21
+ require File.dirname(__FILE__) + '/../config/environment'
22
22
  require 'fcgi_handler'
23
23
 
24
24
  RailsFCGIHandler.process!
@@ -1,10 +1,10 @@
1
1
  #!/home/rails/bin/ruby
2
2
 
3
- require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails.root)
3
+ require File.dirname(__FILE__) + '/../config/environment' unless defined?(Rails.root)
4
4
 
5
5
  # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
6
6
  # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
7
- require "dispatcher"
7
+ require 'dispatcher'
8
8
 
9
9
  ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
10
10
  Dispatcher.dispatch
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- require File.expand_path('../../config/boot', __FILE__)
2
+ require File.expand_path('../config/boot', __dir__)
3
3
  require 'trusty_cms/extension/script'
4
4
 
5
5
  TrustyCms::Extension::Script.execute ARGV
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
3
 
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
4
+ APP_PATH = File.expand_path('../config/application', __dir__)
5
+ require File.expand_path('../config/boot', __dir__)
6
6
  require 'rails/commands'
@@ -1,26 +1,27 @@
1
1
  # -*- encoding: utf-8 -*-
2
+
2
3
  require File.expand_path(__FILE__ + '/../lib/trusty_cms.rb')
3
4
  Gem::Specification.new do |s|
4
- s.name = %q{trusty-cms}
5
+ s.name = 'trusty-cms'
5
6
  s.version = TrustyCms::VERSION
6
7
  s.platform = Gem::Platform::RUBY
7
8
 
8
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
9
- s.authors = ["TrustyCms CMS dev team"]
10
- s.description = %q{TrustyCms is a simple and powerful publishing system designed for small teams.
9
+ s.required_rubygems_version = Gem::Requirement.new('> 1.3.1') if s.respond_to? :required_rubygems_version=
10
+ s.authors = ['TrustyCms CMS dev team']
11
+ s.description = 'TrustyCms is a simple and powerful publishing system designed for small teams.
11
12
  It is built with Rails and is similar to Textpattern or MovableType, but is
12
- a general purpose content managment system--not merely a blogging engine.}
13
- s.email = %q{saalon@gmail.com}
14
- s.executables = ["trusty_cms"]
15
- s.extra_rdoc_files = ["README.md", "INSTALL.md", "LICENSE.md"]
16
- s.files = Dir['**/*','.gitignore', 'public/.htaccess', 'log/.keep', 'vendor/extensions/.keep']
17
- s.homepage = %q{https://github.com/pgharts/trusty-cms}
18
- s.rdoc_options = ["--title", "TrustyCms -- Content Management You Can Trust", "--line-numbers", "--main", "README", "--exclude", "app", "--exclude", "bin", "--exclude", "config", "--exclude", "db", "--exclude", "features", "--exclude", "lib", "--exclude", "log", "--exclude", "pkg", "--exclude", "public", "--exclude", "script", "--exclude", "spec", "--exclude", "test", "--exclude", "tmp", "--exclude", "vendor"]
19
- s.require_paths = ["lib"]
20
- s.rubygems_version = %q{1.3.7}
21
- s.summary = %q{A no-fluff content management system designed for small teams.}
22
- s.license = %q{MIT}
23
- s.test_files = Dir["spec/**/*"]
13
+ a general purpose content managment system--not merely a blogging engine.'
14
+ s.email = 'saalon@gmail.com'
15
+ s.executables = ['trusty_cms']
16
+ s.extra_rdoc_files = ['README.md', 'INSTALL.md', 'LICENSE.md']
17
+ s.files = Dir['**/*', '.gitignore', 'public/.htaccess', 'log/.keep', 'vendor/extensions/.keep']
18
+ s.homepage = 'https://github.com/pgharts/trusty-cms'
19
+ s.rdoc_options = ['--title', 'TrustyCms -- Content Management You Can Trust', '--line-numbers', '--main', 'README', '--exclude', 'app', '--exclude', 'bin', '--exclude', 'config', '--exclude', 'db', '--exclude', 'features', '--exclude', 'lib', '--exclude', 'log', '--exclude', 'pkg', '--exclude', 'public', '--exclude', 'script', '--exclude', 'spec', '--exclude', 'test', '--exclude', 'tmp', '--exclude', 'vendor']
20
+ s.require_paths = ['lib']
21
+ s.rubygems_version = '1.3.7'
22
+ s.summary = 'A no-fluff content management system designed for small teams.'
23
+ s.license = 'MIT'
24
+ s.test_files = Dir['spec/**/*']
24
25
 
25
26
  s.add_dependency 'acts_as_list', '>= 0.9.5', '< 1.1.0'
26
27
  s.add_dependency 'acts_as_tree', '>= 2.6.1', '< 2.9.0'
@@ -32,22 +33,21 @@ a general purpose content managment system--not merely a blogging engine.}
32
33
  s.add_dependency 'haml-rails', '~> 1.0.0'
33
34
  s.add_dependency 'highline', '>= 1.7.8', '< 2.1.0'
34
35
  s.add_dependency 'kraken-io'
35
- s.add_dependency 'mysql2'
36
36
  s.add_dependency 'mini_racer'
37
+ s.add_dependency 'mysql2'
37
38
  s.add_dependency 'paperclip', '> 5.2'
38
39
  s.add_dependency 'rack', '~> 2.0.1'
39
40
  s.add_dependency 'rack-cache', '~> 1.7'
40
- s.add_dependency 'rails'
41
- s.add_dependency 'rdoc', '>= 5.1', '< 7.0'
42
41
  s.add_dependency 'radius', '~> 0.7'
43
- s.add_dependency 'RedCloth', '4.3.2'
42
+ s.add_dependency 'rails'
44
43
  s.add_dependency 'rake', '< 13.0'
44
+ s.add_dependency 'rdoc', '>= 5.1', '< 7.0'
45
+ s.add_dependency 'RedCloth', '4.3.2'
45
46
  s.add_dependency 'roadie-rails'
46
47
  s.add_dependency 'sassc-rails'
47
48
  s.add_dependency 'stringex', '>= 2.7.1', '< 2.9.0'
48
49
  s.add_dependency 'tzinfo', '>= 1.2.3', '< 2.1.0'
49
50
  s.add_dependency 'uglifier', '>= 3.2', '< 5.0'
50
- s.add_dependency 'uuidtools', '~> 2.1.5'
51
- s.add_dependency 'will_paginate', '~> 3.0'
52
-
51
+ s.add_dependency 'uuidtools', '~> 2.1.5'
52
+ s.add_dependency 'will_paginate', '~> 3.0'
53
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trusty-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2
4
+ version: 4.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - TrustyCms CMS dev team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-19 00:00:00.000000000 Z
11
+ date: 2020-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acts_as_list
@@ -181,7 +181,7 @@ dependencies:
181
181
  - !ruby/object:Gem::Version
182
182
  version: '0'
183
183
  - !ruby/object:Gem::Dependency
184
- name: mysql2
184
+ name: mini_racer
185
185
  requirement: !ruby/object:Gem::Requirement
186
186
  requirements:
187
187
  - - ">="
@@ -195,7 +195,7 @@ dependencies:
195
195
  - !ruby/object:Gem::Version
196
196
  version: '0'
197
197
  - !ruby/object:Gem::Dependency
198
- name: mini_racer
198
+ name: mysql2
199
199
  requirement: !ruby/object:Gem::Requirement
200
200
  requirements:
201
201
  - - ">="
@@ -250,6 +250,20 @@ dependencies:
250
250
  - - "~>"
251
251
  - !ruby/object:Gem::Version
252
252
  version: '1.7'
253
+ - !ruby/object:Gem::Dependency
254
+ name: radius
255
+ requirement: !ruby/object:Gem::Requirement
256
+ requirements:
257
+ - - "~>"
258
+ - !ruby/object:Gem::Version
259
+ version: '0.7'
260
+ type: :runtime
261
+ prerelease: false
262
+ version_requirements: !ruby/object:Gem::Requirement
263
+ requirements:
264
+ - - "~>"
265
+ - !ruby/object:Gem::Version
266
+ version: '0.7'
253
267
  - !ruby/object:Gem::Dependency
254
268
  name: rails
255
269
  requirement: !ruby/object:Gem::Requirement
@@ -265,39 +279,39 @@ dependencies:
265
279
  - !ruby/object:Gem::Version
266
280
  version: '0'
267
281
  - !ruby/object:Gem::Dependency
268
- name: rdoc
282
+ name: rake
269
283
  requirement: !ruby/object:Gem::Requirement
270
284
  requirements:
271
- - - ">="
272
- - !ruby/object:Gem::Version
273
- version: '5.1'
274
285
  - - "<"
275
286
  - !ruby/object:Gem::Version
276
- version: '7.0'
287
+ version: '13.0'
277
288
  type: :runtime
278
289
  prerelease: false
279
290
  version_requirements: !ruby/object:Gem::Requirement
280
291
  requirements:
281
- - - ">="
282
- - !ruby/object:Gem::Version
283
- version: '5.1'
284
292
  - - "<"
285
293
  - !ruby/object:Gem::Version
286
- version: '7.0'
294
+ version: '13.0'
287
295
  - !ruby/object:Gem::Dependency
288
- name: radius
296
+ name: rdoc
289
297
  requirement: !ruby/object:Gem::Requirement
290
298
  requirements:
291
- - - "~>"
299
+ - - ">="
292
300
  - !ruby/object:Gem::Version
293
- version: '0.7'
301
+ version: '5.1'
302
+ - - "<"
303
+ - !ruby/object:Gem::Version
304
+ version: '7.0'
294
305
  type: :runtime
295
306
  prerelease: false
296
307
  version_requirements: !ruby/object:Gem::Requirement
297
308
  requirements:
298
- - - "~>"
309
+ - - ">="
299
310
  - !ruby/object:Gem::Version
300
- version: '0.7'
311
+ version: '5.1'
312
+ - - "<"
313
+ - !ruby/object:Gem::Version
314
+ version: '7.0'
301
315
  - !ruby/object:Gem::Dependency
302
316
  name: RedCloth
303
317
  requirement: !ruby/object:Gem::Requirement
@@ -312,20 +326,6 @@ dependencies:
312
326
  - - '='
313
327
  - !ruby/object:Gem::Version
314
328
  version: 4.3.2
315
- - !ruby/object:Gem::Dependency
316
- name: rake
317
- requirement: !ruby/object:Gem::Requirement
318
- requirements:
319
- - - "<"
320
- - !ruby/object:Gem::Version
321
- version: '13.0'
322
- type: :runtime
323
- prerelease: false
324
- version_requirements: !ruby/object:Gem::Requirement
325
- requirements:
326
- - - "<"
327
- - !ruby/object:Gem::Version
328
- version: '13.0'
329
329
  - !ruby/object:Gem::Dependency
330
330
  name: roadie-rails
331
331
  requirement: !ruby/object:Gem::Requirement