guard-middleman 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ .rvmrc
6
+ .DS_Store
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in guard-middleman.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "guard/middleman/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "guard-middleman"
7
+ s.version = Guard::Middleman::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Matthias Döring"]
10
+ s.email = ["matt@foryourcontent.de"]
11
+ s.homepage = "http://rubygems.org/gems/guard-middleman"
12
+ s.summary = %q{Guard gem for Middleman}
13
+ s.description = %q{Guard gem for Middleman - automatically runs mm-build}
14
+
15
+ s.rubyforge_project = "guard-middleman"
16
+
17
+ s.add_dependency 'guard', '>= 0.4.2'
18
+ s.add_dependency 'middleman', '>= 1.2.7'
19
+
20
+ s.files = `git ls-files`.split("\n")
21
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
+ s.require_paths = ["lib"]
24
+ end
@@ -0,0 +1,8 @@
1
+ guard 'middleman' do
2
+ watch(%r{^config.rb})
3
+ watch(%r{^data/.*})
4
+ watch(%r{^source/.*})
5
+
6
+ watch(%r{^views/.*})
7
+ watch(%r{^public/.*})
8
+ end
@@ -0,0 +1,5 @@
1
+ module Guard
2
+ module Middleman
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,64 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class Middleman < Guard
6
+
7
+ def initialize(watchers=[], options={})
8
+ super
9
+ # init stuff here, thx!
10
+ @options = {
11
+ :bundler => File.exist?("#{Dir.pwd}/Gemfile")
12
+ }.merge(options)
13
+ end
14
+
15
+ def bundler?
16
+ @options[:bundler]
17
+ end
18
+
19
+ # =================
20
+ # = Guard methods =
21
+ # =================
22
+
23
+ # If one of those methods raise an exception, the Guard::GuardName instance
24
+ # will be removed from the active guards.
25
+
26
+ # Called once when Guard starts
27
+ # Please override initialize method to init stuff
28
+ def start
29
+ true
30
+ end
31
+
32
+ # Called on Ctrl-C signal (when Guard quits)
33
+ def stop
34
+ true
35
+ end
36
+
37
+ # Called on Ctrl-Z signal
38
+ # This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
39
+ def reload
40
+ true
41
+ end
42
+
43
+ # Called on Ctrl-\ signal
44
+ # This method should be principally used for long action like running all specs/tests/...
45
+ def run_all
46
+ system(build_command)
47
+ end
48
+
49
+ # Called on file(s) modifications
50
+ def run_on_change(paths)
51
+ system(build_command)
52
+ end
53
+
54
+ private
55
+ def build_command
56
+ cmd = []
57
+ cmd << "bundle exec" if bundler?
58
+ cmd << "mm-build"
59
+
60
+ cmd.join(' ')
61
+ end
62
+
63
+ end
64
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-middleman
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.1.0
6
+ platform: ruby
7
+ authors:
8
+ - "Matthias D\xC3\xB6ring"
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-06-11 00:00:00 +02: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.2
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: middleman
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: 1.2.7
36
+ type: :runtime
37
+ version_requirements: *id002
38
+ description: Guard gem for Middleman - automatically runs mm-build
39
+ email:
40
+ - matt@foryourcontent.de
41
+ executables: []
42
+
43
+ extensions: []
44
+
45
+ extra_rdoc_files: []
46
+
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - Rakefile
51
+ - guard-middleman.gemspec
52
+ - lib/guard/middleman.rb
53
+ - lib/guard/middleman/templates/Guardfile
54
+ - lib/guard/middleman/version.rb
55
+ has_rdoc: true
56
+ homepage: http://rubygems.org/gems/guard-middleman
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options: []
61
+
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "0"
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: "0"
76
+ requirements: []
77
+
78
+ rubyforge_project: guard-middleman
79
+ rubygems_version: 1.6.2
80
+ signing_key:
81
+ specification_version: 3
82
+ summary: Guard gem for Middleman
83
+ test_files: []
84
+