dm-core 1.1.0.rc3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +2 -2
- data/.yardopts +1 -0
- data/Gemfile +5 -7
- data/VERSION +1 -1
- data/dm-core.gemspec +14 -11
- data/lib/dm-core.rb +7 -8
- data/lib/dm-core/associations/relationship.rb +8 -2
- data/lib/dm-core/core_ext/kernel.rb +14 -1
- data/lib/dm-core/property/decimal.rb +0 -1
- data/lib/dm-core/{ext → support/ext}/array.rb +0 -0
- data/lib/dm-core/{ext → support/ext}/blank.rb +0 -0
- data/lib/dm-core/{ext → support/ext}/hash.rb +0 -0
- data/lib/dm-core/{ext → support/ext}/module.rb +0 -2
- data/lib/dm-core/{ext → support/ext}/object.rb +0 -0
- data/lib/dm-core/{ext → support/ext}/string.rb +0 -0
- data/lib/dm-core/{ext → support/ext}/try_dup.rb +0 -0
- data/lib/dm-core/support/lazy_array.rb +0 -2
- data/lib/dm-core/support/logger.rb +18 -19
- data/lib/dm-core/version.rb +1 -1
- data/spec/unit/array_spec.rb +1 -1
- data/spec/unit/blank_spec.rb +1 -1
- data/spec/unit/hash_spec.rb +1 -1
- data/spec/unit/module_spec.rb +1 -1
- data/spec/unit/object_spec.rb +1 -1
- data/spec/unit/try_dup_spec.rb +1 -1
- metadata +24 -13
- data/lib/dm-core/ext/singleton_class.rb +0 -8
data/.document
CHANGED
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--markup rdoc --title 'DataMapper Documentation' --protected
|
data/Gemfile
CHANGED
@@ -5,7 +5,7 @@ source 'http://rubygems.org'
|
|
5
5
|
SOURCE = ENV.fetch('SOURCE', :git).to_sym
|
6
6
|
REPO_POSTFIX = SOURCE == :path ? '' : '.git'
|
7
7
|
DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
|
8
|
-
DM_VERSION = '~> 1.1.0
|
8
|
+
DM_VERSION = '~> 1.1.0'
|
9
9
|
DO_VERSION = '~> 0.10.2'
|
10
10
|
DM_DO_ADAPTERS = %w[ sqlite postgres mysql oracle sqlserver ]
|
11
11
|
|
@@ -16,17 +16,15 @@ group :development do
|
|
16
16
|
gem 'jeweler', '~> 1.5.2'
|
17
17
|
gem 'rake', '~> 0.8.7'
|
18
18
|
gem 'rspec', '~> 1.3.1'
|
19
|
+
gem 'yard', '~> 0.6'
|
19
20
|
|
20
21
|
end
|
21
22
|
|
22
|
-
|
23
|
-
group :quality do
|
23
|
+
group :quality do
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
gem 'yardstick', '~> 0.2'
|
25
|
+
gem 'yardstick', '~> 0.2'
|
26
|
+
gem 'rcov', '~> 0.9.9', :platforms => [:mri_18]
|
28
27
|
|
29
|
-
end
|
30
28
|
end
|
31
29
|
|
32
30
|
group :datamapper do
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.0
|
1
|
+
1.1.0
|
data/dm-core.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dm-core}
|
8
|
-
s.version = "1.1.0
|
8
|
+
s.version = "1.1.0"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dan Kubb"]
|
12
|
-
s.date = %q{2011-03-
|
12
|
+
s.date = %q{2011-03-16}
|
13
13
|
s.description = %q{Faster, Better, Simpler.}
|
14
14
|
s.email = %q{dan.kubb@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.files = [
|
20
20
|
".autotest",
|
21
21
|
".document",
|
22
|
+
".yardopts",
|
22
23
|
"Gemfile",
|
23
24
|
"LICENSE",
|
24
25
|
"README.rdoc",
|
@@ -38,14 +39,6 @@ Gem::Specification.new do |s|
|
|
38
39
|
"lib/dm-core/core_ext/kernel.rb",
|
39
40
|
"lib/dm-core/core_ext/pathname.rb",
|
40
41
|
"lib/dm-core/core_ext/symbol.rb",
|
41
|
-
"lib/dm-core/ext/array.rb",
|
42
|
-
"lib/dm-core/ext/blank.rb",
|
43
|
-
"lib/dm-core/ext/hash.rb",
|
44
|
-
"lib/dm-core/ext/module.rb",
|
45
|
-
"lib/dm-core/ext/object.rb",
|
46
|
-
"lib/dm-core/ext/singleton_class.rb",
|
47
|
-
"lib/dm-core/ext/string.rb",
|
48
|
-
"lib/dm-core/ext/try_dup.rb",
|
49
42
|
"lib/dm-core/identity_map.rb",
|
50
43
|
"lib/dm-core/model.rb",
|
51
44
|
"lib/dm-core/model/hook.rb",
|
@@ -107,6 +100,13 @@ Gem::Specification.new do |s|
|
|
107
100
|
"lib/dm-core/support/deprecate.rb",
|
108
101
|
"lib/dm-core/support/descendant_set.rb",
|
109
102
|
"lib/dm-core/support/equalizer.rb",
|
103
|
+
"lib/dm-core/support/ext/array.rb",
|
104
|
+
"lib/dm-core/support/ext/blank.rb",
|
105
|
+
"lib/dm-core/support/ext/hash.rb",
|
106
|
+
"lib/dm-core/support/ext/module.rb",
|
107
|
+
"lib/dm-core/support/ext/object.rb",
|
108
|
+
"lib/dm-core/support/ext/string.rb",
|
109
|
+
"lib/dm-core/support/ext/try_dup.rb",
|
110
110
|
"lib/dm-core/support/hook.rb",
|
111
111
|
"lib/dm-core/support/inflections.rb",
|
112
112
|
"lib/dm-core/support/inflector.rb",
|
@@ -428,17 +428,20 @@ Gem::Specification.new do |s|
|
|
428
428
|
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
429
429
|
s.add_development_dependency(%q<rake>, ["~> 0.8.7"])
|
430
430
|
s.add_development_dependency(%q<rspec>, ["~> 1.3.1"])
|
431
|
+
s.add_development_dependency(%q<yard>, ["~> 0.6"])
|
431
432
|
else
|
432
433
|
s.add_dependency(%q<addressable>, ["~> 2.2.4"])
|
433
434
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
434
435
|
s.add_dependency(%q<rake>, ["~> 0.8.7"])
|
435
436
|
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
437
|
+
s.add_dependency(%q<yard>, ["~> 0.6"])
|
436
438
|
end
|
437
439
|
else
|
438
440
|
s.add_dependency(%q<addressable>, ["~> 2.2.4"])
|
439
441
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
440
442
|
s.add_dependency(%q<rake>, ["~> 0.8.7"])
|
441
443
|
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
444
|
+
s.add_dependency(%q<yard>, ["~> 0.6"])
|
442
445
|
end
|
443
446
|
end
|
444
447
|
|
data/lib/dm-core.rb
CHANGED
@@ -11,12 +11,10 @@ module DataMapper
|
|
11
11
|
module Undefined; end
|
12
12
|
end
|
13
13
|
|
14
|
-
require 'dm-core/ext/
|
15
|
-
require 'dm-core/ext/
|
16
|
-
|
17
|
-
require 'dm-core/ext/
|
18
|
-
require 'dm-core/ext/object'
|
19
|
-
require 'dm-core/ext/string'
|
14
|
+
require 'dm-core/support/ext/blank'
|
15
|
+
require 'dm-core/support/ext/hash'
|
16
|
+
require 'dm-core/support/ext/object'
|
17
|
+
require 'dm-core/support/ext/string'
|
20
18
|
|
21
19
|
begin
|
22
20
|
require 'fastthread'
|
@@ -25,8 +23,9 @@ rescue LoadError
|
|
25
23
|
end
|
26
24
|
|
27
25
|
require 'dm-core/core_ext/pathname'
|
28
|
-
require 'dm-core/ext/module'
|
29
|
-
require 'dm-core/ext/array'
|
26
|
+
require 'dm-core/support/ext/module'
|
27
|
+
require 'dm-core/support/ext/array'
|
28
|
+
require 'dm-core/support/ext/try_dup'
|
30
29
|
|
31
30
|
require 'dm-core/support/mash'
|
32
31
|
require 'dm-core/support/inflector'
|
@@ -452,8 +452,14 @@ module DataMapper
|
|
452
452
|
@options = options.dup.freeze
|
453
453
|
@child_repository_name = @options[:child_repository_name]
|
454
454
|
@parent_repository_name = @options[:parent_repository_name]
|
455
|
-
|
456
|
-
|
455
|
+
|
456
|
+
unless @options[:child_key].nil?
|
457
|
+
@child_properties = DataMapper::Ext.try_dup(@options[:child_key]).freeze
|
458
|
+
end
|
459
|
+
unless @options[:parent_key].nil?
|
460
|
+
@parent_properties = DataMapper::Ext.try_dup(@options[:parent_key]).freeze
|
461
|
+
end
|
462
|
+
|
457
463
|
@min = @options[:min]
|
458
464
|
@max = @options[:max]
|
459
465
|
@reader_visibility = @options.fetch(:reader_visibility, :public)
|
@@ -1,5 +1,17 @@
|
|
1
1
|
module Kernel
|
2
|
-
|
2
|
+
|
3
|
+
# Returns the object's singleton class.
|
4
|
+
#
|
5
|
+
# @return [Class]
|
6
|
+
#
|
7
|
+
# @api private
|
8
|
+
def singleton_class
|
9
|
+
class << self
|
10
|
+
self
|
11
|
+
end
|
12
|
+
end unless respond_to?(:singleton_class) # exists in 1.9.2
|
13
|
+
|
14
|
+
private
|
3
15
|
|
4
16
|
# Delegates to DataMapper.repository()
|
5
17
|
#
|
@@ -7,4 +19,5 @@ module Kernel
|
|
7
19
|
def repository(*args, &block)
|
8
20
|
DataMapper.repository(*args, &block)
|
9
21
|
end
|
22
|
+
|
10
23
|
end # module Kernel
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,36 +1,35 @@
|
|
1
|
-
|
2
|
-
# ==== Public Extlib Logger API
|
1
|
+
# ==== Public DataMapper Logger API
|
3
2
|
#
|
4
3
|
# To replace an existing logger with a new one:
|
5
|
-
#
|
4
|
+
# DataMapper::Logger.set_log(log{String, IO},level{Symbol, String})
|
6
5
|
#
|
7
6
|
# Available logging levels are
|
8
|
-
#
|
7
|
+
# DataMapper::Logger::{ Fatal, Error, Warn, Info, Debug }
|
9
8
|
#
|
10
9
|
# Logging via:
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
10
|
+
# DataMapper.logger.fatal(message<String>,&block)
|
11
|
+
# DataMapper.logger.error(message<String>,&block)
|
12
|
+
# DataMapper.logger.warn(message<String>,&block)
|
13
|
+
# DataMapper.logger.info(message<String>,&block)
|
14
|
+
# DataMapper.logger.debug(message<String>,&block)
|
16
15
|
#
|
17
16
|
# Logging with autoflush:
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
17
|
+
# DataMapper.logger.fatal!(message<String>,&block)
|
18
|
+
# DataMapper.logger.error!(message<String>,&block)
|
19
|
+
# DataMapper.logger.warn!(message<String>,&block)
|
20
|
+
# DataMapper.logger.info!(message<String>,&block)
|
21
|
+
# DataMapper.logger.debug!(message<String>,&block)
|
23
22
|
#
|
24
23
|
# Flush the buffer to
|
25
|
-
#
|
24
|
+
# DataMapper.logger.flush
|
26
25
|
#
|
27
26
|
# Remove the current log object
|
28
|
-
#
|
27
|
+
# DataMapper.logger.close
|
29
28
|
#
|
30
|
-
# ==== Private
|
29
|
+
# ==== Private DataMapper Logger API
|
31
30
|
#
|
32
31
|
# To initialize the logger you create a new object, proxies to set_log.
|
33
|
-
#
|
32
|
+
# DataMapper::Logger.new(log{String, IO},level{Symbol, String})
|
34
33
|
module DataMapper
|
35
34
|
|
36
35
|
class << self
|
@@ -155,7 +154,7 @@ module DataMapper
|
|
155
154
|
end
|
156
155
|
alias_method :push, :<<
|
157
156
|
|
158
|
-
# Generate the logging methods for
|
157
|
+
# Generate the logging methods for DataMapper.logger for each log level.
|
159
158
|
Levels.each_pair do |name, number|
|
160
159
|
class_eval <<-LEVELMETHODS, __FILE__, __LINE__
|
161
160
|
|
data/lib/dm-core/version.rb
CHANGED
data/spec/unit/array_spec.rb
CHANGED
data/spec/unit/blank_spec.rb
CHANGED
data/spec/unit/hash_spec.rb
CHANGED
data/spec/unit/module_spec.rb
CHANGED
data/spec/unit/object_spec.rb
CHANGED
data/spec/unit/try_dup_spec.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 1.1.0
|
4
|
+
prerelease:
|
5
|
+
version: 1.1.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Dan Kubb
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-16 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -57,6 +57,17 @@ dependencies:
|
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: yard
|
62
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: "0.6"
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: *id005
|
60
71
|
description: Faster, Better, Simpler.
|
61
72
|
email: dan.kubb@gmail.com
|
62
73
|
executables: []
|
@@ -69,6 +80,7 @@ extra_rdoc_files:
|
|
69
80
|
files:
|
70
81
|
- .autotest
|
71
82
|
- .document
|
83
|
+
- .yardopts
|
72
84
|
- Gemfile
|
73
85
|
- LICENSE
|
74
86
|
- README.rdoc
|
@@ -88,14 +100,6 @@ files:
|
|
88
100
|
- lib/dm-core/core_ext/kernel.rb
|
89
101
|
- lib/dm-core/core_ext/pathname.rb
|
90
102
|
- lib/dm-core/core_ext/symbol.rb
|
91
|
-
- lib/dm-core/ext/array.rb
|
92
|
-
- lib/dm-core/ext/blank.rb
|
93
|
-
- lib/dm-core/ext/hash.rb
|
94
|
-
- lib/dm-core/ext/module.rb
|
95
|
-
- lib/dm-core/ext/object.rb
|
96
|
-
- lib/dm-core/ext/singleton_class.rb
|
97
|
-
- lib/dm-core/ext/string.rb
|
98
|
-
- lib/dm-core/ext/try_dup.rb
|
99
103
|
- lib/dm-core/identity_map.rb
|
100
104
|
- lib/dm-core/model.rb
|
101
105
|
- lib/dm-core/model/hook.rb
|
@@ -157,6 +161,13 @@ files:
|
|
157
161
|
- lib/dm-core/support/deprecate.rb
|
158
162
|
- lib/dm-core/support/descendant_set.rb
|
159
163
|
- lib/dm-core/support/equalizer.rb
|
164
|
+
- lib/dm-core/support/ext/array.rb
|
165
|
+
- lib/dm-core/support/ext/blank.rb
|
166
|
+
- lib/dm-core/support/ext/hash.rb
|
167
|
+
- lib/dm-core/support/ext/module.rb
|
168
|
+
- lib/dm-core/support/ext/object.rb
|
169
|
+
- lib/dm-core/support/ext/string.rb
|
170
|
+
- lib/dm-core/support/ext/try_dup.rb
|
160
171
|
- lib/dm-core/support/hook.rb
|
161
172
|
- lib/dm-core/support/inflections.rb
|
162
173
|
- lib/dm-core/support/inflector.rb
|
@@ -338,9 +349,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
338
349
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
339
350
|
none: false
|
340
351
|
requirements:
|
341
|
-
- - "
|
352
|
+
- - ">="
|
342
353
|
- !ruby/object:Gem::Version
|
343
|
-
version:
|
354
|
+
version: "0"
|
344
355
|
requirements: []
|
345
356
|
|
346
357
|
rubyforge_project: datamapper
|