yard-activerecord 0.0.12 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7004249aaeef940d9c42dcd0b0b70d1b79132458
4
- data.tar.gz: 74166e2dbe0f6a0e1bac5ebf82ea9b314fc0ce07
3
+ metadata.gz: 2aeaf569bbe832e74a84f79d8be955264db9a05c
4
+ data.tar.gz: 34750658b064c355b6247774e0f6937d3a7b701e
5
5
  SHA512:
6
- metadata.gz: ee09ea1271e6f0739b5ed17928d2079c04da45c65a88cfdb48e20b677dc790d1b0caca1265324afc76a5c89a321d756e7ab4180d760720693b4566a37eb59c76
7
- data.tar.gz: 486069183cbb3b5b7d175f6659fa3da539e31847537781f2262c2ed036d9360f0f5c3cdb18b45ae2ac21e26e90f44fa4113af12054a5467f3ae5390c11d7b28a
6
+ metadata.gz: 039a602e73581316949cf73a3ca6ff6ca35bf905c68b5a890f1aa6ecc193d91ac2cc39c64431cc6beeccb3070327cca051809fcf16339921605cf4aa6dda00aa
7
+ data.tar.gz: f314c4bcaa30a81e6314b4408b30fea8811c27adba14da896be1a83354db68e580b1f46b8c861ffd24025a0c41becbebdbb4f151456f9e73437cb31ecc6ffd89
@@ -0,0 +1 @@
1
+ 2.1.5
@@ -8,17 +8,29 @@ module YARD::Handlers::Ruby::ActiveRecord::Delegations
8
8
  def process
9
9
  params = statement.parameters
10
10
  params.pop # we shouldn't have a block, so pop that off
11
- params.map! { |p| p.source }
11
+ params.map! { |p| p.source.split(",") }
12
+ params.flatten!
12
13
  options, params = params.partition { |v| v =~ /\=\>|\:\s/ }
13
- class_name = options.detect { |v| v =~ /to\:\s|\:to \=\>/ } unless options.length == 0
14
- class_name = class_name.to_s.gsub(/\A.*\:/,'').capitalize
14
+ if options.length > 0
15
+ class_name = options.detect { |v| v =~ /to\:\s|\:to\s+\=\>/ }
16
+ class_name = class_name.to_s.gsub(/\A.*\:/,'').capitalize
17
+ prefix_name = options.detect { |v| v =~ /prefix\:\s|\:prefix\s+\=\>/ }
18
+ prefix_name = prefix_name.to_s.gsub(/\A.*\:/,'').strip
19
+ end
20
+
15
21
  params.each do |method_name|
16
22
  method_name.gsub!(/[\:\'\"]/,'')
23
+ original_method_name = method_name.dup
24
+
25
+ unless prefix_name.length == 0
26
+ prefix_name = class_name.downcase if prefix_name == 'true'
27
+ method_name.prepend("#{prefix_name}_")
28
+ end
17
29
  object = register YARD::CodeObjects::MethodObject.new(namespace, method_name)
18
30
  object.group = "Delegated Instance Attributes"
19
- object.docstring = "Alias for {#{class_name}##{method_name}}"
31
+ object.docstring = "Alias for #{class_name}##{original_method_name}"
20
32
  object.docstring.add_tag get_tag(:return,
21
- "{#{class_name}##{method_name}}", 'Object')
33
+ "#{class_name}##{method_name}", 'Object')
22
34
  object.docstring.add_tag get_tag(:see,"Module#delegate",nil,
23
35
  "http://api.rubyonrails.org/classes/Module.html#method-i-delegate")
24
36
  end
@@ -1,5 +1,5 @@
1
1
  module YARD
2
2
  module ActiveRecord
3
- VERSION = "0.0.12"
3
+ VERSION = "0.0.14"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theodor Tonum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-16 00:00:00.000000000 Z
11
+ date: 2014-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard
@@ -49,6 +49,7 @@ extensions: []
49
49
  extra_rdoc_files: []
50
50
  files:
51
51
  - ".gitignore"
52
+ - ".ruby-version"
52
53
  - Gemfile
53
54
  - LICENSE
54
55
  - README.md