yard-value 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/yard-value-1.0.rb +8 -0
- data/lib/yard-value/version.rb +1 -1
- data/test/unit/yard-value-1.0.rb +11 -0
- metadata +15 -14
data/lib/yard-value-1.0.rb
CHANGED
@@ -22,6 +22,14 @@ class YARD::Handlers::Ruby::ValuesHandler < YARD::Handlers::Ruby::Base
|
|
22
22
|
end
|
23
23
|
ancestor 'Value'
|
24
24
|
initialize = define('initialize', parameters.map{ |e| [e.jump(:ident).source, e.type == :array ? e[0][1].source : nil] })
|
25
|
+
if initialize.parameters.last.first =~ /\A&/
|
26
|
+
base = initialize.parameters.last.first.sub(/\A&/, '')
|
27
|
+
if tag = initialize.docstring.tags.find{ |e| e.tag_name == 'param' and e.name == base }
|
28
|
+
tag.types = %w'Proc' unless tag.types
|
29
|
+
else
|
30
|
+
initialize.docstring.add_tag YARD::Tags::Tag.new(:param, '', %w'Proc', base)
|
31
|
+
end
|
32
|
+
end
|
25
33
|
initialize.docstring.tags(:param).select{ |e| e.text and not e.text.empty? }.each do |e|
|
26
34
|
define e.name.sub(/\A[&*]/, ''), [],
|
27
35
|
'@return [%s] %s' % [e.types ? e.types.join(', ') : '', e.text], :protected
|
data/lib/yard-value/version.rb
CHANGED
data/test/unit/yard-value-1.0.rb
CHANGED
@@ -24,6 +24,17 @@ EOS
|
|
24
24
|
YARD::Registry.at('A#initialize').docstring
|
25
25
|
end
|
26
26
|
|
27
|
+
expect %w'Proc' do
|
28
|
+
YARD::Registry.clear
|
29
|
+
YARD::Parser::SourceParser.parse_string(<<EOS)
|
30
|
+
class A
|
31
|
+
# @param [String] a
|
32
|
+
Value(:a, :'&b')
|
33
|
+
end
|
34
|
+
EOS
|
35
|
+
YARD::Registry.at('A#initialize').docstring.tags(:param).find{ |e| e.name == 'b' }.types
|
36
|
+
end
|
37
|
+
|
27
38
|
expect [['a', nil], ['b', '3']] do
|
28
39
|
YARD::Registry.clear
|
29
40
|
YARD::Parser::SourceParser.parse_string(<<EOS)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-value
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: inventory
|
16
|
-
requirement: &
|
16
|
+
requirement: &14902716 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.3'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *14902716
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: inventory-rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &14901408 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.3'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *14901408
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: lookout
|
38
|
-
requirement: &
|
38
|
+
requirement: &14899992 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '3.0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *14899992
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: lookout-rake
|
49
|
-
requirement: &
|
49
|
+
requirement: &14899536 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '3.0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *14899536
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: yard
|
60
|
-
requirement: &
|
60
|
+
requirement: &14897268 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: 0.8.0
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *14897268
|
69
69
|
description: ! " YARD-Value\n\n YARD-Value provides
|
70
70
|
YARD handlers for Value¹ objects.\n\n¹ Check out the Value library at http://disu.se/software/value\n"
|
71
71
|
email: now@bitwi.se
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- Rakefile
|
82
82
|
homepage: https://github.com/now/yard-value
|
83
83
|
licenses: []
|
84
|
+
metadata: {}
|
84
85
|
post_install_message:
|
85
86
|
rdoc_options: []
|
86
87
|
require_paths:
|
@@ -99,8 +100,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
100
|
version: '0'
|
100
101
|
requirements: []
|
101
102
|
rubyforge_project:
|
102
|
-
rubygems_version: 1.8.
|
103
|
+
rubygems_version: 1.8.10
|
103
104
|
signing_key:
|
104
|
-
specification_version:
|
105
|
+
specification_version: 4
|
105
106
|
summary: YARD-Value provides YARD handlers for Value¹ objects.
|
106
107
|
test_files: []
|