From b36b3b7c3ed8086bcd37d4dd0ff1026aa39d3fb8 Mon Sep 17 00:00:00 2001 From: Sean Cribbs Date: Tue, 29 Jul 2008 19:36:01 -0400 Subject: [PATCH 1/3] Correct bugs in radiant:freeze:edge task. --- CHANGELOG | 1 + lib/tasks/framework.rake | 49 ++++++++++++++++------------------------ 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b3b48fbdd..b95eea76e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ == Change Log === Edge +* Correct bugs in radiant:freeze:edge task. [Sean Cribbs] * Fix strange Page subclass loading errors in development mode. [Sean Cribbs] * Fix typo in if_content description. [Jim Gay] * Correct error in radiant:update:configs task. [Sean Cribbs] diff --git a/lib/tasks/framework.rake b/lib/tasks/framework.rake index 7c4675113..82285bf37 100644 --- a/lib/tasks/framework.rake +++ b/lib/tasks/framework.rake @@ -31,8 +31,7 @@ unless File.directory? "#{RAILS_ROOT}/app" desc "Lock to latest Edge Radiant or a specific revision with REVISION=X (ex: REVISION=245484e), a tag with TAG=Y (ex: TAG=0.6.6), or a branch with BRANCH=Z (ex: BRANCH=mental)" task :edge do $verbose = false - system "git --version" rescue nil - unless !$?.nil? && $?.success? + unless system "git --version" $stderr.puts "ERROR: Must have git available in the PATH to lock this application to Edge Radiant" exit 1 end @@ -40,28 +39,18 @@ unless File.directory? "#{RAILS_ROOT}/app" radiant_git = "git://github.com/radiant/radiant.git" if File.exist?("vendor/radiant/.git/HEAD") - case - when ENV['TAG'] - system "cd vendor/radiant; git pull origin master; git checkout -b #{ENV['TAG']}" - when ENV['BRANCH'] - system "cd vendor/radiant; git pull origin master; git checkout --track -b #{ENV['BRANCH']} origin/#{ENV['BRANCH']}" - when ENV['REVISION'] - system "cd vendor/radiant; git pull origin master; git checkout -b REV_#{ENV['REVISION']} #{ENV['REVISION']}" - else - system "cd vendor/radiant; git pull origin master" - end + system "cd vendor/radiant; git checkout master; git pull origin master" else - case - when ENV['TAG'] - system "git clone #{radiant_git} vendor/radiant" - system "cd vendor/radiant; git checkout -b #{ENV['TAG']}" - when ENV['BRANCH'] - system "git clone #{radiant_git} vendor/radiant" - system "cd vendor/radiant; git checkout --track -b #{ENV['BRANCH']} origin/#{ENV['BRANCH']}" - when ENV['REVISION'] - system "git clone #{radiant_git} vendor/radiant" - system "cd vendor/radiant; git checkout -b REV_#{ENV['REVISION']} #{ENV['REVISION']}" - end + system "git clone #{radiant_git} vendor/radiant" + end + + case + when ENV['TAG'] + system "cd vendor/radiant; git checkout -b v#{ENV['TAG']} #{ENV['TAG']}" + when ENV['BRANCH'] + system "cd vendor/radiant; git checkout --track -b #{ENV['BRANCH']} origin/#{ENV['BRANCH']}" + when ENV['REVISION'] + system "cd vendor/radiant; git checkout -b REV_#{ENV['REVISION']} #{ENV['REVISION']}" end end end @@ -70,7 +59,7 @@ unless File.directory? "#{RAILS_ROOT}/app" task :unfreeze do rm_rf "vendor/radiant" end - + desc "Update both configs, scripts and public/javascripts from Radiant" task :update => [ "update:scripts", "update:javascripts", "update:configs", "update:images", "update:stylesheets" ] @@ -79,11 +68,11 @@ unless File.directory? "#{RAILS_ROOT}/app" task :scripts do local_base = "script" edge_base = "#{File.dirname(__FILE__)}/../../scripts" - + local = Dir["#{local_base}/**/*"].reject { |path| File.directory?(path) } edge = Dir["#{edge_base}/**/*"].reject { |path| File.directory?(path) } edge = edge.reject { |f| f =~ /(generate|plugin|destroy)$/ } - + edge.each do |script| base_name = script[(edge_base.length+1)..-1] next if local.detect { |path| base_name == path[(local_base.length+1)..-1] } @@ -114,7 +103,7 @@ unless File.directory? "#{RAILS_ROOT}/app" tmp_env = "#{RAILS_ROOT}/config/environment.tmp" gen_env = "#{File.dirname(__FILE__)}/../generators/instance/templates/instance_environment.rb" backup_env = "#{RAILS_ROOT}/config/environment.bak" - File.open(tmp_env, 'w') do |f| + File.open(tmp_env, 'w') do |f| f.write ERB.new(File.read(gen_env)).result(lambda do app_name = File.basename(File.expand_path(RAILS_ROOT)) end) @@ -129,20 +118,20 @@ Please copy your customizations to the new file." end FileUtils.rm(tmp_env) end - + desc "Update admin images from your current radiant install" task :images do project_dir = RAILS_ROOT + '/public/images/admin/' images = Dir["#{File.dirname(__FILE__)}/../../public/images/admin/*"] FileUtils.cp(images, project_dir) end - + desc "Update admin stylesheets from your current radiant install" task :stylesheets do project_dir = RAILS_ROOT + '/public/stylesheets/admin/' stylesheets = Dir["#{File.dirname(__FILE__)}/../../public/stylesheets/admin/*.css"] FileUtils.cp(stylesheets, project_dir) - end + end end end end \ No newline at end of file From bbbf07b75a316b8eb64baed4f8fb10163fd95974 Mon Sep 17 00:00:00 2001 From: Sean Cribbs Date: Wed, 30 Jul 2008 08:43:21 -0400 Subject: [PATCH 2/3] Fix authenticity token errors when using cookie session store. --- CHANGELOG | 3 +++ app/controllers/application.rb | 2 +- script/extension | 0 3 files changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 script/extension diff --git a/CHANGELOG b/CHANGELOG index b95eea76e..f8d92a410 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,9 @@ == Change Log === Edge +* Correct authenticity token errors when using cookie session store [Sean +Cribbs] +* Make script/extension executable. [Sean Cribbs] * Correct bugs in radiant:freeze:edge task. [Sean Cribbs] * Fix strange Page subclass loading errors in development mode. [Sean Cribbs] * Fix typo in if_content description. [Jim Gay] diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 9e90c7605..c2460423e 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base filter_parameter_logging :password, :password_confirmation - protect_from_forgery :secret => "sweet-harmonious-biscuits" + protect_from_forgery before_filter :set_current_user before_filter :set_javascripts_and_stylesheets diff --git a/script/extension b/script/extension old mode 100644 new mode 100755 From 40b41575f986037868dee1e4d4814d92d6784ef3 Mon Sep 17 00:00:00 2001 From: Mark Yoon Date: Wed, 30 Jul 2008 21:58:18 -0500 Subject: [PATCH 3/3] inherit attribute should default to 'false' --- app/models/standard_tags.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/standard_tags.rb b/app/models/standard_tags.rb index 8552becc9..cffa2a048 100644 --- a/app/models/standard_tags.rb +++ b/app/models/standard_tags.rb @@ -320,13 +320,13 @@ class TagError < StandardError; end By default the @find@ attribute is set to @all@. *Usage:* -
...
+
...
} tag 'unless_content' do |tag| page = tag.locals.page part_name = tag_part_name(tag) parts_arr = part_name.split(',') - inherit = boolean_attr_or_error(tag, 'inherit', true) + inherit = boolean_attr_or_error(tag, 'inherit', false) find = attr_or_error(tag, :attribute_name => 'find', :default => 'all', :values => 'any, all') expandable, all_found = true, true part_page = page