Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/yoon/radiant
Browse files Browse the repository at this point in the history
  • Loading branch information
saturnflyer committed Jul 31, 2008
2 parents a07d6d4 + 40b4157 commit 0f44217
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
@@ -1,6 +1,10 @@
== 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]
* Correct error in radiant:update:configs task. [Sean Cribbs]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application.rb
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/models/standard_tags.rb
Expand Up @@ -320,13 +320,13 @@ class TagError < StandardError; end
By default the @find@ attribute is set to @all@.
*Usage:*
<pre><code><r:unless_content [part="part_name, other_part"] [inherit="true"] [find="any"]>...</r:unless_content></code></pre>
<pre><code><r:unless_content [part="part_name, other_part"] [inherit="false"] [find="any"]>...</r:unless_content></code></pre>
}
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
Expand Down
49 changes: 19 additions & 30 deletions lib/tasks/framework.rake
Expand Up @@ -31,37 +31,26 @@ 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

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
Expand All @@ -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" ]

Expand All @@ -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] }
Expand Down Expand Up @@ -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)
Expand All @@ -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
Empty file modified script/extension 100644 → 100755
Empty file.

0 comments on commit 0f44217

Please sign in to comment.