hoe-yard 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +11 -0
- data/Manifest.txt +5 -0
- data/README.rdoc +73 -0
- data/Rakefile +22 -0
- data/lib/hoe/yard.rb +194 -0
- data.tar.gz.sig +1 -0
- metadata +149 -0
- metadata.gz.sig +3 -0
data/History.rdoc
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
=== 0.1.0 / 2010-01-08
|
2
|
+
|
3
|
+
* Initial release:
|
4
|
+
* Automatically find the README and History files, irregardless of file
|
5
|
+
extension.
|
6
|
+
* Sets +has_rdoc+ to +yard+.
|
7
|
+
* Sets +rdoc_options+.
|
8
|
+
* Sets +extra_rdoc_files+.
|
9
|
+
* Adds YARD and hoe-yard as development dependencies.
|
10
|
+
* Adds the +yard+ and +docs+ Rake tasks.
|
11
|
+
|
data/Manifest.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
= hoe-yard
|
2
|
+
|
3
|
+
* http://github.com/postmodern/hoe-yard
|
4
|
+
* http://github.com/postmodern/hoe-yard/issues
|
5
|
+
* Postmodern (postmodern.mod3 at gmail.com)
|
6
|
+
|
7
|
+
== DESCRIPTION:
|
8
|
+
|
9
|
+
A Hoe plugin for generating YARD documentation.
|
10
|
+
|
11
|
+
Using the Hoe YARD plugin, projects can begin generating YARD documentation
|
12
|
+
instantly. Additionally, any resulting RubyGems will be properly configured
|
13
|
+
to automatically generate YARD documentation upon installation.
|
14
|
+
|
15
|
+
== FEATURES:
|
16
|
+
|
17
|
+
* Automatically find the README and History files, irregardless of file
|
18
|
+
extension.
|
19
|
+
* Sets +has_rdoc+ to +yard+.
|
20
|
+
* Sets +rdoc_options+.
|
21
|
+
* Sets +extra_rdoc_files+.
|
22
|
+
* Adds YARD and hoe-yard as development dependencies.
|
23
|
+
* Adds the +yard+ and +docs+ Rake tasks.
|
24
|
+
|
25
|
+
== REQUIREMENTS:
|
26
|
+
|
27
|
+
* {yard}[http://yardoc.org/] >= 0.2.3.1
|
28
|
+
|
29
|
+
== INSTALL:
|
30
|
+
|
31
|
+
$ sudo gem install hoe-yard
|
32
|
+
|
33
|
+
== USAGE:
|
34
|
+
|
35
|
+
require 'rubygems'
|
36
|
+
require 'hoe'
|
37
|
+
|
38
|
+
Hoe.plugin :yard
|
39
|
+
|
40
|
+
Hoe.spec('my_project') do
|
41
|
+
# ...
|
42
|
+
|
43
|
+
self.yard_title = 'My Project'
|
44
|
+
self.yard_markup = :markdown
|
45
|
+
self.yard_opts = ['--protected']
|
46
|
+
|
47
|
+
# ...
|
48
|
+
end
|
49
|
+
|
50
|
+
== LICENSE:
|
51
|
+
|
52
|
+
(The MIT License)
|
53
|
+
|
54
|
+
Copyright (c) 2010 Hal Brodigan
|
55
|
+
|
56
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
57
|
+
a copy of this software and associated documentation files (the
|
58
|
+
'Software'), to deal in the Software without restriction, including
|
59
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
60
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
61
|
+
permit persons to whom the Software is furnished to do so, subject to
|
62
|
+
the following conditions:
|
63
|
+
|
64
|
+
The above copyright notice and this permission notice shall be
|
65
|
+
included in all copies or substantial portions of the Software.
|
66
|
+
|
67
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
68
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
69
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
70
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
71
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
72
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
73
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
require 'hoe/signing'
|
6
|
+
require './lib/hoe/yard.rb'
|
7
|
+
|
8
|
+
Hoe.plugin :yard
|
9
|
+
|
10
|
+
Hoe.spec('hoe-yard') do
|
11
|
+
self.version = Hoe::Yard::PLUGIN_VERSION
|
12
|
+
self.developer('Postmodern', 'postmodern.mod3@gmail.com')
|
13
|
+
|
14
|
+
self.remote_yard_dir = '/'
|
15
|
+
self.yard_opts = ['--protected']
|
16
|
+
|
17
|
+
self.extra_deps = [
|
18
|
+
['yard', '>=0.2.3.1']
|
19
|
+
]
|
20
|
+
end
|
21
|
+
|
22
|
+
# vim: syntax=ruby
|
data/lib/hoe/yard.rb
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
require 'hoe'
|
2
|
+
|
3
|
+
gem 'yard'
|
4
|
+
|
5
|
+
##
|
6
|
+
# YARD plugin for hoe.
|
7
|
+
#
|
8
|
+
# === Tasks Provided:
|
9
|
+
#
|
10
|
+
# yard:: Generate YARD documentation
|
11
|
+
# docs:: Generate YARD documentation
|
12
|
+
#
|
13
|
+
module Hoe::Yard
|
14
|
+
# hoe-yard version
|
15
|
+
PLUGIN_VERSION = '0.1.0'
|
16
|
+
|
17
|
+
# Supported markups
|
18
|
+
YARD_MARKUP = [:markdown, :texttile, :rdoc]
|
19
|
+
|
20
|
+
# File extensions indicating raw content
|
21
|
+
YARD_RAW_EXTS = ['.txt', '.html']
|
22
|
+
|
23
|
+
# File extensions for various markups
|
24
|
+
YARD_EXTS = {
|
25
|
+
:markdown => ['.markdown', '.md'],
|
26
|
+
:texttile => ['.texttile', '.tt'],
|
27
|
+
:rdoc => ['.rdoc']
|
28
|
+
}
|
29
|
+
|
30
|
+
# The default YARD template
|
31
|
+
YARD_DEFAULT_TEMPLATE = 'default'
|
32
|
+
|
33
|
+
# The default YARD format
|
34
|
+
YARD_DEFAULT_FORMAT = :html
|
35
|
+
|
36
|
+
# The default return-type for documented methods.
|
37
|
+
YARD_DEFAULT_RETURN_TYPE = 'Object'
|
38
|
+
|
39
|
+
# Title for the YARD documentation
|
40
|
+
attr_accessor :yard_title
|
41
|
+
|
42
|
+
# Markup style used in documentation, like textile, markdown or rdoc.
|
43
|
+
# (default: +:rdoc+)
|
44
|
+
attr_accessor :yard_markup
|
45
|
+
|
46
|
+
# Overrides the library used to process markup formatting
|
47
|
+
# (specify the gem name)
|
48
|
+
attr_accessor :yard_markup_provider
|
49
|
+
|
50
|
+
# Options to pass to YARD
|
51
|
+
attr_accessor :yard_opts
|
52
|
+
|
53
|
+
def initialize_yard
|
54
|
+
self.yard_title = Hoe.normalize_names(self.name).last + ' Documentation'
|
55
|
+
self.yard_markup = nil
|
56
|
+
self.yard_markup_provider = nil
|
57
|
+
self.yard_opts = []
|
58
|
+
|
59
|
+
# find the README.* and History.* files
|
60
|
+
self.readme_file = intuit_file_name(File.basename(self.readme_file))
|
61
|
+
self.history_file = intuit_file_name(File.basename(self.history_file))
|
62
|
+
|
63
|
+
# disable RDoc and ri tasks
|
64
|
+
self.need_rdoc = false
|
65
|
+
|
66
|
+
# add YARD as a development dependency
|
67
|
+
yard_version = Gem.loaded_specs['yard'].version
|
68
|
+
self.extra_dev_deps << ['yard', ">=#{yard_version}"]
|
69
|
+
|
70
|
+
# add hoe-yard as a development dependency
|
71
|
+
self.extra_dev_deps << ['hoe-yard', ">=#{PLUGIN_VERSION}"]
|
72
|
+
|
73
|
+
# we have YARD docs
|
74
|
+
self.spec_extras.merge!(:has_rdoc => 'yard')
|
75
|
+
|
76
|
+
if self.history_file
|
77
|
+
# include the history file
|
78
|
+
self.yard_files << self.history_file
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def define_yard_tasks
|
83
|
+
require 'yard'
|
84
|
+
|
85
|
+
# generate the YARD options
|
86
|
+
opts = normalize_yard_opts
|
87
|
+
|
88
|
+
desc "Remove YARD products"
|
89
|
+
task :clobber_docs do
|
90
|
+
rm_rf local_yard_dir
|
91
|
+
end
|
92
|
+
|
93
|
+
# define the yard task
|
94
|
+
::YARD::Rake::YardocTask.new do |t|
|
95
|
+
t.files = ['lib/**/*.rb']
|
96
|
+
t.options = opts + ['--files'] + self.yard_files
|
97
|
+
end
|
98
|
+
task :docs => :yard
|
99
|
+
|
100
|
+
# override the RDoc options
|
101
|
+
self.spec.rdoc_options = opts
|
102
|
+
end
|
103
|
+
|
104
|
+
protected
|
105
|
+
|
106
|
+
#
|
107
|
+
# Alias to <tt>Hoe#extra_rdoc_files</tt>.
|
108
|
+
#
|
109
|
+
def yard_files
|
110
|
+
self.extra_rdoc_files
|
111
|
+
end
|
112
|
+
|
113
|
+
#
|
114
|
+
# Alias to <tt>Hoe#extra_rdoc_files=</tt>.
|
115
|
+
#
|
116
|
+
def yard_files=(new_files)
|
117
|
+
self.extra_rdoc_files = new_files
|
118
|
+
end
|
119
|
+
|
120
|
+
#
|
121
|
+
# Alias to <tt>Hoe#local_rdoc_dir</tt>.
|
122
|
+
#
|
123
|
+
def local_yard_dir
|
124
|
+
self.local_rdoc_dir
|
125
|
+
end
|
126
|
+
|
127
|
+
#
|
128
|
+
# Alias to <tt>Hoe#local_yard_dir=</tt>.
|
129
|
+
#
|
130
|
+
def local_yard_dir=(new_dir)
|
131
|
+
self.local_rdoc_dir = new_dir
|
132
|
+
end
|
133
|
+
|
134
|
+
#
|
135
|
+
# Alias to <tt>Hoe#remote_rdoc_dir</tt>.
|
136
|
+
#
|
137
|
+
def remote_yard_dir
|
138
|
+
self.remote_rdoc_dir
|
139
|
+
end
|
140
|
+
|
141
|
+
#
|
142
|
+
# Alias to <tt>Hoe#remote_rdoc_dir=</tt>.
|
143
|
+
#
|
144
|
+
def remote_yard_dir=(new_dir)
|
145
|
+
self.remote_rdoc_dir = new_dir
|
146
|
+
end
|
147
|
+
|
148
|
+
#
|
149
|
+
# Intuitively finds the file with the given _name_, using the current
|
150
|
+
# YARD markup setting to guess the file extension.
|
151
|
+
#
|
152
|
+
def intuit_file_name(name)
|
153
|
+
name = name.gsub(/\.[^\.]+$/,'')
|
154
|
+
paths = Dir["#{name}.*"]
|
155
|
+
|
156
|
+
exts = if self.yard_markup
|
157
|
+
YARD_EXTS[self.yard_markup]
|
158
|
+
else
|
159
|
+
YARD_EXTS.values.flatten.uniq
|
160
|
+
end
|
161
|
+
|
162
|
+
# append the other raw extensions
|
163
|
+
exts += YARD_RAW_EXTS
|
164
|
+
|
165
|
+
paths.each do |path|
|
166
|
+
return path if exts.include?(File.extname(path))
|
167
|
+
end
|
168
|
+
|
169
|
+
warn "Could not intuitively find the #{name} file" if $DEBUG
|
170
|
+
return nil
|
171
|
+
end
|
172
|
+
|
173
|
+
#
|
174
|
+
# Generates the minimal amount of YARD options based on the YARD
|
175
|
+
# settings.
|
176
|
+
#
|
177
|
+
def normalize_yard_opts
|
178
|
+
opts = self.yard_opts + ['--title', self.yard_title]
|
179
|
+
|
180
|
+
if self.yard_markup
|
181
|
+
opts += ['--markup', self.yard_markup]
|
182
|
+
end
|
183
|
+
|
184
|
+
if self.yard_markup_provider
|
185
|
+
opts += ['--markup-provider', self.yard_markup_provider]
|
186
|
+
end
|
187
|
+
|
188
|
+
unless (opts.include?('--quiet') || opts.include?('--verbose') || $DEBUG)
|
189
|
+
opts += ['--quiet']
|
190
|
+
end
|
191
|
+
|
192
|
+
return opts
|
193
|
+
end
|
194
|
+
end unless defined? Hoe::Yard
|
data.tar.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
���~��u�[�K��l}��d�S�丘r6L|�إg}v�aG��,�莻a6xGz��%7 8;�ӑ߫�)}9�J��l���(?m翦լ>�K� ����!W[H��>��"<�Q �Bo��<\�!{�7�\��%�n���}p�3��δ�8l
|
metadata
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hoe-yard
|
3
|
+
version: !ruby/object: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g6gX5BIb9tI+zGkpzo0Z7jnxMEcNO7NGGwmzafDBI/xZYv
|
26
|
+
xkRH3/HXbGGYDOi6Q6gWt5GujSx0bOImDtYTJTH8jnzN92HzEK5WdScm1QpZKF1e
|
27
|
+
cezArMbxbSPaosxTCtG6LQTkE28lFQsmFZ5xzouugS4h5+LVJiVMmiP+l3EfkjFa
|
28
|
+
GOURU+rNEMPWo8MCWivGW7jes6BMzWHcW7DQ0scNVmIcCIgdyMmpscuAEOSeghy9
|
29
|
+
/fFs57Ey2OXBL55nDOyvN/ZQ2Vab05UH4t+GCxjAPeirzL/29FBtePT6VD44c38j
|
30
|
+
pDj+ws7QjtH/Qcrr1l9jfN0ehDs=
|
31
|
+
-----END CERTIFICATE-----
|
32
|
+
|
33
|
+
date: 2010-01-08 00:00:00 -08:00
|
34
|
+
default_executable:
|
35
|
+
dependencies:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: yard
|
38
|
+
type: :runtime
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 0.2.3.1
|
45
|
+
version:
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rubyforge
|
48
|
+
type: :development
|
49
|
+
version_requirement:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.0.3
|
55
|
+
version:
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: gemcutter
|
58
|
+
type: :development
|
59
|
+
version_requirement:
|
60
|
+
version_requirements: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 0.3.0
|
65
|
+
version:
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: yard
|
68
|
+
type: :development
|
69
|
+
version_requirement:
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 0.5.2
|
75
|
+
version:
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: hoe-yard
|
78
|
+
type: :development
|
79
|
+
version_requirement:
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 0.1.0
|
85
|
+
version:
|
86
|
+
- !ruby/object:Gem::Dependency
|
87
|
+
name: hoe
|
88
|
+
type: :development
|
89
|
+
version_requirement:
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 2.5.0
|
95
|
+
version:
|
96
|
+
description: |-
|
97
|
+
A Hoe plugin for generating YARD documentation.
|
98
|
+
|
99
|
+
Using the Hoe YARD plugin, projects can begin generating YARD documentation
|
100
|
+
instantly. Additionally, any resulting RubyGems will be properly configured
|
101
|
+
to automatically generate YARD documentation upon installation.
|
102
|
+
email:
|
103
|
+
- postmodern.mod3@gmail.com
|
104
|
+
executables: []
|
105
|
+
|
106
|
+
extensions: []
|
107
|
+
|
108
|
+
extra_rdoc_files:
|
109
|
+
- Manifest.txt
|
110
|
+
- History.rdoc
|
111
|
+
files:
|
112
|
+
- History.rdoc
|
113
|
+
- Manifest.txt
|
114
|
+
- README.rdoc
|
115
|
+
- Rakefile
|
116
|
+
- lib/hoe/yard.rb
|
117
|
+
has_rdoc: yard
|
118
|
+
homepage: http://github.com/postmodern/hoe-yard
|
119
|
+
licenses: []
|
120
|
+
|
121
|
+
post_install_message:
|
122
|
+
rdoc_options:
|
123
|
+
- --protected
|
124
|
+
- --title
|
125
|
+
- HoeYard Documentation
|
126
|
+
- --quiet
|
127
|
+
require_paths:
|
128
|
+
- lib
|
129
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: "0"
|
134
|
+
version:
|
135
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: "0"
|
140
|
+
version:
|
141
|
+
requirements: []
|
142
|
+
|
143
|
+
rubyforge_project: hoe-yard
|
144
|
+
rubygems_version: 1.3.5
|
145
|
+
signing_key:
|
146
|
+
specification_version: 3
|
147
|
+
summary: A Hoe plugin for generating YARD documentation
|
148
|
+
test_files: []
|
149
|
+
|
metadata.gz.sig
ADDED