guard-yard 2.1.4 → 2.2.0

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: 434a0ae6ebca42341d296bd0b0dbe0cf6277e338
4
- data.tar.gz: 412d9c189a3d610ec839fef398c7861d7349d246
3
+ metadata.gz: 8b5b502b0b0cff99bc620a14389e0000a20d8ea5
4
+ data.tar.gz: b47ee07f81d04af0711cb4e639df0f402979dccf
5
5
  SHA512:
6
- metadata.gz: 61d5b1ec3083a8b5194922943d0bef9843588bf54e46139aedde790393bd1e3ae31f3680557841c938bf2fc3b9e71169e62b7b827f6629464180ee6efca4cd51
7
- data.tar.gz: 6ff77b47418369da0b450a65a6229316885fd0167f6197d22ec1d9ff2c7c21248ead659bf0f755e73c181769b9f9a5b7dd59db2846c5fce526087a85f2ad106f
6
+ metadata.gz: ba4ecd6680472a3720227a7e2f61a64bfc31371b2a78485085e8179c3240d36e931ceed622f66e9c3481cffd2cfed163d3d35ddd3379378e3f8af13d467facd5
7
+ data.tar.gz: 66504d272dd6678586d60692c6470d59df3baaeb4169f8cad84d7c9a007dd84e411233edeeca343c2291b1b3c55b44677cdcd8df1d6461ab34cf69ee595ce950
@@ -36,7 +36,9 @@ Guard::Yard also provides some basic options for doc generation and running the
36
36
 
37
37
  Available options:
38
38
 
39
+ :server => true # Disable/Enable server
39
40
  :port => '8808' # Port on which the server shoud run.
41
+ :host => 'localhost' # Host to which the server should bind.
40
42
  :stdout => 'yard.log' # File in which to log the yard server output.
41
43
  :stderr => '/dev/null' # File in which to log the yard server errors.
42
44
  :cli => '--plugin rest' # Additional command line options to be appended to the server command.
@@ -53,3 +55,5 @@ When booting guard, Guard::Yard will do this for you automatically if no .yardoc
53
55
  ## Troubleshooting
54
56
 
55
57
  If you are running into issues, try re-creating your documentation using `rm -rf .yardoc && yard doc`. Once this operation is complete, restart guard. If you are still having problems, open a new issue in the GitHub issue tracker for this project.
58
+
59
+ ## Build Status [![Build Status](https://secure.travis-ci.org/panthomakos/guard-yard.png?branch=master)](http://travis-ci.org/panthomakos/guard-yard)
@@ -3,6 +3,7 @@ require 'guard/plugin'
3
3
  require 'yard'
4
4
 
5
5
  module Guard
6
+ # Main guard-yard plugin class.
6
7
  class Yard < Plugin
7
8
  autoload :NoServer, 'guard/yard/no_server'
8
9
  autoload :Server, 'guard/yard/server'
@@ -27,9 +28,9 @@ module Guard
27
28
  end
28
29
 
29
30
  def run_all
30
- UI.info "[Guard::Yard] Generating all documentation."
31
+ UI.info '[Guard::Yard] Generating all documentation.'
31
32
  system('rm -rf .yardoc && yard doc')
32
- UI.info "[Guard::Yard] Documentation has been generated."
33
+ UI.info '[Guard::Yard] Documentation has been generated.'
33
34
  true
34
35
  end
35
36
 
@@ -42,16 +43,16 @@ module Guard
42
43
  private
43
44
 
44
45
  def check
45
- return true if File.exists?('.yardoc')
46
- UI.info "[Guard::Yard] Documentation missing."
47
- run_all and true
46
+ return true if File.exist?('.yardoc')
47
+ UI.info '[Guard::Yard] Documentation missing.'
48
+ run_all && true
48
49
  end
49
50
 
50
51
  def boot
51
- check and server.kill and server.spawn and server.verify
52
+ check && server.kill && server.spawn && server.verify
52
53
  end
53
54
 
54
- def document files
55
+ def document(files)
55
56
  ::YARD::Registry.load!
56
57
  ::YARD::Registry.load(files, true)
57
58
  ::YARD::Registry.load_all
@@ -60,7 +61,7 @@ module Guard
60
61
  options = yardoc.options
61
62
  objects = ::YARD::Registry.all(:root, :module, :class).reject do |object|
62
63
  (!options[:serializer] || options[:serializer].exists?(object)) \
63
- && !object.files.any?{|f,line| files.include?(f)}
64
+ && !object.files.any? { |f, _line| files.include?(f) }
64
65
  end
65
66
  ::YARD::Templates::Engine.generate(objects, options)
66
67
  save_registry
@@ -1,5 +1,6 @@
1
1
  module Guard
2
2
  class Yard
3
+ # NULL Server
3
4
  class NoServer
4
5
  [:kill, :spawn, :verify].each do |method|
5
6
  define_method(method) { true }
@@ -2,20 +2,22 @@ require 'socket'
2
2
 
3
3
  module Guard
4
4
  class Yard
5
+ # Responsible for running, verifying and killing the YARD server.
5
6
  class Server
6
- attr_accessor :pid, :port
7
+ attr_accessor :pid, :port, :host
7
8
 
8
9
  def initialize(options = {})
9
10
  @port = options[:port] || '8808'
11
+ @host = options[:host] || 'localhost'
10
12
  @stdout = options[:stdout]
11
13
  @stderr = options[:stderr]
12
14
  @cli = options[:cli]
13
15
  end
14
16
 
15
17
  def spawn
16
- UI.info "[Guard::Yard] Starting YARD Documentation Server."
18
+ UI.info '[Guard::Yard] Starting YARD Documentation Server.'
17
19
 
18
- command = ["yard server -p #{port}"]
20
+ command = ["yard server -p #{port} -b #{host}"]
19
21
  command << @cli if @cli
20
22
  command << "2> #{@stderr}" if @stderr
21
23
  command << "1> #{@stdout}" if @stdout
@@ -24,7 +26,7 @@ module Guard
24
26
  end
25
27
 
26
28
  def kill
27
- UI.info "[Guard::Yard] Stopping YARD Documentation Server."
29
+ UI.info '[Guard::Yard] Stopping YARD Documentation Server.'
28
30
  begin
29
31
  if pid
30
32
  Process.kill('QUIT', pid)
@@ -32,6 +34,7 @@ module Guard
32
34
  end
33
35
  rescue Errno::ESRCH, Errno::ECHILD
34
36
  # Process is already dead.
37
+ true
35
38
  end
36
39
  true
37
40
  end
@@ -40,16 +43,19 @@ module Guard
40
43
  5.times do
41
44
  sleep 1
42
45
  begin
43
- TCPSocket.new('localhost', port.to_i).close
46
+ TCPSocket.new(host, port.to_i).close
44
47
  rescue Errno::ECONNREFUSED
45
48
  next
46
49
  end
47
- UI.info "[Guard::Yard] Server successfully started."
50
+ UI.info '[Guard::Yard] Server successfully started.'
48
51
  return true
49
52
  end
50
- UI.error "[Guard::Yard] Error starting documentation server."
51
- Notifier.notify "[Guard::Yard] Server NOT started.",
52
- :title => 'yard', :image => :failed
53
+ UI.error '[Guard::Yard] Error starting documentation server.'
54
+ Notifier.notify(
55
+ '[Guard::Yard] Server NOT started.',
56
+ title: 'yard',
57
+ image: :failed
58
+ )
53
59
  false
54
60
  end
55
61
  end
@@ -1,5 +1,5 @@
1
1
  guard 'yard' do
2
- watch(%r{app/.+\.rb})
3
- watch(%r{lib/.+\.rb})
4
- watch(%r{ext/.+\.c})
2
+ watch(%r{app\/.+\.rb})
3
+ watch(%r{lib\/.+\.rb})
4
+ watch(%r{ext\/.+\.c})
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module YardVersion
3
- VERSION = "2.1.4"
3
+ VERSION = '2.2.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,43 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-yard
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pan Thomakos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-06 00:00:00.000000000 Z
11
+ date: 2016-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: yard
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.7.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.7.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: '0.40'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: '0.40'
41
69
  description: Guard::Yard automatically monitors Yard Documentation.
42
70
  email:
43
71
  - pan.thomakos@gmail.com
@@ -45,13 +73,13 @@ executables: []
45
73
  extensions: []
46
74
  extra_rdoc_files: []
47
75
  files:
76
+ - LICENSE
77
+ - README.markdown
48
78
  - lib/guard/yard.rb
49
- - lib/guard/yard/templates/Guardfile
50
79
  - lib/guard/yard/no_server.rb
51
80
  - lib/guard/yard/server.rb
81
+ - lib/guard/yard/templates/Guardfile
52
82
  - lib/guard/yard/version.rb
53
- - LICENSE
54
- - README.markdown
55
83
  homepage: https://github.com/panthomakos/guard-yard
56
84
  licenses: []
57
85
  metadata: {}
@@ -61,19 +89,18 @@ require_paths:
61
89
  - lib
62
90
  required_ruby_version: !ruby/object:Gem::Requirement
63
91
  requirements:
64
- - - '>='
92
+ - - ">="
65
93
  - !ruby/object:Gem::Version
66
94
  version: 1.9.2
67
95
  required_rubygems_version: !ruby/object:Gem::Requirement
68
96
  requirements:
69
- - - '>='
97
+ - - ">="
70
98
  - !ruby/object:Gem::Version
71
99
  version: '0'
72
100
  requirements: []
73
101
  rubyforge_project: guard-yard
74
- rubygems_version: 2.0.14
102
+ rubygems_version: 2.5.1
75
103
  signing_key:
76
104
  specification_version: 4
77
105
  summary: Guard gem for YARD
78
106
  test_files: []
79
- has_rdoc: