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.
- data/CHANGELOG.md +8 -0
- data/CONTRIBUTORS.md +6 -0
- data/Gemfile +6 -5
- data/Gemfile.lock +2 -2
- data/GemfileRails3 +37 -0
- data/app/controllers/site_controller.rb +31 -7
- data/app/helpers/application_helper.rb +4 -4
- data/app/models/deprecated_tags.rb +8 -1
- data/app/models/page.rb +21 -9
- data/app/models/radiant/page_response_cache_director.rb +43 -0
- data/app/models/standard_tags.rb +34 -32
- data/app/views/admin/pages/_fields.html.haml +1 -1
- data/app/views/admin/pages/_node.html.haml +1 -1
- data/config/compass.config +0 -3
- data/config/initializers/tmp.rb +2 -0
- data/config/preinitializer.rb +15 -16
- data/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb +1 -1
- data/lib/generators/instance/templates/instance_gemfile +9 -5
- data/lib/radiant.rb +1 -1
- data/lib/radiant/engine.rb +10 -0
- data/lib/radiant/extension.rb +1 -10
- data/lib/radiant/initializer.rb +1 -0
- data/lib/radiant/task_support.rb +66 -0
- data/lib/tasks/framework.rake +1 -1
- data/lib/tasks/radiant_config.rake +3 -3
- data/lib/tasks/release.rake +1 -1
- data/public/javascripts/admin/page_preview.js +1 -1
- data/public/javascripts/admin/pagefield.js +1 -1
- data/public/javascripts/admin/shortcuts.js +7 -1
- data/radiant.gemspec +2 -1
- data/rails/init.rb +1 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +45 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +22 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +26 -0
- data/spec/dummy/config/environments/production.rb +49 -0
- data/spec/dummy/config/environments/test.rb +35 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/production.log +0 -0
- data/spec/dummy/log/server.log +0 -0
- data/spec/dummy/log/test.log +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +2 -0
- data/spec/dummy/public/javascripts/controls.js +965 -0
- data/spec/dummy/public/javascripts/dragdrop.js +974 -0
- data/spec/dummy/public/javascripts/effects.js +1123 -0
- data/spec/dummy/public/javascripts/prototype.js +6001 -0
- data/spec/dummy/public/javascripts/rails.js +202 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/fixtures/example_extension/example_extension.rb +0 -4
- data/spec/lib/radiant/extension_spec.rb +0 -8
- data/spec/lib/task_support_spec.rb +13 -13
- data/spec/models/deprecated_tags_spec.rb +8 -1
- data/spec/models/radiant/page_response_cache_director_spec.rb +83 -0
- data/spec/models/standard_tags_spec.rb +10 -7
- data/spec/spec_helper_rails_3.rb +15 -0
- metadata +105 -53
- data/config/initializers/compass.rb +0 -6
- data/lib/plugins/extension_patches/init.rb +0 -1
- data/lib/plugins/extension_patches/lib/routing_extension.rb +0 -31
- data/lib/task_support.rb +0 -64
@@ -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
|