finish some docs
This commit is contained in:
parent
9515c25b23
commit
cfa7f86bc9
13
README.md
Normal file
13
README.md
Normal file
@ -0,0 +1,13 @@
|
||||
It's a [Guard](http://github.com/guard/guard) for the [Rocco](http://github.com/rtomayko/rocco) documentation system!
|
||||
|
||||
guard 'rocco' do
|
||||
watch(%r{app/.*\.(rb|coffee)})
|
||||
watch(%r{lib/.*\.rb})
|
||||
end
|
||||
|
||||
Only one option for now:
|
||||
|
||||
* `:dir` specifies the output dir (default `doc`)
|
||||
|
||||
`gem install guard-rocco` or Bundle it up with `gem 'guard-rocco'`. Yeah!
|
||||
|
@ -22,8 +22,8 @@ module Guard
|
||||
end
|
||||
|
||||
private
|
||||
def build(path)
|
||||
target = File.join(@options[:dir], path).gsub(%r{\.[^\.]+$}, '.html')
|
||||
def build(path, target = nil)
|
||||
target ||= self.filename_to_target(path)
|
||||
puts "rocco: #{path} -> #{target}"
|
||||
File.open(target, 'wb') { |fh| fh.print ::Rocco.new(path, all_paths).to_html }
|
||||
end
|
||||
@ -31,6 +31,10 @@ module Guard
|
||||
def all_paths
|
||||
Watcher.match_files(self, Dir['**/*'])
|
||||
end
|
||||
|
||||
def self.filename_to_target(path)
|
||||
File.join(@options[:dir], path).gsub(%r{\.[^\.]+$}, '.html')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
6
lib/guard/rocco/templates/Guardfile
Normal file
6
lib/guard/rocco/templates/Guardfile
Normal file
@ -0,0 +1,6 @@
|
||||
guard 'rocco' do
|
||||
# For Rails 3.0.x and 3.1
|
||||
watch(%r{app/.*\.(rb|coffee)})
|
||||
watch(%r{lib/.*\.rb})
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user