inventory-rake-tasks-yard 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/inventory/rake/tasks/yard-1.0.rb +16 -17
- data/lib/inventory/rake/tasks/yard/version.rb +1 -1
- metadata +14 -14
@@ -20,8 +20,13 @@ class Inventory::Rake::Tasks::YARD
|
|
20
20
|
|
21
21
|
def initialize(options = {})
|
22
22
|
self.name = options.fetch(:name, :html)
|
23
|
-
self.options = options.fetch(:options,
|
24
|
-
|
23
|
+
self.options = options.fetch(:options,
|
24
|
+
['--no-private',
|
25
|
+
'--protected',
|
26
|
+
'--private',
|
27
|
+
['--query', '"(!object.docstring.blank?&&!(YARD::CodeObjects::NamespaceObject===object.namespace&&(a=object.namespace.aliases[object])&&object.name==:eql?&&a==:==)&&!(object.visibility!=:public&&((@return.text==\'\'&&@return.types==%w\'Boolean\')||object.docstring.start_with?(\'Returns the value of attribute \', \'Sets the attribute \')||(@raise&&@raise.types=[]))))||object.root?"'],
|
28
|
+
['--markup', 'markdown'],
|
29
|
+
'--no-stats'])
|
25
30
|
self.inventory = options.fetch(:inventory, Inventory::Rake::Tasks.inventory)
|
26
31
|
self.files = options.fetch(:files){ ENV.include?('FILES') ? FileList[ENV['FILES']] : inventory.lib_files }
|
27
32
|
self.globals = options.fetch(:globals, {})
|
@@ -33,18 +38,12 @@ class Inventory::Rake::Tasks::YARD
|
|
33
38
|
|
34
39
|
def define
|
35
40
|
desc 'Create .yardopts file'
|
36
|
-
file '.yardopts' => [__FILE__, '
|
41
|
+
file '.yardopts' => [__FILE__, 'Rakefile'] do |t|
|
37
42
|
tmp = '%s.tmp' % t.name
|
38
43
|
rm([t.name, tmp], :force => true)
|
39
|
-
|
40
|
-
rake_output_message '{echo %s%s} > %s' %
|
41
|
-
[Options, project ? ' && cat .yardopts.project' : '', tmp] if verbose
|
44
|
+
rake_output_message 'echo %s > %s' % [options.join(' '), tmp] if verbose
|
42
45
|
File.open(tmp, 'wb') do |f|
|
43
|
-
f.write
|
44
|
-
if project
|
45
|
-
f.write ' '
|
46
|
-
f.write project
|
47
|
-
end
|
46
|
+
f.write options.join(' ')
|
48
47
|
end
|
49
48
|
chmod File.stat(tmp).mode & ~0222, tmp
|
50
49
|
mv tmp, t.name
|
@@ -58,15 +57,11 @@ class Inventory::Rake::Tasks::YARD
|
|
58
57
|
yardoc = YARD::CLI::Yardoc.new
|
59
58
|
yardoc.parse_arguments(*arguments)
|
60
59
|
yardoc.options.merge! globals
|
61
|
-
Rake.rake_output_message 'yard doc %s' % Shellwords.
|
60
|
+
Rake.rake_output_message 'yard doc %s' % Shellwords.shelljoin(arguments(yardoc.yardopts.dup)) if verbose
|
62
61
|
yardoc.run(nil)
|
63
62
|
end
|
64
63
|
end
|
65
64
|
|
66
|
-
private
|
67
|
-
|
68
|
-
Options = '--no-private --protected --private --query "(!object.docstring.blank?&&!(YARD::CodeObjects::NamespaceObject===object.namespace&&(a=object.namespace.aliases[object])&&object.name==:eql?&&a==:==)&&!(object.visibility!=:public&&((@return.text==\'\'&&@return.types==%w\'Boolean\')||object.docstring.start_with?(\'Returns the value of attribute \', \'Sets the attribute \')||(@raise&&@raise.types=[]))))||object.root?" --markup markdown --no-stats'
|
69
|
-
|
70
65
|
def read(type)
|
71
66
|
File.open('.yardopts.%s' % type, 'rb', &:read)
|
72
67
|
rescue Errno::ENOENT
|
@@ -74,6 +69,10 @@ class Inventory::Rake::Tasks::YARD
|
|
74
69
|
end
|
75
70
|
|
76
71
|
def arguments(additional = [])
|
77
|
-
|
72
|
+
additional.
|
73
|
+
concat(Shellwords.split(read('html') || '')).
|
74
|
+
concat(Shellwords.split(ENV['OPTIONS'] || '')).
|
75
|
+
push('--').
|
76
|
+
concat(files)
|
78
77
|
end
|
79
78
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inventory-rake-tasks-yard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: inventory
|
16
|
-
requirement: &
|
16
|
+
requirement: &2152941300 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2152941300
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: lookout
|
27
|
-
requirement: &
|
27
|
+
requirement: &2152940140 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '3.0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2152940140
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: lookout-rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &2152939320 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '3.0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2152939320
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: inventory-rake
|
49
|
-
requirement: &
|
49
|
+
requirement: &2152938400 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '1.3'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2152938400
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &2152937640 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.9.2
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2152937640
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: yard
|
71
|
-
requirement: &
|
71
|
+
requirement: &2152936960 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: 0.7.0
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2152936960
|
80
80
|
description: ! " Inventory-Rake-Tasks-YARD\n\n Inventory-Rake-Tasks-YARD
|
81
81
|
provides Rake¹ tasks for YARD² using your\n Inventory³.\n\n¹ Read up on Ruby’s
|
82
82
|
build tool Rake at http://rake.rubyforge.org/\n² Find out more about the YARD documentation
|