guard-autorefresh 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/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010-2011 Jean-Michel Garnier
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.
@@ -0,0 +1,68 @@
1
+ = Guard::Autorefresh
2
+
3
+ Autorefresh guard allows to automatically reload your browser when 'view' files are modified.
4
+
5
+ It is using {logankoester / autorefresh}[https://github.com/logankoester/autorefresh] to do its job.
6
+
7
+ No need for a browser extension, it just works.
8
+
9
+ I wrote it in 3 pomodori as I could not make {guard-livereload}[https://github.com/guard/guard-livereload] work on my machine and I did not want to bother installing an extension.
10
+
11
+ == Install
12
+
13
+ Please be sure to have {Guard}[http://github.com/guard/guard] installed before continue.
14
+
15
+ Install the gem:
16
+
17
+ gem install guard-autorefresh
18
+
19
+ Add it to your Gemfile (inside development group):
20
+
21
+ gem 'guard-autorefresh'
22
+
23
+ Add guard definition to your Guardfile by running this command:
24
+
25
+ guard init autorefresh
26
+
27
+ Add autorefresh socket setup to your layout files:
28
+
29
+ <head>
30
+ <%= AutoRefresh.channel('my_awesome_app') if Rails.env.development? %>
31
+ </head>
32
+
33
+ Do not rename 'my_awesome_app', your app must be awesome and it is hardcoded inside the library.
34
+
35
+ == Usage
36
+
37
+ Please read {Guard usage doc}[http://github.com/guard/guard#readme]
38
+
39
+ == Guardfile
40
+
41
+ You can adapt your 'view' files like you want.
42
+ Please read {Guard doc}[http://github.com/guard/guard#readme] for more info about Guardfile DSL.
43
+
44
+ guard 'autorefresh' do
45
+ watch(%r{app/.+\.(erb|haml)})
46
+ watch(%r{app/helpers/.+\.rb})
47
+ watch(%r{(public/|app/assets).+\.(css|js|html)})
48
+ watch(%r{(app/assets/.+\.css)\.scss}) { |m| m[1] }
49
+ watch(%r{(app/assets/.+\.js)\.coffee}) { |m| m[1] }
50
+ watch(%r{config/locales/.+\.yml})
51
+ end
52
+
53
+ == Development
54
+
55
+ - Source hosted at {GitHub}[http://github.com/21croissants/guard-autorefresh]
56
+ - Report issues/Questions/Feature requests on {GitHub Issues}[http://github.com/21croissants/guard-autorefresh/issues]
57
+
58
+ Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change
59
+ you make.
60
+
61
+ == TODO
62
+
63
+ - autorefresh has a dependency on watchr :(
64
+ - travis CI ;)
65
+
66
+ == Authors
67
+
68
+ {Jean-Michel Garnier}[http://github.com/21croissants]
@@ -0,0 +1,12 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class Autorefresh < Guard
6
+
7
+ def run_on_change(paths)
8
+ system('autorefresh my_awesome_app')
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ guard 'autorefresh' do
2
+ watch(%r{app/.+\.(erb|haml)})
3
+ watch(%r{app/helpers/.+\.rb})
4
+ watch(%r{(public/|app/assets).+\.(css|js|html)})
5
+ watch(%r{(app/assets/.+\.css)\.scss}) { |m| m[1] }
6
+ watch(%r{(app/assets/.+\.js)\.coffee}) { |m| m[1] }
7
+ watch(%r{config/locales/.+\.yml})
8
+ end
9
+
10
+ # Add autorefresh socket setup to your layout files:
11
+ # <head>
12
+ # <%= AutoRefresh.channel('my_awesome_app') if Rails.env.development? %>
13
+ # </head>
@@ -0,0 +1,5 @@
1
+ module Guard
2
+ module AutorefreshVersion
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-autorefresh
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Jean-Michel Garnier
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-09-16 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: guard
16
+ requirement: &2153383180 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.4.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *2153383180
25
+ - !ruby/object:Gem::Dependency
26
+ name: autorefresh
27
+ requirement: &2153382720 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - =
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.0
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *2153382720
36
+ - !ruby/object:Gem::Dependency
37
+ name: bundler
38
+ requirement: &2153382260 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: '1.0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *2153382260
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: &2153381800 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '2.5'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *2153381800
58
+ - !ruby/object:Gem::Dependency
59
+ name: guard-rspec
60
+ requirement: &2153381340 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ~>
64
+ - !ruby/object:Gem::Version
65
+ version: '0.2'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *2153381340
69
+ description: Guard::Autorefresh automatically reloads your browser when 'view' files
70
+ are modified.
71
+ email:
72
+ - jean-michel@21croissants.com
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - lib/guard/autorefresh/templates/Guardfile
78
+ - lib/guard/autorefresh/version.rb
79
+ - lib/guard/autorefresh.rb
80
+ - LICENSE
81
+ - README.rdoc
82
+ homepage: http://rubygems.org/gems/guard-autorefresh
83
+ licenses: []
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ! '>='
98
+ - !ruby/object:Gem::Version
99
+ version: 1.3.6
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 1.8.6
103
+ signing_key:
104
+ specification_version: 3
105
+ summary: Guard gem for autorefresh
106
+ test_files: []