parlement 0.3 → 0.4

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.
Files changed (122) hide show
  1. data/CHANGES +16 -0
  2. data/README +36 -3
  3. data/Rakefile +8 -12
  4. data/app/controllers/account_controller.rb +2 -0
  5. data/app/controllers/elt_controller.rb +1 -5
  6. data/app/controllers/subscriber_controller.rb +1 -1
  7. data/app/helpers/elt_helper.rb +30 -10
  8. data/app/models/elt.rb +2 -1
  9. data/app/models/mail.rb +41 -41
  10. data/app/models/mail_notify.rb +27 -10
  11. data/app/views/account/_login.rhtml +9 -7
  12. data/app/views/account/_show.rhtml +4 -4
  13. data/app/views/elt/_elt.rhtml +52 -51
  14. data/app/views/elt/_list.rhtml +22 -14
  15. data/app/views/elt/new.rhtml +1 -1
  16. data/app/views/elt/show.rhtml +15 -16
  17. data/app/views/layouts/top.rhtml +13 -1
  18. data/app/views/person/show.rhtml +1 -7
  19. data/config/boot.rb +32 -7
  20. data/config/database.yml +3 -0
  21. data/config/environment.rb +3 -1
  22. data/config/environments/development.rb +1 -1
  23. data/db/ROOT/parlement/ddRing.txt +14 -0
  24. data/db/ROOT/parlement/top-politics.txt +12 -0
  25. data/db/ROOT/perso.txt +1 -1
  26. data/db/development_structure.sql +30 -16
  27. data/db/schema.rb +18 -10
  28. data/db/schema.sql +34 -34
  29. data/public/javascripts/application.js +2 -0
  30. data/public/javascripts/blank.gif +0 -0
  31. data/public/javascripts/borders.js +687 -0
  32. data/public/javascripts/controls.js +95 -30
  33. data/public/javascripts/dragdrop.js +161 -21
  34. data/public/javascripts/effects.js +310 -211
  35. data/public/javascripts/ie7-load.htc +1 -0
  36. data/public/javascripts/prototype.js +228 -28
  37. data/test/fixtures/attachments.yml +3 -0
  38. data/test/fixtures/mail/mail_ruby +1 -0
  39. data/test/fixtures/people.yml +14 -0
  40. data/test/functional/account_controller_test.rb +3 -2
  41. data/test/unit/mail_notify_test.rb +2 -0
  42. data/test/unit/mail_test.rb +59 -6
  43. data/test/unit/person_test.rb +1 -1
  44. data/vendor/plugins/engines/CHANGELOG +92 -0
  45. data/vendor/plugins/engines/MIT-LICENSE +21 -0
  46. data/vendor/plugins/engines/README +325 -39
  47. data/vendor/plugins/engines/generators/engine/USAGE +26 -0
  48. data/vendor/plugins/engines/generators/engine/engine_generator.rb +199 -0
  49. data/vendor/plugins/engines/generators/engine/templates/README +85 -0
  50. data/vendor/plugins/engines/generators/engine/templates/init_engine.erb +13 -0
  51. data/vendor/plugins/engines/generators/engine/templates/install.erb +4 -0
  52. data/vendor/plugins/engines/generators/engine/templates/lib/engine.erb +6 -0
  53. data/vendor/plugins/engines/generators/engine/templates/licenses/GPL +18 -0
  54. data/vendor/plugins/engines/generators/engine/templates/licenses/LGPL +19 -0
  55. data/vendor/plugins/engines/generators/engine/templates/licenses/MIT +22 -0
  56. data/vendor/plugins/engines/generators/engine/templates/licenses/None +1 -0
  57. data/vendor/plugins/engines/generators/engine/templates/public/javascripts/engine.js +0 -0
  58. data/vendor/plugins/engines/generators/engine/templates/public/stylesheets/engine.css +0 -0
  59. data/vendor/plugins/engines/generators/engine/templates/tasks/engine.rake +0 -0
  60. data/vendor/plugins/engines/generators/engine/templates/test/test_helper.erb +13 -0
  61. data/vendor/plugins/engines/init.rb +18 -3
  62. data/vendor/plugins/engines/lib/bundles/require_resource.rb +124 -0
  63. data/vendor/plugins/engines/lib/bundles.rb +77 -0
  64. data/vendor/plugins/engines/lib/{action_mailer_extensions.rb → engines/action_mailer_extensions.rb} +15 -36
  65. data/vendor/plugins/engines/lib/{action_view_extensions.rb → engines/action_view_extensions.rb} +40 -33
  66. data/vendor/plugins/engines/lib/engines/active_record_extensions.rb +19 -0
  67. data/vendor/plugins/engines/lib/engines/dependencies_extensions.rb +118 -0
  68. data/vendor/plugins/engines/lib/engines/migration_extensions.rb +53 -0
  69. data/vendor/plugins/engines/lib/{ruby_extensions.rb → engines/ruby_extensions.rb} +14 -28
  70. data/vendor/plugins/engines/lib/engines/testing_extensions.rb +323 -0
  71. data/vendor/plugins/engines/lib/engines.rb +258 -148
  72. data/vendor/plugins/engines/tasks/engines.rake +161 -0
  73. data/vendor/plugins/engines/test/action_view_extensions_test.rb +9 -0
  74. data/vendor/plugins/engines/test/ruby_extensions_test.rb +24 -3
  75. data/vendor/plugins/guid/README.TXT +14 -4
  76. data/vendor/plugins/guid/init.rb +9 -2
  77. data/vendor/plugins/guid/lib/uuidtools.rb +22 -15
  78. data/vendor/plugins/login_engine/CHANGELOG +14 -0
  79. data/vendor/plugins/login_engine/README +93 -7
  80. data/vendor/plugins/login_engine/app/controllers/user_controller.rb +30 -20
  81. data/vendor/plugins/login_engine/app/helpers/user_helper.rb +1 -1
  82. data/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml +2 -2
  83. data/vendor/plugins/login_engine/db/migrate/001_initial_schema.rb +25 -0
  84. data/vendor/plugins/login_engine/install.rb +4 -0
  85. data/vendor/plugins/login_engine/lib/login_engine/authenticated_system.rb +11 -5
  86. data/vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb +15 -9
  87. data/vendor/plugins/login_engine/lib/login_engine.rb +7 -3
  88. data/vendor/plugins/login_engine/test/functional/user_controller_test.rb +22 -19
  89. data/vendor/plugins/login_engine/test/test_helper.rb +4 -8
  90. data/vendor/plugins/login_engine/test/unit/user_test.rb +31 -11
  91. metadata +60 -57
  92. data/app/models/attachment.rb +0 -6
  93. data/public/attachment/file/architecture.png +0 -0
  94. data/public/attachment/file/architecture.svg +0 -8972
  95. data/public/attachment/file/security.svg +0 -8960
  96. data/public/engine_files/login_engine/stylesheets/login_engine.css +0 -81
  97. data/public/oldREADME +0 -190
  98. data/public/stylesheets/default.css +0 -235
  99. data/public/stylesheets/live_tree.css +0 -62
  100. data/public/stylesheets/scaffold.css +0 -74
  101. data/script/about +0 -3
  102. data/script/benchmarker +0 -19
  103. data/script/breakpointer +0 -3
  104. data/script/console +0 -3
  105. data/script/create_db +0 -7
  106. data/script/destroy +0 -3
  107. data/script/generate +0 -3
  108. data/script/performance/benchmarker +0 -3
  109. data/script/performance/profiler +0 -3
  110. data/script/plugin +0 -3
  111. data/script/process/reaper +0 -3
  112. data/script/process/spawner +0 -3
  113. data/script/process/spinner +0 -3
  114. data/script/profiler +0 -34
  115. data/script/runner +0 -3
  116. data/script/server +0 -3
  117. data/test/unit/user_test.rb +0 -94
  118. data/vendor/plugins/engines/lib/dependencies_extensions.rb +0 -56
  119. data/vendor/plugins/engines/lib/testing_extensions.rb +0 -33
  120. data/vendor/plugins/login_engine/db/schema.rb +0 -25
  121. data/vendor/plugins/login_engine/test/fixtures/templates/users.yml +0 -41
  122. /data/public/images/{eltBackground.png → eltBackground.jng} +0 -0
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/process/reaper'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/process/spawner'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/process/spinner'
data/script/profiler DELETED
@@ -1,34 +0,0 @@
1
- #!/usr/bin/ruby1.8
2
- if ARGV.empty?
3
- $stderr.puts "Usage: profiler 'Person.expensive_method(10)' [times]"
4
- exit(1)
5
- end
6
-
7
- # Keep the expensive require out of the profile.
8
- $stderr.puts 'Loading Rails...'
9
- require File.dirname(__FILE__) + '/../config/environment'
10
-
11
- # Define a method to profile.
12
- if ARGV[1] and ARGV[1].to_i > 1
13
- eval "def profile_me() #{ARGV[1]}.times { #{ARGV[0]} } end"
14
- else
15
- eval "def profile_me() #{ARGV[0]} end"
16
- end
17
-
18
- # Use the ruby-prof extension if available. Fall back to stdlib profiler.
19
- begin
20
- require 'prof'
21
- $stderr.puts 'Using the ruby-prof extension.'
22
- Prof.clock_mode = Prof::GETTIMEOFDAY
23
- Prof.start
24
- profile_me
25
- results = Prof.stop
26
- require 'rubyprof_ext'
27
- Prof.print_profile(results, $stderr)
28
- rescue LoadError
29
- $stderr.puts 'Using the standard Ruby profiler.'
30
- Profiler__.start_profile
31
- profile_me
32
- Profiler__.stop_profile
33
- Profiler__.print_profile($stderr)
34
- end
data/script/runner DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/runner'
data/script/server DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/server'
@@ -1,94 +0,0 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
-
3
- class UserTest < Test::Unit::TestCase
4
- fixtures :people, :users, :subscribers
5
-
6
- def setup
7
- LoginEngine::CONFIG[:salt] = "test-salt"
8
- end
9
-
10
- def test_auth
11
- assert_equal fixture_object(LoginEngine.config(:user_table), :bob), User.authenticate("bob", "atest")
12
-
13
- assert_nil User.authenticate("nonbob", "atest")
14
- end
15
-
16
-
17
- def test_passwordchange
18
- @longbob = users(:longbob)
19
- @longbob.change_password("nonbobpasswd")
20
- @longbob.save
21
- assert_equal @longbob, User.authenticate("longbob", "nonbobpasswd")
22
- assert_nil User.authenticate("longbob", "alongtest")
23
- @longbob.change_password("alongtest")
24
- @longbob.save
25
- assert_equal @longbob, User.authenticate("longbob", "alongtest")
26
- assert_nil User.authenticate("longbob", "nonbobpasswd")
27
- end
28
-
29
- def test_disallowed_passwords
30
- u = User.new
31
- u.login = "first"
32
-
33
- u.change_password("tiny")
34
- assert !u.save
35
- assert u.errors.invalid?('password')
36
-
37
- u.change_password("hugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehugehuge")
38
- assert !u.save
39
- assert u.errors.invalid?('password')
40
-
41
- u.change_password("")
42
- assert !u.save
43
- assert u.errors.invalid?('password')
44
-
45
- u.change_password("bobs_secure_password")
46
- assert u.save
47
- assert u.errors.empty?
48
- end
49
-
50
- def test_bad_logins
51
-
52
- u = User.new
53
- u.change_password("bobs_secure_password")
54
-
55
- u.login = "bo"
56
- assert !u.save
57
- assert u.errors.invalid?('login')
58
-
59
- u.login = "hugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhug"
60
- assert !u.save
61
- assert u.errors.invalid?('login')
62
-
63
- u.login = ""
64
- assert !u.save
65
- assert u.errors.invalid?('login')
66
-
67
- u.login = "bob2"
68
- assert u.save
69
- assert u.errors.empty?
70
-
71
- end
72
-
73
-
74
- def test_collision
75
- u = User.new
76
- u.login = people('bob').name
77
- u.change_password("bobs_secure_password")
78
- assert !u.save
79
- end
80
-
81
-
82
- def test_create
83
- p = Person.new
84
- p.name = "otherbob"
85
- assert p.save
86
-
87
- u = User.new
88
- u.login = p.name
89
- u.change_password("bobs_secure_password")
90
-
91
- assert u.save
92
- end
93
- end
94
-
@@ -1,56 +0,0 @@
1
- #--
2
- # Copyright (c) 2004 David Heinemeier Hansson
3
-
4
- # Permission is hereby granted, free of charge, to any person obtaining
5
- # a copy of this software and associated documentation files (the
6
- # "Software"), to deal in the Software without restriction, including
7
- # without limitation the rights to use, copy, modify, merge, publish,
8
- # distribute, sublicense, and/or sell copies of the Software, and to
9
- # permit persons to whom the Software is furnished to do so, subject to
10
- # the following conditions:
11
-
12
- # The above copyright notice and this permission notice shall be
13
- # included in all copies or substantial portions of the Software.
14
-
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
- #
23
- # Engine Hacks by James Adam, 2005.
24
- #++
25
-
26
- module ::Dependencies
27
- def require_or_load(file_name)
28
- # try and load the framework code first
29
- # can't use model, as there's nothing in the name to indicate that the file is a 'model' file
30
- # rather than a library or anything else.
31
- ['controller', 'helper'].each do |type|
32
- if file_name.include?('_' + type)
33
- Engines::ActiveEngines.reverse.each do |engine|
34
- engine_file_name = File.join(engine.root, 'app', "#{type}s", File.basename(file_name))
35
- engine_file_name += '.rb' unless engine_file_name[-3..-1] == '.rb'
36
- if File.exist? engine_file_name
37
- load? ? load(engine_file_name) : require(engine_file_name)
38
- end
39
- end
40
- end
41
- end
42
-
43
- # finally, load any application-specific controller classes.
44
- file_name = "#{file_name}.rb" unless ! load? || file_name [-3..-1] == '.rb'
45
- load? ? load(file_name) : require(file_name)
46
- end
47
-
48
- class RootLoadingModule < LoadingModule
49
- # hack to allow adding to the load paths within the Rails Dependencies mechanism.
50
- # this allows Engine classes to be unloaded and loaded along with standard
51
- # Rails application classes.
52
- def add_path(path)
53
- @load_paths << (path.kind_of?(ConstantLoadPath) ? path : ConstantLoadPath.new(path))
54
- end
55
- end
56
- end
@@ -1,33 +0,0 @@
1
- require 'fileutils'
2
-
3
- module Test
4
- module Unit
5
- class TestCase
6
- # Create a fixtures file based on the template file
7
- # (<fixture_path>/templates/<fixture_template_name>.yml), and create a suitable
8
- # fixture file in the fixture_path directory to be loaded into the table given by
9
- # table_name.
10
- def self.set_fixtures_table(fixture_file_name, table_name)
11
- # presume that the template files are in fixture_path + "/templates"
12
- template_file = File.join(fixture_path, "templates", fixture_file_name.to_s + ".yml")
13
- destination_file = File.join(fixture_path, table_name.to_s + ".yml")
14
- if !File.exists?(template_file)
15
- raise "Cannot find fixture template file '#{template_file}'!"
16
- end
17
- # Copy the file across, unless the destination is identical.
18
- begin
19
- unless File.exist?(destination_file) && FileUtils.identical?(template_file, destination_file)
20
- FileUtils.cp(template_file, destination_file)
21
- end
22
- rescue Exception => e
23
- raise "Couldn't create fixture file: " + e
24
- end
25
- end
26
-
27
- # Returns any object from the given fixtures
28
- def fixture_object(fixture_name, object_name)
29
- send(fixture_name.to_sym, object_name)
30
- end
31
- end
32
- end
33
- end
@@ -1,25 +0,0 @@
1
- # This file is autogenerated. Instead of editing this file, please use the
2
- # migrations feature of ActiveRecord to incrementally modify your database, and
3
- # then regenerate this schema definition.
4
-
5
- ActiveRecord::Schema.define() do
6
-
7
- create_table LoginEngine.config(:user_table), :force => true do |t|
8
- t.column "login", :string, :limit => 80, :default => "", :null => false
9
- t.column "salted_password", :string, :limit => 40, :default => "", :null => false
10
- t.column "email", :string, :limit => 60, :default => "", :null => false
11
- t.column "firstname", :string, :limit => 40
12
- t.column "lastname", :string, :limit => 40
13
- t.column "salt", :string, :limit => 40, :default => "", :null => false
14
- t.column "verified", :integer, :default => 0
15
- t.column "role", :string, :limit => 40
16
- t.column "security_token", :string, :limit => 40
17
- t.column "token_expiry", :datetime
18
- t.column "created_at", :datetime
19
- t.column "updated_at", :datetime
20
- t.column "logged_in_at", :datetime
21
- t.column "deleted", :integer, :default => 0
22
- t.column "delete_after", :datetime
23
- end
24
-
25
- end
@@ -1,41 +0,0 @@
1
- # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
-
3
- bob:
4
- id: 1000001
5
- login: bob
6
- salted_password: b1de1d1d2aec05df2be6f02995537c1783f08490 # atest
7
- salt: bf3c47e71c0bfeb6288c9b6b5e24e15256a0e407
8
- email: bob@test.com
9
- verified: 1
10
-
11
- existingbob:
12
- id: 1000002
13
- login: existingbob
14
- salted_password: b1de1d1d2aec05df2be6f02995537c1783f08490 # atest
15
- salt: bf3c47e71c0bfeb6288c9b6b5e24e15256a0e407
16
- email: existingbob@test.com
17
- verified: 1
18
-
19
- longbob:
20
- id: 1000003
21
- login: longbob
22
- salted_password: 53427dca242488e885216a579e362ee888c3ebc1 # alongtest
23
- salt: d35a9cc89af83799d9a938a74cb06a11d295aa9c
24
- email: longbob@test.com
25
- verified: 1
26
-
27
- deletebob1:
28
- id: 1000004
29
- login: deletebob1
30
- salted_password: 53427dca242488e885216a579e362ee888c3ebc1 # alongtest
31
- salt: d35a9cc89af83799d9a938a74cb06a11d295aa9c
32
- email: deletebob1@test.com
33
- verified: 1
34
-
35
- deletebob2:
36
- id: 1000005
37
- login: deletebob2
38
- salted_password: 53427dca242488e885216a579e362ee888c3ebc1 # alongtest
39
- salt: d35a9cc89af83799d9a938a74cb06a11d295aa9c
40
- email: deletebob2@test.com
41
- verified: 1