yard-turnip 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +9 -9
  2. data/README.md +4 -0
  3. data/lib/yard/turnip.rb +19 -10
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Mzk4ZWMxZjdhODVmNWRjNzg0Y2Y5MDI3YzQyODRkOTAwZTUzMWNiZQ==
4
+ YTMwODE4ZDNkZmRhNjNiMzZiNjJkNzE2Y2U3OTE3YTI0NzQxZThlNg==
5
5
  data.tar.gz: !binary |-
6
- MDdkZWY1MmY0M2M2YmE5NzRmNDNkMWNmYjg4MTBlY2IyNzU2OWE3Mg==
7
- SHA512:
6
+ ZGQxNzc2YmUwY2NjYjhhZGEyMmIyNzViMTQ0YTBiNzI3ODcxMTJmMQ==
7
+ !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDZlMjY2NDkyNTRmNzA4YWMxMzNhMDYzZjBkNThjODI1NjYyNzhjNTFmYjEy
10
- YTgwYTFiMjc2ZTBjZjcxNTQ1YzgwMWU4MGYyMWJjOTZmYmNjMTY2MjY2NTQx
11
- OWJiN2FhOTdjZjVlMmI3ZmQzNjBlYzAyMDQ0OWU2YzEwMWQ4N2M=
9
+ YmY0Nzg0M2U1ZjcyNWI0N2IzMzIyMjlmYzE4MTEyOTczZTVkZjAwOTVmZmI4
10
+ ODEyNzdmNDdhZmRlNGIwMmNmODFlNzhhYmQ1YjEzM2U1ZTVkMDBkYzYxMWQ0
11
+ MmMwZmQ2M2YxMjZjMDk5OTlkZWEzOWE1N2QzMGYxNGEwMDZjMTA=
12
12
  data.tar.gz: !binary |-
13
- YWZlZjJmYTdiMjdkOWM4NDExZjEwOWU0Yjc2YjBmNDU1YmNhOGExZGE2YTZk
14
- N2ZkNTRjZGE1ODM5Yjc5NTA4M2M3YTlhZDgyZjlhNDRjMGU2MGIyYjhlOTM4
15
- M2UzMGM4NTk5ZTVlMGY0MmQ5OGEzMTYyYTJlODcwNWFiNWQzZTk=
13
+ NTlhODhmNjUxZDEyZGRjMjk3YTkxYTdhMjBjNDRkMWZmMjRmMjVkYWExOTdi
14
+ Yjg2MTE3YTRjNGQ0NmM2YzcyYzQ4NDkzOGY5ZjZjMGQ2YTZjZDRlZDE5YTE3
15
+ NjEwYTk2YzRkM2VkOWY5ZTRiNDhhNzVmZDRhOTFlMDYxZTU5ODA=
data/README.md CHANGED
@@ -10,6 +10,10 @@ This plugin adds Turnip steps to YARD output.
10
10
  gem install yard-turnip
11
11
  ```
12
12
 
13
+ ```
14
+ yard --plugin yard-turnip *_steps.rb
15
+ ```
16
+
13
17
  ## Licence
14
18
 
15
19
  [MIT](https://github.com/tcnksm/tool/blob/master/LICENCE)
data/lib/yard/turnip.rb CHANGED
@@ -1,31 +1,40 @@
1
1
  require 'yard'
2
2
  module YARD
3
3
  module Turnip
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
6
6
 
7
7
  module CodeObjects
8
+ class StepsForObject < ModuleObject
9
+ def type
10
+ :module
11
+ end
12
+ end
13
+
8
14
  class StepObject < MethodObject
9
15
  def type
10
16
  :method
11
17
  end
12
18
  end
13
19
  end
14
-
20
+
21
+ class StepsForHandler < Handlers::Ruby::Base
22
+ handles method_call(:steps_for)
23
+
24
+ def process
25
+ name = statement.parameters.first.jump(:tstring_content, :ident).source
26
+ object = CodeObjects::StepsForObject.new(namespace, name)
27
+ register(object)
28
+ end
29
+ end
30
+
15
31
  class StepHandler < Handlers::Ruby::Base
16
32
  handles method_call(:step)
17
33
 
18
34
  def process
19
- p name = statement.parameters.first.jump(:tstring_content, :ident).source
35
+ name = statement.parameters.first.jump(:tstring_content, :ident).source
20
36
  object = CodeObjects::StepObject.new(namespace, name)
21
37
  register(object)
22
- parse_block(statement.last.last, :owner => object)
23
-
24
- # modify the object
25
- object.dynamic = true
26
-
27
- # add custom metadata to the object
28
- object['custom_field'] = 'Generated by Methodify'
29
38
  end
30
39
  end
31
40
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-turnip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo TAKAISHI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-21 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.4.5
92
+ rubygems_version: 2.0.14
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: This plugin adds Turnip steps to YARD output.