guard-rocco 0.0.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.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in guard-rocco.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,13 @@
1
+ It's a [Guard](http://github.com/guard/guard) for the [Rocco](http://github.com/rtomayko/rocco) documentation system!
2
+
3
+ guard 'rocco' do
4
+ watch(%r{app/.*\.(rb|coffee)})
5
+ watch(%r{lib/.*\.rb})
6
+ end
7
+
8
+ Only one option for now:
9
+
10
+ * `:dir` specifies the output dir (default `doc`)
11
+
12
+ `gem install guard-rocco` or Bundle it up with `gem 'guard-rocco'`. Then `guard init rocco`. Yeah!
13
+
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ include Rake::DSL if defined?(Rake::DSL)
2
+
3
+ require 'bundler'
4
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "guard/rocco/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "guard-rocco"
7
+ s.version = Guard::RoccoVersion::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["John Bintz"]
10
+ s.email = ["john@coswellproductions.com"]
11
+ s.homepage = ""
12
+ s.summary = %q{Guard to generate Rocco documentation}
13
+ s.description = %q{Guard to generate Rocco documentation}
14
+
15
+ s.rubyforge_project = "guard-rocco"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_dependency 'guard', '>= 0.4.0'
23
+ s.add_dependency 'rocco'
24
+ end
25
+
@@ -0,0 +1,40 @@
1
+ require 'rocco'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class Rocco < Guard
6
+ def initialize(watchers = [], options = {})
7
+ super
8
+
9
+ @options = { :dir => 'doc' }.merge(options)
10
+ end
11
+
12
+ def start
13
+ UI.info "Guard::Rocco is waiting to build docs..."
14
+ end
15
+
16
+ def run_all
17
+ all_paths.each { |path| build(path) }
18
+ end
19
+
20
+ def run_on_change(paths = [])
21
+ paths.each { |path| build(path) }
22
+ end
23
+
24
+ private
25
+ def build(path, target = nil)
26
+ target ||= self.filename_to_target(path)
27
+ puts "rocco: #{path} -> #{target}"
28
+ File.open(target, 'wb') { |fh| fh.print ::Rocco.new(path, all_paths).to_html }
29
+ end
30
+
31
+ def all_paths
32
+ Watcher.match_files(self, Dir['**/*'])
33
+ end
34
+
35
+ def self.filename_to_target(path)
36
+ File.join(@options[:dir], path).gsub(%r{\.[^\.]+$}, '.html')
37
+ end
38
+ end
39
+ end
40
+
@@ -0,0 +1,6 @@
1
+ guard 'rocco' do
2
+ # For Rails 3.0.x and 3.1
3
+ watch(%r{app/.*\.(rb|coffee)})
4
+ watch(%r{lib/.*\.rb})
5
+ end
6
+
@@ -0,0 +1,5 @@
1
+ module Guard
2
+ module RoccoVersion
3
+ VERSION = '0.0.1'
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-rocco
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - John Bintz
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-06-18 00:00:00 -04:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: guard
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: 0.4.0
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: rocco
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: "0"
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ description: Guard to generate Rocco documentation
39
+ email:
40
+ - john@coswellproductions.com
41
+ executables: []
42
+
43
+ extensions: []
44
+
45
+ extra_rdoc_files: []
46
+
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - README.md
51
+ - Rakefile
52
+ - guard-rocco.gemspec
53
+ - lib/guard/rocco.rb
54
+ - lib/guard/rocco/templates/Guardfile
55
+ - lib/guard/rocco/version.rb
56
+ has_rdoc: true
57
+ homepage: ""
58
+ licenses: []
59
+
60
+ post_install_message:
61
+ rdoc_options: []
62
+
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: "0"
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: "0"
77
+ requirements: []
78
+
79
+ rubyforge_project: guard-rocco
80
+ rubygems_version: 1.6.2
81
+ signing_key:
82
+ specification_version: 3
83
+ summary: Guard to generate Rocco documentation
84
+ test_files: []
85
+