guard-livereload 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1898992c5889a043423dc786d78b7b74fd7e7bb
4
- data.tar.gz: 2d6c64cf12ef5e33b30115942deb5de20418cd53
3
+ metadata.gz: 453a0af138fcc205c6093736aa5e9fe5e935db57
4
+ data.tar.gz: acc5eec88f2848a4ed38ea1e544aa9df1b068d92
5
5
  SHA512:
6
- metadata.gz: 7a1e4fc6b7739648f345d00df55e28aabdeb5e50ec249dc281e9463d89d37acf53cea912b180655c1c2fab3b97ca75cae4a56421e1abe6ce062895875e318f08
7
- data.tar.gz: ff509308ebc1c6795f832023bce01dccad6c53f0b1f2aa3667b1fde618bda875cfb29020d84171dfb501f4e86273eb60421da5b5bc22a429be28913908a9b827
6
+ metadata.gz: cd19896a140cce30488ad9a271b800bd0c6145b5d3580ab6d9c3871a66809d3bab61b5d003c2d68b7f4f3bfaa658a04f253da5e5804bf1042d0eff05f914af2b
7
+ data.tar.gz: 6301dd7c6b80ff9cbef490a4fd5400408fbaf065c1424a9b7d88af1591316a5a30b6f8150589f0234111570086faa2fdaaf3bb7bf6264aa6e2c75369b794d748
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ bundler_args: --without development
3
3
  rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
+ - 2.1.0
6
7
  - jruby-19mode
7
8
  - rbx-19mode
8
9
  matrix:
data/README.md CHANGED
@@ -36,7 +36,7 @@ Use [rack-livereload](https://github.com/johnbintz/rack-livereload) or install [
36
36
 
37
37
  ## Usage
38
38
 
39
- Please read [Guard usage doc](https://github.com/guard/guard#readme) and [rack-livereload how it works readme section](https://github.com/johnbintz/rack-livereload#readme) or [LiveReload extension usage doc](http://github.com/mockko/livereload#readme)
39
+ Please read [Guard usage doc](https://github.com/guard/guard#readme) and [rack-livereload how it works readme section](https://github.com/johnbintz/rack-livereload#readme) or [LiveReload extension usage doc](https://github.com/mockko/livereload/blob/master/README-old.md) from version 1.x
40
40
 
41
41
  ## Guardfile
42
42
 
@@ -59,7 +59,7 @@ end
59
59
  LiveReload guard has 6 options that you can set like this:
60
60
 
61
61
  ``` ruby
62
- guard 'livereload' do
62
+ guard 'livereload', grace_period: 0.5, override_url: true do
63
63
  # ...
64
64
  end
65
65
  ```
@@ -74,7 +74,7 @@ override_url: false # default false
74
74
  grace_period: 0.5 # default 0 (seconds)
75
75
  ```
76
76
 
77
- See [LiveReload configuration doc](https://github.com/mockko/livereload#readme) for more info about those options.
77
+ See [LiveReload configuration doc](https://github.com/mockko/livereload/blob/master/README-old.md) from version 1.x for more info about those options.
78
78
 
79
79
  ## Development
80
80
 
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module LiveReloadVersion
3
- VERSION = "2.1.0"
3
+ VERSION = "2.1.1"
4
4
  end
5
5
  end
@@ -1,6 +1,7 @@
1
1
  require 'eventmachine'
2
2
  require 'em-websocket'
3
3
  require 'http/parser'
4
+ require 'uri'
4
5
 
5
6
  module Guard
6
7
  class LiveReload
@@ -9,12 +10,13 @@ module Guard
9
10
  def dispatch(data)
10
11
  parser = Http::Parser.new
11
12
  parser << data
13
+ request_path = URI.parse(parser.request_url).path
12
14
  if parser.http_method != 'GET' || parser.upgrade?
13
15
  super #pass the request to websocket
14
- elsif parser.request_path == '/livereload.js'
16
+ elsif request_path == '/livereload.js'
15
17
  _serve_file(_livereload_js_file)
16
- elsif File.exist?(parser.request_path[1..-1])
17
- _serve_file(parser.request_path[1..-1]) # Strip leading slash
18
+ elsif File.exist?(request_path[1..-1])
19
+ _serve_file(request_path[1..-1]) # Strip leading slash
18
20
  else
19
21
  send_data("HTTP/1.1 404 Not Found\r\nContent-Type: text/plain\r\nContent-Length: 13\r\n\r\n404 Not Found")
20
22
  close_connection_after_writing
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-livereload
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibaud Guillaume-Gentil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-02 00:00:00.000000000 Z
11
+ date: 2014-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: em-websocket
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.5'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: multi_json
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.8'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.8'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.3.5
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.3.5
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Guard::LiveReload automatically reloads your browser when 'view' files
@@ -101,8 +101,8 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
105
- - .travis.yml
104
+ - ".gitignore"
105
+ - ".travis.yml"
106
106
  - Gemfile
107
107
  - Guardfile
108
108
  - LICENSE.txt
@@ -128,17 +128,17 @@ require_paths:
128
128
  - lib
129
129
  required_ruby_version: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - '>='
131
+ - - ">="
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  requirements: []
140
140
  rubyforge_project:
141
- rubygems_version: 2.1.10
141
+ rubygems_version: 2.2.0
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Guard plugin for livereload