magico 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +18 -10
- data/bin/magico +6 -9
- data/lib/magico/version.rb +1 -1
- data/magico.gemspec +1 -1
- data/vendor/assets/javascripts/magico.js +1 -2
- metadata +31 -24
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 780d2a9385119a962464cb51a5ef64bc19671628
|
4
|
+
data.tar.gz: 0a59231d93ef3796c0583ae5252625187b8775b7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a399c102f6539dd26f14b59d96c25ad9542a63ad8bc8c859e39ce0b6dd706b6f7fedbc9406edd5cff986e4bc83f46c13665de82ad19a9ca4ae48f12163c884d6
|
7
|
+
data.tar.gz: 55ef111c332e91e6a51e99d56cbba086a881422c2327e7e169d15045c14a05764a947111400b24ae6b81dab7067ae83cbd8820651a984aa91bacf46e434df373
|
data/README.md
CHANGED
@@ -1,24 +1,32 @@
|
|
1
1
|
# Magico
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://fury-badge.herokuapp.com/rb/magico.png)](http://badge.fury.io/rb/magico)
|
4
4
|
|
5
|
-
|
5
|
+
Auto-update for your CSS stylesheets without refreshing the browser
|
6
6
|
|
7
|
-
|
7
|
+
## Requirements
|
8
8
|
|
9
|
-
|
9
|
+
* Rails
|
10
|
+
* jQuery
|
11
|
+
* [WebSockets-compatible browser](http://caniuse.com/#search=Websocket)
|
10
12
|
|
11
|
-
|
13
|
+
## Usage
|
12
14
|
|
13
|
-
|
15
|
+
Add this line to your application's Gemfile:
|
14
16
|
|
15
|
-
|
17
|
+
group :development do
|
18
|
+
gem 'magico'
|
19
|
+
end
|
16
20
|
|
17
|
-
|
21
|
+
Add this to your layout (after you load jQuery):
|
18
22
|
|
19
|
-
|
23
|
+
<% if Rails.env.development? %>
|
24
|
+
<%= javascript_include_tag 'magico' %>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
Start the server in your Rails app path:
|
20
28
|
|
21
|
-
|
29
|
+
$ magico
|
22
30
|
|
23
31
|
## Contributing
|
24
32
|
|
data/bin/magico
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
require 'rubygems'
|
3
3
|
require 'eventmachine'
|
4
4
|
require 'em-websocket'
|
5
|
-
require '
|
5
|
+
require 'listen'
|
6
6
|
|
7
7
|
root_path = File.expand_path(ARGV[0] || '.', Dir.pwd)
|
8
8
|
|
@@ -17,14 +17,11 @@ EM.run {
|
|
17
17
|
end
|
18
18
|
|
19
19
|
Thread.new do
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
FSSM.monitor(root_path, '**/*css*') do
|
26
|
-
update(&onChange)
|
27
|
-
create(&onChange)
|
20
|
+
Listen.to(root_path, filter: /.*\.css.*/) do |m, a, r|
|
21
|
+
(m + a + r).each do |path|
|
22
|
+
parts = File.basename(path).split('.') - SKIP_PARTS
|
23
|
+
@clients.each { |ws| ws.send(parts.join('.')) }
|
24
|
+
end
|
28
25
|
end
|
29
26
|
end
|
30
27
|
|
data/lib/magico/version.rb
CHANGED
data/magico.gemspec
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
/*globals console jQuery */
|
2
2
|
|
3
3
|
/* Magico: CSS Autorefresh server */
|
4
|
-
|
5
4
|
Magico = {
|
6
5
|
connect: function() {
|
7
6
|
var klass = window.WebSocket || window.MozWebSocket;
|
8
7
|
if(!klass) {
|
9
8
|
console.log('Magico is not compatible with your browser');
|
10
9
|
} else {
|
11
|
-
var socket = new klass('ws://
|
10
|
+
var socket = new klass('ws://' + window.location.hostname + ':8787/');
|
12
11
|
socket.onopen = function () {
|
13
12
|
console.log("Connected to Magico server!");
|
14
13
|
};
|
metadata
CHANGED
@@ -1,49 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magico
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Michael Rykov
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: eventmachine
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 0.12.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.12.0
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: em-websocket
|
27
|
-
requirement:
|
28
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
|
-
- - ~>
|
31
|
+
- - "~>"
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: 0.3.0
|
33
34
|
type: :runtime
|
34
35
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.3.0
|
36
41
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement:
|
39
|
-
none: false
|
42
|
+
name: listen
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
40
44
|
requirements:
|
41
|
-
- - ~>
|
45
|
+
- - "~>"
|
42
46
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
47
|
+
version: 0.7.0
|
44
48
|
type: :runtime
|
45
49
|
prerelease: false
|
46
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.7.0
|
47
55
|
description: Live stylesheet updates for Rails
|
48
56
|
email:
|
49
57
|
- michael@gemfury.com
|
@@ -52,7 +60,7 @@ executables:
|
|
52
60
|
extensions: []
|
53
61
|
extra_rdoc_files: []
|
54
62
|
files:
|
55
|
-
- .gitignore
|
63
|
+
- ".gitignore"
|
56
64
|
- Gemfile
|
57
65
|
- LICENSE
|
58
66
|
- README.md
|
@@ -64,26 +72,25 @@ files:
|
|
64
72
|
- vendor/assets/javascripts/magico.js
|
65
73
|
homepage: https://www.github.com/gemfury/magico
|
66
74
|
licenses: []
|
75
|
+
metadata: {}
|
67
76
|
post_install_message:
|
68
77
|
rdoc_options: []
|
69
78
|
require_paths:
|
70
79
|
- lib
|
71
80
|
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
81
|
requirements:
|
74
|
-
- -
|
82
|
+
- - ">="
|
75
83
|
- !ruby/object:Gem::Version
|
76
84
|
version: '0'
|
77
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
-
none: false
|
79
86
|
requirements:
|
80
|
-
- -
|
87
|
+
- - ">="
|
81
88
|
- !ruby/object:Gem::Version
|
82
89
|
version: '0'
|
83
90
|
requirements: []
|
84
91
|
rubyforge_project:
|
85
|
-
rubygems_version:
|
92
|
+
rubygems_version: 2.4.5
|
86
93
|
signing_key:
|
87
|
-
specification_version:
|
94
|
+
specification_version: 4
|
88
95
|
summary: Instantly autoupdate stylesheets
|
89
96
|
test_files: []
|