inventory-rake-tasks-yard 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@ 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, Shellwords.split('--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'))
23
+ self.options = options.fetch(:options, [])
24
24
  self.options += Shellwords.split(ENV['OPTIONS']) if ENV.include? 'OPTIONS'
25
25
  self.inventory = options.fetch(:inventory, Inventory::Rake::Tasks.inventory)
26
26
  self.files = options.fetch(:files){ ENV.include?('FILES') ? FileList[ENV['FILES']] : inventory.lib_files }
@@ -32,10 +32,28 @@ class Inventory::Rake::Tasks::YARD
32
32
  attr_accessor :name, :options, :files, :inventory, :globals
33
33
 
34
34
  def define
35
+ desc 'Create .yardopts file'
36
+ file '.yardopts' => [__FILE__, '.yardopts.project'] do |t|
37
+ tmp = '%s.tmp' % t.name
38
+ rm([t.name, tmp], :force => true)
39
+ project = read('project')
40
+ rake_output_message '{echo %s%s} > %s' %
41
+ [Options, project ? ' && cat .yardopts.project' : '', tmp] if verbose
42
+ File.open(tmp, 'wb') do |f|
43
+ f.write Options
44
+ if project
45
+ f.write ' '
46
+ f.write project
47
+ end
48
+ end
49
+ chmod File.stat(tmp).mode & ~0222, tmp
50
+ mv tmp, t.name
51
+ end
52
+
35
53
  desc name == :html ?
36
54
  'Generate documentation in HTML format' :
37
55
  'Generate documentation for %s in HTML format' % name
38
- task name do
56
+ task name => '.yardopts' do
39
57
  require 'yard'
40
58
  yardoc = YARD::CLI::Yardoc.new
41
59
  yardoc.parse_arguments(*arguments)
@@ -47,7 +65,15 @@ class Inventory::Rake::Tasks::YARD
47
65
 
48
66
  private
49
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
+ def read(type)
71
+ File.open('.yardopts.%s' % type, 'rb', &:read)
72
+ rescue Errno::ENOENT
73
+ nil
74
+ end
75
+
50
76
  def arguments(additional = [])
51
- options.dup.concat(additional).push('--').concat(files)
77
+ options.dup.concat(additional).concat(Shellwords.split(read('html') || '')).push('--').concat(files)
52
78
  end
53
79
  end
@@ -3,7 +3,7 @@
3
3
  require 'inventory-1.0'
4
4
 
5
5
  class Inventory::Rake::Tasks::YARD
6
- Version = Inventory.new(1, 0, 0){
6
+ Version = Inventory.new(1, 1, 0){
7
7
  def dependencies
8
8
  super + Inventory::Dependencies.new{
9
9
  development 'lookout', 3, 0, 0
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.0.0
4
+ version: 1.1.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-27 00:00:00.000000000 Z
12
+ date: 2012-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: inventory
16
- requirement: &10881012 !ruby/object:Gem::Requirement
16
+ requirement: &2152350600 !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: *10881012
24
+ version_requirements: *2152350600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: lookout
27
- requirement: &10879944 !ruby/object:Gem::Requirement
27
+ requirement: &2152349660 !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: *10879944
35
+ version_requirements: *2152349660
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: lookout-rake
38
- requirement: &10879224 !ruby/object:Gem::Requirement
38
+ requirement: &2152349060 !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: *10879224
46
+ version_requirements: *2152349060
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: inventory-rake
49
- requirement: &14405448 !ruby/object:Gem::Requirement
49
+ requirement: &2152348500 !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: *14405448
57
+ version_requirements: *2152348500
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rake
60
- requirement: &14404260 !ruby/object:Gem::Requirement
60
+ requirement: &2156773100 !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: *14404260
68
+ version_requirements: *2156773100
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: yard
71
- requirement: &14402940 !ruby/object:Gem::Requirement
71
+ requirement: &2156772520 !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: *14402940
79
+ version_requirements: *2156772520
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
@@ -97,7 +97,6 @@ files:
97
97
  - Rakefile
98
98
  homepage: https://github.com/now/inventory-rake-tasks-yard
99
99
  licenses: []
100
- metadata: {}
101
100
  post_install_message:
102
101
  rdoc_options: []
103
102
  require_paths:
@@ -116,8 +115,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
115
  version: '0'
117
116
  requirements: []
118
117
  rubyforge_project:
119
- rubygems_version: 1.8.10
118
+ rubygems_version: 1.8.11
120
119
  signing_key:
121
- specification_version: 4
120
+ specification_version: 3
122
121
  summary: Inventory³.
123
122
  test_files: []