yard-ruby-hooks 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/yard-ruby-hooks.rb +8 -0
- data/lib/yard-ruby-hooks/define_hook_handler.rb +34 -0
- data/lib/yard-ruby-hooks/version.rb +11 -0
- metadata +48 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 38d637db8d9892c73d512f649b29e5f7929276b1
|
4
|
+
data.tar.gz: 3b51b3d2b731f8c2d4c3dd64bf89eadc1c462a85
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9d8ef8ce9d72ee03418b17797ce5b7bfc1c5c9feb7114ab503ca6e47969467cec1d2df255d56f3d7548d78ce25d546f5d7f0f6830b3a92bf0d80f0061e4a710d
|
7
|
+
data.tar.gz: f961b710cd2cf541cd404c28012aef71a8d09654d34ceac334b56b3675646239959efedeea42ce3ef64d3c3901652db68512dc16ffdd1deeab75e4de23139aad
|
@@ -0,0 +1,8 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright 2014 Michal Papis <mpapis@gmail.com>
|
3
|
+
|
4
|
+
See the file LICENSE for copying permission.
|
5
|
+
=end
|
6
|
+
|
7
|
+
#YARD::Templates::Engine.register_template_path File.dirname(__FILE__) + '/../templates'
|
8
|
+
require File.join(File.dirname(__FILE__), 'yard-ruby-hooks', 'define_hook_handler')
|
@@ -0,0 +1,34 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright 2014 Michal Papis <mpapis@gmail.com>
|
3
|
+
|
4
|
+
See the file LICENSE for copying permission.
|
5
|
+
=end
|
6
|
+
|
7
|
+
YARD::Tags::Library.define_tag "Hook#notify_objects block params", :notify_param, :with_types_and_name
|
8
|
+
YARD::Tags::Library.visible_tags << :notify_param
|
9
|
+
|
10
|
+
|
11
|
+
class DefineHookHandler < YARD::Handlers::Ruby::Base
|
12
|
+
|
13
|
+
handles method_call(:define_hook)
|
14
|
+
namespace_only
|
15
|
+
|
16
|
+
def process
|
17
|
+
namespace.groups = ["Hooks"]
|
18
|
+
name = statement.parameters.first.jump(:tsymbol_content, :ident).source
|
19
|
+
object = YARD::CodeObjects::MethodObject.new(namespace, name)
|
20
|
+
object.group = namespace.groups.first
|
21
|
+
register(object)
|
22
|
+
parse_block(statement.last, :owner => object)
|
23
|
+
|
24
|
+
# modify the object
|
25
|
+
object.dynamic = true
|
26
|
+
|
27
|
+
object.add_tag YARD::Tags::Tag.new("return", "the Observable instance", "Hook")
|
28
|
+
|
29
|
+
# add custom metadata to the object
|
30
|
+
object["custom_field"] = "Genrated by define_hook"
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: yard-ruby-hooks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michal Papis
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-10-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
- mpapis@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/yard-ruby-hooks.rb
|
21
|
+
- lib/yard-ruby-hooks/define_hook_handler.rb
|
22
|
+
- lib/yard-ruby-hooks/version.rb
|
23
|
+
homepage: https://github.com/remote-exec/yard-ruby-hooks
|
24
|
+
licenses:
|
25
|
+
- MIT
|
26
|
+
metadata: {}
|
27
|
+
post_install_message:
|
28
|
+
rdoc_options: []
|
29
|
+
require_paths:
|
30
|
+
- lib
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
requirements: []
|
42
|
+
rubyforge_project:
|
43
|
+
rubygems_version: 2.2.2
|
44
|
+
signing_key:
|
45
|
+
specification_version: 4
|
46
|
+
summary: Documentation helper for define_hook from ruby-hooks
|
47
|
+
test_files: []
|
48
|
+
has_rdoc:
|