rack-livejs 0.2.0 → 0.2.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/README.md +7 -2
- data/lib/rack/livejs.rb +2 -1
- data/lib/rack/livejs/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Rack::Livejs
|
2
2
|
|
3
|
-
|
3
|
+
Rack middleware to inject and serve "live.js", a handy javascript snippet for automatically updating content in browser when files in your local dev environment change.
|
4
|
+
|
5
|
+
"Just include Live.js and it will monitor the current page including local CSS and Javascript by sending consecutive HEAD requests to the server. Changes to CSS will be applied dynamically and HTML or Javascript changes will reload the page." - extracted form livejs.com
|
6
|
+
|
7
|
+
View [livejs.com](http://livejs.com) for more information on live.js and how it works
|
8
|
+
|
4
9
|
|
5
10
|
## Installation
|
6
11
|
|
@@ -18,7 +23,7 @@ Or install it yourself as:
|
|
18
23
|
|
19
24
|
## Usage
|
20
25
|
|
21
|
-
|
26
|
+
Nothing else to do. Rack will serve live.js into your site and will monitor your assets (css, js and html) changes.
|
22
27
|
|
23
28
|
## Contributing
|
24
29
|
|
data/lib/rack/livejs.rb
CHANGED
@@ -31,7 +31,8 @@ module Rack
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def inject_livejs(html)
|
34
|
-
|
34
|
+
livejs_snippet = %{<script src="#{bundled_livejs_path}"></script>}
|
35
|
+
html.sub(%r{(?=</head>)}i) { livejs_snippet }
|
35
36
|
end
|
36
37
|
|
37
38
|
def bundled_livejs_prefix
|
data/lib/rack/livejs/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-livejs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-03-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -81,7 +81,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
81
|
version: '0'
|
82
82
|
segments:
|
83
83
|
- 0
|
84
|
-
hash:
|
84
|
+
hash: 538134631761730897
|
85
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
86
|
none: false
|
87
87
|
requirements:
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
segments:
|
92
92
|
- 0
|
93
|
-
hash:
|
93
|
+
hash: 538134631761730897
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
96
|
rubygems_version: 1.8.23
|