radiant 0.6.1 → 0.6.2

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  == Change Log
2
2
 
3
+ === 0.6.2 Jewel Carver (June 23, 2007)
4
+ * Removed some of the database specific code from the ArchiveFinder [Daniel
5
+ Sheppard]
6
+ * Fixed typo in extension model generator documentation
7
+ * Reworked the way the generator extension is loaded (closing #500) [Keita]
8
+ * Fixed failing unit tests in instance mode [Daniel Shephard]
9
+ * Modified the page edit form to use multipart/form-data (useful for an upload
10
+ extension) [Sean Cribbs]
11
+
3
12
  === 0.6.1 Stone Cutter (May 5, 2007)
4
13
  * Fixed a security vulnerability which caused passwords to appear in the logs
5
14
  * Fixed a bug in the site map code which caused it to forget which rows were
@@ -4,6 +4,11 @@
4
4
  The following people have submitted changes which have been applied to the
5
5
  core:
6
6
 
7
+ === 0.6.2 Jewel Carver
8
+ * Sean Cribbs
9
+ * Daniel Sheppard
10
+ * Keita
11
+
7
12
  === 0.6.1 Stone Cutter
8
13
  * Sean Cribbs
9
14
  * Daniel Sheppard
@@ -10,23 +10,27 @@ class ArchiveFinder
10
10
  class << self
11
11
  def year_finder(finder, year)
12
12
  new do |method, options|
13
- add_condition(options, "#{extract('year', 'published_at')} = ?", year.to_i)
13
+ start = Time.local(year)
14
+ finish = start.next_year
15
+ add_condition(options, "published_at >= ? and published_at < ?", start, finish)
14
16
  finder.find(method, options)
15
17
  end
16
18
  end
17
19
 
18
20
  def month_finder(finder, year, month)
19
- finder = year_finder(finder, year)
20
21
  new do |method, options|
21
- add_condition(options, "#{extract('month', 'published_at')} = ?", month.to_i)
22
+ start = Time.local(year, month)
23
+ finish = start.next_month
24
+ add_condition(options, "published_at >= ? and published_at < ?", start, finish)
22
25
  finder.find(method, options)
23
26
  end
24
27
  end
25
28
 
26
29
  def day_finder(finder, year, month, day)
27
- finder = month_finder(finder, year, month)
28
30
  new do |method, options|
29
- add_condition(options, "#{extract('day', 'published_at')} = ?", day.to_i)
31
+ start = Time.local(year, month, day)
32
+ finish = start.tomorrow
33
+ add_condition(options, "published_at >= ? and published_at < ?", start, finish)
30
34
  finder.find(method, options)
31
35
  end
32
36
  end
@@ -45,25 +49,5 @@ class ArchiveFinder
45
49
  options[:conditions] = conditions
46
50
  options
47
51
  end
48
-
49
- def extract(part, field)
50
- case ActiveRecord::Base.connection.adapter_name
51
- when /sqlite/i
52
- format = case part
53
- when /year/i
54
- '%Y'
55
- when /month/i
56
- '%m'
57
- when /day/i
58
- '%d'
59
- end
60
- "CAST(STRFTIME('#{format}', #{field}) AS INTEGER)"
61
- when /sqlserver/i
62
- "DATEPART(#{part.upcase}, #{field})"
63
- else
64
- "EXTRACT(#{part.upcase} FROM #{field})"
65
- end
66
- end
67
-
68
52
  end
69
- end
53
+ end
@@ -107,7 +107,7 @@
107
107
  <h1 id="edit_page">Edit Page</h1>
108
108
  <% end -%>
109
109
 
110
- <form method="post">
110
+ <form method="post" enctype="multipart/form-data">
111
111
  <%= hidden_field "page", "lock_version" %>
112
112
  <div class="form-area">
113
113
  <p class="title">
@@ -12,7 +12,7 @@ class ExtensionModelGenerator < ModelGenerator
12
12
  end
13
13
 
14
14
  def banner
15
- "Usage: #{$0} generate ExtensionName ModelName [field:type, field:type]"
15
+ "Usage: #{$0} extension_model ExtensionName ModelName [field:type, field:type]"
16
16
  end
17
17
 
18
18
  def extension_path
@@ -1,5 +1,4 @@
1
1
  require 'rails_generator'
2
-
3
2
  module Radiant
4
3
  module GeneratorBaseExtension
5
4
  def self.included(base)
@@ -0,0 +1,6 @@
1
+ (class << Dependencies; self; end).class_eval do
2
+ def loadable_constants_for_path_with_filtered_args(*args)
3
+ loadable_constants_for_path_without_filtered_args(*args).select {|path| /^(::)?([A-Z]\w*)(::[A-Z]\w*)*$/ =~ path }
4
+ end
5
+ alias_method_chain :loadable_constants_for_path, :filtered_args
6
+ end
@@ -1,7 +1,4 @@
1
1
  require 'routing_extension'
2
2
  require 'view_paths_extension'
3
3
  require 'mailer_view_paths_extension'
4
- if RAILS_ENV != 'production'
5
- require 'generator_base_extension'
6
- end
7
4
  require 'fixture_loading_extension'
@@ -42,8 +42,35 @@ module Radiant
42
42
  end
43
43
  end
44
44
  end
45
-
46
45
  end
47
46
 
48
47
  require 'active_record/fixtures'
49
48
  Fixtures.class_eval { include Radiant::FixtureLoadingExtension }
49
+
50
+ require 'action_controller/test_process'
51
+ module ActionController::TestProcess
52
+ def fixture_file_upload(path, mime_type = nil)
53
+ if Test::Unit::TestCase.respond_to?(:fixture_path)
54
+ fixture_path = Test::Unit::TestCase.fixture_path
55
+ if(fixture_path.respond_to? :to_str)
56
+ ActionController::TestUploadedFile.new(
57
+ fixture_path.to_str + path,
58
+ mime_type
59
+ )
60
+ else
61
+ best_path = fixture_path.find { |x| File.exist? (x + path) }
62
+ best_path ||= fixture_path.last
63
+ ActionController::TestUploadedFile.new(
64
+ best_path + path,
65
+ mime_type
66
+ )
67
+ end
68
+ else
69
+ ActionController::TestUploadedFile.new(
70
+ path,
71
+ mime_type
72
+ )
73
+ end
74
+ end
75
+ end
76
+
@@ -5,7 +5,7 @@ unless defined? Radiant::Version
5
5
  module Version
6
6
  Major = '0'
7
7
  Minor = '6'
8
- Tiny = '1'
8
+ Tiny = '2'
9
9
 
10
10
  class << self
11
11
  def to_s
@@ -38,21 +38,21 @@ namespace 'radiant' do
38
38
  end
39
39
  s.extra_rdoc_files = RDOC_EXTRAS
40
40
  files = FileList['**/*']
41
- files.include 'public/.htaccess'
42
41
  files.exclude '**/._*'
43
42
  files.exclude '**/*.rej'
44
- files.exclude 'cache/*'
43
+ files.exclude 'cache/'
45
44
  files.exclude 'config/database.yml'
46
45
  files.exclude 'config/locomotive.yml'
47
46
  files.exclude 'config/lighttpd.conf'
48
47
  files.exclude 'config/mongrel_mimes.yml'
49
48
  files.exclude 'db/*.db'
50
- files.exclude 'doc'
49
+ files.exclude /^doc/
51
50
  files.exclude 'log/*.log'
52
51
  files.exclude 'log/*.pid'
53
52
  files.include 'log/.keep'
54
- files.exclude 'pkg'
55
- files.exclude 'tmp'
53
+ files.exclude /^pkg/
54
+ files.include 'public/.htaccess'
55
+ files.exclude 'tmp/'
56
56
  s.files = files.to_a
57
57
  end
58
58
 
@@ -86,4 +86,4 @@ namespace 'radiant' do
86
86
  system %{rubyforge add_release #{RUBY_FORGE_GROUPID} #{RUBY_FORGE_PACKAGEID} "#{RELEASE_NAME}" #{file}}
87
87
  end
88
88
  end
89
- end
89
+ end
@@ -1,3 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
  require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'generators/generator_base_extension'
3
4
  require 'commands/generate'
@@ -0,0 +1,65 @@
1
+ require File.dirname(__FILE__) + '/tokenizer'
2
+ require File.dirname(__FILE__) + '/node'
3
+ require File.dirname(__FILE__) + '/selector'
4
+
5
+ module HTML #:nodoc:
6
+
7
+ # A top-level HTMl document. You give it a body of text, and it will parse that
8
+ # text into a tree of nodes.
9
+ class Document #:nodoc:
10
+
11
+ # The root of the parsed document.
12
+ attr_reader :root
13
+
14
+ # Create a new Document from the given text.
15
+ def initialize(text, strict=false, xml=false)
16
+ tokenizer = Tokenizer.new(text)
17
+ @root = Node.new(nil)
18
+ node_stack = [ @root ]
19
+ while token = tokenizer.next
20
+ node = Node.parse(node_stack.last, tokenizer.line, tokenizer.position, token)
21
+
22
+ node_stack.last.children << node unless node.tag? && node.closing == :close
23
+ if node.tag?
24
+ if node_stack.length > 1 && node.closing == :close
25
+ if node_stack.last.name == node.name
26
+ node_stack.pop
27
+ else
28
+ open_start = node_stack.last.position - 20
29
+ open_start = 0 if open_start < 0
30
+ close_start = node.position - 20
31
+ close_start = 0 if close_start < 0
32
+ msg = <<EOF.strip
33
+ ignoring attempt to close #{node_stack.last.name} with #{node.name}
34
+ opened at byte #{node_stack.last.position}, line #{node_stack.last.line}
35
+ closed at byte #{node.position}, line #{node.line}
36
+ attributes at open: #{node_stack.last.attributes.inspect}
37
+ text around open: #{text[open_start,40].inspect}
38
+ text around close: #{text[close_start,40].inspect}
39
+ EOF
40
+ strict ? raise(msg) : warn(msg)
41
+ end
42
+ elsif !node.childless?(xml) && node.closing != :close
43
+ node_stack.push node
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ # Search the tree for (and return) the first node that matches the given
50
+ # conditions. The conditions are interpreted differently for different node
51
+ # types, see HTML::Text#find and HTML::Tag#find.
52
+ def find(conditions)
53
+ @root.find(conditions)
54
+ end
55
+
56
+ # Search the tree for (and return) all nodes that match the given
57
+ # conditions. The conditions are interpreted differently for different node
58
+ # types, see HTML::Text#find and HTML::Tag#find.
59
+ def find_all(conditions)
60
+ @root.find_all(conditions)
61
+ end
62
+
63
+ end
64
+
65
+ end
@@ -0,0 +1,2 @@
1
+ Use this README file to introduce your application and point to useful places in the API for learning more.
2
+ Run "rake appdoc" to generate API documentation for your models and controllers.
@@ -0,0 +1,82 @@
1
+ namespace :doc do
2
+ desc "Generate documentation for the application"
3
+ Rake::RDocTask.new("app") { |rdoc|
4
+ rdoc.rdoc_dir = 'doc/app'
5
+ rdoc.title = "Rails Application Documentation"
6
+ rdoc.options << '--line-numbers' << '--inline-source'
7
+ rdoc.rdoc_files.include('doc/README_FOR_APP')
8
+ rdoc.rdoc_files.include('app/**/*.rb')
9
+ rdoc.rdoc_files.include('lib/**/*.rb')
10
+ }
11
+
12
+ desc "Generate documentation for the Rails framework"
13
+ Rake::RDocTask.new("rails") { |rdoc|
14
+ rdoc.rdoc_dir = 'doc/api'
15
+ rdoc.template = "#{ENV['template']}.rb" if ENV['template']
16
+ rdoc.title = "Rails Framework Documentation"
17
+ rdoc.options << '--line-numbers' << '--inline-source'
18
+ rdoc.rdoc_files.include('README')
19
+ rdoc.rdoc_files.include('vendor/rails/railties/CHANGELOG')
20
+ rdoc.rdoc_files.include('vendor/rails/railties/MIT-LICENSE')
21
+ rdoc.rdoc_files.include('vendor/rails/activerecord/README')
22
+ rdoc.rdoc_files.include('vendor/rails/activerecord/CHANGELOG')
23
+ rdoc.rdoc_files.include('vendor/rails/activerecord/lib/active_record/**/*.rb')
24
+ rdoc.rdoc_files.exclude('vendor/rails/activerecord/lib/active_record/vendor/*')
25
+ rdoc.rdoc_files.include('vendor/rails/actionpack/README')
26
+ rdoc.rdoc_files.include('vendor/rails/actionpack/CHANGELOG')
27
+ rdoc.rdoc_files.include('vendor/rails/actionpack/lib/action_controller/**/*.rb')
28
+ rdoc.rdoc_files.include('vendor/rails/actionpack/lib/action_view/**/*.rb')
29
+ rdoc.rdoc_files.include('vendor/rails/actionmailer/README')
30
+ rdoc.rdoc_files.include('vendor/rails/actionmailer/CHANGELOG')
31
+ rdoc.rdoc_files.include('vendor/rails/actionmailer/lib/action_mailer/base.rb')
32
+ rdoc.rdoc_files.include('vendor/rails/actionwebservice/README')
33
+ rdoc.rdoc_files.include('vendor/rails/actionwebservice/CHANGELOG')
34
+ rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service.rb')
35
+ rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/*.rb')
36
+ rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/api/*.rb')
37
+ rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/client/*.rb')
38
+ rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/container/*.rb')
39
+ rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/dispatcher/*.rb')
40
+ rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/protocol/*.rb')
41
+ rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/support/*.rb')
42
+ rdoc.rdoc_files.include('vendor/rails/activesupport/README')
43
+ rdoc.rdoc_files.include('vendor/rails/activesupport/CHANGELOG')
44
+ rdoc.rdoc_files.include('vendor/rails/activesupport/lib/active_support/**/*.rb')
45
+ }
46
+
47
+ plugins = FileList['vendor/plugins/**'].collect { |plugin| File.basename(plugin) }
48
+
49
+ desc "Generate documation for all installed plugins"
50
+ task :plugins => plugins.collect { |plugin| "doc:plugins:#{plugin}" }
51
+
52
+ desc "Remove plugin documentation"
53
+ task :clobber_plugins do
54
+ rm_rf 'doc/plugins' rescue nil
55
+ end
56
+
57
+ namespace :plugins do
58
+ # Define doc tasks for each plugin
59
+ plugins.each do |plugin|
60
+ task(plugin => :environment) do
61
+ plugin_base = "vendor/plugins/#{plugin}"
62
+ options = []
63
+ files = Rake::FileList.new
64
+ options << "-o doc/plugins/#{plugin}"
65
+ options << "--title '#{plugin.titlecase} Plugin Documentation'"
66
+ options << '--line-numbers' << '--inline-source'
67
+ options << '-T html'
68
+
69
+ files.include("#{plugin_base}/lib/**/*.rb")
70
+ if File.exists?("#{plugin_base}/README")
71
+ files.include("#{plugin_base}/README")
72
+ options << "--main '#{plugin_base}/README'"
73
+ end
74
+ files.include("#{plugin_base}/CHANGELOG") if File.exists?("#{plugin_base}/CHANGELOG")
75
+
76
+ options << files.to_s
77
+
78
+ sh %(rdoc #{options * ' '})
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,37 @@
1
+ namespace :tmp do
2
+ desc "Clear session, cache, and socket files from tmp/"
3
+ task :clear => [ "tmp:sessions:clear", "tmp:cache:clear", "tmp:sockets:clear"]
4
+
5
+ desc "Creates tmp directories for sessions, cache, and sockets"
6
+ task :create do
7
+ FileUtils.mkdir_p(%w( tmp/sessions tmp/cache tmp/sockets tmp/pids ))
8
+ end
9
+
10
+ namespace :sessions do
11
+ desc "Clears all files in tmp/sessions"
12
+ task :clear do
13
+ FileUtils.rm(Dir['tmp/sessions/[^.]*'])
14
+ end
15
+ end
16
+
17
+ namespace :cache do
18
+ desc "Clears all files and directories in tmp/cache"
19
+ task :clear do
20
+ FileUtils.rm_rf(Dir['tmp/cache/[^.]*'])
21
+ end
22
+ end
23
+
24
+ namespace :sockets do
25
+ desc "Clears all files in tmp/sockets"
26
+ task :clear do
27
+ FileUtils.rm(Dir['tmp/sockets/[^.]*'])
28
+ end
29
+ end
30
+
31
+ namespace :pids do
32
+ desc "Clears all files in tmp/pids"
33
+ task :clear do
34
+ FileUtils.rm(Dir['tmp/pids/[^.]*'])
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,160 @@
1
+ --- %YAML:1.0
2
+ - version: 3.0.4
3
+ date: 2005-02-18
4
+ changes:
5
+ - The caps class doesn't swallow spaces.
6
+ - Horizontal rules required to be on an empty line.
7
+ - Hard breaks don't screw with Markdown headers any longer.
8
+ - Fixed error triggered by complex lists.
9
+ - Inline markups need to be butted up against enclosing text, no spaces.
10
+ - Fixed problem with intermingled single and double quotes.
11
+ - Brought back lite_mode.
12
+
13
+ - version: 3.0.3
14
+ date: 2005-02-06
15
+ changes:
16
+ - Stack overflow regexp on code inlines obliterated.
17
+ - Citations scaled back.
18
+ - Toggle span tags on CAPS with :no_span_tags accessor.
19
+
20
+ - version: 3.0.2
21
+ date: 2005-02-02
22
+ changes:
23
+ - Stack overflow Regexps replaced.
24
+ - All code blocks protected from formatting.
25
+ - Hard breaks working.
26
+ - Filter HTML now uses detailed cleaner.
27
+
28
+ - version: 3.0.1
29
+ date: 2004-11-15
30
+ changes:
31
+ - Using `float' rather than `text-align' to align image blocks.
32
+ - Shelving more HTML attributes to prevent them from clashing with Textile glyphs.
33
+ - Simplifying the block regexp.
34
+
35
+ - version: 3.0
36
+ date: 2004-10-26
37
+ changes:
38
+ - Broke up the Textile engine into smaller parts, recoded central block parser.
39
+ - Added preliminary support for Markdown.
40
+ - Added support for custom Textile prefixes.
41
+ - RedCloth now generates XHTML fragments.
42
+ - Complete HTML documents should now work, RedCloth ignores complex HTML.
43
+
44
+ - version: 2.0.12
45
+ date: 2004-08-09
46
+ changes:
47
+ - Escaping tighter for <pre> tags that share a single line.
48
+ - No more String#htmlesc!. Moved to RedCloth#htmlesc.
49
+ - Pruned out the code that was handling multibyte.
50
+
51
+ - version: 2.0.11
52
+ date: 2004-06-01
53
+ changes:
54
+ - Fixed the new 2.0-style aliased links.
55
+ - Lines starting with div opening or closing tags aren't given paragraph tags.
56
+ - Escaped some sample markup that was being translated by RDoc.
57
+ - Subtle changes to the quick tags to help them interact with surrounding HTML better.
58
+ - Ensure angle brackets inside code quick tags get escaped.
59
+ - New patch and test by F. Ros to fix <pre> tags with class settings.
60
+ - Commented out encode_entities and fix_entities, they do nothing now. Thanks, Denis.
61
+ - Scaled back QTAGS a back to avoid mixing up hyphens and dels. Thanks, Denis.
62
+ - Work on the references to ensure they are generating at least XHTML 1.0 Transitional.
63
+
64
+ - version: 2.0.10
65
+ date: 2004-05-26
66
+ changes:
67
+ - Table and list problems. Rewrote the <pre> handling code.. again.
68
+
69
+ - version: 2.0.9
70
+ date: 2004-05-26
71
+ changes:
72
+ - Improved RDoc. Ri documentation is auto-installed now!
73
+ - Links were consuming closing HTML tags. (See latest test in tests/links.yml.)
74
+ - Further speed patch from Denis. Good good.
75
+ - Patch by F. Ros to fix <pre> tags with class settings.
76
+
77
+ - version: 2.0.8
78
+ date: 2004-05-22
79
+ changes:
80
+ - First scan of the glyphs() method only scans for pre|notextile|code, the
81
+ deeper passes scan for all HTML. Now inlines work around HTML tags!
82
+ (What a pain!)
83
+ - Moved tables and blocks into glyphs to keep them shielded from the parser
84
+ if they are in <pre> tags.
85
+ - Patch by Denis Mertz to speed up RedCloth by compiling the various RegExps
86
+ only once. Thanks, David!
87
+
88
+ - version: 2.0.7
89
+ date: 2004-04-21
90
+ changes:
91
+ - New REFERENCE and QUICK-REFERENCE. See http://hobix.com/textile/.
92
+ - Lists rewritten to accomplish better line folding.
93
+ - Better, greedier links.
94
+ - Additional link and list tests.
95
+
96
+ - version: 2.0.6
97
+ date: 2004-04-16
98
+ changes:
99
+ - Bold and strong tags were mixed up. '*' is now strong. '**' is bold.
100
+ They were swapped until now.
101
+ - Horizontal alignments were pretty buggy. Combining alignments with
102
+ indents was totally broken.
103
+ - Fixed table problem. Now glyphs are handled between tables and blocks.
104
+ - Nested <pre> and <code> tags are now escaped. Much better handling of
105
+ HTML inside <pre> tags. Really: quite nice.
106
+ - Patch from Florian Gross to fix an html filtration inconsistency.
107
+
108
+ - version: 2.0.5
109
+ date: 2004-04-14
110
+ changes:
111
+ - Added safe mode (patch courtesy of Florian Gross).
112
+ - Added line folding (suggested by Jim Menard).
113
+ - Fixing notextile tags to work multi-line.
114
+ - Ambiguity with em-dash and block opener.
115
+ - Footnote bug. (Thanks, Jim Menard!)
116
+
117
+ - version: 2.0.4
118
+ date: 2004-04-08
119
+ changes:
120
+ - Scaled back aggresiveness of the inline matching to aid the em-dash.
121
+ - Scaled back footnotes to stay out of array indices.
122
+
123
+ - version: 2.0.3
124
+ date: 2004-04-02
125
+ changes:
126
+ - Handling of pre, code, notextile was all wrong. Also, got rid of the goofed up
127
+ split then collect. Now using gsub! and recursion to handle inlines and glyphs.
128
+ - Better acronym support.
129
+ - Suppression of Regexp warnings.
130
+ - Single- and double-quoted string wierdness. Thanks, Bret Pettichord.
131
+
132
+ - version: 2.0.2
133
+ date: 2004-03-08
134
+ changes:
135
+ - Fixed broken lists, broken tables.
136
+ - code/pre tags now escape properly, glyphs are working, spans are working when surrounded by html tags.
137
+ - Fixed classes and ids.
138
+ - Restricted notextile tags to a single line.
139
+
140
+ - version: 2.0.1
141
+ date: 2004-02-10
142
+ changes:
143
+ - Unmatched closing slash on regexps in ruby 1.6.8.
144
+ - Fixes to bulleted lists.
145
+
146
+ - version: 2.0
147
+ date: 2004-02-06
148
+ changes:
149
+ - Complete rewrite of RedCloth, against beta2 from textism.com.
150
+
151
+ - version: 0.41
152
+ date: 2003-06-20
153
+ changes:
154
+ - Newlines were outputing as escaped.
155
+
156
+ - version: 0.4
157
+ date: 2003-06-20
158
+ changes:
159
+ - Initial public release.
160
+ - Integration of YAML-based PyTextile tests.