guard-yard 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0199552654ff2ced2a93f4cac26bd20d8d08bcfa
4
+ data.tar.gz: e50a8bd0a7cdd98cc6d1cc98cb9e882c23db0d56
5
+ SHA512:
6
+ metadata.gz: 24c6d72723ac5de9e63743e451920033e7fb1c35cd3de68f5364aa6dfebe1edd41c7ada4f02fbd8322ff782eea3625f9ad9d5ba32efc65b6c703ad6905138633
7
+ data.tar.gz: 7f12db433eb9b6a84f0a33176c8b67eb0ec536ce65213e34c5af9c8b88a68a8330a0c6aa74ef93f162e692f38f689af9c6fdbeb88428cabb3881117b5f7d56d5
@@ -2,9 +2,13 @@
2
2
 
3
3
  Guard::Yard allows you to automatically run and update your local YARD Documentation Server. It aims to centralize your file monitoring to guard instead of using the `yard server --reload` command which can be unreliable and provides little control over the generated documentation. Guard::Yard monitors files and updates only the documentation than changes, as opposed to generating the entire documentation suite. That means that changes to your documentation are available sooner!
4
4
 
5
- ## Install
5
+ ## Requirements
6
+
7
+ * The [YARD](http://yardoc.org) documentation tool.
8
+ * The [Guard](https://github.com/guard/guard) rubygem.
9
+ * Ruby 1.9.2 or higher.
6
10
 
7
- Ensure you have [Guard](https://github.com/guard/guard) installed before you continue.
11
+ ## Install
8
12
 
9
13
  Add guard-yard to your Gemfile (inside development group):
10
14
 
@@ -4,16 +4,17 @@ require 'yard'
4
4
 
5
5
  module Guard
6
6
  class Yard < Guard
7
+ autoload :NoServer, 'guard/yard/no_server'
7
8
  autoload :Server, 'guard/yard/server'
8
9
  attr_accessor :server
9
10
 
10
11
  def initialize(watchers=[], options={})
11
12
  super
12
- @server = Server.new(options)
13
+ options[:server] = true unless options.has_key?(:server)
14
+ @server = options[:server] ? Server.new(options) : NoServer.new
13
15
  end
14
16
 
15
17
  def start
16
- UI.info "[Guard::Yard] Starting YARD Documentation Server."
17
18
  boot
18
19
  end
19
20
 
@@ -22,7 +23,6 @@ module Guard
22
23
  end
23
24
 
24
25
  def reload
25
- UI.info "[Guard::Yard] Reloading YARD Documentation Server."
26
26
  boot
27
27
  end
28
28
 
@@ -0,0 +1,9 @@
1
+ module Guard
2
+ class Yard
3
+ class NoServer
4
+ [:kill, :spawn, :verify].each do |method|
5
+ define_method(method) { true }
6
+ end
7
+ end
8
+ end
9
+ end
@@ -13,25 +13,24 @@ module Guard
13
13
  end
14
14
 
15
15
  def spawn
16
- self.pid = fork
17
- raise 'Fork failed' if pid == -1
16
+ UI.info "[Guard::Yard] Starting YARD Documentation Server."
18
17
 
19
- unless pid
20
- Signal.trap('QUIT', 'IGNORE')
21
- Signal.trap('INT', 'IGNORE')
22
- Signal.trap('TSTP', 'IGNORE')
18
+ command = ["yard server -p #{port}"]
19
+ command << @cli if @cli
20
+ command << "2> #{@stderr}" if @stderr
21
+ command << "1> #{@stdout}" if @stdout
23
22
 
24
- command = ["yard server -p #{port}"]
25
- command << @cli if @cli
26
- command << "2> #{@stderr}" if @stderr
27
- command << "1> #{@stdout}" if @stdout
28
- exec command.join(' ')
29
- end
30
- pid
23
+ self.pid = Process.spawn(command.join(' '))
31
24
  end
32
25
 
33
26
  def kill
34
- Process.kill('KILL', pid) unless pid.nil?
27
+ UI.info "[Guard::Yard] Stopping YARD Documentation Server."
28
+ begin
29
+ Process.kill('QUIT', pid) if pid
30
+ Process.wait2
31
+ rescue Errno::ESRCH, Errno::ECHILD
32
+ # Process is already dead.
33
+ end
35
34
  true
36
35
  end
37
36
 
@@ -1,5 +1,5 @@
1
1
  module Guard
2
- module Yard
3
- VERSION = "2.1.0"
2
+ module YardVersion
3
+ VERSION = "2.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-yard
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
5
- prerelease:
4
+ version: 2.1.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Pan Thomakos
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-18 00:00:00.000000000 Z
11
+ date: 2014-03-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: guard
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 1.1.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 1.1.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: yard
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: 0.7.0
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: 0.7.0
46
41
  description: Guard::Yard automatically monitors Yard Documentation.
@@ -50,35 +45,35 @@ executables: []
50
45
  extensions: []
51
46
  extra_rdoc_files: []
52
47
  files:
53
- - lib/guard/yard/server.rb
48
+ - lib/guard/yard.rb
54
49
  - lib/guard/yard/templates/Guardfile
50
+ - lib/guard/yard/no_server.rb
51
+ - lib/guard/yard/server.rb
55
52
  - lib/guard/yard/version.rb
56
- - lib/guard/yard.rb
57
53
  - LICENSE
58
54
  - README.markdown
59
55
  homepage: https://github.com/panthomakos/guard-yard
60
56
  licenses: []
57
+ metadata: {}
61
58
  post_install_message:
62
59
  rdoc_options: []
63
60
  require_paths:
64
61
  - lib
65
62
  required_ruby_version: !ruby/object:Gem::Requirement
66
- none: false
67
63
  requirements:
68
- - - ! '>='
64
+ - - '>='
69
65
  - !ruby/object:Gem::Version
70
66
  version: 1.9.2
71
67
  required_rubygems_version: !ruby/object:Gem::Requirement
72
- none: false
73
68
  requirements:
74
- - - ! '>='
69
+ - - '>='
75
70
  - !ruby/object:Gem::Version
76
71
  version: '0'
77
72
  requirements: []
78
73
  rubyforge_project: guard-yard
79
- rubygems_version: 1.8.23
74
+ rubygems_version: 2.0.14
80
75
  signing_key:
81
- specification_version: 3
76
+ specification_version: 4
82
77
  summary: Guard gem for YARD
83
78
  test_files: []
84
79
  has_rdoc: