yard-activerecord 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjFjYWUyNzVlNzM3MzU2YjEyNGY5M2E4OWM3MmFhODg0MjlhMDk5Yw==
5
+ data.tar.gz: !binary |-
6
+ ZDNkNjM3ZmJhYjJiNzI3NzVkYmVlYzBmNmMwMTg5YWZhY2U5OWJkMg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ OTRkMDM1MmYwNTE4MTNkZmE0M2E2M2I4YzVmMDU1YTgyNzRmMzc1MmI1ZmU5
10
+ Y2Y3ZDBiMDE3M2YxNTMxMGQ5ZTlhNWE2YWRjMTg0M2M4MDVmMmUxYzI5YzA3
11
+ MGE5MGVkMjMyZGMyMDU5YWQzZDY0NjNkMWI3YjRlNGU1ZTdhZTg=
12
+ data.tar.gz: !binary |-
13
+ YTVmMmU3NDA4YWJhZGRjYjdmMzczODEwNTU1NzA3MTAxYTk3YjhjY2FkOWQ5
14
+ NGQ5ZDE5ZTZjMWRhYTA4Y2EyN2M5MTYyNTUxMGE4Y2NhZDYyYTFlN2ZiZmUy
15
+ M2Y3YjBmNmUxZDRlOTRmNmM3Y2EyYmJlMWE2ZWQ4MTc0NzRjYjk=
@@ -18,23 +18,20 @@ module YARD::Handlers::Ruby::ActiveRecord::Fields
18
18
  ensure_loaded! P(globals.klass)
19
19
  namespace = P(globals.klass)
20
20
  return if namespace.nil?
21
-
22
- r_object = YARD::CodeObjects::MethodObject.new(namespace, method_name)
23
- r_object.docstring = description(method_name)
24
- r_object.docstring.add_tag get_tag(:return, '', class_name)
25
- r_object.dynamic = true
26
- register r_object
27
-
28
- w_object = YARD::CodeObjects::MethodObject.new(namespace, "#{method_name}=")
29
- w_object.docstring = description(method_name)
30
- w_object.docstring.add_tag get_tag(:return, '', class_name)
31
- w_object.dynamic = true
32
- register w_object
33
-
34
- namespace.instance_attributes[method_name.to_sym] = {
35
- read: r_object,
36
- write: w_object
37
- }
21
+
22
+ method_definition = namespace.instance_attributes[method_name.to_sym] || {}
23
+
24
+ { read: method_name, write: "#{method_name}=" }.each do |(rw, name)|
25
+ next if method_definition[rw]
26
+ rw_object = YARD::CodeObjects::MethodObject.new(namespace, name)
27
+ rw_object.docstring = description(name)
28
+ rw_object.docstring.add_tag get_tag(:return, '', class_name)
29
+ rw_object.dynamic = true
30
+ register rw_object
31
+ method_definition[rw] = r_object
32
+ end
33
+
34
+ namespace.instance_attributes[method_name.to_sym] = method_definition
38
35
  end
39
36
 
40
37
  def description(method_name)
@@ -55,4 +52,4 @@ module YARD::Handlers::Ruby::ActiveRecord::Fields
55
52
  end
56
53
  end
57
54
  end
58
- end
55
+ end
@@ -1,5 +1,5 @@
1
1
  module YARD
2
2
  module ActiveRecord
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.10"
4
4
  end
5
5
  end
@@ -15,6 +15,7 @@ Gem::Specification.new do |s|
15
15
  used when developing applications with ActiveRecord. The extension handles
16
16
  attributes, associations, delegates and scopes. A must for any Rails app
17
17
  using YARD as documentation plugin. }
18
+ s.licenses = ["MIT License"]
18
19
 
19
20
  s.add_dependency 'yard', '>= 0.8.3'
20
21
 
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
5
- prerelease:
4
+ version: 0.0.10
6
5
  platform: ruby
7
6
  authors:
8
7
  - Theodor Tonum
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-14 00:00:00.000000000 Z
11
+ date: 2013-08-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: yard
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -75,28 +70,28 @@ files:
75
70
  - test.rb
76
71
  - yard-activerecord.gemspec
77
72
  homepage: https://github.com/theodorton/yard-activerecord
78
- licenses: []
73
+ licenses:
74
+ - MIT License
75
+ metadata: {}
79
76
  post_install_message:
80
77
  rdoc_options: []
81
78
  require_paths:
82
79
  - lib
83
80
  required_ruby_version: !ruby/object:Gem::Requirement
84
- none: false
85
81
  requirements:
86
82
  - - ! '>='
87
83
  - !ruby/object:Gem::Version
88
84
  version: '0'
89
85
  required_rubygems_version: !ruby/object:Gem::Requirement
90
- none: false
91
86
  requirements:
92
87
  - - ! '>='
93
88
  - !ruby/object:Gem::Version
94
89
  version: '0'
95
90
  requirements: []
96
91
  rubyforge_project:
97
- rubygems_version: 1.8.25
92
+ rubygems_version: 2.0.6
98
93
  signing_key:
99
- specification_version: 3
94
+ specification_version: 4
100
95
  summary: ActiveRecord Handlers for YARD
101
96
  test_files: []
102
97
  has_rdoc: