Class: Guard::Yard
- Inherits:
-
Plugin
- Object
- Plugin
- Guard::Yard
show all
- Defined in:
- lib/guard/yard.rb,
lib/guard/yard/server.rb,
lib/guard/yard/no_server.rb
Defined Under Namespace
Classes: NoServer, Server
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}) ⇒ Yard
Returns a new instance of Yard.
11
12
13
14
15
|
# File 'lib/guard/yard.rb', line 11
def initialize(options = {})
super
options[:server] = true unless options.key?(:server)
@server = options[:server] ? Server.new(options) : NoServer.new
end
|
Instance Attribute Details
#server ⇒ Object
Returns the value of attribute server.
9
10
11
|
# File 'lib/guard/yard.rb', line 9
def server
@server
end
|
Instance Method Details
#reload ⇒ Object
25
26
27
|
# File 'lib/guard/yard.rb', line 25
def reload
boot
end
|
#run_all ⇒ Object
29
30
31
32
33
34
|
# File 'lib/guard/yard.rb', line 29
def run_all
UI.info "[Guard::Yard] Generating all documentation."
system('rm -rf .yardoc && yard doc')
UI.info "[Guard::Yard] Documentation has been generated."
true
end
|
#run_on_changes(paths) ⇒ Object
36
37
38
39
40
|
# File 'lib/guard/yard.rb', line 36
def run_on_changes(paths)
UI.info "[Guard::Yard] Detected changes in #{paths.join(',')}."
paths.each { |path| document([path]) }
UI.info "[Guard::Yard] Updated documentation for #{paths.join(',')}."
end
|
#start ⇒ Object
17
18
19
|
# File 'lib/guard/yard.rb', line 17
def start
boot
end
|
#stop ⇒ Object
21
22
23
|
# File 'lib/guard/yard.rb', line 21
def stop
server.kill
end
|