mack-data_mapper 0.7.0.1 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/doc/classes/Mack.html +8 -0
  2. data/doc/classes/Mack/{Testing/Helpers.html → DataMapper/Session.html} +24 -18
  3. data/doc/classes/Mack/Database.html +35 -35
  4. data/doc/classes/Mack/Database/Generators.html +6 -6
  5. data/doc/classes/Mack/Database/Migrations.html +24 -24
  6. data/doc/classes/Mack/SessionStore/DataMapper.html +262 -0
  7. data/doc/classes/Mack/Testing/DataMapperHelpers.html +21 -21
  8. data/doc/classes/Mack/ViewHelpers/DataMapperHelpers.html +1 -1
  9. data/doc/created.rid +1 -1
  10. data/doc/files/README.html +1 -1
  11. data/doc/files/lib/mack-data_mapper/database_migrations_rb.html +1 -1
  12. data/doc/files/lib/mack-data_mapper/database_rb.html +1 -1
  13. data/doc/files/lib/mack-data_mapper/dm_patches/dm-timestamps_rb.html +16 -1
  14. data/doc/files/lib/mack-data_mapper/dm_patches/migrations_rb.html +1 -1
  15. data/doc/files/lib/mack-data_mapper/dm_patches/model_rb.html +58 -1
  16. data/doc/files/lib/mack-data_mapper/dm_patches/property_set_rb.html +25 -1
  17. data/doc/files/lib/mack-data_mapper/dm_patches/validations_rb.html +25 -1
  18. data/doc/files/lib/mack-data_mapper/generators_rb.html +1 -1
  19. data/doc/files/lib/mack-data_mapper/helpers/orm_helpers_rb.html +1 -1
  20. data/doc/files/lib/mack-data_mapper/migration_generator/migration_generator_rb.html +1 -1
  21. data/doc/files/lib/mack-data_mapper/model_generator/model_generator_rb.html +1 -1
  22. data/doc/files/lib/mack-data_mapper/resource_rb.html +1 -1
  23. data/doc/files/lib/mack-data_mapper/runner_rb.html +1 -1
  24. data/doc/files/lib/mack-data_mapper/sessions/data_mapper_session_store_rb.html +101 -0
  25. data/doc/files/lib/mack-data_mapper/sessions/session_rb.html +101 -0
  26. data/doc/files/lib/mack-data_mapper/test_extensions_rb.html +1 -1
  27. data/doc/files/lib/mack-data_mapper_rb.html +1 -1
  28. data/doc/files/lib/mack-data_mapper_tasks_rb.html +1 -1
  29. data/doc/fr_class_index.html +2 -1
  30. data/doc/fr_file_index.html +2 -0
  31. data/doc/fr_method_index.html +14 -10
  32. data/lib/mack-data_mapper.rb +11 -7
  33. data/lib/mack-data_mapper/database.rb +8 -8
  34. data/lib/mack-data_mapper/database_migrations.rb +6 -6
  35. data/lib/mack-data_mapper/dm_patches/dm-timestamps.rb +6 -6
  36. data/lib/mack-data_mapper/dm_patches/model.rb +48 -48
  37. data/lib/mack-data_mapper/dm_patches/property_set.rb +15 -15
  38. data/lib/mack-data_mapper/dm_patches/validations.rb +15 -15
  39. data/lib/mack-data_mapper/helpers/orm_helpers.rb +1 -1
  40. data/lib/mack-data_mapper/sessions/data_mapper_session_store.rb +62 -0
  41. data/lib/mack-data_mapper/sessions/session.rb +14 -0
  42. data/lib/mack-data_mapper/test_extensions.rb +0 -9
  43. metadata +17 -22
@@ -0,0 +1,101 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: session.rb</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>session.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/mack-data_mapper/sessions/session.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Mon Sep 08 10:32:44 -0400 2008</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Aug 25 10:11:28 -0400 2008</td>
59
+ <td>Mon Sep 08 10:32:44 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri Aug 29 11:33:21 -0400 2008</td>
59
+ <td>Mon Sep 08 10:32:44 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri Aug 29 11:33:21 -0400 2008</td>
59
+ <td>Mon Sep 08 10:32:44 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -22,11 +22,12 @@
22
22
  <div id="index-entries">
23
23
  <a href="classes/DataMapper/Resource.html">DataMapper::Resource</a><br />
24
24
  <a href="classes/Mack.html">Mack</a><br />
25
+ <a href="classes/Mack/DataMapper/Session.html">Mack::DataMapper::Session</a><br />
25
26
  <a href="classes/Mack/Database.html">Mack::Database</a><br />
26
27
  <a href="classes/Mack/Database/Generators.html">Mack::Database::Generators</a><br />
27
28
  <a href="classes/Mack/Database/Migrations.html">Mack::Database::Migrations</a><br />
29
+ <a href="classes/Mack/SessionStore/DataMapper.html">Mack::SessionStore::DataMapper</a><br />
28
30
  <a href="classes/Mack/Testing/DataMapperHelpers.html">Mack::Testing::DataMapperHelpers</a><br />
29
- <a href="classes/Mack/Testing/Helpers.html">Mack::Testing::Helpers</a><br />
30
31
  <a href="classes/Mack/ViewHelpers/DataMapperHelpers.html">Mack::ViewHelpers::DataMapperHelpers</a><br />
31
32
  <a href="classes/MigrationGenerator.html">MigrationGenerator</a><br />
32
33
  <a href="classes/ModelGenerator.html">ModelGenerator</a><br />
@@ -35,6 +35,8 @@
35
35
  <a href="files/lib/mack-data_mapper/model_generator/model_generator_rb.html">lib/mack-data_mapper/model_generator/model_generator.rb</a><br />
36
36
  <a href="files/lib/mack-data_mapper/resource_rb.html">lib/mack-data_mapper/resource.rb</a><br />
37
37
  <a href="files/lib/mack-data_mapper/runner_rb.html">lib/mack-data_mapper/runner.rb</a><br />
38
+ <a href="files/lib/mack-data_mapper/sessions/data_mapper_session_store_rb.html">lib/mack-data_mapper/sessions/data_mapper_session_store.rb</a><br />
39
+ <a href="files/lib/mack-data_mapper/sessions/session_rb.html">lib/mack-data_mapper/sessions/session.rb</a><br />
38
40
  <a href="files/lib/mack-data_mapper/test_extensions_rb.html">lib/mack-data_mapper/test_extensions.rb</a><br />
39
41
  <a href="files/lib/mack-data_mapper_tasks_rb.html">lib/mack-data_mapper_tasks.rb</a><br />
40
42
  </div>
@@ -20,17 +20,21 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Methods</h1>
22
22
  <div id="index-entries">
23
- <a href="classes/Mack/Database/Migrations.html#M000011">abort_if_pending_migrations (Mack::Database::Migrations)</a><br />
24
- <a href="classes/Mack/Database/Generators.html#M000008">controller_template_location (Mack::Database::Generators)</a><br />
25
- <a href="classes/Mack/Database.html#M000004">create (Mack::Database)</a><br />
26
- <a href="classes/Mack/Database.html#M000005">drop (Mack::Database)</a><br />
27
- <a href="classes/Mack/Database.html#M000007">dump_structure (Mack::Database)</a><br />
23
+ <a href="classes/Mack/Database/Migrations.html#M000015">abort_if_pending_migrations (Mack::Database::Migrations)</a><br />
24
+ <a href="classes/Mack/Database/Generators.html#M000012">controller_template_location (Mack::Database::Generators)</a><br />
25
+ <a href="classes/Mack/Database.html#M000008">create (Mack::Database)</a><br />
26
+ <a href="classes/Mack/Database.html#M000009">drop (Mack::Database)</a><br />
27
+ <a href="classes/Mack/Database.html#M000011">dump_structure (Mack::Database)</a><br />
28
28
  <a href="classes/Mack/ViewHelpers/DataMapperHelpers.html#M000002">error_messages_for (Mack::ViewHelpers::DataMapperHelpers)</a><br />
29
- <a href="classes/Mack/Database.html#M000003">establish_connection (Mack::Database)</a><br />
30
- <a href="classes/Mack/Database.html#M000006">load_structure (Mack::Database)</a><br />
31
- <a href="classes/Mack/Database/Migrations.html#M000009">migrate (Mack::Database::Migrations)</a><br />
32
- <a href="classes/Mack/Database/Migrations.html#M000010">rollback (Mack::Database::Migrations)</a><br />
33
- <a href="classes/Mack/Testing/DataMapperHelpers.html#M000012">rollback_transaction (Mack::Testing::DataMapperHelpers)</a><br />
29
+ <a href="classes/Mack/Database.html#M000007">establish_connection (Mack::Database)</a><br />
30
+ <a href="classes/Mack/SessionStore/DataMapper.html#M000005">expire (Mack::SessionStore::DataMapper)</a><br />
31
+ <a href="classes/Mack/SessionStore/DataMapper.html#M000006">expire_all (Mack::SessionStore::DataMapper)</a><br />
32
+ <a href="classes/Mack/SessionStore/DataMapper.html#M000003">get (Mack::SessionStore::DataMapper)</a><br />
33
+ <a href="classes/Mack/Database.html#M000010">load_structure (Mack::Database)</a><br />
34
+ <a href="classes/Mack/Database/Migrations.html#M000013">migrate (Mack::Database::Migrations)</a><br />
35
+ <a href="classes/Mack/Database/Migrations.html#M000014">rollback (Mack::Database::Migrations)</a><br />
36
+ <a href="classes/Mack/Testing/DataMapperHelpers.html#M000016">rollback_transaction (Mack::Testing::DataMapperHelpers)</a><br />
37
+ <a href="classes/Mack/SessionStore/DataMapper.html#M000004">set (Mack::SessionStore::DataMapper)</a><br />
34
38
  <a href="classes/DataMapper/Resource.html#M000001">to_param (DataMapper::Resource)</a><br />
35
39
  </div>
36
40
  </div>
@@ -1,12 +1,20 @@
1
1
  require 'rubygems'
2
2
  require 'genosaurus'
3
3
  require 'mack-orm'
4
+
5
+ config = {
6
+ "data_mapper_session_store::expiry_time" => 4.hours
7
+ }
8
+
9
+ app_config.load_hash(config.merge(app_config.final_configuration_settings), "mack-data_mapper")
10
+
11
+
4
12
  fl = File.join(File.dirname(__FILE__), "mack-data_mapper")
5
13
 
6
14
  $: << File.expand_path(File.join(fl, "dm_patches"))
7
15
 
8
16
  [:core, :aggregates, :migrations, :serializer, :timestamps, :validations, :observer, :types].each do |g|
9
- gem "dm-#{g}", "0.9.4"
17
+ gem "dm-#{g}", "0.9.5"
10
18
  require "dm-#{g}"
11
19
  end
12
20
 
@@ -20,7 +28,7 @@ require File.join(fl, "runner")
20
28
  require File.join(fl, "test_extensions")
21
29
 
22
30
 
23
- [:helpers, :migration_generator, :model_generator, :scaffold_generator, :dm_patches].each do |folder|
31
+ [:helpers, :migration_generator, :model_generator, :scaffold_generator, :dm_patches, :sessions].each do |folder|
24
32
  Dir.glob(File.join(fl, folder.to_s, "**/*.rb")).each {|f| require f}
25
33
  end
26
34
 
@@ -46,8 +54,4 @@ module DataMapper # :nodoc:
46
54
  end
47
55
  end
48
56
 
49
- DataMapper.logger = DataMapper::Logger.new(StringIO.new, 0)
50
-
51
- Mack::Database.establish_connection(Mack.env)
52
-
53
- require File.join(File.dirname(__FILE__), 'mack-data_mapper_tasks')
57
+ DataMapper.logger = DataMapper::Logger.new(StringIO.new, 0)
@@ -4,15 +4,15 @@ module Mack
4
4
  # Sets up and establishes connections to the database based on the specified environment
5
5
  # and the settings in the database.yml file.
6
6
  def self.establish_connection(env = Mack.env)
7
- dbs = YAML::load(ERB.new(IO.read(File.join(Mack.root, "config", "database.yml"))).result)
7
+ dbs = YAML::load(ERB.new(IO.read(Mack::Paths.config("database.yml"))).result)
8
8
  settings = dbs[env]
9
9
  settings.symbolize_keys!
10
10
  if settings[:default]
11
11
  settings.each do |k,v|
12
- DataMapper.setup(k, v.symbolize_keys)
12
+ ::DataMapper.setup(k, v.symbolize_keys)
13
13
  end
14
14
  else
15
- DataMapper.setup(:default, settings)
15
+ ::DataMapper.setup(:default, settings)
16
16
  end
17
17
  end # establish_connection
18
18
 
@@ -50,7 +50,7 @@ module Mack
50
50
  adapter = repository(repis).adapter
51
51
  uri = adapter.uri
52
52
  structure = ""
53
- output_file = File.join(Mack.root, "db", "#{env}_schema_structure.sql")
53
+ output_file = Mack::Paths.db("#{env}_schema_structure.sql")
54
54
  case adapter.class.name
55
55
  when /Mysql/
56
56
  sql = "SHOW TABLES"
@@ -63,7 +63,7 @@ module Mack
63
63
  when /Postgres/
64
64
  `pg_dump -i -U "#{uri.user}" -s -x -O -n #{ENV["SCHEMA"] ||= "public"} -f #{output_file} #{uri.basename}`
65
65
  when /Sqlite3/
66
- db_dir = File.join(Mack.root, "db")
66
+ db_dir = Mack::Paths.db
67
67
  `sqlite3 #{File.join(db_dir, uri.basename)} .schema > #{output_file}`
68
68
  else
69
69
  raise "Task not supported for '#{repository(repis).adapter.class.name}'"
@@ -72,7 +72,7 @@ module Mack
72
72
 
73
73
  private
74
74
  def self.setup_temp(uri, adapter)
75
- DataMapper.setup(:tmp, {
75
+ ::DataMapper.setup(:tmp, {
76
76
  :adapter => adapter,
77
77
  :host => "localhost",
78
78
  :database => adapter,
@@ -97,7 +97,7 @@ module Mack
97
97
  repo.adapter.execute "CREATE DATABASE #{uri.basename} ENCODING = 'utf8'"
98
98
  end
99
99
  when /Sqlite3/
100
- db_dir = File.join(Mack.root, "db")
100
+ db_dir = Mack::Paths.db
101
101
  puts "Creating (SQLite3): #{uri.basename}"
102
102
  FileUtils.mkdir_p(db_dir)
103
103
  FileUtils.touch(File.join(db_dir, uri.basename))
@@ -123,7 +123,7 @@ module Mack
123
123
  end
124
124
  when /Sqlite3/
125
125
  puts "Dropping (SQLite3): #{uri.basename}"
126
- db_dir = File.join(Mack.root, "db")
126
+ db_dir = Mack::Paths.db
127
127
  FileUtils.rm_rf(File.join(db_dir.to_s, uri.basename))
128
128
  else
129
129
  raise "Task not supported for '#{repository(repis).adapter.class.name}'"
@@ -7,16 +7,16 @@ module Mack
7
7
  # Migrates the database to the latest version
8
8
  def self.migrate
9
9
  Mack::Database.establish_connection
10
- DataMapper::MigrationRunner.reset!
10
+ ::DataMapper::MigrationRunner.reset!
11
11
  migration_files.each { |mig| load mig }
12
- DataMapper::MigrationRunner.migrate_up!
12
+ ::DataMapper::MigrationRunner.migrate_up!
13
13
  end
14
14
 
15
15
  # Rolls back the database by the specified number of steps. Default is 1
16
16
  def self.rollback(step = 1)
17
- DataMapper::MigrationRunner.reset!
17
+ ::DataMapper::MigrationRunner.reset!
18
18
  migration_files.each { |mig| load mig }
19
- migrations = DataMapper::MigrationRunner.migrations.sort.reverse
19
+ migrations = ::DataMapper::MigrationRunner.migrations.sort.reverse
20
20
  step.times do |i|
21
21
  migrations[migrations.size - (i + 1)].perform_down
22
22
  end
@@ -24,10 +24,10 @@ module Mack
24
24
 
25
25
  def self.abort_if_pending_migrations
26
26
  migration_files.each { |mig| load mig }
27
- DataMapper::MigrationRunner.migrations.each do |mig|
27
+ ::DataMapper::MigrationRunner.migrations.each do |mig|
28
28
  raise Mack::Errors::UnrunMigrations.new(mig.name) if mig.send("needs_up?")
29
29
  end
30
- DataMapper::MigrationRunner.migrations.clear
30
+ ::DataMapper::MigrationRunner.migrations.clear
31
31
  end
32
32
 
33
33
  end # Migrations
@@ -1,6 +1,6 @@
1
- module DataMapper # :nodoc:
2
- module Timestamp # :nodoc:
3
- TIMESTAMP_PROPERTIES[:created_at] = lambda { |r| r.created_at = DateTime.now if r.new_record? && r.created_at.nil? } # :nodoc:
4
- TIMESTAMP_PROPERTIES[:created_on] = lambda { |r| r.created_on = DateTime.now if r.new_record? && r.created_on.nil? } # :nodoc:
5
- end
6
- end
1
+ # module DataMapper # :nodoc:
2
+ # module Timestamp # :nodoc:
3
+ # TIMESTAMP_PROPERTIES[:created_at] = lambda { |r| r.created_at = DateTime.now if r.new_record? && r.created_at.nil? } # :nodoc:
4
+ # TIMESTAMP_PROPERTIES[:created_on] = lambda { |r| r.created_on = DateTime.now if r.new_record? && r.created_on.nil? } # :nodoc:
5
+ # end
6
+ # end
@@ -1,48 +1,48 @@
1
- module DataMapper # :nodoc:
2
- module Model # :nodoc:
3
-
4
- def property(name, type, options = {})
5
- property = Property.new(self, name, type, options)
6
-
7
- create_property_getter(property)
8
- create_property_setter(property)
9
-
10
- @properties[repository_name][property.name] = property
11
-
12
- # Add property to the other mappings as well if this is for the default
13
- # repository.
14
- if repository_name == default_repository_name
15
- @properties.each_pair do |repository_name, properties|
16
- next if repository_name == default_repository_name
17
- properties << property
18
- end
19
- end
20
-
21
- # Add the property to the lazy_loads set for this resources repository
22
- # only.
23
- # TODO Is this right or should we add the lazy contexts to all
24
- # repositories?
25
- if property.lazy?
26
- context = options.fetch(:lazy, :default)
27
- context = :default if context == true
28
-
29
- Array(context).each do |item|
30
- @properties[repository_name].lazy_context(item) << name
31
- end
32
- end
33
-
34
- # add the property to the child classes only if the property was
35
- # added after the child classes' properties have been copied from
36
- # the parent
37
- if respond_to?(:descendants)
38
- descendants.each do |model|
39
- next if model.properties(repository_name).has_property?(name)
40
- model.property(name, type, options)
41
- end
42
- end
43
-
44
- property
45
- end
46
-
47
- end # module Model
48
- end # module DataMapper
1
+ # module DataMapper # :nodoc:
2
+ # module Model # :nodoc:
3
+ #
4
+ # def property(name, type, options = {})
5
+ # property = Property.new(self, name, type, options)
6
+ #
7
+ # create_property_getter(property)
8
+ # create_property_setter(property)
9
+ #
10
+ # @properties[repository_name][property.name] = property
11
+ #
12
+ # # Add property to the other mappings as well if this is for the default
13
+ # # repository.
14
+ # if repository_name == default_repository_name
15
+ # @properties.each_pair do |repository_name, properties|
16
+ # next if repository_name == default_repository_name
17
+ # properties << property
18
+ # end
19
+ # end
20
+ #
21
+ # # Add the property to the lazy_loads set for this resources repository
22
+ # # only.
23
+ # # TODO Is this right or should we add the lazy contexts to all
24
+ # # repositories?
25
+ # if property.lazy?
26
+ # context = options.fetch(:lazy, :default)
27
+ # context = :default if context == true
28
+ #
29
+ # Array(context).each do |item|
30
+ # @properties[repository_name].lazy_context(item) << name
31
+ # end
32
+ # end
33
+ #
34
+ # # add the property to the child classes only if the property was
35
+ # # added after the child classes' properties have been copied from
36
+ # # the parent
37
+ # if respond_to?(:descendants)
38
+ # descendants.each do |model|
39
+ # next if model.properties(repository_name).has_property?(name)
40
+ # model.property(name, type, options)
41
+ # end
42
+ # end
43
+ #
44
+ # property
45
+ # end
46
+ #
47
+ # end # module Model
48
+ # end # module DataMapper
@@ -1,15 +1,15 @@
1
- module DataMapper # :nodoc:
2
- class PropertySet # :nodoc:
3
-
4
- def []=(name, property)
5
- if existing_property = detect { |p| p.name == name }
6
- property.hash
7
- @entries[@entries.index(existing_property)] = property
8
- else
9
- add(property)
10
- end
11
- property
12
- end
13
-
14
- end # class PropertySet
15
- end # module DataMapper
1
+ # module DataMapper # :nodoc:
2
+ # class PropertySet # :nodoc:
3
+ #
4
+ # def []=(name, property)
5
+ # if existing_property = detect { |p| p.name == name }
6
+ # property.hash
7
+ # @entries[@entries.index(existing_property)] = property
8
+ # else
9
+ # add(property)
10
+ # end
11
+ # property
12
+ # end
13
+ #
14
+ # end # class PropertySet
15
+ # end # module DataMapper