dm-core 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -71,7 +71,7 @@
71
71
  source 'http://rubygems.org'
72
72
 
73
73
  DATAMAPPER = 'git://github.com/datamapper'
74
- DM_VERSION = '~> 1.0.1'
74
+ DM_VERSION = '~> 1.0.2'
75
75
 
76
76
  group :runtime do # Runtime dependencies (as in the gemspec)
77
77
 
data/Rakefile CHANGED
@@ -12,6 +12,7 @@ begin
12
12
  gem.email = 'dan.kubb@gmail.com'
13
13
  gem.homepage = 'http://github.com/datamapper/%s' % gem.name
14
14
  gem.authors = [ 'Dan Kubb' ]
15
+ gem.has_rdoc = 'yard'
15
16
 
16
17
  gem.rubyforge_project = 'datamapper'
17
18
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
data/dm-core.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dm-core}
8
- s.version = "1.0.1"
8
+ s.version = "1.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dan Kubb"]
@@ -215,6 +215,7 @@ Gem::Specification.new do |s|
215
215
  "tasks/yard.rake",
216
216
  "tasks/yardstick.rake"
217
217
  ]
218
+ s.has_rdoc = %q{yard}
218
219
  s.homepage = %q{http://github.com/datamapper/dm-core}
219
220
  s.rdoc_options = ["--charset=UTF-8"]
220
221
  s.require_paths = ["lib"]
@@ -27,7 +27,7 @@ module DataMapper
27
27
  end
28
28
 
29
29
  # @api semipublic
30
- alias target_key child_key
30
+ alias_method :target_key, :child_key
31
31
 
32
32
  # Intermediate association for through model
33
33
  # relationships
@@ -7,19 +7,19 @@ module DataMapper
7
7
  OPTIONS = superclass::OPTIONS.dup << :required << :key
8
8
 
9
9
  # @api semipublic
10
- alias source_repository_name child_repository_name
10
+ alias_method :source_repository_name, :child_repository_name
11
11
 
12
12
  # @api semipublic
13
- alias source_model child_model
13
+ alias_method :source_model, :child_model
14
14
 
15
15
  # @api semipublic
16
- alias target_repository_name parent_repository_name
16
+ alias_method :target_repository_name, :parent_repository_name
17
17
 
18
18
  # @api semipublic
19
- alias target_model parent_model
19
+ alias_method :target_model, :parent_model
20
20
 
21
21
  # @api semipublic
22
- alias target_key parent_key
22
+ alias_method :target_key, :parent_key
23
23
 
24
24
  # @api semipublic
25
25
  def required?
@@ -64,7 +64,7 @@ module DataMapper
64
64
  end
65
65
 
66
66
  # @api semipublic
67
- alias source_key child_key
67
+ alias_method :source_key, :child_key
68
68
 
69
69
  # Returns a hash of conditions that scopes query that fetches
70
70
  # target object
@@ -3,19 +3,19 @@ module DataMapper
3
3
  module OneToMany #:nodoc:
4
4
  class Relationship < Associations::Relationship
5
5
  # @api semipublic
6
- alias target_repository_name child_repository_name
6
+ alias_method :target_repository_name, :child_repository_name
7
7
 
8
8
  # @api semipublic
9
- alias target_model child_model
9
+ alias_method :target_model, :child_model
10
10
 
11
11
  # @api semipublic
12
- alias source_repository_name parent_repository_name
12
+ alias_method :source_repository_name, :parent_repository_name
13
13
 
14
14
  # @api semipublic
15
- alias source_model parent_model
15
+ alias_method :source_model, :parent_model
16
16
 
17
17
  # @api semipublic
18
- alias source_key parent_key
18
+ alias_method :source_key, :parent_key
19
19
 
20
20
  # @api semipublic
21
21
  def child_key
@@ -23,7 +23,7 @@ module DataMapper
23
23
  end
24
24
 
25
25
  # @api semipublic
26
- alias target_key child_key
26
+ alias_method :target_key, :child_key
27
27
 
28
28
  # Returns a Collection for this relationship with a given source
29
29
  #
@@ -209,7 +209,7 @@ module DataMapper
209
209
  # Access Relationship#child_key directly
210
210
  #
211
211
  # @api private
212
- alias relationship_child_key child_key
212
+ alias_method :relationship_child_key, :child_key
213
213
  private :relationship_child_key
214
214
 
215
215
  # Returns model class used by parent side of the relationship
@@ -97,8 +97,8 @@ module DataMapper
97
97
  set_operation(:|, other)
98
98
  end
99
99
 
100
- alias | union
101
- alias + union
100
+ alias_method :|, :union
101
+ alias_method :+, :union
102
102
 
103
103
  # Return the intersection with another collection
104
104
  #
@@ -113,7 +113,7 @@ module DataMapper
113
113
  set_operation(:&, other)
114
114
  end
115
115
 
116
- alias & intersection
116
+ alias_method :&, :intersection
117
117
 
118
118
  # Return the difference with another collection
119
119
  #
@@ -128,7 +128,7 @@ module DataMapper
128
128
  set_operation(:-, other)
129
129
  end
130
130
 
131
- alias - difference
131
+ alias_method :-, :difference
132
132
 
133
133
  # Lookup a Resource in the Collection by key
134
134
  #
@@ -367,7 +367,7 @@ module DataMapper
367
367
  # the resources directly so that it can orphan them properly.
368
368
  #
369
369
  # @api private
370
- alias superclass_slice slice
370
+ alias_method :superclass_slice, :slice
371
371
  private :superclass_slice
372
372
 
373
373
  # Simulates Array#slice and returns a new Collection
@@ -406,7 +406,7 @@ module DataMapper
406
406
  end
407
407
  end
408
408
 
409
- alias slice []
409
+ alias_method :slice, :[]
410
410
 
411
411
  # Deletes and Returns the Resources given by an offset or a Range
412
412
  #
@@ -466,7 +466,7 @@ module DataMapper
466
466
  resources
467
467
  end
468
468
 
469
- alias splice []=
469
+ alias_method :splice, :[]=
470
470
 
471
471
  # Return a copy of the Collection sorted in reverse
472
472
  #
@@ -526,7 +526,7 @@ module DataMapper
526
526
  super { |resource| resource_added(yield(resource_removed(resource))) }
527
527
  end
528
528
 
529
- alias map! collect!
529
+ alias_method :map!, :collect!
530
530
 
531
531
  # Append one Resource to the Collection and relate it
532
532
  #
@@ -690,7 +690,7 @@ module DataMapper
690
690
  # Access LazyArray#replace directly
691
691
  #
692
692
  # @api private
693
- alias superclass_replace replace
693
+ alias_method :superclass_replace, :replace
694
694
  private :superclass_replace
695
695
 
696
696
  # Replace the Resources within the Collection
@@ -13,8 +13,8 @@ class Pathname
13
13
  (self + path).expand_path
14
14
  end
15
15
 
16
- # alias to_s to to_str when to_str not defined
16
+ # alias_method :to_s, :to to_str when to_str not defined
17
17
  unless public_instance_methods(false).any? { |m| m.to_sym == :to_str }
18
- alias to_str to_s
18
+ alias_method :to_str, :to_s
19
19
  end
20
20
  end # class Pathname
data/lib/dm-core/model.rb CHANGED
@@ -297,7 +297,7 @@ module DataMapper
297
297
  all[*args]
298
298
  end
299
299
 
300
- alias slice []
300
+ alias_method :slice, :[]
301
301
 
302
302
  def at(*args)
303
303
  all.at(*args)
@@ -109,7 +109,8 @@ module DataMapper
109
109
  create_reader_for(property)
110
110
  create_writer_for(property)
111
111
 
112
- property
112
+ # FIXME: explicit return needed for YARD to parse this properly
113
+ return property
113
114
  end
114
115
 
115
116
  # Gets a list of all properties that have been defined on this Model in
@@ -15,7 +15,7 @@ module DataMapper
15
15
  @properties[name]
16
16
  end
17
17
 
18
- alias superclass_slice []=
18
+ alias_method :superclass_slice, :[]=
19
19
  private :superclass_slice
20
20
 
21
21
  # @api semipublic
data/lib/dm-core/query.rb CHANGED
@@ -430,8 +430,8 @@ module DataMapper
430
430
  set_operation(:union, other)
431
431
  end
432
432
 
433
- alias | union
434
- alias + union
433
+ alias_method :|, :union
434
+ alias_method :+, :union
435
435
 
436
436
  # Return the intersection with another query
437
437
  #
@@ -447,7 +447,7 @@ module DataMapper
447
447
  set_operation(:intersection, other)
448
448
  end
449
449
 
450
- alias & intersection
450
+ alias_method :&, :intersection
451
451
 
452
452
  # Return the difference with another query
453
453
  #
@@ -462,7 +462,7 @@ module DataMapper
462
462
  set_operation(:difference, other)
463
463
  end
464
464
 
465
- alias - difference
465
+ alias_method :-, :difference
466
466
 
467
467
  # Clear conditions
468
468
  #
@@ -568,7 +568,7 @@ module DataMapper
568
568
  dup.slice!(*args)
569
569
  end
570
570
 
571
- alias [] slice
571
+ alias_method :[], :slice
572
572
 
573
573
  # Slices collection by adding limit and offset to the
574
574
  # query, so a single query is executed
@@ -88,7 +88,7 @@ module DataMapper
88
88
  # @api semipublic
89
89
  attr_reader :operands
90
90
 
91
- alias children operands
91
+ alias_method :children, :operands
92
92
 
93
93
  # Returns the classes that inherit from AbstractComparison
94
94
  #
@@ -232,8 +232,8 @@ module DataMapper
232
232
  Operation.new(:or, dup, other.dup).minimize
233
233
  end
234
234
 
235
- alias | union
236
- alias + union
235
+ alias_method :|, :union
236
+ alias_method :+, :union
237
237
 
238
238
  # Return the intersection of the operation and another operand
239
239
  #
@@ -248,7 +248,7 @@ module DataMapper
248
248
  Operation.new(:and, dup, other.dup).minimize
249
249
  end
250
250
 
251
- alias & intersection
251
+ alias_method :&, :intersection
252
252
 
253
253
  # Return the difference of the operation and another operand
254
254
  #
@@ -263,7 +263,7 @@ module DataMapper
263
263
  Operation.new(:and, dup, Operation.new(:not, other.dup)).minimize
264
264
  end
265
265
 
266
- alias - difference
266
+ alias_method :-, :difference
267
267
 
268
268
  # Minimize the operation
269
269
  #
@@ -46,7 +46,7 @@ module DataMapper
46
46
  attr_reader :name
47
47
 
48
48
  # @api semipublic
49
- alias to_sym name
49
+ alias_method :to_sym, :name
50
50
 
51
51
  # Get the adapter for this repository
52
52
  #
@@ -254,7 +254,7 @@ module DataMapper
254
254
  persisted_state.get(properties[name])
255
255
  end
256
256
 
257
- alias [] attribute_get
257
+ alias_method :[], :attribute_get
258
258
 
259
259
  # Sets the value of the attribute and marks the attribute as dirty
260
260
  # if it has been changed so that it may be saved. Do not set from
@@ -295,7 +295,7 @@ module DataMapper
295
295
  self.persisted_state = persisted_state.set(properties[name], value)
296
296
  end
297
297
 
298
- alias []= attribute_set
298
+ alias_method :[]=, :attribute_set
299
299
 
300
300
  # Gets all the attributes of the Resource instance
301
301
  #
@@ -96,7 +96,7 @@ module DataMapper
96
96
  @adapter ||= setup!
97
97
  end
98
98
 
99
- alias :setup :adapter
99
+ alias_method :setup, :adapter
100
100
 
101
101
  def setup!
102
102
  adapter = DataMapper.setup(name, connection_uri)
@@ -116,7 +116,7 @@ class LazyArray # borrowed partially from StrokeDB
116
116
  end
117
117
  end
118
118
 
119
- alias slice []
119
+ alias_method :slice, :[]
120
120
 
121
121
  def slice!(*args)
122
122
  index, length = extract_slice_arguments(*args)
@@ -144,7 +144,7 @@ class LazyArray # borrowed partially from StrokeDB
144
144
  end
145
145
  end
146
146
 
147
- alias splice []=
147
+ alias_method :splice, :[]=
148
148
 
149
149
  def reverse
150
150
  dup.reverse!
@@ -278,7 +278,7 @@ class LazyArray # borrowed partially from StrokeDB
278
278
  @array.to_a
279
279
  end
280
280
 
281
- alias to_ary to_a
281
+ alias_method :to_ary, :to_a
282
282
 
283
283
  def load_with(&block)
284
284
  @load_with_proc = block
@@ -293,7 +293,7 @@ class LazyArray # borrowed partially from StrokeDB
293
293
  super || @array.kind_of?(klass)
294
294
  end
295
295
 
296
- alias is_a? kind_of?
296
+ alias_method :is_a?, :kind_of?
297
297
 
298
298
  def respond_to?(method, include_private = false)
299
299
  super || @array.respond_to?(method)
@@ -153,7 +153,7 @@ module DataMapper
153
153
 
154
154
  message
155
155
  end
156
- alias :push :<<
156
+ alias_method :push, :<<
157
157
 
158
158
  # Generate the logging methods for Extlib.logger for each log level.
159
159
  Levels.each_pair do |name, number|
@@ -2,9 +2,9 @@ share_examples_for 'A method that delegates to the superclass #set' do
2
2
  it 'should delegate to the superclass' do
3
3
  # this is the only way I could think of to test if the
4
4
  # superclass method is being called
5
- DataMapper::Resource::State.class_eval { alias original_set set; undef_method(:set) }
5
+ DataMapper::Resource::State.class_eval { alias_method :original_set, :set; undef_method(:set) }
6
6
  method(:subject).should raise_error(NoMethodError)
7
- DataMapper::Resource::State.class_eval { alias set original_set; undef_method(:original_set) }
7
+ DataMapper::Resource::State.class_eval { alias_method :set, :original_set; undef_method(:original_set) }
8
8
  end
9
9
  end
10
10
 
@@ -12,9 +12,9 @@ share_examples_for 'A method that does not delegate to the superclass #set' do
12
12
  it 'should delegate to the superclass' do
13
13
  # this is the only way I could think of to test if the
14
14
  # superclass method is not being called
15
- DataMapper::Resource::State.class_eval { alias original_set set; undef_method(:set) }
15
+ DataMapper::Resource::State.class_eval { alias_method :original_set, :set; undef_method(:set) }
16
16
  method(:subject).should_not raise_error(NoMethodError)
17
- DataMapper::Resource::State.class_eval { alias set original_set; undef_method(:original_set) }
17
+ DataMapper::Resource::State.class_eval { alias_method :set, :original_set; undef_method(:original_set) }
18
18
  end
19
19
  end
20
20
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 1
9
- version: 1.0.1
8
+ - 2
9
+ version: 1.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dan Kubb
@@ -281,7 +281,7 @@ files:
281
281
  - tasks/spec.rake
282
282
  - tasks/yard.rake
283
283
  - tasks/yardstick.rake
284
- has_rdoc: true
284
+ has_rdoc: yard
285
285
  homepage: http://github.com/datamapper/dm-core
286
286
  licenses: []
287
287