parlement 0.14 → 0.17
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +41 -1
- data/MEMORY +66 -5
- data/README +10 -5
- data/Rakefile +15 -23
- data/app/controllers/account_controller.rb +48 -43
- data/app/controllers/{application.rb → application_controller.rb} +15 -12
- data/app/controllers/elt_controller.rb +77 -32
- data/app/controllers/subscriber_controller.rb +11 -10
- data/app/helpers/application_helper.rb +14 -1
- data/app/helpers/elt_helper.rb +9 -7
- data/app/models/elt.rb +25 -24
- data/app/models/mail.rb +44 -47
- data/app/models/person_notify.rb +2 -2
- data/app/models/user.rb +128 -2
- data/app/models/user_notify.rb +15 -15
- data/app/views/account/_login.rhtml +39 -39
- data/app/views/account/_show.rhtml +22 -30
- data/app/views/account/signup.rhtml +2 -2
- data/app/views/elt/_choice.rhtml +6 -6
- data/app/views/elt/_elt.rhtml +27 -32
- data/app/views/elt/choices.rhtml +16 -18
- data/app/views/elt/list/_byDate.rhtml +14 -14
- data/app/views/elt/list/_byVote.rhtml +15 -15
- data/app/views/elt/list/_children.rhtml +48 -40
- data/app/views/elt/list/_subscribers.rhtml +1 -1
- data/app/views/elt/new.rhtml +22 -21
- data/app/views/elt/rss.rxml +4 -11
- data/app/views/elt/show.rhtml +65 -61
- data/app/views/elt/vote_rss.rxml +4 -11
- data/app/views/layouts/top.rhtml +39 -50
- data/app/views/person/_listElts.rhtml +1 -1
- data/app/views/person/show.rhtml +1 -1
- data/{vendor/plugins/login_engine/app → app}/views/user_notify/change_password.rhtml +0 -0
- data/{vendor/plugins/login_engine/app → app}/views/user_notify/delete.rhtml +0 -0
- data/{vendor/plugins/login_engine/app → app}/views/user_notify/forgot_password.rhtml +0 -0
- data/{vendor/plugins/login_engine/app → app}/views/user_notify/pending_delete.rhtml +0 -0
- data/{vendor/plugins/login_engine/app → app}/views/user_notify/signup.rhtml +0 -0
- data/config/boot.rb +97 -32
- data/config/environment.rb +37 -35
- data/config/environments/development.rb +2 -3
- data/config/environments/production.rb +3 -0
- data/config/initializers/string_ruby_1.8.rb +10 -0
- data/config/routes.rb +17 -22
- data/db/schema.rb +102 -74
- data/lib/tasks/rspec.rake +167 -0
- data/public/404.html +25 -7
- data/public/500.html +26 -7
- data/public/dispatch.cgi +0 -0
- data/public/dispatch.fcgi +0 -0
- data/public/dispatch.rb +0 -0
- data/public/images/live_tree_branch_collapsed_icon.gif +0 -0
- data/public/images/live_tree_branch_expanded_icon.gif +0 -0
- data/public/images/live_tree_leaf_icon.gif +0 -0
- data/public/javascripts/application.js +258 -0
- data/public/javascripts/controls.js +544 -414
- data/public/javascripts/dragdrop.js +229 -198
- data/public/javascripts/effects.js +499 -459
- data/public/javascripts/prototype.js +2926 -1121
- data/public/javascripts/shadedborder.js +68 -50
- data/public/stylesheets/default.css +34 -34
- data/public/stylesheets/live_tree.css +0 -0
- data/public/stylesheets/scaffold.css +6 -6
- data/script/about +0 -0
- data/script/autospec +6 -0
- data/script/benchmarker +0 -0
- data/script/breakpointer +0 -0
- data/script/console +0 -0
- data/script/dbconsole +3 -0
- data/script/destroy +0 -0
- data/script/generate +0 -0
- data/script/plugin +0 -0
- data/script/profiler +0 -0
- data/script/runner +0 -0
- data/script/server +0 -0
- data/script/spec +10 -0
- data/script/spec_server +9 -0
- data/test/unit/attachment_test.rb +4 -4
- data/test/unit/choice_test.rb +1 -1
- data/test/unit/elt_test.rb +9 -9
- data/test/unit/mail_notify_test.rb +2 -2
- data/test/unit/mail_test.rb +18 -11
- data/test/unit/person_notify_test.rb +1 -1
- data/test/unit/person_test.rb +1 -1
- data/test/unit/subscriber_test.rb +1 -1
- data/test/unit/user_test.rb +81 -0
- data/test/unit/visit_test.rb +6 -6
- data/vendor/plugins/activerecord_foreign_key_extensions/init.rb +2 -0
- data/vendor/plugins/activerecord_foreign_key_extensions/lib/active_record_extensions.rb +182 -0
- data/vendor/plugins/activerecord_text_id_extensions/init.rb +2 -0
- data/vendor/plugins/activerecord_text_id_extensions/lib/active_record_extensions.rb +24 -0
- data/vendor/plugins/acts_as_nested_set/README +15 -0
- data/vendor/plugins/acts_as_nested_set/init.rb +1 -0
- data/vendor/plugins/acts_as_nested_set/lib/active_record/acts/nested_set.rb +210 -0
- data/vendor/plugins/acts_as_nested_set/test/nested_set_test.rb +269 -0
- data/vendor/plugins/acts_as_tree/README +26 -0
- data/vendor/plugins/acts_as_tree/Rakefile +22 -0
- data/vendor/plugins/acts_as_tree/init.rb +1 -0
- data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +96 -0
- data/vendor/plugins/{output_compression/CHANGELOG → acts_as_tree/test/abstract_unit.rb} +0 -0
- data/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +219 -0
- data/vendor/plugins/acts_as_tree/test/database.yml +0 -0
- data/vendor/plugins/acts_as_tree/test/fixtures/mixin.rb +0 -0
- data/vendor/plugins/acts_as_tree/test/fixtures/mixins.yml +0 -0
- data/vendor/plugins/acts_as_tree/test/schema.rb +0 -0
- data/vendor/plugins/classic_pagination/CHANGELOG +152 -0
- data/vendor/plugins/classic_pagination/README +18 -0
- data/vendor/plugins/{output_compression/rakefile → classic_pagination/Rakefile} +22 -22
- data/vendor/plugins/classic_pagination/init.rb +33 -0
- data/vendor/plugins/classic_pagination/install.rb +1 -0
- data/vendor/plugins/classic_pagination/lib/pagination.rb +405 -0
- data/vendor/plugins/classic_pagination/lib/pagination_helper.rb +135 -0
- data/vendor/plugins/classic_pagination/test/fixtures/companies.yml +24 -0
- data/vendor/plugins/classic_pagination/test/fixtures/company.rb +9 -0
- data/vendor/plugins/classic_pagination/test/fixtures/developer.rb +7 -0
- data/vendor/plugins/classic_pagination/test/fixtures/developers.yml +21 -0
- data/vendor/plugins/classic_pagination/test/fixtures/developers_projects.yml +13 -0
- data/vendor/plugins/classic_pagination/test/fixtures/project.rb +3 -0
- data/vendor/plugins/classic_pagination/test/fixtures/projects.yml +7 -0
- data/vendor/plugins/classic_pagination/test/fixtures/replies.yml +13 -0
- data/vendor/plugins/classic_pagination/test/fixtures/reply.rb +5 -0
- data/vendor/plugins/classic_pagination/test/fixtures/schema.sql +42 -0
- data/vendor/plugins/classic_pagination/test/fixtures/topic.rb +3 -0
- data/vendor/plugins/classic_pagination/test/fixtures/topics.yml +22 -0
- data/vendor/plugins/classic_pagination/test/helper.rb +117 -0
- data/vendor/plugins/classic_pagination/test/pagination_helper_test.rb +38 -0
- data/vendor/plugins/classic_pagination/test/pagination_test.rb +177 -0
- data/vendor/plugins/file_column/lib/file_column.rb +1 -1
- data/vendor/plugins/file_column/test/file_column_test.rb +0 -0
- metadata +151 -197
- data/app/helpers/live_tree.rb +0 -238
- data/app/views/elt/_form.rhtml +0 -31
- data/app/views/elt/show_tree.rhtml +0 -8
- data/config/environments/user_environment.rb +0 -1
- data/db/ROOT/Titemagli.txt +0 -3
- data/db/ROOT/titemagli.txt +0 -9
- data/public/javascripts/behaviour.js +0 -254
- data/public/javascripts/ie7-load.htc +0 -1
- data/public/javascripts/ie7.js +0 -6
- data/public/javascripts/live_tree.js +0 -749
- data/public/javascripts/mybehaviour.js +0 -225
- data/public/javascripts/scriptaculous.js +0 -47
- data/public/javascripts/slider.js +0 -283
- data/public/stylesheets/blue.css +0 -471
- data/vendor/plugins/engines/CHANGELOG +0 -241
- data/vendor/plugins/engines/MIT-LICENSE +0 -21
- data/vendor/plugins/engines/README +0 -64
- data/vendor/plugins/engines/Rakefile +0 -32
- data/vendor/plugins/engines/UPGRADING +0 -93
- data/vendor/plugins/engines/about.yml +0 -7
- data/vendor/plugins/engines/generators/plugin_migration/USAGE +0 -45
- data/vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb +0 -79
- data/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.erb +0 -13
- data/vendor/plugins/engines/init.rb +0 -40
- data/vendor/plugins/engines/install.rb +0 -32
- data/vendor/plugins/engines/lib/engines.rb +0 -323
- data/vendor/plugins/engines/lib/engines/deprecated_config_support.rb +0 -135
- data/vendor/plugins/engines/lib/engines/plugin.rb +0 -214
- data/vendor/plugins/engines/lib/engines/plugin_list.rb +0 -31
- data/vendor/plugins/engines/lib/engines/plugin_migrator.rb +0 -60
- data/vendor/plugins/engines/lib/engines/rails_extensions.rb +0 -6
- data/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb +0 -19
- data/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb +0 -143
- data/vendor/plugins/engines/lib/engines/rails_extensions/migrations.rb +0 -155
- data/vendor/plugins/engines/lib/engines/rails_extensions/public_asset_helpers.rb +0 -116
- data/vendor/plugins/engines/lib/engines/rails_extensions/rails.rb +0 -20
- data/vendor/plugins/engines/lib/engines/rails_extensions/rails_initializer.rb +0 -86
- data/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb +0 -77
- data/vendor/plugins/engines/lib/engines/rails_extensions/templates.rb +0 -140
- data/vendor/plugins/engines/lib/engines/testing.rb +0 -87
- data/vendor/plugins/engines/tasks/engines.rake +0 -149
- data/vendor/plugins/login_engine/CHANGELOG +0 -22
- data/vendor/plugins/login_engine/README +0 -344
- data/vendor/plugins/login_engine/app/controllers/user_controller.rb +0 -262
- data/vendor/plugins/login_engine/app/helpers/user_helper.rb +0 -88
- data/vendor/plugins/login_engine/app/models/user.rb +0 -7
- data/vendor/plugins/login_engine/app/models/user_notify.rb +0 -75
- data/vendor/plugins/login_engine/app/views/user/_edit.rhtml +0 -11
- data/vendor/plugins/login_engine/app/views/user/_password.rhtml +0 -9
- data/vendor/plugins/login_engine/app/views/user/change_password.rhtml +0 -17
- data/vendor/plugins/login_engine/app/views/user/edit.rhtml +0 -23
- data/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml +0 -18
- data/vendor/plugins/login_engine/app/views/user/home.rhtml +0 -7
- data/vendor/plugins/login_engine/app/views/user/login.rhtml +0 -17
- data/vendor/plugins/login_engine/app/views/user/logout.rhtml +0 -8
- data/vendor/plugins/login_engine/app/views/user/signup.rhtml +0 -17
- data/vendor/plugins/login_engine/db/migrate/001_initial_schema.rb +0 -25
- data/vendor/plugins/login_engine/init_engine.rb +0 -11
- data/vendor/plugins/login_engine/install.rb +0 -4
- data/vendor/plugins/login_engine/lib/login_engine.rb +0 -62
- data/vendor/plugins/login_engine/lib/login_engine/authenticated_system.rb +0 -113
- data/vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb +0 -155
- data/vendor/plugins/login_engine/public/stylesheets/login_engine.css +0 -81
- data/vendor/plugins/login_engine/test/fixtures/users.yml +0 -41
- data/vendor/plugins/login_engine/test/functional/user_controller_test.rb +0 -536
- data/vendor/plugins/login_engine/test/mocks/mail.rb +0 -14
- data/vendor/plugins/login_engine/test/mocks/time.rb +0 -19
- data/vendor/plugins/login_engine/test/test_helper.rb +0 -11
- data/vendor/plugins/login_engine/test/unit/user_test.rb +0 -114
- data/vendor/plugins/output_compression/MIT-LICENSE +0 -20
- data/vendor/plugins/output_compression/README +0 -4
- data/vendor/plugins/output_compression/init.rb +0 -1
- data/vendor/plugins/output_compression/lib/output_compression.rb +0 -84
- data/vendor/plugins/output_compression/test/output_test.rb +0 -11
- data/vendor/plugins/output_compression/test/test_controller.rb +0 -3
- data/vendor/plugins/output_compression/test/test_helper.rb +0 -14
data/config/environment.rb
CHANGED
@@ -39,10 +39,24 @@ Rails::Initializer.run do |config|
|
|
39
39
|
# Use Active Record's schema dumper instead of SQL when creating the test database
|
40
40
|
# (enables use of different database adapters for development and test environments)
|
41
41
|
# config.active_record.schema_format = :ruby
|
42
|
-
# echarp
|
43
|
-
config.active_record.schema_format = :sql
|
44
42
|
|
45
43
|
# See Rails::Configuration for more options
|
44
|
+
|
45
|
+
config.action_controller.session = {
|
46
|
+
:session_key => "_parlement_session",
|
47
|
+
:secret => "phrase of at least 30 characters"
|
48
|
+
}
|
49
|
+
|
50
|
+
config.gem "term-ansicolor", :lib => "term/ansicolor"
|
51
|
+
config.gem "ruby-debug"
|
52
|
+
config.gem "RedCloth", :lib => "redcloth"
|
53
|
+
|
54
|
+
config.gem 'locale'
|
55
|
+
config.gem "locale_rails"
|
56
|
+
config.gem "gettext_activerecord"
|
57
|
+
config.gem "gettext_rails"
|
58
|
+
|
59
|
+
config.gem "meta_project"
|
46
60
|
end
|
47
61
|
|
48
62
|
# Add new inflection rules using the following format
|
@@ -56,16 +70,6 @@ end
|
|
56
70
|
|
57
71
|
# Include your application configuration below
|
58
72
|
|
59
|
-
|
60
|
-
|
61
|
-
# http://www.kanthak.net/opensource/file_column/
|
62
|
-
require 'rails_file_column'
|
63
|
-
|
64
|
-
require 'jcode'
|
65
|
-
$KCODE = 'u'
|
66
|
-
|
67
|
-
require 'gettext/rails'
|
68
|
-
|
69
73
|
# What is the name of a quick anonymous poster
|
70
74
|
ANONYMOUS_POSTER = 'anon'
|
71
75
|
|
@@ -79,38 +83,36 @@ LIST_LENGTH = 10
|
|
79
83
|
# Number of elt's paragraphs to show initially
|
80
84
|
NB_PARAGRAPH_TO_DISPLAY = 4
|
81
85
|
|
82
|
-
|
86
|
+
# Number of seconds between sidebar list automatic updates
|
87
|
+
UPDATE_VIEW_PERIOD = 300
|
83
88
|
|
84
89
|
CONFIG = { :default_language => 'en' }
|
85
90
|
|
86
91
|
# This variable is of course used for mails, but also in the html mail
|
87
92
|
# template, to set the base url for the generated html
|
88
93
|
ActionMailer::Base.smtp_settings = {
|
89
|
-
|
94
|
+
:domain => 'leparlement.org'
|
90
95
|
}
|
91
96
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
"deprecated_config_support")
|
103
|
-
|
104
|
-
module LoginEngine
|
105
|
-
config :salt, 'parle'
|
106
|
-
config :email_from, 'facteur@leparlement.org'
|
107
|
-
config :admin_email, 'root@leparlement.org'
|
108
|
-
config :app_url, 'http://leparlement.org'
|
109
|
-
config :app_name, 'parlement'
|
110
|
-
config :use_email_notification, true
|
111
|
-
end
|
97
|
+
LOGIN_ENGINE = {
|
98
|
+
:salt => 'parle',
|
99
|
+
:email_from => 'facteur@leparlement.org',
|
100
|
+
:admin_email => 'root@leparlement.org',
|
101
|
+
:app_url => 'http://leparlement.org',
|
102
|
+
:app_name => 'parlement',
|
103
|
+
:use_email_notification => true,
|
104
|
+
:mail_charset => 'utf-8',
|
105
|
+
:security_token_life_hours => 24
|
106
|
+
}
|
112
107
|
|
113
108
|
Rubaidh::GoogleAnalytics.tracker_id = 'UA-317241-1'
|
114
109
|
|
115
|
-
PARLEMENT_VERSION='0.
|
110
|
+
PARLEMENT_VERSION = '0.17'
|
111
|
+
|
112
|
+
def log_to(stream)
|
113
|
+
ActiveRecord::Base.logger = Logger.new(stream)
|
114
|
+
ActiveRecord::Base.clear_active_connections!
|
115
|
+
end
|
116
|
+
|
117
|
+
#log_to STDOUT
|
116
118
|
|
@@ -8,9 +8,6 @@ config.cache_classes = false
|
|
8
8
|
# Log error messages when you accidentally call methods on nil.
|
9
9
|
config.whiny_nils = true
|
10
10
|
|
11
|
-
# Enable the breakpoint server that script/breakpointer connects to
|
12
|
-
config.breakpoint_server = true
|
13
|
-
|
14
11
|
# Show full error reports and disable caching
|
15
12
|
config.action_controller.consider_all_requests_local = true
|
16
13
|
config.action_controller.perform_caching = true
|
@@ -19,3 +16,5 @@ config.action_controller.perform_caching = true
|
|
19
16
|
config.action_mailer.raise_delivery_errors = false
|
20
17
|
|
21
18
|
config.action_mailer.delivery_method = :test
|
19
|
+
|
20
|
+
require 'ruby-debug'
|
data/config/routes.rb
CHANGED
@@ -1,36 +1,31 @@
|
|
1
1
|
ActionController::Routing::Routes.draw do |map|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
# Here's a sample route:
|
6
|
-
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
7
|
-
# Keep in mind you can assign values other than :controller and :action
|
2
|
+
# Add your own custom routes here.
|
3
|
+
# The priority is based upon order of creation: first created -> highest priority.
|
8
4
|
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
# Here's a sample route:
|
6
|
+
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
7
|
+
# Keep in mind you can assign values other than :controller and :action
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
map.connect '
|
9
|
+
# You can have the root of your site routed by hooking up ''
|
10
|
+
# -- just remember to delete public/index.html.
|
11
|
+
# map.connect '', :controller => "welcome"
|
12
|
+
|
13
|
+
# This is to get clean nice rss urls, the empty id is necessary... it seems
|
14
|
+
map.connect 'index.rss', :controller => 'elt', :action => 'rss', :id => ''
|
15
|
+
map.connect 'vote.rss', :controller => 'elt', :action => 'vote_rss', :id => ''
|
16
16
|
|
17
17
|
map.connect ':id/index.rss', :controller => 'elt', :action => 'rss'
|
18
18
|
map.connect ':id/vote.rss', :controller => 'elt', :action => 'vote_rss'
|
19
|
-
map.connect ':id//index.rss', :controller => 'elt', :action => 'rss'
|
20
|
-
map.connect ':id//vote.rss', :controller => 'elt', :action => 'vote_rss'
|
21
|
-
|
22
|
-
# Allow downloading Web Service WSDL as a file with an extension
|
23
|
-
# instead of a file named 'wsdl'
|
24
|
-
#map.connect ':controller/service.wsdl', :action => 'wsdl'
|
25
19
|
|
26
20
|
map.connect ':id', :controller => 'elt', :action => 'rss', :requirements => { :id => /.*\.rss/ }
|
27
|
-
map.connect ':id', :controller => 'elt'
|
21
|
+
map.connect ':id', :controller => 'elt'
|
28
22
|
|
29
|
-
|
30
|
-
|
23
|
+
# Install the default route as the lowest priority.
|
24
|
+
map.connect ':controller/:action/:id'
|
31
25
|
|
32
|
-
map.connect 'perso/:id', :controller => 'elt'
|
26
|
+
map.connect 'perso/:id', :controller => 'elt'
|
33
27
|
map.connect 'perso/:id/index.rss', :controller => 'elt', :action => 'rss'
|
28
|
+
map.connect 'perso/:id/vote.rss', :controller => 'elt', :action => 'rss'
|
34
29
|
map.connect 'perso/blog/:id', :controller => 'elt'
|
35
30
|
map.connect 'perso/blog/:id/index.rss', :controller => 'elt', :action => 'rss'
|
36
31
|
map.connect 'perso/blog/:id/vote.rss', :controller => 'elt', :action => 'vote_rss'
|
data/db/schema.rb
CHANGED
@@ -1,130 +1,158 @@
|
|
1
|
-
# This file is
|
2
|
-
# migrations feature of
|
1
|
+
# This file is auto-generated from the current state of the database. Instead of editing this file,
|
2
|
+
# please use the migrations feature of Active Record to incrementally modify your database, and
|
3
3
|
# then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
|
6
|
+
# to create the application database on another system, you should be using db:schema:load, not running
|
7
|
+
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
8
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
9
|
+
#
|
10
|
+
# It's strongly recommended to check this file into your version control system.
|
4
11
|
|
5
12
|
ActiveRecord::Schema.define(:version => 9) do
|
6
13
|
|
7
14
|
create_table "attachments", :force => true do |t|
|
8
|
-
t.
|
9
|
-
t.
|
10
|
-
t.
|
11
|
-
t.
|
15
|
+
t.text "elt_id", :null => false
|
16
|
+
t.datetime "created_on", :null => false
|
17
|
+
t.text "content_type"
|
18
|
+
t.text "file"
|
12
19
|
end
|
13
20
|
|
21
|
+
remove_column :attachments, :id
|
22
|
+
add_column :attachments, :id, :text, :null => false, :primary_key => true
|
23
|
+
execute 'ALTER TABLE attachments ADD CONSTRAINT attachments_pkey PRIMARY KEY (id)'
|
24
|
+
|
14
25
|
create_table "choices", :force => true do |t|
|
15
|
-
t.
|
16
|
-
t.
|
17
|
-
t.
|
18
|
-
t.
|
26
|
+
t.string "elt_id", :null => false
|
27
|
+
t.string "person_id"
|
28
|
+
t.datetime "created_on", :null => false
|
29
|
+
t.integer "value", :default => 1, :null => false
|
19
30
|
end
|
20
31
|
|
21
32
|
add_index "choices", ["elt_id", "person_id"], :name => "elt_person_key", :unique => true
|
22
33
|
|
23
34
|
create_table "delegations", :force => true do |t|
|
24
|
-
t.
|
25
|
-
t.
|
26
|
-
t.
|
27
|
-
t.
|
28
|
-
t.
|
35
|
+
t.text "elt_id", :null => false
|
36
|
+
t.text "person_id", :null => false
|
37
|
+
t.datetime "created_on", :null => false
|
38
|
+
t.boolean "temporary", :default => false, :null => false
|
39
|
+
t.text "delegate_to", :null => false
|
29
40
|
end
|
30
41
|
|
31
42
|
create_table "elts", :force => true do |t|
|
32
|
-
t.
|
33
|
-
t.
|
34
|
-
t.
|
35
|
-
t.
|
36
|
-
t.
|
37
|
-
t.
|
38
|
-
t.
|
39
|
-
t.
|
40
|
-
t.
|
41
|
-
t.
|
43
|
+
t.text "parent_id"
|
44
|
+
t.float "position"
|
45
|
+
t.datetime "created_on", :null => false
|
46
|
+
t.text "person_id"
|
47
|
+
t.text "subject"
|
48
|
+
t.text "body"
|
49
|
+
t.integer "lft"
|
50
|
+
t.integer "rgt"
|
51
|
+
t.integer "elts_count", :default => 0
|
52
|
+
t.datetime "last_activity"
|
42
53
|
end
|
43
54
|
|
55
|
+
add_index "elts", ["lft"], :name => "lft"
|
44
56
|
add_index "elts", ["parent_id"], :name => "elts_parent"
|
45
57
|
add_index "elts", ["parent_id"], :name => "elts_parent_key"
|
46
|
-
add_index "elts", ["lft"], :name => "lft"
|
47
58
|
add_index "elts", ["rgt"], :name => "rgt"
|
48
59
|
|
60
|
+
remove_column :elts, :id
|
61
|
+
add_column :elts, :id, :text, :null => false, :primary_key => true
|
62
|
+
execute 'ALTER TABLE elts ADD CONSTRAINT elts_pkey PRIMARY KEY (id)'
|
63
|
+
|
49
64
|
create_table "engine_schema_info", :id => false, :force => true do |t|
|
50
|
-
t.
|
51
|
-
t.
|
65
|
+
t.string "engine_name"
|
66
|
+
t.integer "version"
|
52
67
|
end
|
53
68
|
|
54
69
|
create_table "mails", :force => true do |t|
|
55
|
-
t.
|
56
|
-
t.
|
57
|
-
t.
|
58
|
-
t.
|
70
|
+
t.text "elt_id", :null => false
|
71
|
+
t.text "message"
|
72
|
+
t.text "mail_parents"
|
73
|
+
t.text "file"
|
59
74
|
end
|
60
75
|
|
76
|
+
remove_column :mails, :id
|
77
|
+
add_column :mails, :id, :text, :null => false, :primary_key => true
|
78
|
+
execute 'ALTER TABLE mails ADD CONSTRAINT mails_pkey PRIMARY KEY (id)'
|
79
|
+
|
61
80
|
create_table "old_visits", :force => true do |t|
|
62
|
-
t.
|
63
|
-
t.
|
64
|
-
t.
|
65
|
-
t.
|
66
|
-
t.
|
81
|
+
t.string "person_id"
|
82
|
+
t.string "elt_id", :null => false
|
83
|
+
t.datetime "created_on", :null => false
|
84
|
+
t.datetime "updated_on"
|
85
|
+
t.integer "filter", :default => 0
|
67
86
|
end
|
68
87
|
|
69
|
-
add_index "old_visits", ["
|
88
|
+
add_index "old_visits", ["elt_id", "person_id"], :name => "old_visits_elt_person_key", :unique => true
|
70
89
|
|
71
90
|
create_table "people", :force => true do |t|
|
72
|
-
t.
|
73
|
-
t.
|
74
|
-
t.
|
75
|
-
t.
|
76
|
-
t.
|
91
|
+
t.datetime "created_on", :null => false
|
92
|
+
t.text "name"
|
93
|
+
t.text "email"
|
94
|
+
t.text "image"
|
95
|
+
t.datetime "last_login"
|
77
96
|
end
|
78
97
|
|
79
98
|
add_index "people", ["name"], :name => "people_name_key", :unique => true
|
80
99
|
|
100
|
+
remove_column :people, :id
|
101
|
+
add_column :people, :id, :text, :null => false, :primary_key => true
|
102
|
+
execute 'ALTER TABLE people ADD CONSTRAINT people_pkey PRIMARY KEY (id)'
|
103
|
+
|
81
104
|
create_table "person_mails", :force => true do |t|
|
82
|
-
t.
|
83
|
-
t.
|
84
|
-
t.
|
105
|
+
t.string "mail_id", :null => false
|
106
|
+
t.string "person_id"
|
107
|
+
t.datetime "created_on", :null => false
|
108
|
+
end
|
109
|
+
|
110
|
+
create_table "plugin_schema_info", :id => false, :force => true do |t|
|
111
|
+
t.string "plugin_name"
|
112
|
+
t.integer "version"
|
85
113
|
end
|
86
114
|
|
87
115
|
create_table "subscriptions", :force => true do |t|
|
88
|
-
t.
|
89
|
-
t.
|
90
|
-
t.
|
91
|
-
t.
|
116
|
+
t.text "elt_id", :null => false
|
117
|
+
t.text "person_id", :null => false
|
118
|
+
t.integer "filter", :default => 0
|
119
|
+
t.datetime "created_on", :null => false
|
92
120
|
end
|
93
121
|
|
94
122
|
create_table "users", :force => true do |t|
|
95
|
-
t.
|
96
|
-
t.
|
97
|
-
t.
|
98
|
-
t.
|
99
|
-
t.
|
100
|
-
t.
|
101
|
-
t.
|
102
|
-
t.
|
103
|
-
t.
|
104
|
-
t.
|
105
|
-
t.
|
106
|
-
t.
|
123
|
+
t.text "login", :null => false
|
124
|
+
t.string "salted_password", :limit => 40, :null => false
|
125
|
+
t.string "email", :limit => 60
|
126
|
+
t.string "firstname", :limit => 40
|
127
|
+
t.string "lastname", :limit => 40
|
128
|
+
t.string "salt", :limit => 40, :null => false
|
129
|
+
t.integer "verified", :default => 0
|
130
|
+
t.string "role", :limit => 40
|
131
|
+
t.string "security_token", :limit => 40
|
132
|
+
t.datetime "token_expiry"
|
133
|
+
t.integer "deleted", :default => 0
|
134
|
+
t.datetime "delete_after"
|
107
135
|
end
|
108
136
|
|
109
137
|
create_table "usersold", :force => true do |t|
|
110
|
-
t.
|
111
|
-
t.
|
112
|
-
t.
|
113
|
-
t.
|
114
|
-
t.
|
115
|
-
t.
|
138
|
+
t.text "person_id", :null => false
|
139
|
+
t.text "salted_password"
|
140
|
+
t.text "salt"
|
141
|
+
t.integer "verified", :default => 0
|
142
|
+
t.text "new_email"
|
143
|
+
t.text "security_token"
|
116
144
|
end
|
117
145
|
|
118
146
|
add_index "usersold", ["person_id"], :name => "usersold_person_id_key", :unique => true
|
119
147
|
|
120
148
|
create_table "visits", :force => true do |t|
|
121
|
-
t.
|
122
|
-
t.
|
123
|
-
t.
|
124
|
-
t.
|
125
|
-
t.
|
149
|
+
t.string "person_id"
|
150
|
+
t.string "elt_id", :null => false
|
151
|
+
t.datetime "created_on", :null => false
|
152
|
+
t.datetime "updated_on"
|
153
|
+
t.integer "filter", :default => 0
|
126
154
|
end
|
127
155
|
|
128
|
-
add_index "visits", ["
|
156
|
+
add_index "visits", ["elt_id", "person_id"], :name => "visits_elt_person_key", :unique => true
|
129
157
|
|
130
158
|
end
|
@@ -0,0 +1,167 @@
|
|
1
|
+
gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
|
2
|
+
rspec_plugin_dir = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec')
|
3
|
+
$LOAD_PATH.unshift("#{rspec_plugin_dir}/lib") if File.exist?(rspec_plugin_dir)
|
4
|
+
|
5
|
+
# Don't load rspec if running "rake gems:*"
|
6
|
+
unless ARGV.any? {|a| a =~ /^gems/}
|
7
|
+
|
8
|
+
begin
|
9
|
+
require 'spec/rake/spectask'
|
10
|
+
rescue MissingSourceFile
|
11
|
+
module Spec
|
12
|
+
module Rake
|
13
|
+
class SpecTask
|
14
|
+
def initialize(name)
|
15
|
+
task name do
|
16
|
+
# if rspec-rails is a configured gem, this will output helpful material and exit ...
|
17
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../config/environment")
|
18
|
+
|
19
|
+
# ... otherwise, do this:
|
20
|
+
raise <<-MSG
|
21
|
+
|
22
|
+
#{"*" * 80}
|
23
|
+
* You are trying to run an rspec rake task defined in
|
24
|
+
* #{__FILE__},
|
25
|
+
* but rspec can not be found in vendor/gems, vendor/plugins or system gems.
|
26
|
+
#{"*" * 80}
|
27
|
+
MSG
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
Rake.application.instance_variable_get('@tasks').delete('default')
|
36
|
+
|
37
|
+
spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
|
38
|
+
task :noop do
|
39
|
+
end
|
40
|
+
|
41
|
+
task :default => :spec
|
42
|
+
task :stats => "spec:statsetup"
|
43
|
+
|
44
|
+
desc "Run all specs in spec directory (excluding plugin specs)"
|
45
|
+
Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
|
46
|
+
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
47
|
+
t.spec_files = FileList['spec/**/*/*_spec.rb']
|
48
|
+
end
|
49
|
+
|
50
|
+
namespace :spec do
|
51
|
+
desc "Run all specs in spec directory with RCov (excluding plugin specs)"
|
52
|
+
Spec::Rake::SpecTask.new(:rcov) do |t|
|
53
|
+
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
54
|
+
t.spec_files = FileList['spec/**/*/*_spec.rb']
|
55
|
+
t.rcov = true
|
56
|
+
t.rcov_opts = lambda do
|
57
|
+
IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
desc "Print Specdoc for all specs (excluding plugin specs)"
|
62
|
+
Spec::Rake::SpecTask.new(:doc) do |t|
|
63
|
+
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
64
|
+
t.spec_files = FileList['spec/**/*/*_spec.rb']
|
65
|
+
end
|
66
|
+
|
67
|
+
desc "Print Specdoc for all plugin examples"
|
68
|
+
Spec::Rake::SpecTask.new(:plugin_doc) do |t|
|
69
|
+
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
70
|
+
t.spec_files = FileList['vendor/plugins/**/spec/**/*/*_spec.rb'].exclude('vendor/plugins/rspec/*')
|
71
|
+
end
|
72
|
+
|
73
|
+
[:models, :controllers, :views, :helpers, :lib].each do |sub|
|
74
|
+
desc "Run the code examples in spec/#{sub}"
|
75
|
+
Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
|
76
|
+
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
77
|
+
t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
desc "Run the code examples in vendor/plugins (except RSpec's own)"
|
82
|
+
Spec::Rake::SpecTask.new(:plugins => spec_prereq) do |t|
|
83
|
+
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
84
|
+
t.spec_files = FileList['vendor/plugins/**/spec/**/*/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude("vendor/plugins/rspec-rails/*")
|
85
|
+
end
|
86
|
+
|
87
|
+
namespace :plugins do
|
88
|
+
desc "Runs the examples for rspec_on_rails"
|
89
|
+
Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
|
90
|
+
t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
|
91
|
+
t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*/*_spec.rb']
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Setup specs for stats
|
96
|
+
task :statsetup do
|
97
|
+
require 'code_statistics'
|
98
|
+
::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
|
99
|
+
::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
|
100
|
+
::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
|
101
|
+
::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
|
102
|
+
::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
|
103
|
+
::STATS_DIRECTORIES << %w(Routing\ specs spec/routing) if File.exist?('spec/routing')
|
104
|
+
::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models')
|
105
|
+
::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views')
|
106
|
+
::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers')
|
107
|
+
::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers')
|
108
|
+
::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib')
|
109
|
+
::CodeStatistics::TEST_TYPES << "Routing specs" if File.exist?('spec/routing')
|
110
|
+
end
|
111
|
+
|
112
|
+
namespace :db do
|
113
|
+
namespace :fixtures do
|
114
|
+
desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y. Load from subdirectory in test/fixtures using FIXTURES_DIR=z."
|
115
|
+
task :load => :environment do
|
116
|
+
ActiveRecord::Base.establish_connection(Rails.env)
|
117
|
+
base_dir = File.join(Rails.root, 'spec', 'fixtures')
|
118
|
+
fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir
|
119
|
+
|
120
|
+
require 'active_record/fixtures'
|
121
|
+
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/).map {|f| File.join(fixtures_dir, f) } : Dir.glob(File.join(fixtures_dir, '*.{yml,csv}'))).each do |fixture_file|
|
122
|
+
Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*'))
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
namespace :server do
|
129
|
+
daemonized_server_pid = File.expand_path("#{RAILS_ROOT}/tmp/pids/spec_server.pid")
|
130
|
+
|
131
|
+
desc "start spec_server."
|
132
|
+
task :start do
|
133
|
+
if File.exist?(daemonized_server_pid)
|
134
|
+
$stderr.puts "spec_server is already running."
|
135
|
+
else
|
136
|
+
$stderr.puts %Q{Starting up spec_server ...}
|
137
|
+
FileUtils.mkdir_p('tmp/pids') unless test ?d, 'tmp/pids'
|
138
|
+
system("ruby", "script/spec_server", "--daemon", "--pid", daemonized_server_pid)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
desc "stop spec_server."
|
143
|
+
task :stop do
|
144
|
+
unless File.exist?(daemonized_server_pid)
|
145
|
+
$stderr.puts "No server running."
|
146
|
+
else
|
147
|
+
$stderr.puts "Shutting down spec_server ..."
|
148
|
+
system("kill", "-s", "TERM", File.read(daemonized_server_pid).strip) &&
|
149
|
+
File.delete(daemonized_server_pid)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
desc "restart spec_server."
|
154
|
+
task :restart => [:stop, :start]
|
155
|
+
|
156
|
+
desc "check if spec server is running"
|
157
|
+
task :status do
|
158
|
+
if File.exist?(daemonized_server_pid)
|
159
|
+
$stderr.puts %Q{spec_server is running (PID: #{File.read(daemonized_server_pid).gsub("\n","")})}
|
160
|
+
else
|
161
|
+
$stderr.puts "No server running."
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
end
|