radiant 1.1.0.beta → 1.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of radiant might be problematic. Click here for more details.

Files changed (77) hide show
  1. data/CHANGELOG.md +8 -0
  2. data/CONTRIBUTORS.md +6 -0
  3. data/Gemfile +6 -5
  4. data/Gemfile.lock +2 -2
  5. data/GemfileRails3 +37 -0
  6. data/app/controllers/site_controller.rb +31 -7
  7. data/app/helpers/application_helper.rb +4 -4
  8. data/app/models/deprecated_tags.rb +8 -1
  9. data/app/models/page.rb +21 -9
  10. data/app/models/radiant/page_response_cache_director.rb +43 -0
  11. data/app/models/standard_tags.rb +34 -32
  12. data/app/views/admin/pages/_fields.html.haml +1 -1
  13. data/app/views/admin/pages/_node.html.haml +1 -1
  14. data/config/compass.config +0 -3
  15. data/config/initializers/tmp.rb +2 -0
  16. data/config/preinitializer.rb +15 -16
  17. data/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb +1 -1
  18. data/lib/generators/instance/templates/instance_gemfile +9 -5
  19. data/lib/radiant.rb +1 -1
  20. data/lib/radiant/engine.rb +10 -0
  21. data/lib/radiant/extension.rb +1 -10
  22. data/lib/radiant/initializer.rb +1 -0
  23. data/lib/radiant/task_support.rb +66 -0
  24. data/lib/tasks/framework.rake +1 -1
  25. data/lib/tasks/radiant_config.rake +3 -3
  26. data/lib/tasks/release.rake +1 -1
  27. data/public/javascripts/admin/page_preview.js +1 -1
  28. data/public/javascripts/admin/pagefield.js +1 -1
  29. data/public/javascripts/admin/shortcuts.js +7 -1
  30. data/radiant.gemspec +2 -1
  31. data/rails/init.rb +1 -0
  32. data/spec/dummy/Rakefile +7 -0
  33. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  34. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  35. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  36. data/spec/dummy/config.ru +4 -0
  37. data/spec/dummy/config/application.rb +45 -0
  38. data/spec/dummy/config/boot.rb +10 -0
  39. data/spec/dummy/config/database.yml +22 -0
  40. data/spec/dummy/config/environment.rb +5 -0
  41. data/spec/dummy/config/environments/development.rb +26 -0
  42. data/spec/dummy/config/environments/production.rb +49 -0
  43. data/spec/dummy/config/environments/test.rb +35 -0
  44. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  45. data/spec/dummy/config/initializers/inflections.rb +10 -0
  46. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  47. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  48. data/spec/dummy/config/initializers/session_store.rb +8 -0
  49. data/spec/dummy/config/locales/en.yml +5 -0
  50. data/spec/dummy/config/routes.rb +3 -0
  51. data/spec/dummy/log/development.log +0 -0
  52. data/spec/dummy/log/production.log +0 -0
  53. data/spec/dummy/log/server.log +0 -0
  54. data/spec/dummy/log/test.log +0 -0
  55. data/spec/dummy/public/404.html +26 -0
  56. data/spec/dummy/public/422.html +26 -0
  57. data/spec/dummy/public/500.html +26 -0
  58. data/spec/dummy/public/favicon.ico +0 -0
  59. data/spec/dummy/public/javascripts/application.js +2 -0
  60. data/spec/dummy/public/javascripts/controls.js +965 -0
  61. data/spec/dummy/public/javascripts/dragdrop.js +974 -0
  62. data/spec/dummy/public/javascripts/effects.js +1123 -0
  63. data/spec/dummy/public/javascripts/prototype.js +6001 -0
  64. data/spec/dummy/public/javascripts/rails.js +202 -0
  65. data/spec/dummy/script/rails +6 -0
  66. data/spec/fixtures/example_extension/example_extension.rb +0 -4
  67. data/spec/lib/radiant/extension_spec.rb +0 -8
  68. data/spec/lib/task_support_spec.rb +13 -13
  69. data/spec/models/deprecated_tags_spec.rb +8 -1
  70. data/spec/models/radiant/page_response_cache_director_spec.rb +83 -0
  71. data/spec/models/standard_tags_spec.rb +10 -7
  72. data/spec/spec_helper_rails_3.rb +15 -0
  73. metadata +105 -53
  74. data/config/initializers/compass.rb +0 -6
  75. data/lib/plugins/extension_patches/init.rb +0 -1
  76. data/lib/plugins/extension_patches/lib/routing_extension.rb +0 -31
  77. data/lib/task_support.rb +0 -64
@@ -1,6 +0,0 @@
1
- require 'fileutils'
2
- FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets"))
3
-
4
- require 'compass'
5
- require 'compass/app_integration/rails'
6
- Compass::AppIntegration::Rails.initialize!
@@ -1 +0,0 @@
1
- require 'routing_extension'
@@ -1,31 +0,0 @@
1
- module Radiant
2
- module RoutingExtension
3
-
4
- def self.included(base)
5
- base.class_eval do
6
- alias :draw_without_plugin_routes :draw
7
- alias :draw :draw_with_plugin_routes
8
- end
9
- end
10
-
11
- def draw_with_plugin_routes
12
- draw_without_plugin_routes do |mapper|
13
- add_extension_routes(mapper)
14
- yield mapper
15
- end
16
- end
17
-
18
- private
19
-
20
- def add_extension_routes(mapper)
21
- Extension.descendants.each do |ext|
22
- ext.route_definitions.each do |block|
23
- block.call(mapper)
24
- end
25
- end
26
- end
27
-
28
- end
29
- end
30
-
31
- ActionController::Routing::RouteSet.class_eval { include Radiant::RoutingExtension }
data/lib/task_support.rb DELETED
@@ -1,64 +0,0 @@
1
- class TaskSupport
2
- class << self
3
- def establish_connection
4
- unless ActiveRecord::Base.connected?
5
- connection_hash = YAML.load_file("#{Rails.root}/config/database.yml").to_hash
6
- env_connection = connection_hash[RAILS_ENV]
7
- ActiveRecord::Base.establish_connection(env_connection)
8
- end
9
- end
10
- def config_export(path = "#{Rails.root}/config/radiant_config.yml")
11
- self.establish_connection
12
- FileUtils.mkdir_p(File.dirname(path))
13
- if File.open(File.expand_path(path), 'w') { |f| YAML.dump(Radiant::Config.to_hash.to_yaml,f) }
14
- puts "Radiant::Config saved to #{path}"
15
- end
16
- end
17
- def config_import(path = "#{Rails.root}/config/radiant_config.yml", clear = nil)
18
- self.establish_connection
19
- if File.exist?(path)
20
- begin
21
- Radiant::Config.transaction do
22
- Radiant::Config.delete_all if clear
23
- configs = YAML.load(YAML.load_file(path))
24
- configs.each do |key, value|
25
- c = Radiant::Config.find_or_initialize_by_key(key)
26
- c.value = value
27
- c.save
28
- end
29
- end
30
- puts "Radiant::Config updated from #{path}"
31
- rescue ActiveRecord::RecordInvalid => e
32
- puts "IMPORT FAILED and rolled back. #{e}"
33
- end
34
- else
35
- puts "No file exists at #{path}"
36
- end
37
- end
38
-
39
- # Write the combined content of files in dir into cache_file in the same dir.
40
- #
41
- def cache_files(dir, files, cache_file)
42
- cache_content = files.collect { |f|
43
- File.read(File.join(dir, f)) }.join("\n\n")
44
-
45
- cache_path = File.join(dir, cache_file)
46
- File.delete(cache_path) if File.exists?(cache_path)
47
- File.open(cache_path, "w+") { |f| f.write(cache_content) }
48
- end
49
-
50
- # Reads through the layout file and returns an array of JS filenames
51
- #
52
- def find_admin_js
53
- layout = "#{RADIANT_ROOT}/app/views/layouts/application.html.haml"
54
- js_regexp = /javascript_include_tag %w\((.*)\), :cache => 'admin\/all/
55
- files = File.open(layout) { |f| f.read.match(js_regexp)[1].split }
56
- files.collect { |f| f.split('/').last + '.js' }
57
- end
58
-
59
- def cache_admin_js
60
- dir = "#{Rails.root}/public/javascripts/admin"
61
- cache_files(dir, find_admin_js, 'all.js')
62
- end
63
- end
64
- end