parlement 0.10 → 0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +11 -0
- data/MEMORY +9 -1
- data/README +5 -4
- data/app/controllers/account_controller.rb +10 -13
- data/app/controllers/application.rb +4 -5
- data/app/controllers/elt_controller.rb +9 -7
- data/app/controllers/person_controller.rb +1 -3
- data/app/controllers/subscriber_controller.rb +10 -10
- data/app/helpers/elt_helper.rb +2 -0
- data/app/models/elt.rb +28 -19
- data/app/models/mail.rb +26 -14
- data/app/models/mail_notify.rb +5 -4
- data/app/models/person.rb +11 -2
- data/app/views/account/_login.rhtml +3 -3
- data/app/views/account/_show.rhtml +12 -14
- data/app/views/elt/_choice.rhtml +3 -3
- data/app/views/elt/_elt.rhtml +4 -4
- data/app/views/elt/_list.rhtml +2 -2
- data/app/views/elt/_listByDate.rhtml +1 -1
- data/app/views/elt/_listByVote.rhtml +1 -1
- data/app/views/elt/new.rhtml +3 -3
- data/app/views/elt/show.rhtml +2 -2
- data/app/views/layouts/top.rhtml +6 -0
- data/app/views/mail_notify/publish.text.html.rhtml +1 -1
- data/app/views/person/_listElts.rhtml +5 -3
- data/app/views/person/show.rhtml +1 -2
- data/config/boot.rb +5 -4
- data/config/environment.rb +6 -4
- data/config/routes.rb +3 -2
- data/db/development_structure.sql +15 -4
- data/db/migrate/006_last_activity.rb +10 -0
- data/db/schema.rb +67 -49
- data/public/dispatch.fcgi +1 -0
- data/public/javascripts/controls.js +41 -23
- data/public/javascripts/dragdrop.js +317 -99
- data/public/javascripts/effects.js +301 -166
- data/public/javascripts/prototype.js +932 -402
- data/public/stylesheets/default.css +3 -2
- data/test/unit/elt_test.rb +13 -0
- data/test/unit/mail_test.rb +3 -1
- data/vendor/plugins/engines/CHANGELOG +203 -99
- data/vendor/plugins/engines/MIT-LICENSE +1 -1
- data/vendor/plugins/engines/README +32 -384
- data/vendor/plugins/engines/Rakefile +14 -0
- data/vendor/plugins/engines/UPGRADING +93 -0
- data/vendor/plugins/engines/about.yml +7 -0
- data/vendor/plugins/engines/generators/plugin_migration/USAGE +45 -0
- data/vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb +79 -0
- data/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.erb +13 -0
- data/vendor/plugins/engines/init.rb +34 -47
- data/vendor/plugins/engines/install.rb +32 -0
- data/vendor/plugins/engines/lib/engines/{ruby_extensions.rb → deprecated_config_support.rb} +135 -113
- data/vendor/plugins/engines/lib/engines/plugin.rb +214 -0
- data/vendor/plugins/engines/lib/engines/plugin_list.rb +31 -0
- data/vendor/plugins/engines/lib/engines/plugin_migrator.rb +60 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb +19 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb +143 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/migrations.rb +155 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/public_asset_helpers.rb +116 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/rails.rb +20 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/rails_initializer.rb +86 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb +77 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/templates.rb +140 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions.rb +6 -0
- data/vendor/plugins/engines/lib/engines/testing.rb +88 -0
- data/vendor/plugins/engines/lib/engines.rb +281 -425
- data/vendor/plugins/engines/tasks/engines.rake +108 -137
- metadata +218 -250
- data/db/ROOT/perso.txt +0 -214
- data/public/images/indicator.gif +0 -0
- data/public/images/orange_by_darren_Hester_350o.jpg +0 -0
- data/public/images/smile.png +0 -0
- data/vendor/plugins/engines/generators/engine/USAGE +0 -26
- data/vendor/plugins/engines/generators/engine/engine_generator.rb +0 -199
- data/vendor/plugins/engines/generators/engine/templates/README +0 -85
- data/vendor/plugins/engines/generators/engine/templates/init_engine.erb +0 -15
- data/vendor/plugins/engines/generators/engine/templates/install.erb +0 -4
- data/vendor/plugins/engines/generators/engine/templates/lib/engine.erb +0 -6
- data/vendor/plugins/engines/generators/engine/templates/licenses/GPL +0 -18
- data/vendor/plugins/engines/generators/engine/templates/licenses/LGPL +0 -19
- data/vendor/plugins/engines/generators/engine/templates/licenses/MIT +0 -22
- data/vendor/plugins/engines/generators/engine/templates/licenses/None +0 -1
- data/vendor/plugins/engines/generators/engine/templates/public/javascripts/engine.js +0 -0
- data/vendor/plugins/engines/generators/engine/templates/public/stylesheets/engine.css +0 -0
- data/vendor/plugins/engines/generators/engine/templates/tasks/engine.rake +0 -0
- data/vendor/plugins/engines/generators/engine/templates/test/test_helper.erb +0 -17
- data/vendor/plugins/engines/lib/bundles/require_resource.rb +0 -124
- data/vendor/plugins/engines/lib/bundles.rb +0 -77
- data/vendor/plugins/engines/lib/engines/action_mailer_extensions.rb +0 -140
- data/vendor/plugins/engines/lib/engines/action_view_extensions.rb +0 -141
- data/vendor/plugins/engines/lib/engines/active_record_extensions.rb +0 -21
- data/vendor/plugins/engines/lib/engines/dependencies_extensions.rb +0 -129
- data/vendor/plugins/engines/lib/engines/migration_extensions.rb +0 -53
- data/vendor/plugins/engines/lib/engines/routing_extensions.rb +0 -28
- data/vendor/plugins/engines/lib/engines/testing_extensions.rb +0 -327
- data/vendor/plugins/engines/tasks/deprecated_engines.rake +0 -7
- data/vendor/plugins/engines/test/action_view_extensions_test.rb +0 -9
- data/vendor/plugins/engines/test/ruby_extensions_test.rb +0 -115
- data/vendor/plugins/guid/README.TXT +0 -29
- data/vendor/plugins/guid/init.rb +0 -30
- data/vendor/plugins/guid/lib/usesguid.rb +0 -37
- data/vendor/plugins/guid/lib/uuid22.rb +0 -43
- data/vendor/plugins/guid/lib/uuidtools.rb +0 -572
- data/vendor/plugins/responds_to_parent/MIT-LICENSE +0 -20
- data/vendor/plugins/responds_to_parent/README +0 -42
- data/vendor/plugins/responds_to_parent/Rakefile +0 -22
- data/vendor/plugins/responds_to_parent/init.rb +0 -1
- data/vendor/plugins/responds_to_parent/lib/responds_to_parent.rb +0 -46
- data/vendor/plugins/responds_to_parent/test/responds_to_parent_test.rb +0 -115
|
@@ -1,176 +1,147 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
# This code lets us redefine existing Rake tasks, which is extermely
|
|
2
|
+
# handy for modifying existing Rails rake tasks.
|
|
3
|
+
# Credit for this snippet of code goes to Jeremy Kemper
|
|
4
|
+
# http://pastie.caboo.se/9620
|
|
5
|
+
unless Rake::TaskManager.methods.include?(:redefine_task)
|
|
6
|
+
module Rake
|
|
7
|
+
module TaskManager
|
|
8
|
+
def redefine_task(task_class, args, &block)
|
|
9
|
+
task_name, deps = resolve_args(args)
|
|
10
|
+
task_name = task_class.scope_name(@scope, task_name)
|
|
11
|
+
deps = [deps] unless deps.respond_to?(:to_ary)
|
|
12
|
+
deps = deps.collect {|d| d.to_s }
|
|
13
|
+
task = @tasks[task_name.to_s] = task_class.new(task_name, self)
|
|
14
|
+
task.application = self
|
|
15
|
+
task.add_comment(@last_comment)
|
|
16
|
+
@last_comment = nil
|
|
17
|
+
task.enhance(deps, &block)
|
|
18
|
+
task
|
|
11
19
|
end
|
|
12
|
-
engine_base_dirs.map! {|d| [d + '/*_engine/*',
|
|
13
|
-
d + '/*_bundle/*',
|
|
14
|
-
d + '/*/init_engine.rb']}.flatten!
|
|
15
|
-
engine_dirs = FileList.new(*engine_base_dirs)
|
|
16
|
-
engine_dirs.map do |engine|
|
|
17
|
-
File.basename(File.dirname(engine))
|
|
18
|
-
end.uniq
|
|
19
20
|
end
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
desc "Display version information about active engines"
|
|
26
|
-
task :info => :environment do
|
|
27
|
-
if ENV["ENGINE"]
|
|
28
|
-
e = Engines.get(ENV["ENGINE"])
|
|
29
|
-
header = "Details for engine '#{e.name}':"
|
|
30
|
-
puts header
|
|
31
|
-
puts "-" * header.length
|
|
32
|
-
puts "Version: #{e.version}"
|
|
33
|
-
puts "Details: #{e.info}"
|
|
34
|
-
else
|
|
35
|
-
puts "Engines plugin: #{Engines.version}"
|
|
36
|
-
Engines.each do |e|
|
|
37
|
-
puts "#{e.name}: #{e.version}"
|
|
21
|
+
class Task
|
|
22
|
+
class << self
|
|
23
|
+
def redefine_task(args, &block)
|
|
24
|
+
Rake.application.redefine_task(self, args, &block)
|
|
25
|
+
end
|
|
38
26
|
end
|
|
39
27
|
end
|
|
40
28
|
end
|
|
41
29
|
end
|
|
42
30
|
|
|
31
|
+
|
|
43
32
|
namespace :db do
|
|
44
33
|
namespace :fixtures do
|
|
45
|
-
namespace :
|
|
34
|
+
namespace :plugins do
|
|
46
35
|
|
|
47
|
-
desc "Load plugin
|
|
36
|
+
desc "Load plugin fixtures into the current environment's database."
|
|
48
37
|
task :load => :environment do
|
|
49
38
|
require 'active_record/fixtures'
|
|
50
39
|
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
Dir.glob(File.join(RAILS_ROOT, 'vendor', 'plugins', ENV['PLUGIN'] || '**',
|
|
41
|
+
'test', 'fixtures', '*.yml')).each do |fixture_file|
|
|
53
42
|
Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*'))
|
|
54
43
|
end
|
|
55
44
|
end
|
|
56
45
|
|
|
57
46
|
end
|
|
58
47
|
end
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
namespace :migrate do
|
|
62
|
-
|
|
63
|
-
desc "Migrate all engines. Target specific version with VERSION=x, specific engine with ENGINE=x"
|
|
64
|
-
task :engines => :environment do
|
|
65
|
-
engines_to_migrate = ENV["ENGINE"] ? [Engines.get(ENV["ENGINE"])].compact : Engines.active
|
|
66
|
-
if engines_to_migrate.empty?
|
|
67
|
-
puts "Couldn't find an engine called '#{ENV["ENGINE"]}'"
|
|
68
|
-
else
|
|
69
|
-
if ENV["VERSION"] && !ENV["ENGINE"]
|
|
70
|
-
# ignore the VERSION, since it makes no sense in this context; we wouldn't
|
|
71
|
-
# want to revert ALL engines to the same version because of a misttype
|
|
72
|
-
puts "Ignoring the given version (#{ENV["VERSION"]})."
|
|
73
|
-
puts "To control individual engine versions, use the ENGINE=<engine> argument"
|
|
74
|
-
else
|
|
75
|
-
engines_to_migrate.each do |engine|
|
|
76
|
-
Engines::EngineMigrator.current_engine = engine
|
|
77
|
-
migration_directory = File.join(engine.root, 'db', 'migrate')
|
|
78
|
-
if File.exist?(migration_directory)
|
|
79
|
-
puts "Migrating engine '#{engine.name}'"
|
|
80
|
-
Engines::EngineMigrator.migrate(migration_directory, ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
|
|
81
|
-
else
|
|
82
|
-
puts "The db/migrate directory for engine '#{engine.name}' appears to be missing."
|
|
83
|
-
puts "Should be: #{migration_directory}"
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
if ActiveRecord::Base.schema_format == :ruby && !engines_to_migrate.empty?
|
|
87
|
-
Rake::Task[:db_schema_dump].invoke
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
namespace :engines do
|
|
94
|
-
Engines::RakeTasks.all_engines.each do |engine_name|
|
|
95
|
-
desc "Migrate the '#{engine_name}' engine. Target specific version with VERSION=x"
|
|
96
|
-
task engine_name => :environment do
|
|
97
|
-
ENV['ENGINE'] = engine_name; Rake::Task['db:migrate:engines'].invoke
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
end
|
|
103
48
|
end
|
|
104
49
|
|
|
105
|
-
|
|
106
|
-
#
|
|
107
|
-
#
|
|
108
|
-
#
|
|
50
|
+
# this is just a modification of the original task in railties/lib/tasks/documentation.rake,
|
|
51
|
+
# because the default task doesn't support subdirectories like <plugin>/app or
|
|
52
|
+
# <plugin>/component. These tasks now include every file under a plugin's code paths (see
|
|
53
|
+
# Plugin#code_paths).
|
|
109
54
|
namespace :doc do
|
|
110
55
|
|
|
111
|
-
|
|
112
|
-
|
|
56
|
+
plugins = FileList['vendor/plugins/**'].collect { |plugin| File.basename(plugin) }
|
|
57
|
+
|
|
58
|
+
namespace :plugins do
|
|
113
59
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
engine_base = "vendor/plugins/#{engine_name}"
|
|
60
|
+
# Define doc tasks for each plugin
|
|
61
|
+
plugins.each do |plugin|
|
|
62
|
+
desc "Create plugin documentation for '#{plugin}'"
|
|
63
|
+
Rake::Task.redefine_task(plugin => :environment) do
|
|
64
|
+
plugin_base = RAILS_ROOT + "/vendor/plugins/#{plugin}"
|
|
120
65
|
options = []
|
|
121
66
|
files = Rake::FileList.new
|
|
122
|
-
options << "-o doc/plugins/#{
|
|
123
|
-
options << "--title '#{
|
|
124
|
-
options << '--line-numbers --inline-source'
|
|
125
|
-
options << '--all' # include protected methods
|
|
67
|
+
options << "-o doc/plugins/#{plugin}"
|
|
68
|
+
options << "--title '#{plugin.titlecase} Plugin Documentation'"
|
|
69
|
+
options << '--line-numbers' << '--inline-source'
|
|
126
70
|
options << '-T html'
|
|
127
71
|
|
|
128
|
-
|
|
129
|
-
files.include("#{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
options << "--main '#{engine_base}/README'"
|
|
72
|
+
# Include every file in the plugin's code_paths (see Plugin#code_paths)
|
|
73
|
+
files.include("#{plugin_base}/{#{Rails.plugins[plugin].code_paths.join(",")}}/**/*.rb")
|
|
74
|
+
if File.exists?("#{plugin_base}/README")
|
|
75
|
+
files.include("#{plugin_base}/README")
|
|
76
|
+
options << "--main '#{plugin_base}/README'"
|
|
134
77
|
end
|
|
135
|
-
files.include("#{
|
|
78
|
+
files.include("#{plugin_base}/CHANGELOG") if File.exists?("#{plugin_base}/CHANGELOG")
|
|
136
79
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
80
|
+
if files.empty?
|
|
81
|
+
puts "No source files found in #{plugin_base}. No documentation will be generated."
|
|
82
|
+
else
|
|
83
|
+
options << files.to_s
|
|
84
|
+
sh %(rdoc #{options * ' '})
|
|
85
|
+
end
|
|
140
86
|
end
|
|
141
87
|
end
|
|
142
88
|
end
|
|
143
89
|
end
|
|
144
90
|
|
|
91
|
+
|
|
92
|
+
|
|
145
93
|
namespace :test do
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
t.pattern = "vendor/plugins/#{engines}/test/**/*_test.rb"
|
|
166
|
-
t.verbose = true
|
|
94
|
+
task :warn_about_multiple_plugin_testing_with_engines do
|
|
95
|
+
puts %{-~============== A Moste Polite Warninge ===========================~-
|
|
96
|
+
|
|
97
|
+
You may experience issues testing multiple plugins at once when using
|
|
98
|
+
the code-mixing features that the engines plugin provides. If you do
|
|
99
|
+
experience any problems, please test plugins individually, i.e.
|
|
100
|
+
|
|
101
|
+
$ rake test:plugins PLUGIN=my_plugin
|
|
102
|
+
|
|
103
|
+
or use the per-type plugin test tasks:
|
|
104
|
+
|
|
105
|
+
$ rake test:plugins:units
|
|
106
|
+
$ rake test:plugins:functionals
|
|
107
|
+
$ rake test:plugins:integration
|
|
108
|
+
$ rake test:plugins:all
|
|
109
|
+
|
|
110
|
+
Report any issues on http://dev.rails-engines.org. Thanks!
|
|
111
|
+
|
|
112
|
+
-~===============( ... as you were ... )============================~-}
|
|
167
113
|
end
|
|
168
114
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
115
|
+
namespace :plugins do
|
|
116
|
+
|
|
117
|
+
desc "Run the plugin tests in vendor/plugins/**/test (or specify with PLUGIN=name)"
|
|
118
|
+
task :all => [:warn_about_multiple_plugin_testing_with_engines,
|
|
119
|
+
:units, :functionals, :integration]
|
|
120
|
+
|
|
121
|
+
desc "Run all plugin unit tests"
|
|
122
|
+
Rake::TestTask.new(:units => :setup_plugin_fixtures) do |t|
|
|
123
|
+
t.pattern = "vendor/plugins/#{ENV['PLUGIN'] || "**"}/test/unit/**/*_test.rb"
|
|
124
|
+
t.verbose = true
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
desc "Run all plugin functional tests"
|
|
128
|
+
Rake::TestTask.new(:functionals => :setup_plugin_fixtures) do |t|
|
|
129
|
+
t.pattern = "vendor/plugins/#{ENV['PLUGIN'] || "**"}/test/functional/**/*_test.rb"
|
|
130
|
+
t.verbose = true
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
desc "Integration test engines"
|
|
134
|
+
Rake::TestTask.new(:integration => :setup_plugin_fixtures) do |t|
|
|
135
|
+
t.pattern = "vendor/plugins/#{ENV['PLUGIN'] || "**"}/test/integration/**/*_test.rb"
|
|
136
|
+
t.verbose = true
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
desc "Mirrors plugin fixtures into a single location to help plugin tests"
|
|
140
|
+
task :setup_plugin_fixtures => :environment do
|
|
141
|
+
Engines::Testing.setup_plugin_fixtures
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Patch the default plugin testing task to have setup_plugin_fixtures as a prerequisite
|
|
145
|
+
Rake::Task["test:plugins"].prerequisites << "test:plugins:setup_plugin_fixtures"
|
|
146
|
+
end
|
|
176
147
|
end
|