inventory-rake-tasks-yard 1.3.2 → 1.3.3

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: 16a9fcb604b34aa74bed4e4b5937a7c46d8426d4
4
- data.tar.gz: 342a48ed2b75307412a5dd79c036d43830ae482d
3
+ metadata.gz: 7cfb2acd8a44a9e98e560b7961f4d6f605f36f74
4
+ data.tar.gz: 4499363058455509f5ca2fa4c67a8808f4b21c72
5
5
  SHA512:
6
- metadata.gz: 31f86ce50a2120e3dc6e4a3ede88dda750dd38fcc20108aab2dbaf6968a922706d861b52f4fca7fa1fe8221c26fbeeef9db97efb8c142a3e4b623c7f602b03b4
7
- data.tar.gz: 791d9f66a0586c6282cda612a13491c6f7cbe33b272f901e5581f2c1dee097381be61e4eb0f3904c91777c0edbf9ca079278baa4bdae6824dd18e4e01fbad830
6
+ metadata.gz: b732194c8fbf208e8e0914c140e9577c36c72c9cdc5b79b0a7963494a581cb7779eb6fb69c23f5bd696f2beaa9f8a5535cb1add8589f0612be54dfa273bdb13c
7
+ data.tar.gz: dbc0bc23550917b878ff907f154f14238c9db7748f884b1ba23885ac35b9706725c3f6192f397b83ff70f184738d0342323488c04c813255f645dde0983ac61e
data/README CHANGED
@@ -3,9 +3,9 @@
3
3
  Inventory-Rake-Tasks-YARD provides Rake¹ tasks for YARD² using your
4
4
  Inventory³.
5
5
 
6
- ¹ Read up on Ruby’s build tool Rake at http://rake.rubyforge.org/
7
- ² Find out more about the YARD documentation tool at http://yardoc.org/
8
- ³ Get information on Inventory at http://disu.se/software/inventory/
6
+ ¹ See http://rake.rubyforge.org/
7
+ ² See http://yardoc.org/
8
+ ³ See http://disu.se/software/inventory/
9
9
 
10
10
  § Installation
11
11
 
@@ -15,7 +15,63 @@
15
15
 
16
16
  § Usage
17
17
 
18
- Include the following code in your ‹Rakefile›:
18
+ Include the following code in your ‹Rakefile› (assuming that you’ve already
19
+ set up Inventory-Rake¹:
19
20
 
20
- require 'inventory/rake/tasks/yard-1.0'
21
- Inventory::Rake::Tasks::YARD.new
21
+ Inventory::Rake::Tasks.unless_installing_dependencies do
22
+ require 'inventory-rake-tasks-yard-1.0'
23
+ Inventory::Rake::Tasks::YARD.new
24
+ end
25
+
26
+ This’ll define the following tasks:
27
+
28
+ = .yardopts (file). = Create .yardopts file; depends on the file defining
29
+ this task and Rakefile.
30
+ = html. = Generate documentation in HTML format for all lib files in the
31
+ inventory; depends on .yardopts file.
32
+
33
+ ‹Inventory::Rake::Tasks::YARD› takes a couple of options, but the ones you
34
+ might want to adjust are
35
+
36
+ = :options. = The options to pass to YARD; will be passed to
37
+ `Shellwords.shelljoin`.
38
+ = :globals. = The globals to pass to YARD.
39
+ = :files. = The files to process; mainly used if you want to add additional
40
+ files to process beyond the lib files in the inventory.
41
+
42
+ The options passed to YARD will be augmented with any options you list in a
43
+ file named ‹.yardopts.task›, where ‹task› is the name of the Rake task
44
+ invoking YARD, for example, ‹.yardopts.html› for the default
45
+ HTML-generating task. You can use this to add options that are local to
46
+ your installation and should thus not be listed in the Rakefile itself.
47
+
48
+ See the {API documentation}² for more information.
49
+
50
+ ¹ See http://disu.se/software/inventory-rake/
51
+ ² See http://disu.se/software/inventory-rake-tasks-yard/api/Inventory/Rake/Tasks/YARD/
52
+
53
+ § Financing
54
+
55
+ Currently, most of my time is spent at my day job and in my rather busy
56
+ private life. Please motivate me to spend time on this piece of software
57
+ by donating some of your money to this project. Yeah, I realize that
58
+ requesting money to develop software is a bit, well, capitalistic of me.
59
+ But please realize that I live in a capitalistic society and I need money
60
+ to have other people give me the things that I need to continue living
61
+ under the rules of said society. So, if you feel that this piece of
62
+ software has helped you out enough to warrant a reward, please PayPal a
63
+ donation to now@disu.se¹. Thanks! Your support won’t go unnoticed!
64
+
65
+ ¹ Send a donation:
66
+ https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=now%40disu%2ese&item_name=Nikolai%20Weibull%20Software%20Services
67
+
68
+ § Reporting Bugs
69
+
70
+ Please report any bugs that you encounter to the {issue tracker}¹.
71
+
72
+ ¹ See https://github.com/now/inventory-rake-tasks-yard/issues
73
+
74
+ § Authors
75
+
76
+ Nikolai Weibull wrote the code, the tests, the manual pages, and this
77
+ README.
data/Rakefile CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
- require 'inventory/rake-1.0'
3
+ require 'inventory-rake-1.0'
4
4
 
5
5
  $:.unshift File.expand_path('../lib', __FILE__)
6
- require 'inventory/rake/tasks/yard-1.0'
6
+ require 'inventory-rake-tasks-yard-1.0'
7
7
 
8
8
  Inventory::Rake::Tasks.define Inventory::Rake::Tasks::YARD::Version, :gem => proc{ |_, s|
9
9
  s.author = 'Nikolai Weibull'
@@ -12,6 +12,11 @@ Inventory::Rake::Tasks.define Inventory::Rake::Tasks::YARD::Version, :gem => pro
12
12
  }
13
13
 
14
14
  Inventory::Rake::Tasks.unless_installing_dependencies do
15
- require 'lookout/rake-3.0'
15
+ require 'lookout-rake-3.0'
16
16
  Lookout::Rake::Tasks::Test.new
17
17
  end
18
+
19
+ Inventory::Rake::Tasks::YARD.new do |t|
20
+ t.options += %w'--plugin yard-heuristics-1.0'
21
+ t.globals[:source_code_url] = 'https://github.com/now/%s/blob/v%s/%%s#L%%d' % [t.inventory.package, t.inventory]
22
+ end
@@ -0,0 +1,149 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # Namespace for [Inventory](http://disu.se/software/inventory/). The bulk of
4
+ # the library is in {Rake::Tasks::YARD}.
5
+ class Inventory; end
6
+
7
+ # Namespace for [Rake](http://rake.rubyforge.org/) integration of Inventory.
8
+ module Inventory::Rake
9
+ end
10
+
11
+ # Namespace for [Inventory Rake](http://disu.se/software/inventory-rake) tasks.
12
+ module Inventory::Rake::Tasks
13
+ end
14
+
15
+ # Defines a task that invokes [YARD](http://yardoc.org/) to process embedded
16
+ # documentation.
17
+ class Inventory::Rake::Tasks::YARD
18
+ load File.expand_path('../inventory-rake-tasks-yard-1.0/version.rb', __FILE__)
19
+ Version.load
20
+
21
+ include Rake::DSL
22
+
23
+ # Sets up a YARD task NAME, passing OPTIONS, on the files listed in INVENTORY
24
+ # or FILES, with GLOBALS set, optionally yields the task object for further
25
+ # customization, then {#define}s NAME.
26
+ #
27
+ # The default for OPTIONS is:
28
+ #
29
+ # --no-private --protected --private --query \
30
+ # "(!object.docstring.blank?&&object.docstring.line)||object.root?" \
31
+ # --markup markdown --no-stats
32
+ #
33
+ # This’ll make YARD output documentation for all public, protected, and
34
+ # private objects not markes as `@private` that have documentation that
35
+ # hasn’t been automatically generated or is the top-level namespace using
36
+ # Markdown as the markup format and not outputting any statistics at the end
37
+ # of execution.
38
+ #
39
+ # @param [Hash] options
40
+ # @option options [Symbol] :name (:html) The name of the task to define
41
+ # @option options [Array<String, Array<String>>] :options (…) The options to
42
+ # pass to YARD; will be passed to `Shellwords.shelljoin`
43
+ # @option options [Inventory] :inventory (Inventory::Rake::Tasks.inventory)
44
+ # The inventory to use for FILES default
45
+ # @option options [Array<String>] :files (FileList[ENV['FILES']] or
46
+ # inventory.lib_files) The files to process
47
+ # @option options [Hash] :globals ({}) The globals to pass to YARD
48
+ # @yield [?]
49
+ # @yieldparam [self] task
50
+ def initialize(options = {})
51
+ self.name = options.fetch(:name, :html)
52
+ self.options = options.fetch(:options,
53
+ ['--no-private',
54
+ '--protected',
55
+ '--private',
56
+ ['--query', %w{'(!object.docstring.blank?&&object.docstring.line)||object.root?'}],
57
+ ['--markup', 'markdown'],
58
+ '--no-stats'])
59
+ self.inventory = options.fetch(:inventory, Inventory::Rake::Tasks.inventory)
60
+ self.files = options.fetch(:files){ ENV.include?('FILES') ? FileList[ENV['FILES']] : inventory.lib_files }
61
+ self.globals = options.fetch(:globals, {})
62
+ yield self if block_given?
63
+ define
64
+ end
65
+
66
+ # Defines the following tasks (html is actually whatever {#name} has been set
67
+ # to):
68
+ #
69
+ # <dl>
70
+ # <dt>.yardopts (file)</dt>
71
+ # <dd>Create .yardopts file based on {#options}; depends on the file
72
+ # defining this task and Rakefile.</dd>
73
+ #
74
+ # <dt>html</dt>
75
+ # <dd>Generate documentation in HTML format for all {#files}, passing
76
+ # {#globals} to YARD; depends on .yardopts file.</dd>
77
+ # </dl>
78
+ def define
79
+ desc 'Create .yardopts file'
80
+ file '.yardopts' => [__FILE__, 'Rakefile'] do |t|
81
+ tmp = '%s.tmp' % t.name
82
+ rm([t.name, tmp], :force => true)
83
+ rake_output_message 'echo %s > %s' % [options.join(' '), tmp] if verbose
84
+ File.open(tmp, 'wb') do |f|
85
+ f.write options.join(' ')
86
+ end
87
+ chmod File.stat(tmp).mode & ~0222, tmp
88
+ mv tmp, t.name
89
+ end
90
+
91
+ desc name == :html ?
92
+ 'Generate documentation in HTML format' :
93
+ 'Generate documentation for %s in HTML format' % name
94
+ task name => '.yardopts' do
95
+ require 'yard'
96
+ yardoc = YARD::CLI::Yardoc.new
97
+ yardoc.parse_arguments(*arguments)
98
+ globals.each do |key, value|
99
+ yardoc.options.globals.send '%s=' % key, value
100
+ end
101
+ rake_output_message 'yard doc %s' % Shellwords.shelljoin(arguments(yardopts(yardoc))) if verbose
102
+ yardoc.run(nil)
103
+ end
104
+ end
105
+
106
+ # @param [Symbol] value
107
+ # @return [Symbol] The name to use for the task: VALUE
108
+ attr_accessor :name
109
+
110
+ # @param [Array<String, Array<String>>] value
111
+ # @return [Array<String, Array<String>>] The options to pass to YARD: VALUE
112
+ attr_accessor :options
113
+
114
+ # @param [Inventory] value
115
+ # @return [Inventory] The inventory to use: VALUE
116
+ attr_accessor :inventory
117
+
118
+ # @param [Array<String>] value
119
+ # @return [Array<String>] The files to process: VALUE
120
+ attr_accessor :files
121
+
122
+ # @param [Hash] value
123
+ # @return [Hash] The globals to pass to YARD: VALUE
124
+ attr_accessor :globals
125
+
126
+ private
127
+
128
+ def read(type)
129
+ File.open('.yardopts.%s' % type, 'rb', &:read)
130
+ rescue Errno::ENOENT
131
+ nil
132
+ end
133
+
134
+ def arguments(additional = [])
135
+ additional.
136
+ concat(Shellwords.split(read('html') || '')).
137
+ concat(Shellwords.split(ENV['OPTIONS'] || '')).
138
+ push('--').
139
+ concat(files)
140
+ end
141
+
142
+ def yardopts(yardoc)
143
+ yardoc.use_yardopts_file ?
144
+ Shellwords.split(File.open(yardoc.options_file, 'rb', &:read)) :
145
+ []
146
+ rescue Errno::ENOENT
147
+ []
148
+ end
149
+ end
@@ -3,21 +3,28 @@
3
3
  require 'inventory-1.0'
4
4
 
5
5
  class Inventory::Rake::Tasks::YARD
6
- Version = Inventory.new(1, 3, 2){
6
+ Version = Inventory.new(1, 3, 3){
7
7
  def dependencies
8
8
  super + Inventory::Dependencies.new{
9
9
  development 'lookout', 3, 0, 0
10
10
  development 'lookout-rake', 3, 0, 0
11
- runtime 'inventory-rake', 1, 3, 0
11
+ development 'yard-heuristics', 1, 1, 0
12
+ runtime 'inventory-rake', 1, 4, 0
12
13
  runtime 'rake', 0, 9, 2, :feature => 'rake'
13
14
  optional 'yard', 0, 8, 0
14
15
  }
15
16
  end
16
17
 
17
18
  def requires
18
- %w'
19
- shellwords
20
- '
19
+ %w[shellwords]
20
+ end
21
+
22
+ def additional_libs
23
+ super + %w[inventory/rake/tasks/yard-1.0.rb]
24
+ end
25
+
26
+ def unit_tests
27
+ super - %w[inventory/rake/tasks/yard-1.0.rb]
21
28
  end
22
29
  }
23
30
  end
@@ -1,90 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
- # Namespace for Inventory, see {http://disu.se/software/inventory}.
4
- class Inventory; end
5
-
6
- # Namespace for Rake integration of Inventory, see
7
- # {http://disu.se/software/inventory-rake}.
8
- module Inventory::Rake
9
- end
10
-
11
- # Namespace for Rake tasks.
12
- module Inventory::Rake::Tasks
13
- end
14
-
15
- class Inventory::Rake::Tasks::YARD
16
- load File.expand_path('../yard/version.rb', __FILE__)
17
- Version.load
18
-
19
- include Rake::DSL
20
-
21
- def initialize(options = {})
22
- self.name = options.fetch(:name, :html)
23
- self.options = options.fetch(:options,
24
- ['--no-private',
25
- '--protected',
26
- '--private',
27
- ['--query', %w{'(!object.docstring.blank?&&object.docstring.line)||object.root?'}],
28
- ['--markup', 'markdown'],
29
- '--no-stats'])
30
- self.inventory = options.fetch(:inventory, Inventory::Rake::Tasks.inventory)
31
- self.files = options.fetch(:files){ ENV.include?('FILES') ? FileList[ENV['FILES']] : inventory.lib_files }
32
- self.globals = options.fetch(:globals, {})
33
- yield self if block_given?
34
- define
35
- end
36
-
37
- attr_accessor :name, :options, :files, :inventory, :globals
38
-
39
- def define
40
- desc 'Create .yardopts file'
41
- file '.yardopts' => [__FILE__, 'Rakefile'] do |t|
42
- tmp = '%s.tmp' % t.name
43
- rm([t.name, tmp], :force => true)
44
- rake_output_message 'echo %s > %s' % [options.join(' '), tmp] if verbose
45
- File.open(tmp, 'wb') do |f|
46
- f.write options.join(' ')
47
- end
48
- chmod File.stat(tmp).mode & ~0222, tmp
49
- mv tmp, t.name
50
- end
51
-
52
- desc name == :html ?
53
- 'Generate documentation in HTML format' :
54
- 'Generate documentation for %s in HTML format' % name
55
- task name => '.yardopts' do
56
- require 'yard'
57
- yardoc = YARD::CLI::Yardoc.new
58
- yardoc.parse_arguments(*arguments)
59
- globals.each do |key, value|
60
- yardoc.options.globals.send '%s=' % key, value
61
- end
62
- rake_output_message 'yard doc %s' % Shellwords.shelljoin(arguments(yardopts(yardoc))) if verbose
63
- yardoc.run(nil)
64
- end
65
- end
66
-
67
- private
68
-
69
- def read(type)
70
- File.open('.yardopts.%s' % type, 'rb', &:read)
71
- rescue Errno::ENOENT
72
- nil
73
- end
74
-
75
- def arguments(additional = [])
76
- additional.
77
- concat(Shellwords.split(read('html') || '')).
78
- concat(Shellwords.split(ENV['OPTIONS'] || '')).
79
- push('--').
80
- concat(files)
81
- end
82
-
83
- def yardopts(yardoc)
84
- yardoc.use_yardopts_file ?
85
- Shellwords.split(File.open(yardoc.options_file, 'rb', &:read)) :
86
- []
87
- rescue Errno::ENOENT
88
- []
89
- end
90
- end
3
+ warn "requiring 'inventory/rake/tasks/yard-1.0' is deprecated; require 'inventory-rake-tasks-yard-1.0' instead"
4
+ require 'inventory-rake-tasks-yard-1.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inventory-rake-tasks-yard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikolai Weibull
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-10 00:00:00.000000000 Z
11
+ date: 2013-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inventory
@@ -52,20 +52,34 @@ dependencies:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: yard-heuristics
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.1'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: inventory-rake
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - ~>
60
74
  - !ruby/object:Gem::Version
61
- version: '1.3'
75
+ version: '1.4'
62
76
  type: :runtime
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - ~>
67
81
  - !ruby/object:Gem::Version
68
- version: '1.3'
82
+ version: '1.4'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rake
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,9 +114,9 @@ description: |2
100
114
  Inventory-Rake-Tasks-YARD provides Rake¹ tasks for YARD² using your
101
115
  Inventory³.
102
116
 
103
- ¹ Read up on Ruby’s build tool Rake at http://rake.rubyforge.org/
104
- ² Find out more about the YARD documentation tool at http://yardoc.org/
105
- ³ Get information on Inventory at http://disu.se/software/inventory/
117
+ ¹ See http://rake.rubyforge.org/
118
+ ² See http://yardoc.org/
119
+ ³ See http://disu.se/software/inventory/
106
120
 
107
121
  § Installation
108
122
 
@@ -112,19 +126,76 @@ description: |2
112
126
 
113
127
  § Usage
114
128
 
115
- Include the following code in your ‹Rakefile›:
129
+ Include the following code in your ‹Rakefile› (assuming that you’ve already
130
+ set up Inventory-Rake¹:
131
+
132
+ Inventory::Rake::Tasks.unless_installing_dependencies do
133
+ require 'inventory-rake-tasks-yard-1.0'
134
+ Inventory::Rake::Tasks::YARD.new
135
+ end
136
+
137
+ This’ll define the following tasks:
138
+
139
+ = .yardopts (file). = Create .yardopts file; depends on the file defining
140
+ this task and Rakefile.
141
+ = html. = Generate documentation in HTML format for all lib files in the
142
+ inventory; depends on .yardopts file.
143
+
144
+ ‹Inventory::Rake::Tasks::YARD› takes a couple of options, but the ones you
145
+ might want to adjust are
146
+
147
+ = :options. = The options to pass to YARD; will be passed to
148
+ `Shellwords.shelljoin`.
149
+ = :globals. = The globals to pass to YARD.
150
+ = :files. = The files to process; mainly used if you want to add additional
151
+ files to process beyond the lib files in the inventory.
152
+
153
+ The options passed to YARD will be augmented with any options you list in a
154
+ file named ‹.yardopts.task›, where ‹task› is the name of the Rake task
155
+ invoking YARD, for example, ‹.yardopts.html› for the default
156
+ HTML-generating task. You can use this to add options that are local to
157
+ your installation and should thus not be listed in the Rakefile itself.
158
+
159
+ See the {API documentation}² for more information.
160
+
161
+ ¹ See http://disu.se/software/inventory-rake/
162
+ ² See http://disu.se/software/inventory-rake-tasks-yard/api/Inventory/Rake/Tasks/YARD/
163
+
164
+ § Financing
165
+
166
+ Currently, most of my time is spent at my day job and in my rather busy
167
+ private life. Please motivate me to spend time on this piece of software
168
+ by donating some of your money to this project. Yeah, I realize that
169
+ requesting money to develop software is a bit, well, capitalistic of me.
170
+ But please realize that I live in a capitalistic society and I need money
171
+ to have other people give me the things that I need to continue living
172
+ under the rules of said society. So, if you feel that this piece of
173
+ software has helped you out enough to warrant a reward, please PayPal a
174
+ donation to now@disu.se¹. Thanks! Your support won’t go unnoticed!
175
+
176
+ ¹ Send a donation:
177
+ https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=now%40disu%2ese&item_name=Nikolai%20Weibull%20Software%20Services
178
+
179
+ § Reporting Bugs
180
+
181
+ Please report any bugs that you encounter to the {issue tracker}¹.
182
+
183
+ ¹ See https://github.com/now/inventory-rake-tasks-yard/issues
184
+
185
+ § Authors
116
186
 
117
- require 'inventory/rake/tasks/yard-1.0'
118
- Inventory::Rake::Tasks::YARD.new
187
+ Nikolai Weibull wrote the code, the tests, the manual pages, and this
188
+ README.
119
189
  email: now@bitwi.se
120
190
  executables: []
121
191
  extensions: []
122
192
  extra_rdoc_files: []
123
193
  files:
194
+ - lib/inventory-rake-tasks-yard-1.0.rb
195
+ - lib/inventory-rake-tasks-yard-1.0/version.rb
124
196
  - lib/inventory/rake/tasks/yard-1.0.rb
125
- - lib/inventory/rake/tasks/yard/version.rb
126
- - test/unit/inventory/rake/tasks/yard-1.0.rb
127
- - test/unit/inventory/rake/tasks/yard/version.rb
197
+ - test/unit/inventory-rake-tasks-yard-1.0.rb
198
+ - test/unit/inventory-rake-tasks-yard-1.0/version.rb
128
199
  - README
129
200
  - Rakefile
130
201
  homepage: https://github.com/now/inventory-rake-tasks-yard