dm-core 1.0.2 → 1.1.0.rc1
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/Gemfile +28 -94
- data/LICENSE +1 -1
- data/README.rdoc +44 -11
- data/Rakefile +1 -7
- data/VERSION +1 -1
- data/dm-core.gemspec +398 -299
- data/lib/dm-core.rb +23 -13
- data/lib/dm-core/adapters/abstract_adapter.rb +1 -1
- data/lib/dm-core/associations/many_to_many.rb +1 -3
- data/lib/dm-core/associations/many_to_one.rb +54 -36
- data/lib/dm-core/associations/one_to_many.rb +1 -2
- data/lib/dm-core/associations/relationship.rb +11 -2
- data/lib/dm-core/collection.rb +3 -7
- data/lib/dm-core/core_ext/symbol.rb +1 -1
- data/lib/dm-core/identity_map.rb +0 -5
- data/lib/dm-core/model.rb +11 -21
- data/lib/dm-core/model/property.rb +43 -58
- data/lib/dm-core/model/relationship.rb +49 -44
- data/lib/dm-core/property.rb +106 -130
- data/lib/dm-core/property/date_time.rb +1 -3
- data/lib/dm-core/property/decimal.rb +11 -7
- data/lib/dm-core/property/integer.rb +2 -2
- data/lib/dm-core/property/lookup.rb +3 -16
- data/lib/dm-core/property/numeric.rb +3 -3
- data/lib/dm-core/property/object.rb +2 -11
- data/lib/dm-core/property/string.rb +1 -1
- data/lib/dm-core/property_set.rb +34 -54
- data/lib/dm-core/query.rb +85 -56
- data/lib/dm-core/query/conditions/comparison.rb +3 -6
- data/lib/dm-core/query/direction.rb +0 -4
- data/lib/dm-core/query/path.rb +22 -6
- data/lib/dm-core/relationship_set.rb +74 -0
- data/lib/dm-core/resource.rb +21 -32
- data/lib/dm-core/resource/state.rb +3 -4
- data/lib/dm-core/spec/lib/spec_helper.rb +1 -4
- data/lib/dm-core/spec/setup.rb +12 -5
- data/lib/dm-core/spec/shared/public/property_spec.rb +35 -21
- data/lib/dm-core/spec/shared/resource_spec.rb +1 -1
- data/lib/dm-core/spec/shared/semipublic/property_spec.rb +9 -9
- data/lib/dm-core/spec/shared/semipublic/query/conditions/abstract_comparison_spec.rb +261 -0
- data/lib/dm-core/support/deprecate.rb +1 -1
- data/lib/dm-core/support/descendant_set.rb +12 -5
- data/lib/dm-core/support/ordered_set.rb +382 -0
- data/lib/dm-core/support/subject_set.rb +252 -0
- data/lib/dm-core/version.rb +1 -1
- data/spec/public/associations/many_to_many/read_multiple_join_spec.rb +1 -2
- data/spec/public/associations/many_to_many_spec.rb +11 -9
- data/spec/public/associations/many_to_one_spec.rb +1 -1
- data/spec/public/associations/many_to_one_with_boolean_cpk_spec.rb +1 -1
- data/spec/public/associations/many_to_one_with_custom_fk_spec.rb +2 -2
- data/spec/public/associations/one_to_many_spec.rb +6 -5
- data/spec/public/associations/one_to_one_spec.rb +1 -1
- data/spec/public/associations/one_to_one_with_boolean_cpk_spec.rb +1 -1
- data/spec/public/collection_spec.rb +7 -6
- data/spec/public/finalize_spec.rb +1 -1
- data/spec/public/model/hook_spec.rb +4 -3
- data/spec/public/model/property_spec.rb +9 -3
- data/spec/public/model/relationship_spec.rb +2 -4
- data/spec/public/model_spec.rb +1 -1
- data/spec/public/property/binary_spec.rb +1 -1
- data/spec/public/property/boolean_spec.rb +1 -1
- data/spec/public/property/class_spec.rb +1 -1
- data/spec/public/property/date_spec.rb +1 -1
- data/spec/public/property/date_time_spec.rb +1 -1
- data/spec/public/property/decimal_spec.rb +7 -6
- data/spec/public/property/discriminator_spec.rb +1 -1
- data/spec/public/property/float_spec.rb +1 -1
- data/spec/public/property/integer_spec.rb +1 -1
- data/spec/public/property/object_spec.rb +2 -2
- data/spec/public/property/serial_spec.rb +1 -1
- data/spec/public/property/string_spec.rb +1 -1
- data/spec/public/property/text_spec.rb +6 -3
- data/spec/public/property/time_spec.rb +1 -1
- data/spec/public/property_spec.rb +13 -11
- data/spec/public/resource_spec.rb +43 -1
- data/spec/public/sel_spec.rb +1 -1
- data/spec/public/setup_spec.rb +1 -1
- data/spec/public/shared/collection_shared_spec.rb +6 -1
- data/spec/semipublic/adapters/abstract_adapter_spec.rb +1 -1
- data/spec/semipublic/adapters/in_memory_adapter_spec.rb +1 -1
- data/spec/semipublic/associations/many_to_many_spec.rb +1 -1
- data/spec/semipublic/associations/many_to_one_spec.rb +1 -1
- data/spec/semipublic/associations/one_to_many_spec.rb +1 -1
- data/spec/semipublic/associations/one_to_one_spec.rb +1 -1
- data/spec/semipublic/associations/relationship_spec.rb +1 -1
- data/spec/semipublic/associations_spec.rb +1 -1
- data/spec/semipublic/collection_spec.rb +1 -1
- data/spec/semipublic/model_spec.rb +1 -1
- data/spec/semipublic/property/binary_spec.rb +1 -1
- data/spec/semipublic/property/boolean_spec.rb +1 -1
- data/spec/semipublic/property/class_spec.rb +1 -1
- data/spec/semipublic/property/date_spec.rb +1 -1
- data/spec/semipublic/property/date_time_spec.rb +1 -1
- data/spec/semipublic/property/decimal_spec.rb +6 -5
- data/spec/semipublic/property/discriminator_spec.rb +1 -1
- data/spec/semipublic/property/float_spec.rb +1 -1
- data/spec/semipublic/property/integer_spec.rb +1 -1
- data/spec/semipublic/property/lookup_spec.rb +8 -5
- data/spec/semipublic/property/serial_spec.rb +1 -1
- data/spec/semipublic/property/string_spec.rb +1 -1
- data/spec/semipublic/property/text_spec.rb +1 -1
- data/spec/semipublic/property/time_spec.rb +1 -1
- data/spec/semipublic/property_spec.rb +32 -7
- data/spec/semipublic/query/conditions/comparison_spec.rb +1 -264
- data/spec/semipublic/query/conditions/operation_spec.rb +1 -2
- data/spec/semipublic/query/path_spec.rb +27 -1
- data/spec/semipublic/query_spec.rb +87 -36
- data/spec/semipublic/resource/state/clean_spec.rb +1 -2
- data/spec/semipublic/resource/state/deleted_spec.rb +1 -2
- data/spec/semipublic/resource/state/dirty_spec.rb +1 -2
- data/spec/semipublic/resource/state/immutable_spec.rb +1 -2
- data/spec/semipublic/resource/state/transient_spec.rb +7 -2
- data/spec/semipublic/resource/state_spec.rb +1 -1
- data/spec/semipublic/resource_spec.rb +1 -1
- data/spec/unit/array_spec.rb +1 -0
- data/spec/unit/data_mapper/ordered_set/append_spec.rb +26 -0
- data/spec/unit/data_mapper/ordered_set/clear_spec.rb +24 -0
- data/spec/unit/data_mapper/ordered_set/delete_spec.rb +28 -0
- data/spec/unit/data_mapper/ordered_set/each_spec.rb +19 -0
- data/spec/unit/data_mapper/ordered_set/empty_spec.rb +20 -0
- data/spec/unit/data_mapper/ordered_set/entries_spec.rb +22 -0
- data/spec/unit/data_mapper/ordered_set/eql_spec.rb +51 -0
- data/spec/unit/data_mapper/ordered_set/equal_value_spec.rb +84 -0
- data/spec/unit/data_mapper/ordered_set/hash_spec.rb +12 -0
- data/spec/unit/data_mapper/ordered_set/include_spec.rb +23 -0
- data/spec/unit/data_mapper/ordered_set/index_spec.rb +28 -0
- data/spec/unit/data_mapper/ordered_set/initialize_spec.rb +32 -0
- data/spec/unit/data_mapper/ordered_set/merge_spec.rb +36 -0
- data/spec/unit/data_mapper/ordered_set/shared/append_spec.rb +24 -0
- data/spec/unit/data_mapper/ordered_set/shared/clear_spec.rb +9 -0
- data/spec/unit/data_mapper/ordered_set/shared/delete_spec.rb +25 -0
- data/spec/unit/data_mapper/ordered_set/shared/each_spec.rb +17 -0
- data/spec/unit/data_mapper/ordered_set/shared/empty_spec.rb +9 -0
- data/spec/unit/data_mapper/ordered_set/shared/entries_spec.rb +9 -0
- data/spec/unit/data_mapper/ordered_set/shared/include_spec.rb +9 -0
- data/spec/unit/data_mapper/ordered_set/shared/index_spec.rb +13 -0
- data/spec/unit/data_mapper/ordered_set/shared/initialize_spec.rb +28 -0
- data/spec/unit/data_mapper/ordered_set/shared/merge_spec.rb +28 -0
- data/spec/unit/data_mapper/ordered_set/shared/size_spec.rb +13 -0
- data/spec/unit/data_mapper/ordered_set/shared/to_ary_spec.rb +11 -0
- data/spec/unit/data_mapper/ordered_set/size_spec.rb +27 -0
- data/spec/unit/data_mapper/ordered_set/to_ary_spec.rb +23 -0
- data/spec/unit/data_mapper/subject_set/append_spec.rb +47 -0
- data/spec/unit/data_mapper/subject_set/clear_spec.rb +34 -0
- data/spec/unit/data_mapper/subject_set/delete_spec.rb +40 -0
- data/spec/unit/data_mapper/subject_set/each_spec.rb +30 -0
- data/spec/unit/data_mapper/subject_set/empty_spec.rb +31 -0
- data/spec/unit/data_mapper/subject_set/entries_spec.rb +31 -0
- data/spec/unit/data_mapper/subject_set/get_spec.rb +34 -0
- data/spec/unit/data_mapper/subject_set/include_spec.rb +32 -0
- data/spec/unit/data_mapper/subject_set/named_spec.rb +33 -0
- data/spec/unit/data_mapper/subject_set/shared/append_spec.rb +18 -0
- data/spec/unit/data_mapper/subject_set/shared/clear_spec.rb +9 -0
- data/spec/unit/data_mapper/subject_set/shared/delete_spec.rb +9 -0
- data/spec/unit/data_mapper/subject_set/shared/each_spec.rb +9 -0
- data/spec/unit/data_mapper/subject_set/shared/empty_spec.rb +9 -0
- data/spec/unit/data_mapper/subject_set/shared/entries_spec.rb +9 -0
- data/spec/unit/data_mapper/subject_set/shared/get_spec.rb +9 -0
- data/spec/unit/data_mapper/subject_set/shared/include_spec.rb +9 -0
- data/spec/unit/data_mapper/subject_set/shared/named_spec.rb +9 -0
- data/spec/unit/data_mapper/subject_set/shared/size_spec.rb +13 -0
- data/spec/unit/data_mapper/subject_set/shared/to_ary_spec.rb +9 -0
- data/spec/unit/data_mapper/subject_set/shared/values_at_spec.rb +44 -0
- data/spec/unit/data_mapper/subject_set/size_spec.rb +42 -0
- data/spec/unit/data_mapper/subject_set/to_ary_spec.rb +34 -0
- data/spec/unit/data_mapper/subject_set/values_at_spec.rb +57 -0
- data/spec/unit/hash_spec.rb +2 -1
- data/spec/unit/hook_spec.rb +1 -0
- data/spec/unit/lazy_array_spec.rb +2 -1
- data/spec/unit/module_spec.rb +2 -1
- data/spec/unit/object_spec.rb +1 -0
- data/spec/unit/try_dup_spec.rb +1 -0
- data/tasks/spec.rake +0 -3
- metadata +149 -52
- data/.gitignore +0 -37
- data/lib/dm-core/type.rb +0 -216
- data/lib/dm-core/types/boolean.rb +0 -9
- data/lib/dm-core/types/decimal.rb +0 -9
- data/lib/dm-core/types/discriminator.rb +0 -50
- data/lib/dm-core/types/object.rb +0 -25
- data/lib/dm-core/types/serial.rb +0 -11
- data/lib/dm-core/types/text.rb +0 -11
- data/tasks/local_gemfile.rake +0 -16
- data/tasks/metrics.rake +0 -37
data/Gemfile
CHANGED
|
@@ -1,142 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
# recommended to create a local Gemfile and use this instead of the git
|
|
3
|
-
# sources. This will make sure that you are developing against your
|
|
4
|
-
# other local datamapper sources that you currently work on. Gemfile.local
|
|
5
|
-
# will behave identically to the standard Gemfile apart from the fact that
|
|
6
|
-
# it fetches the datamapper gems from local paths. This means that you can use
|
|
7
|
-
# the same environment variables, like ADAPTER(S) or PLUGIN(S) when running
|
|
8
|
-
# bundle commands. Gemfile.local is added to .gitignore, so you don't need to
|
|
9
|
-
# worry about accidentally checking local development paths into git.
|
|
10
|
-
# In order to create a local Gemfile, all you need to do is run:
|
|
11
|
-
#
|
|
12
|
-
# bundle exec rake local_gemfile
|
|
13
|
-
#
|
|
14
|
-
# This will give you a Gemfile.local file that points to your local clones of
|
|
15
|
-
# the various datamapper gems. It's assumed that all datamapper repo clones
|
|
16
|
-
# reside in the same directory. You can use the Gemfile.local like so for
|
|
17
|
-
# running any bundle command:
|
|
18
|
-
#
|
|
19
|
-
# BUNDLE_GEMFILE=Gemfile.local bundle foo
|
|
20
|
-
#
|
|
21
|
-
# You can also specify which adapter(s) should be part of the bundle by setting
|
|
22
|
-
# an environment variable. This of course also works when using the Gemfile.local
|
|
23
|
-
#
|
|
24
|
-
# bundle foo # dm-sqlite-adapter
|
|
25
|
-
# ADAPTER=mysql bundle foo # dm-mysql-adapter
|
|
26
|
-
# ADAPTERS=sqlite,mysql bundle foo # dm-sqlite-adapter and dm-mysql-adapter
|
|
27
|
-
#
|
|
28
|
-
# Of course you can also use the ADAPTER(S) variable when using the Gemfile.local
|
|
29
|
-
# and running specs against selected adapters.
|
|
30
|
-
#
|
|
31
|
-
# For easily working with adapters supported on your machine, it's recommended
|
|
32
|
-
# that you first install all adapters that you are planning to use or work on
|
|
33
|
-
# by doing something like
|
|
34
|
-
#
|
|
35
|
-
# ADAPTERS=sqlite,mysql,postgres bundle install
|
|
36
|
-
#
|
|
37
|
-
# This will clone the various repositories and make them available to bundler.
|
|
38
|
-
# Once you have them installed you can easily switch between adapters for the
|
|
39
|
-
# various development tasks. Running something like
|
|
40
|
-
#
|
|
41
|
-
# ADAPTER=mysql bundle exec rake spec
|
|
42
|
-
#
|
|
43
|
-
# will make sure that the dm-mysql-adapter is part of the bundle, and will be used
|
|
44
|
-
# when running the specs.
|
|
45
|
-
#
|
|
46
|
-
# You can also specify which plugin(s) should be part of the bundle by setting
|
|
47
|
-
# an environment variable. This also works when using the Gemfile.local
|
|
48
|
-
#
|
|
49
|
-
# bundle foo # dm-migrations
|
|
50
|
-
# PLUGINS=dm-validations bundle foo # dm-migrations and dm-validations
|
|
51
|
-
# PLUGINS=dm-validations,dm-types bundle foo # dm-migrations, dm-validations and dm-types
|
|
52
|
-
#
|
|
53
|
-
# Of course you can combine the PLUGIN(S) and ADAPTER(S) env vars to run specs
|
|
54
|
-
# for certain adapter/plugin combinations.
|
|
55
|
-
#
|
|
56
|
-
# Finally, to speed up running specs and other tasks, it's recommended to run
|
|
57
|
-
#
|
|
58
|
-
# bundle lock
|
|
59
|
-
#
|
|
60
|
-
# after running 'bundle install' for the first time. This will make 'bundle exec' run
|
|
61
|
-
# a lot faster compared to the unlocked version. With an unlocked bundle you would
|
|
62
|
-
# typically just run 'bundle install' from time to time to fetch the latest sources from
|
|
63
|
-
# upstream. When you locked your bundle, you need to run
|
|
64
|
-
#
|
|
65
|
-
# bundle install --relock
|
|
66
|
-
#
|
|
67
|
-
# to make sure to fetch the latest updates and then lock the bundle again. Gemfile.lock
|
|
68
|
-
# is added to the .gitignore file, so you don't need to worry about accidentally checking
|
|
69
|
-
# it into version control.
|
|
1
|
+
require 'pathname'
|
|
70
2
|
|
|
71
3
|
source 'http://rubygems.org'
|
|
72
4
|
|
|
73
|
-
|
|
74
|
-
|
|
5
|
+
SOURCE = ENV.fetch('SOURCE', :git).to_sym
|
|
6
|
+
REPO_POSTFIX = SOURCE == :path ? '' : '.git'
|
|
7
|
+
DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
|
|
8
|
+
DM_VERSION = '~> 1.1.0.rc1'
|
|
75
9
|
|
|
76
|
-
group :runtime do
|
|
10
|
+
group :runtime do
|
|
77
11
|
|
|
78
12
|
if ENV['EXTLIB']
|
|
79
|
-
gem 'extlib',
|
|
13
|
+
gem 'extlib', '~> 0.9.15', SOURCE => "#{DATAMAPPER}/extlib#{REPO_POSTFIX}", :require => nil
|
|
80
14
|
else
|
|
81
|
-
gem 'activesupport', '~> 3.0.
|
|
15
|
+
gem 'activesupport', '~> 3.0.4', :require => nil
|
|
16
|
+
gem 'i18n', '~> 0.5.0'
|
|
82
17
|
end
|
|
83
18
|
|
|
84
|
-
gem 'addressable',
|
|
19
|
+
gem 'addressable', '~> 2.2'
|
|
85
20
|
|
|
86
21
|
end
|
|
87
22
|
|
|
88
|
-
group
|
|
23
|
+
group :development do
|
|
89
24
|
|
|
90
|
-
gem '
|
|
91
|
-
gem '
|
|
92
|
-
gem '
|
|
25
|
+
gem 'jeweler', '~> 1.5.2'
|
|
26
|
+
gem 'rake', '~> 0.8.7'
|
|
27
|
+
gem 'rspec', '~> 1.3.1'
|
|
93
28
|
|
|
94
29
|
end
|
|
95
30
|
|
|
96
|
-
group :quality do
|
|
31
|
+
group :quality do
|
|
97
32
|
|
|
98
|
-
gem '
|
|
99
|
-
gem '
|
|
100
|
-
gem '
|
|
101
|
-
gem 'roodi', '~> 2.1'
|
|
102
|
-
gem 'yard', '~> 0.5'
|
|
103
|
-
gem 'yardstick', '~> 0.1'
|
|
33
|
+
gem 'rcov', '~> 0.9.9', :platforms => :mri_18
|
|
34
|
+
gem 'yard', '~> 0.6'
|
|
35
|
+
gem 'yardstick', '~> 0.2'
|
|
104
36
|
|
|
105
37
|
end
|
|
106
38
|
|
|
107
|
-
group :datamapper do
|
|
39
|
+
group :datamapper do
|
|
108
40
|
|
|
109
41
|
gem 'dm-core', DM_VERSION, :path => File.dirname(__FILE__) # Make ourself available to the adapters
|
|
110
42
|
|
|
111
|
-
adapters = ENV['
|
|
112
|
-
adapters = adapters.to_s.tr(',', ' ').split.uniq
|
|
43
|
+
adapters = ENV['ADAPTERS'] || ENV['ADAPTER'] || 'in_memory'
|
|
44
|
+
adapters = adapters.to_s.tr(',', ' ').split.uniq
|
|
113
45
|
|
|
114
46
|
DO_VERSION = '~> 0.10.2'
|
|
115
47
|
DM_DO_ADAPTERS = %w[ sqlite postgres mysql oracle sqlserver ]
|
|
116
48
|
|
|
117
49
|
if (do_adapters = DM_DO_ADAPTERS & adapters).any?
|
|
118
50
|
options = {}
|
|
119
|
-
options[:git] = "#{DATAMAPPER}/do
|
|
51
|
+
options[:git] = "#{DATAMAPPER}/do#{REPO_POSTFIX}" if ENV['DO_GIT'] == 'true'
|
|
120
52
|
|
|
121
|
-
gem 'data_objects',
|
|
53
|
+
gem 'data_objects', DO_VERSION, options.dup
|
|
122
54
|
|
|
123
55
|
do_adapters.each do |adapter|
|
|
124
56
|
adapter = 'sqlite3' if adapter == 'sqlite'
|
|
125
57
|
gem "do_#{adapter}", DO_VERSION, options.dup
|
|
126
58
|
end
|
|
127
59
|
|
|
128
|
-
gem 'dm-do-adapter', DM_VERSION,
|
|
60
|
+
gem 'dm-do-adapter', DM_VERSION, SOURCE => "#{DATAMAPPER}/dm-do-adapter#{REPO_POSTFIX}"
|
|
129
61
|
end
|
|
130
62
|
|
|
131
63
|
adapters.each do |adapter|
|
|
132
|
-
|
|
64
|
+
unless adapter == 'in_memory'
|
|
65
|
+
gem "dm-#{adapter}-adapter", DM_VERSION, SOURCE => "#{DATAMAPPER}/dm-#{adapter}-adapter#{REPO_POSTFIX}"
|
|
66
|
+
end
|
|
133
67
|
end
|
|
134
68
|
|
|
135
69
|
plugins = ENV['PLUGINS'] || ENV['PLUGIN']
|
|
136
70
|
plugins = plugins.to_s.tr(',', ' ').split.push('dm-migrations').uniq
|
|
137
71
|
|
|
138
72
|
plugins.each do |plugin|
|
|
139
|
-
gem plugin, DM_VERSION,
|
|
73
|
+
gem plugin, DM_VERSION, SOURCE => "#{DATAMAPPER}/#{plugin}#{REPO_POSTFIX}"
|
|
140
74
|
end
|
|
141
75
|
|
|
142
76
|
end
|
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
|
@@ -64,14 +64,14 @@ board.
|
|
|
64
64
|
Not so with the DataMapper. Text fields are lazily loaded, meaning they
|
|
65
65
|
only load when you need them. If you want more control you can enable or
|
|
66
66
|
disable this feature for any field (not just text-fields) by passing a
|
|
67
|
-
|
|
67
|
+
<tt>:lazy</tt> option to your field mapping with a value of <tt>true</tt> or
|
|
68
68
|
<tt>false</tt>.
|
|
69
69
|
|
|
70
70
|
class Animal
|
|
71
71
|
include DataMapper::Resource
|
|
72
72
|
|
|
73
|
-
property :name,
|
|
74
|
-
property :
|
|
73
|
+
property :name, String
|
|
74
|
+
property :description, Text, :lazy => false
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
Plus, lazy-loading of Text fields happens automatically and intelligently when
|
|
@@ -79,10 +79,10 @@ working with associations. The following only issues 2 queries to load up all
|
|
|
79
79
|
of the notes fields on each animal:
|
|
80
80
|
|
|
81
81
|
repository do
|
|
82
|
-
Animal.all.each { |animal| animal.
|
|
82
|
+
Animal.all.each { |animal| animal.description.to_a }
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
-
Did you notice the
|
|
85
|
+
Did you notice the <tt>#to_a</tt> call in the above example? That
|
|
86
86
|
was necessary because even DataMapper collections are lazy. If you don't
|
|
87
87
|
iterate over them, or in this case ask them to become Arrays, they won't
|
|
88
88
|
execute until you need them. We needed to call <tt>#to_a</tt> to force
|
|
@@ -90,12 +90,11 @@ the lazy load because without it, the above example would have only
|
|
|
90
90
|
executed one query. This extra bit of laziness can come in very handy,
|
|
91
91
|
for example:
|
|
92
92
|
|
|
93
|
-
animals
|
|
93
|
+
animals = Animal.all
|
|
94
|
+
description = 'foo'
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
animal.update(:note => note)
|
|
98
|
-
end
|
|
96
|
+
animals.each do |animal|
|
|
97
|
+
animal.update(:description => description)
|
|
99
98
|
end
|
|
100
99
|
|
|
101
100
|
In the above example, the Animals won't be retrieved until you actually
|
|
@@ -133,6 +132,40 @@ You can even use this on association collections, eg:
|
|
|
133
132
|
|
|
134
133
|
zoo.animals.mammals.to_a # => executes one query
|
|
135
134
|
|
|
135
|
+
== Custom Properties
|
|
136
|
+
|
|
137
|
+
With DataMapper it is possible to create custom properties for your models.
|
|
138
|
+
Consider this example:
|
|
139
|
+
|
|
140
|
+
module DataMapper
|
|
141
|
+
class Property
|
|
142
|
+
class Email < String
|
|
143
|
+
required true
|
|
144
|
+
format /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
class User
|
|
150
|
+
include DataMapper::Resource
|
|
151
|
+
|
|
152
|
+
property :id, Serial
|
|
153
|
+
property :email, Email
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
This way there won't be a need to repeat same property options every time you
|
|
157
|
+
add an email to a model. In the example above we create an Email property which
|
|
158
|
+
is just a String with additional pre-configured options: <tt>required</tt> and
|
|
159
|
+
<tt>format</tt>. Please note that it is possible to override these options when
|
|
160
|
+
declaring a property, like this:
|
|
161
|
+
|
|
162
|
+
class Member
|
|
163
|
+
include DataMapper::Resource
|
|
164
|
+
|
|
165
|
+
property :id, Serial
|
|
166
|
+
property :email, Email, :required => false
|
|
167
|
+
end
|
|
168
|
+
|
|
136
169
|
== Plays Well With Others
|
|
137
170
|
|
|
138
171
|
In ActiveRecord, all your fields are mapped, whether you want them or not.
|
|
@@ -201,4 +234,4 @@ nice syntax tweaks DataMapper delivers out of the box...
|
|
|
201
234
|
|
|
202
235
|
== Copyright
|
|
203
236
|
|
|
204
|
-
Copyright (c)
|
|
237
|
+
Copyright (c) 2011 Dan Kubb. See LICENSE for details.
|
data/Rakefile
CHANGED
|
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
|
2
2
|
require 'rake'
|
|
3
3
|
|
|
4
4
|
begin
|
|
5
|
-
gem 'jeweler', '~> 1.
|
|
5
|
+
gem 'jeweler', '~> 1.5.2'
|
|
6
6
|
require 'jeweler'
|
|
7
7
|
|
|
8
8
|
Jeweler::Tasks.new do |gem|
|
|
@@ -15,12 +15,6 @@ begin
|
|
|
15
15
|
gem.has_rdoc = 'yard'
|
|
16
16
|
|
|
17
17
|
gem.rubyforge_project = 'datamapper'
|
|
18
|
-
|
|
19
|
-
gem.add_dependency 'extlib', '~> 0.9.15'
|
|
20
|
-
gem.add_dependency 'addressable', '~> 2.2'
|
|
21
|
-
|
|
22
|
-
gem.add_development_dependency 'rspec', '~> 1.3'
|
|
23
|
-
gem.add_development_dependency 'jeweler', '~> 1.4'
|
|
24
18
|
end
|
|
25
19
|
|
|
26
20
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.1.0.rc1
|
data/dm-core.gemspec
CHANGED
|
@@ -1,336 +1,435 @@
|
|
|
1
1
|
# Generated by jeweler
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{dm-core}
|
|
8
|
-
s.version = "1.0.
|
|
8
|
+
s.version = "1.1.0.rc1"
|
|
9
9
|
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Dan Kubb"]
|
|
12
|
-
s.date = %q{
|
|
12
|
+
s.date = %q{2011-02-28}
|
|
13
13
|
s.description = %q{Faster, Better, Simpler.}
|
|
14
14
|
s.email = %q{dan.kubb@gmail.com}
|
|
15
15
|
s.extra_rdoc_files = [
|
|
16
16
|
"LICENSE",
|
|
17
|
-
|
|
17
|
+
"README.rdoc"
|
|
18
18
|
]
|
|
19
19
|
s.files = [
|
|
20
20
|
".autotest",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
21
|
+
".document",
|
|
22
|
+
"Gemfile",
|
|
23
|
+
"LICENSE",
|
|
24
|
+
"README.rdoc",
|
|
25
|
+
"Rakefile",
|
|
26
|
+
"VERSION",
|
|
27
|
+
"dm-core.gemspec",
|
|
28
|
+
"lib/dm-core.rb",
|
|
29
|
+
"lib/dm-core/adapters.rb",
|
|
30
|
+
"lib/dm-core/adapters/abstract_adapter.rb",
|
|
31
|
+
"lib/dm-core/adapters/in_memory_adapter.rb",
|
|
32
|
+
"lib/dm-core/associations/many_to_many.rb",
|
|
33
|
+
"lib/dm-core/associations/many_to_one.rb",
|
|
34
|
+
"lib/dm-core/associations/one_to_many.rb",
|
|
35
|
+
"lib/dm-core/associations/one_to_one.rb",
|
|
36
|
+
"lib/dm-core/associations/relationship.rb",
|
|
37
|
+
"lib/dm-core/collection.rb",
|
|
38
|
+
"lib/dm-core/core_ext/array.rb",
|
|
39
|
+
"lib/dm-core/core_ext/hash.rb",
|
|
40
|
+
"lib/dm-core/core_ext/kernel.rb",
|
|
41
|
+
"lib/dm-core/core_ext/module.rb",
|
|
42
|
+
"lib/dm-core/core_ext/object.rb",
|
|
43
|
+
"lib/dm-core/core_ext/pathname.rb",
|
|
44
|
+
"lib/dm-core/core_ext/string.rb",
|
|
45
|
+
"lib/dm-core/core_ext/symbol.rb",
|
|
46
|
+
"lib/dm-core/core_ext/try_dup.rb",
|
|
47
|
+
"lib/dm-core/identity_map.rb",
|
|
48
|
+
"lib/dm-core/model.rb",
|
|
49
|
+
"lib/dm-core/model/hook.rb",
|
|
50
|
+
"lib/dm-core/model/is.rb",
|
|
51
|
+
"lib/dm-core/model/property.rb",
|
|
52
|
+
"lib/dm-core/model/relationship.rb",
|
|
53
|
+
"lib/dm-core/model/scope.rb",
|
|
54
|
+
"lib/dm-core/property.rb",
|
|
55
|
+
"lib/dm-core/property/binary.rb",
|
|
56
|
+
"lib/dm-core/property/boolean.rb",
|
|
57
|
+
"lib/dm-core/property/class.rb",
|
|
58
|
+
"lib/dm-core/property/date.rb",
|
|
59
|
+
"lib/dm-core/property/date_time.rb",
|
|
60
|
+
"lib/dm-core/property/decimal.rb",
|
|
61
|
+
"lib/dm-core/property/discriminator.rb",
|
|
62
|
+
"lib/dm-core/property/float.rb",
|
|
63
|
+
"lib/dm-core/property/integer.rb",
|
|
64
|
+
"lib/dm-core/property/lookup.rb",
|
|
65
|
+
"lib/dm-core/property/numeric.rb",
|
|
66
|
+
"lib/dm-core/property/object.rb",
|
|
67
|
+
"lib/dm-core/property/serial.rb",
|
|
68
|
+
"lib/dm-core/property/string.rb",
|
|
69
|
+
"lib/dm-core/property/text.rb",
|
|
70
|
+
"lib/dm-core/property/time.rb",
|
|
71
|
+
"lib/dm-core/property/typecast/numeric.rb",
|
|
72
|
+
"lib/dm-core/property/typecast/time.rb",
|
|
73
|
+
"lib/dm-core/property_set.rb",
|
|
74
|
+
"lib/dm-core/query.rb",
|
|
75
|
+
"lib/dm-core/query/conditions/comparison.rb",
|
|
76
|
+
"lib/dm-core/query/conditions/operation.rb",
|
|
77
|
+
"lib/dm-core/query/direction.rb",
|
|
78
|
+
"lib/dm-core/query/operator.rb",
|
|
79
|
+
"lib/dm-core/query/path.rb",
|
|
80
|
+
"lib/dm-core/query/sort.rb",
|
|
81
|
+
"lib/dm-core/relationship_set.rb",
|
|
82
|
+
"lib/dm-core/repository.rb",
|
|
83
|
+
"lib/dm-core/resource.rb",
|
|
84
|
+
"lib/dm-core/resource/state.rb",
|
|
85
|
+
"lib/dm-core/resource/state/clean.rb",
|
|
86
|
+
"lib/dm-core/resource/state/deleted.rb",
|
|
87
|
+
"lib/dm-core/resource/state/dirty.rb",
|
|
88
|
+
"lib/dm-core/resource/state/immutable.rb",
|
|
89
|
+
"lib/dm-core/resource/state/persisted.rb",
|
|
90
|
+
"lib/dm-core/resource/state/transient.rb",
|
|
91
|
+
"lib/dm-core/spec/lib/adapter_helpers.rb",
|
|
92
|
+
"lib/dm-core/spec/lib/collection_helpers.rb",
|
|
93
|
+
"lib/dm-core/spec/lib/counter_adapter.rb",
|
|
94
|
+
"lib/dm-core/spec/lib/pending_helpers.rb",
|
|
95
|
+
"lib/dm-core/spec/lib/spec_helper.rb",
|
|
96
|
+
"lib/dm-core/spec/setup.rb",
|
|
97
|
+
"lib/dm-core/spec/shared/adapter_spec.rb",
|
|
98
|
+
"lib/dm-core/spec/shared/public/property_spec.rb",
|
|
99
|
+
"lib/dm-core/spec/shared/resource_spec.rb",
|
|
100
|
+
"lib/dm-core/spec/shared/sel_spec.rb",
|
|
101
|
+
"lib/dm-core/spec/shared/semipublic/property_spec.rb",
|
|
102
|
+
"lib/dm-core/spec/shared/semipublic/query/conditions/abstract_comparison_spec.rb",
|
|
103
|
+
"lib/dm-core/support/assertions.rb",
|
|
104
|
+
"lib/dm-core/support/chainable.rb",
|
|
105
|
+
"lib/dm-core/support/deprecate.rb",
|
|
106
|
+
"lib/dm-core/support/descendant_set.rb",
|
|
107
|
+
"lib/dm-core/support/equalizer.rb",
|
|
108
|
+
"lib/dm-core/support/hook.rb",
|
|
109
|
+
"lib/dm-core/support/lazy_array.rb",
|
|
110
|
+
"lib/dm-core/support/local_object_space.rb",
|
|
111
|
+
"lib/dm-core/support/logger.rb",
|
|
112
|
+
"lib/dm-core/support/naming_conventions.rb",
|
|
113
|
+
"lib/dm-core/support/ordered_set.rb",
|
|
114
|
+
"lib/dm-core/support/subject.rb",
|
|
115
|
+
"lib/dm-core/support/subject_set.rb",
|
|
116
|
+
"lib/dm-core/version.rb",
|
|
117
|
+
"script/performance.rb",
|
|
118
|
+
"script/profile.rb",
|
|
119
|
+
"spec/lib/rspec_immediate_feedback_formatter.rb",
|
|
120
|
+
"spec/public/associations/many_to_many/read_multiple_join_spec.rb",
|
|
121
|
+
"spec/public/associations/many_to_many_spec.rb",
|
|
122
|
+
"spec/public/associations/many_to_one_spec.rb",
|
|
123
|
+
"spec/public/associations/many_to_one_with_boolean_cpk_spec.rb",
|
|
124
|
+
"spec/public/associations/many_to_one_with_custom_fk_spec.rb",
|
|
125
|
+
"spec/public/associations/one_to_many_spec.rb",
|
|
126
|
+
"spec/public/associations/one_to_one_spec.rb",
|
|
127
|
+
"spec/public/associations/one_to_one_with_boolean_cpk_spec.rb",
|
|
128
|
+
"spec/public/collection_spec.rb",
|
|
129
|
+
"spec/public/finalize_spec.rb",
|
|
130
|
+
"spec/public/model/hook_spec.rb",
|
|
131
|
+
"spec/public/model/property_spec.rb",
|
|
132
|
+
"spec/public/model/relationship_spec.rb",
|
|
133
|
+
"spec/public/model_spec.rb",
|
|
134
|
+
"spec/public/property/binary_spec.rb",
|
|
135
|
+
"spec/public/property/boolean_spec.rb",
|
|
136
|
+
"spec/public/property/class_spec.rb",
|
|
137
|
+
"spec/public/property/date_spec.rb",
|
|
138
|
+
"spec/public/property/date_time_spec.rb",
|
|
139
|
+
"spec/public/property/decimal_spec.rb",
|
|
140
|
+
"spec/public/property/discriminator_spec.rb",
|
|
141
|
+
"spec/public/property/float_spec.rb",
|
|
142
|
+
"spec/public/property/integer_spec.rb",
|
|
143
|
+
"spec/public/property/object_spec.rb",
|
|
144
|
+
"spec/public/property/serial_spec.rb",
|
|
145
|
+
"spec/public/property/string_spec.rb",
|
|
146
|
+
"spec/public/property/text_spec.rb",
|
|
147
|
+
"spec/public/property/time_spec.rb",
|
|
148
|
+
"spec/public/property_spec.rb",
|
|
149
|
+
"spec/public/resource_spec.rb",
|
|
150
|
+
"spec/public/sel_spec.rb",
|
|
151
|
+
"spec/public/setup_spec.rb",
|
|
152
|
+
"spec/public/shared/association_collection_shared_spec.rb",
|
|
153
|
+
"spec/public/shared/collection_finder_shared_spec.rb",
|
|
154
|
+
"spec/public/shared/collection_shared_spec.rb",
|
|
155
|
+
"spec/public/shared/finder_shared_spec.rb",
|
|
156
|
+
"spec/rcov.opts",
|
|
157
|
+
"spec/semipublic/adapters/abstract_adapter_spec.rb",
|
|
158
|
+
"spec/semipublic/adapters/in_memory_adapter_spec.rb",
|
|
159
|
+
"spec/semipublic/associations/many_to_many_spec.rb",
|
|
160
|
+
"spec/semipublic/associations/many_to_one_spec.rb",
|
|
161
|
+
"spec/semipublic/associations/one_to_many_spec.rb",
|
|
162
|
+
"spec/semipublic/associations/one_to_one_spec.rb",
|
|
163
|
+
"spec/semipublic/associations/relationship_spec.rb",
|
|
164
|
+
"spec/semipublic/associations_spec.rb",
|
|
165
|
+
"spec/semipublic/collection_spec.rb",
|
|
166
|
+
"spec/semipublic/model_spec.rb",
|
|
167
|
+
"spec/semipublic/property/binary_spec.rb",
|
|
168
|
+
"spec/semipublic/property/boolean_spec.rb",
|
|
169
|
+
"spec/semipublic/property/class_spec.rb",
|
|
170
|
+
"spec/semipublic/property/date_spec.rb",
|
|
171
|
+
"spec/semipublic/property/date_time_spec.rb",
|
|
172
|
+
"spec/semipublic/property/decimal_spec.rb",
|
|
173
|
+
"spec/semipublic/property/discriminator_spec.rb",
|
|
174
|
+
"spec/semipublic/property/float_spec.rb",
|
|
175
|
+
"spec/semipublic/property/integer_spec.rb",
|
|
176
|
+
"spec/semipublic/property/lookup_spec.rb",
|
|
177
|
+
"spec/semipublic/property/serial_spec.rb",
|
|
178
|
+
"spec/semipublic/property/string_spec.rb",
|
|
179
|
+
"spec/semipublic/property/text_spec.rb",
|
|
180
|
+
"spec/semipublic/property/time_spec.rb",
|
|
181
|
+
"spec/semipublic/property_spec.rb",
|
|
182
|
+
"spec/semipublic/query/conditions/comparison_spec.rb",
|
|
183
|
+
"spec/semipublic/query/conditions/operation_spec.rb",
|
|
184
|
+
"spec/semipublic/query/path_spec.rb",
|
|
185
|
+
"spec/semipublic/query_spec.rb",
|
|
186
|
+
"spec/semipublic/resource/state/clean_spec.rb",
|
|
187
|
+
"spec/semipublic/resource/state/deleted_spec.rb",
|
|
188
|
+
"spec/semipublic/resource/state/dirty_spec.rb",
|
|
189
|
+
"spec/semipublic/resource/state/immutable_spec.rb",
|
|
190
|
+
"spec/semipublic/resource/state/transient_spec.rb",
|
|
191
|
+
"spec/semipublic/resource/state_spec.rb",
|
|
192
|
+
"spec/semipublic/resource_spec.rb",
|
|
193
|
+
"spec/semipublic/shared/condition_shared_spec.rb",
|
|
194
|
+
"spec/semipublic/shared/resource_shared_spec.rb",
|
|
195
|
+
"spec/semipublic/shared/resource_state_shared_spec.rb",
|
|
196
|
+
"spec/semipublic/shared/subject_shared_spec.rb",
|
|
197
|
+
"spec/spec.opts",
|
|
198
|
+
"spec/spec_helper.rb",
|
|
199
|
+
"spec/support/properties/huge_integer.rb",
|
|
200
|
+
"spec/unit/array_spec.rb",
|
|
201
|
+
"spec/unit/data_mapper/ordered_set/append_spec.rb",
|
|
202
|
+
"spec/unit/data_mapper/ordered_set/clear_spec.rb",
|
|
203
|
+
"spec/unit/data_mapper/ordered_set/delete_spec.rb",
|
|
204
|
+
"spec/unit/data_mapper/ordered_set/each_spec.rb",
|
|
205
|
+
"spec/unit/data_mapper/ordered_set/empty_spec.rb",
|
|
206
|
+
"spec/unit/data_mapper/ordered_set/entries_spec.rb",
|
|
207
|
+
"spec/unit/data_mapper/ordered_set/eql_spec.rb",
|
|
208
|
+
"spec/unit/data_mapper/ordered_set/equal_value_spec.rb",
|
|
209
|
+
"spec/unit/data_mapper/ordered_set/hash_spec.rb",
|
|
210
|
+
"spec/unit/data_mapper/ordered_set/include_spec.rb",
|
|
211
|
+
"spec/unit/data_mapper/ordered_set/index_spec.rb",
|
|
212
|
+
"spec/unit/data_mapper/ordered_set/initialize_spec.rb",
|
|
213
|
+
"spec/unit/data_mapper/ordered_set/merge_spec.rb",
|
|
214
|
+
"spec/unit/data_mapper/ordered_set/shared/append_spec.rb",
|
|
215
|
+
"spec/unit/data_mapper/ordered_set/shared/clear_spec.rb",
|
|
216
|
+
"spec/unit/data_mapper/ordered_set/shared/delete_spec.rb",
|
|
217
|
+
"spec/unit/data_mapper/ordered_set/shared/each_spec.rb",
|
|
218
|
+
"spec/unit/data_mapper/ordered_set/shared/empty_spec.rb",
|
|
219
|
+
"spec/unit/data_mapper/ordered_set/shared/entries_spec.rb",
|
|
220
|
+
"spec/unit/data_mapper/ordered_set/shared/include_spec.rb",
|
|
221
|
+
"spec/unit/data_mapper/ordered_set/shared/index_spec.rb",
|
|
222
|
+
"spec/unit/data_mapper/ordered_set/shared/initialize_spec.rb",
|
|
223
|
+
"spec/unit/data_mapper/ordered_set/shared/merge_spec.rb",
|
|
224
|
+
"spec/unit/data_mapper/ordered_set/shared/size_spec.rb",
|
|
225
|
+
"spec/unit/data_mapper/ordered_set/shared/to_ary_spec.rb",
|
|
226
|
+
"spec/unit/data_mapper/ordered_set/size_spec.rb",
|
|
227
|
+
"spec/unit/data_mapper/ordered_set/to_ary_spec.rb",
|
|
228
|
+
"spec/unit/data_mapper/subject_set/append_spec.rb",
|
|
229
|
+
"spec/unit/data_mapper/subject_set/clear_spec.rb",
|
|
230
|
+
"spec/unit/data_mapper/subject_set/delete_spec.rb",
|
|
231
|
+
"spec/unit/data_mapper/subject_set/each_spec.rb",
|
|
232
|
+
"spec/unit/data_mapper/subject_set/empty_spec.rb",
|
|
233
|
+
"spec/unit/data_mapper/subject_set/entries_spec.rb",
|
|
234
|
+
"spec/unit/data_mapper/subject_set/get_spec.rb",
|
|
235
|
+
"spec/unit/data_mapper/subject_set/include_spec.rb",
|
|
236
|
+
"spec/unit/data_mapper/subject_set/named_spec.rb",
|
|
237
|
+
"spec/unit/data_mapper/subject_set/shared/append_spec.rb",
|
|
238
|
+
"spec/unit/data_mapper/subject_set/shared/clear_spec.rb",
|
|
239
|
+
"spec/unit/data_mapper/subject_set/shared/delete_spec.rb",
|
|
240
|
+
"spec/unit/data_mapper/subject_set/shared/each_spec.rb",
|
|
241
|
+
"spec/unit/data_mapper/subject_set/shared/empty_spec.rb",
|
|
242
|
+
"spec/unit/data_mapper/subject_set/shared/entries_spec.rb",
|
|
243
|
+
"spec/unit/data_mapper/subject_set/shared/get_spec.rb",
|
|
244
|
+
"spec/unit/data_mapper/subject_set/shared/include_spec.rb",
|
|
245
|
+
"spec/unit/data_mapper/subject_set/shared/named_spec.rb",
|
|
246
|
+
"spec/unit/data_mapper/subject_set/shared/size_spec.rb",
|
|
247
|
+
"spec/unit/data_mapper/subject_set/shared/to_ary_spec.rb",
|
|
248
|
+
"spec/unit/data_mapper/subject_set/shared/values_at_spec.rb",
|
|
249
|
+
"spec/unit/data_mapper/subject_set/size_spec.rb",
|
|
250
|
+
"spec/unit/data_mapper/subject_set/to_ary_spec.rb",
|
|
251
|
+
"spec/unit/data_mapper/subject_set/values_at_spec.rb",
|
|
252
|
+
"spec/unit/hash_spec.rb",
|
|
253
|
+
"spec/unit/hook_spec.rb",
|
|
254
|
+
"spec/unit/lazy_array_spec.rb",
|
|
255
|
+
"spec/unit/module_spec.rb",
|
|
256
|
+
"spec/unit/object_spec.rb",
|
|
257
|
+
"spec/unit/try_dup_spec.rb",
|
|
258
|
+
"tasks/ci.rake",
|
|
259
|
+
"tasks/spec.rake",
|
|
260
|
+
"tasks/yard.rake",
|
|
261
|
+
"tasks/yardstick.rake"
|
|
217
262
|
]
|
|
218
|
-
s.has_rdoc = %q{yard}
|
|
219
263
|
s.homepage = %q{http://github.com/datamapper/dm-core}
|
|
220
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
|
221
264
|
s.require_paths = ["lib"]
|
|
222
265
|
s.rubyforge_project = %q{datamapper}
|
|
223
|
-
s.rubygems_version = %q{1.
|
|
266
|
+
s.rubygems_version = %q{1.5.2}
|
|
224
267
|
s.summary = %q{An Object/Relational Mapper for Ruby}
|
|
225
268
|
s.test_files = [
|
|
226
269
|
"spec/lib/rspec_immediate_feedback_formatter.rb",
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
270
|
+
"spec/public/associations/many_to_many/read_multiple_join_spec.rb",
|
|
271
|
+
"spec/public/associations/many_to_many_spec.rb",
|
|
272
|
+
"spec/public/associations/many_to_one_spec.rb",
|
|
273
|
+
"spec/public/associations/many_to_one_with_boolean_cpk_spec.rb",
|
|
274
|
+
"spec/public/associations/many_to_one_with_custom_fk_spec.rb",
|
|
275
|
+
"spec/public/associations/one_to_many_spec.rb",
|
|
276
|
+
"spec/public/associations/one_to_one_spec.rb",
|
|
277
|
+
"spec/public/associations/one_to_one_with_boolean_cpk_spec.rb",
|
|
278
|
+
"spec/public/collection_spec.rb",
|
|
279
|
+
"spec/public/finalize_spec.rb",
|
|
280
|
+
"spec/public/model/hook_spec.rb",
|
|
281
|
+
"spec/public/model/property_spec.rb",
|
|
282
|
+
"spec/public/model/relationship_spec.rb",
|
|
283
|
+
"spec/public/model_spec.rb",
|
|
284
|
+
"spec/public/property/binary_spec.rb",
|
|
285
|
+
"spec/public/property/boolean_spec.rb",
|
|
286
|
+
"spec/public/property/class_spec.rb",
|
|
287
|
+
"spec/public/property/date_spec.rb",
|
|
288
|
+
"spec/public/property/date_time_spec.rb",
|
|
289
|
+
"spec/public/property/decimal_spec.rb",
|
|
290
|
+
"spec/public/property/discriminator_spec.rb",
|
|
291
|
+
"spec/public/property/float_spec.rb",
|
|
292
|
+
"spec/public/property/integer_spec.rb",
|
|
293
|
+
"spec/public/property/object_spec.rb",
|
|
294
|
+
"spec/public/property/serial_spec.rb",
|
|
295
|
+
"spec/public/property/string_spec.rb",
|
|
296
|
+
"spec/public/property/text_spec.rb",
|
|
297
|
+
"spec/public/property/time_spec.rb",
|
|
298
|
+
"spec/public/property_spec.rb",
|
|
299
|
+
"spec/public/resource_spec.rb",
|
|
300
|
+
"spec/public/sel_spec.rb",
|
|
301
|
+
"spec/public/setup_spec.rb",
|
|
302
|
+
"spec/public/shared/association_collection_shared_spec.rb",
|
|
303
|
+
"spec/public/shared/collection_finder_shared_spec.rb",
|
|
304
|
+
"spec/public/shared/collection_shared_spec.rb",
|
|
305
|
+
"spec/public/shared/finder_shared_spec.rb",
|
|
306
|
+
"spec/semipublic/adapters/abstract_adapter_spec.rb",
|
|
307
|
+
"spec/semipublic/adapters/in_memory_adapter_spec.rb",
|
|
308
|
+
"spec/semipublic/associations/many_to_many_spec.rb",
|
|
309
|
+
"spec/semipublic/associations/many_to_one_spec.rb",
|
|
310
|
+
"spec/semipublic/associations/one_to_many_spec.rb",
|
|
311
|
+
"spec/semipublic/associations/one_to_one_spec.rb",
|
|
312
|
+
"spec/semipublic/associations/relationship_spec.rb",
|
|
313
|
+
"spec/semipublic/associations_spec.rb",
|
|
314
|
+
"spec/semipublic/collection_spec.rb",
|
|
315
|
+
"spec/semipublic/model_spec.rb",
|
|
316
|
+
"spec/semipublic/property/binary_spec.rb",
|
|
317
|
+
"spec/semipublic/property/boolean_spec.rb",
|
|
318
|
+
"spec/semipublic/property/class_spec.rb",
|
|
319
|
+
"spec/semipublic/property/date_spec.rb",
|
|
320
|
+
"spec/semipublic/property/date_time_spec.rb",
|
|
321
|
+
"spec/semipublic/property/decimal_spec.rb",
|
|
322
|
+
"spec/semipublic/property/discriminator_spec.rb",
|
|
323
|
+
"spec/semipublic/property/float_spec.rb",
|
|
324
|
+
"spec/semipublic/property/integer_spec.rb",
|
|
325
|
+
"spec/semipublic/property/lookup_spec.rb",
|
|
326
|
+
"spec/semipublic/property/serial_spec.rb",
|
|
327
|
+
"spec/semipublic/property/string_spec.rb",
|
|
328
|
+
"spec/semipublic/property/text_spec.rb",
|
|
329
|
+
"spec/semipublic/property/time_spec.rb",
|
|
330
|
+
"spec/semipublic/property_spec.rb",
|
|
331
|
+
"spec/semipublic/query/conditions/comparison_spec.rb",
|
|
332
|
+
"spec/semipublic/query/conditions/operation_spec.rb",
|
|
333
|
+
"spec/semipublic/query/path_spec.rb",
|
|
334
|
+
"spec/semipublic/query_spec.rb",
|
|
335
|
+
"spec/semipublic/resource/state/clean_spec.rb",
|
|
336
|
+
"spec/semipublic/resource/state/deleted_spec.rb",
|
|
337
|
+
"spec/semipublic/resource/state/dirty_spec.rb",
|
|
338
|
+
"spec/semipublic/resource/state/immutable_spec.rb",
|
|
339
|
+
"spec/semipublic/resource/state/transient_spec.rb",
|
|
340
|
+
"spec/semipublic/resource/state_spec.rb",
|
|
341
|
+
"spec/semipublic/resource_spec.rb",
|
|
342
|
+
"spec/semipublic/shared/condition_shared_spec.rb",
|
|
343
|
+
"spec/semipublic/shared/resource_shared_spec.rb",
|
|
344
|
+
"spec/semipublic/shared/resource_state_shared_spec.rb",
|
|
345
|
+
"spec/semipublic/shared/subject_shared_spec.rb",
|
|
346
|
+
"spec/spec_helper.rb",
|
|
347
|
+
"spec/support/properties/huge_integer.rb",
|
|
348
|
+
"spec/unit/array_spec.rb",
|
|
349
|
+
"spec/unit/data_mapper/ordered_set/append_spec.rb",
|
|
350
|
+
"spec/unit/data_mapper/ordered_set/clear_spec.rb",
|
|
351
|
+
"spec/unit/data_mapper/ordered_set/delete_spec.rb",
|
|
352
|
+
"spec/unit/data_mapper/ordered_set/each_spec.rb",
|
|
353
|
+
"spec/unit/data_mapper/ordered_set/empty_spec.rb",
|
|
354
|
+
"spec/unit/data_mapper/ordered_set/entries_spec.rb",
|
|
355
|
+
"spec/unit/data_mapper/ordered_set/eql_spec.rb",
|
|
356
|
+
"spec/unit/data_mapper/ordered_set/equal_value_spec.rb",
|
|
357
|
+
"spec/unit/data_mapper/ordered_set/hash_spec.rb",
|
|
358
|
+
"spec/unit/data_mapper/ordered_set/include_spec.rb",
|
|
359
|
+
"spec/unit/data_mapper/ordered_set/index_spec.rb",
|
|
360
|
+
"spec/unit/data_mapper/ordered_set/initialize_spec.rb",
|
|
361
|
+
"spec/unit/data_mapper/ordered_set/merge_spec.rb",
|
|
362
|
+
"spec/unit/data_mapper/ordered_set/shared/append_spec.rb",
|
|
363
|
+
"spec/unit/data_mapper/ordered_set/shared/clear_spec.rb",
|
|
364
|
+
"spec/unit/data_mapper/ordered_set/shared/delete_spec.rb",
|
|
365
|
+
"spec/unit/data_mapper/ordered_set/shared/each_spec.rb",
|
|
366
|
+
"spec/unit/data_mapper/ordered_set/shared/empty_spec.rb",
|
|
367
|
+
"spec/unit/data_mapper/ordered_set/shared/entries_spec.rb",
|
|
368
|
+
"spec/unit/data_mapper/ordered_set/shared/include_spec.rb",
|
|
369
|
+
"spec/unit/data_mapper/ordered_set/shared/index_spec.rb",
|
|
370
|
+
"spec/unit/data_mapper/ordered_set/shared/initialize_spec.rb",
|
|
371
|
+
"spec/unit/data_mapper/ordered_set/shared/merge_spec.rb",
|
|
372
|
+
"spec/unit/data_mapper/ordered_set/shared/size_spec.rb",
|
|
373
|
+
"spec/unit/data_mapper/ordered_set/shared/to_ary_spec.rb",
|
|
374
|
+
"spec/unit/data_mapper/ordered_set/size_spec.rb",
|
|
375
|
+
"spec/unit/data_mapper/ordered_set/to_ary_spec.rb",
|
|
376
|
+
"spec/unit/data_mapper/subject_set/append_spec.rb",
|
|
377
|
+
"spec/unit/data_mapper/subject_set/clear_spec.rb",
|
|
378
|
+
"spec/unit/data_mapper/subject_set/delete_spec.rb",
|
|
379
|
+
"spec/unit/data_mapper/subject_set/each_spec.rb",
|
|
380
|
+
"spec/unit/data_mapper/subject_set/empty_spec.rb",
|
|
381
|
+
"spec/unit/data_mapper/subject_set/entries_spec.rb",
|
|
382
|
+
"spec/unit/data_mapper/subject_set/get_spec.rb",
|
|
383
|
+
"spec/unit/data_mapper/subject_set/include_spec.rb",
|
|
384
|
+
"spec/unit/data_mapper/subject_set/named_spec.rb",
|
|
385
|
+
"spec/unit/data_mapper/subject_set/shared/append_spec.rb",
|
|
386
|
+
"spec/unit/data_mapper/subject_set/shared/clear_spec.rb",
|
|
387
|
+
"spec/unit/data_mapper/subject_set/shared/delete_spec.rb",
|
|
388
|
+
"spec/unit/data_mapper/subject_set/shared/each_spec.rb",
|
|
389
|
+
"spec/unit/data_mapper/subject_set/shared/empty_spec.rb",
|
|
390
|
+
"spec/unit/data_mapper/subject_set/shared/entries_spec.rb",
|
|
391
|
+
"spec/unit/data_mapper/subject_set/shared/get_spec.rb",
|
|
392
|
+
"spec/unit/data_mapper/subject_set/shared/include_spec.rb",
|
|
393
|
+
"spec/unit/data_mapper/subject_set/shared/named_spec.rb",
|
|
394
|
+
"spec/unit/data_mapper/subject_set/shared/size_spec.rb",
|
|
395
|
+
"spec/unit/data_mapper/subject_set/shared/to_ary_spec.rb",
|
|
396
|
+
"spec/unit/data_mapper/subject_set/shared/values_at_spec.rb",
|
|
397
|
+
"spec/unit/data_mapper/subject_set/size_spec.rb",
|
|
398
|
+
"spec/unit/data_mapper/subject_set/to_ary_spec.rb",
|
|
399
|
+
"spec/unit/data_mapper/subject_set/values_at_spec.rb",
|
|
400
|
+
"spec/unit/hash_spec.rb",
|
|
401
|
+
"spec/unit/hook_spec.rb",
|
|
402
|
+
"spec/unit/lazy_array_spec.rb",
|
|
403
|
+
"spec/unit/module_spec.rb",
|
|
404
|
+
"spec/unit/object_spec.rb",
|
|
405
|
+
"spec/unit/try_dup_spec.rb"
|
|
312
406
|
]
|
|
313
407
|
|
|
314
408
|
if s.respond_to? :specification_version then
|
|
315
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
316
409
|
s.specification_version = 3
|
|
317
410
|
|
|
318
411
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
319
|
-
s.add_runtime_dependency(%q<
|
|
412
|
+
s.add_runtime_dependency(%q<activesupport>, ["~> 3.0.4"])
|
|
413
|
+
s.add_runtime_dependency(%q<i18n>, ["~> 0.5.0"])
|
|
320
414
|
s.add_runtime_dependency(%q<addressable>, ["~> 2.2"])
|
|
321
|
-
s.add_development_dependency(%q<
|
|
322
|
-
s.add_development_dependency(%q<
|
|
415
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
|
416
|
+
s.add_development_dependency(%q<rake>, ["~> 0.8.7"])
|
|
417
|
+
s.add_development_dependency(%q<rspec>, ["~> 1.3.1"])
|
|
323
418
|
else
|
|
324
|
-
s.add_dependency(%q<
|
|
419
|
+
s.add_dependency(%q<activesupport>, ["~> 3.0.4"])
|
|
420
|
+
s.add_dependency(%q<i18n>, ["~> 0.5.0"])
|
|
325
421
|
s.add_dependency(%q<addressable>, ["~> 2.2"])
|
|
326
|
-
s.add_dependency(%q<
|
|
327
|
-
s.add_dependency(%q<
|
|
422
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
|
423
|
+
s.add_dependency(%q<rake>, ["~> 0.8.7"])
|
|
424
|
+
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
|
328
425
|
end
|
|
329
426
|
else
|
|
330
|
-
s.add_dependency(%q<
|
|
427
|
+
s.add_dependency(%q<activesupport>, ["~> 3.0.4"])
|
|
428
|
+
s.add_dependency(%q<i18n>, ["~> 0.5.0"])
|
|
331
429
|
s.add_dependency(%q<addressable>, ["~> 2.2"])
|
|
332
|
-
s.add_dependency(%q<
|
|
333
|
-
s.add_dependency(%q<
|
|
430
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
|
431
|
+
s.add_dependency(%q<rake>, ["~> 0.8.7"])
|
|
432
|
+
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
|
334
433
|
end
|
|
335
434
|
end
|
|
336
435
|
|