guard-pow 0.1.0
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/LICENSE +20 -0
- data/README.rdoc +57 -0
- data/lib/guard/pow.rb +32 -0
- data/lib/guard/pow/runner.rb +16 -0
- data/lib/guard/pow/templates/Guardfile +11 -0
- data/lib/guard/pow/version.rb +5 -0
- metadata +138 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Thibaud Guillaume-Gentil
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
= Guard::Pow
|
2
|
+
|
3
|
+
Pow guard allows to automatically & intelligently restart your applications (just by touching tmp/restart.txt)
|
4
|
+
|
5
|
+
- Tested on Ruby 1.8.6, 1.8.7 & 1.9.2.
|
6
|
+
|
7
|
+
== Install
|
8
|
+
|
9
|
+
Please be sure to have {Guard}[http://github.com/guard/guard] installed before continue.
|
10
|
+
|
11
|
+
Install the gem:
|
12
|
+
|
13
|
+
gem install guard-pow
|
14
|
+
|
15
|
+
Add it to your Gemfile (inside test group):
|
16
|
+
|
17
|
+
gem 'guard-pow'
|
18
|
+
|
19
|
+
Add guard definition to your Guardfile with:
|
20
|
+
|
21
|
+
guard init pow
|
22
|
+
|
23
|
+
== Usage
|
24
|
+
|
25
|
+
Please read {Guard usage doc}[http://github.com/guard/guard#readme]
|
26
|
+
|
27
|
+
== Guardfile
|
28
|
+
|
29
|
+
Pow guard can be really be adapated to all kind of projects.
|
30
|
+
Please read {Guard doc}[http://github.com/guard/guard#readme] for more info about Guardfile DSL.
|
31
|
+
|
32
|
+
=== Rails app
|
33
|
+
|
34
|
+
guard 'pow' do
|
35
|
+
watch('.powrc')
|
36
|
+
watch('.powenv')
|
37
|
+
watch('.rvmrc')
|
38
|
+
watch('Gemfile')
|
39
|
+
watch('Gemfile.lock')
|
40
|
+
watch('config/application.rb')
|
41
|
+
watch('config/environment.rb')
|
42
|
+
watch(%r{^config/environments/.*\.rb$})
|
43
|
+
watch(%r{^config/initializers/.*\.rb$})
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
== Development
|
48
|
+
|
49
|
+
- Source hosted at {GitHub}[http://github.com/guard/guard-pow]
|
50
|
+
- Report issues/Questions/Feature requests on {GitHub Issues}[http://github.com/guard/guard-pow/issues]
|
51
|
+
|
52
|
+
Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change
|
53
|
+
you make.
|
54
|
+
|
55
|
+
== Authors
|
56
|
+
|
57
|
+
{Thibaud Guillaume-Gentil}[http://github.com/thibaudgg]
|
data/lib/guard/pow.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'guard'
|
2
|
+
require 'guard/guard'
|
3
|
+
|
4
|
+
module Guard
|
5
|
+
class Pow < Guard
|
6
|
+
|
7
|
+
autoload :Runner, 'guard/pow/runner'
|
8
|
+
attr_accessor :runner
|
9
|
+
|
10
|
+
def initialize(watchers = [], options = {})
|
11
|
+
super
|
12
|
+
@runner = Runner.new
|
13
|
+
end
|
14
|
+
|
15
|
+
def start
|
16
|
+
runner.restart_pow
|
17
|
+
end
|
18
|
+
|
19
|
+
def reload
|
20
|
+
runner.restart_pow
|
21
|
+
end
|
22
|
+
|
23
|
+
def run_on_change(paths)
|
24
|
+
runner.restart_pow
|
25
|
+
end
|
26
|
+
|
27
|
+
def stop
|
28
|
+
true
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Guard
|
4
|
+
class Pow
|
5
|
+
class Runner
|
6
|
+
|
7
|
+
def restart_pow
|
8
|
+
FileUtils.mkdir 'tmp' unless File.directory?("tmp")
|
9
|
+
FileUtils.touch 'tmp/restart.txt'
|
10
|
+
UI.info "Pow restarted."
|
11
|
+
Notifier.notify("Pow restarted.", :title => "Pow", :image => :success)
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
guard 'pow' do
|
2
|
+
watch('.powrc')
|
3
|
+
watch('.powenv')
|
4
|
+
watch('.rvmrc')
|
5
|
+
watch('Gemfile')
|
6
|
+
watch('Gemfile.lock')
|
7
|
+
watch('config/application.rb')
|
8
|
+
watch('config/environment.rb')
|
9
|
+
watch(%r{^config/environments/.*\.rb$})
|
10
|
+
watch(%r{^config/initializers/.*\.rb$})
|
11
|
+
end
|
metadata
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-pow
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Thibaud Guillaume-Gentil
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-04-08 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: guard
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 19
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 3
|
33
|
+
- 0
|
34
|
+
version: 0.3.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: bundler
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 1
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 0
|
49
|
+
- 11
|
50
|
+
version: 1.0.11
|
51
|
+
type: :development
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: rspec
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 27
|
62
|
+
segments:
|
63
|
+
- 2
|
64
|
+
- 5
|
65
|
+
- 0
|
66
|
+
version: 2.5.0
|
67
|
+
type: :development
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: guard-rspec
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 23
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
- 2
|
81
|
+
- 0
|
82
|
+
version: 0.2.0
|
83
|
+
type: :development
|
84
|
+
version_requirements: *id004
|
85
|
+
description: Guard::Pow automatically manage Pow applications restart
|
86
|
+
email:
|
87
|
+
- thibaud@thibaud.me
|
88
|
+
executables: []
|
89
|
+
|
90
|
+
extensions: []
|
91
|
+
|
92
|
+
extra_rdoc_files: []
|
93
|
+
|
94
|
+
files:
|
95
|
+
- lib/guard/pow/runner.rb
|
96
|
+
- lib/guard/pow/templates/Guardfile
|
97
|
+
- lib/guard/pow/version.rb
|
98
|
+
- lib/guard/pow.rb
|
99
|
+
- LICENSE
|
100
|
+
- README.rdoc
|
101
|
+
has_rdoc: true
|
102
|
+
homepage: http://rubygems.org/gems/guard-pow
|
103
|
+
licenses: []
|
104
|
+
|
105
|
+
post_install_message:
|
106
|
+
rdoc_options: []
|
107
|
+
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
hash: 3
|
116
|
+
segments:
|
117
|
+
- 0
|
118
|
+
version: "0"
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
hash: 23
|
125
|
+
segments:
|
126
|
+
- 1
|
127
|
+
- 3
|
128
|
+
- 6
|
129
|
+
version: 1.3.6
|
130
|
+
requirements: []
|
131
|
+
|
132
|
+
rubyforge_project: guard-pow
|
133
|
+
rubygems_version: 1.5.0
|
134
|
+
signing_key:
|
135
|
+
specification_version: 3
|
136
|
+
summary: Guard gem for Pow
|
137
|
+
test_files: []
|
138
|
+
|