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 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
- TODO: Write a gem description
3
+ [![Gem Version](https://fury-badge.herokuapp.com/rb/magico.png)](http://badge.fury.io/rb/magico)
4
4
 
5
- ## Installation
5
+ Auto-update for your CSS stylesheets without refreshing the browser
6
6
 
7
- Add this line to your application's Gemfile:
7
+ ## Requirements
8
8
 
9
- gem 'magico'
9
+ * Rails
10
+ * jQuery
11
+ * [WebSockets-compatible browser](http://caniuse.com/#search=Websocket)
10
12
 
11
- And then execute:
13
+ ## Usage
12
14
 
13
- $ bundle
15
+ Add this line to your application's Gemfile:
14
16
 
15
- Or install it yourself as:
17
+ group :development do
18
+ gem 'magico'
19
+ end
16
20
 
17
- $ gem install magico
21
+ Add this to your layout (after you load jQuery):
18
22
 
19
- ## Usage
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
- TODO: Write usage instructions here
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 'fssm'
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
- onChange = lambda { |base, relative|
21
- parts = File.basename(relative).split('.') - SKIP_PARTS
22
- @clients.each { |ws| ws.send(parts.join('.')) }
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
 
@@ -1,3 +1,3 @@
1
1
  module Magico
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/magico.gemspec CHANGED
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.add_runtime_dependency 'eventmachine', '>= 0.12.0'
19
19
  gem.add_runtime_dependency 'em-websocket', '~> 0.3.0'
20
- gem.add_runtime_dependency 'fssm', '~> 0.2.0'
20
+ gem.add_runtime_dependency 'listen', '~> 0.7.0'
21
21
  end
@@ -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://localhost:8787/');
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.0
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: 2012-01-08 00:00:00.000000000 Z
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: &70223421332840 !ruby/object:Gem::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: *70223421332840
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: &70223421332340 !ruby/object:Gem::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: *70223421332340
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: fssm
38
- requirement: &70223421331860 !ruby/object:Gem::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.2.0
47
+ version: 0.7.0
44
48
  type: :runtime
45
49
  prerelease: false
46
- version_requirements: *70223421331860
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: 1.8.11
92
+ rubygems_version: 2.4.5
86
93
  signing_key:
87
- specification_version: 3
94
+ specification_version: 4
88
95
  summary: Instantly autoupdate stylesheets
89
96
  test_files: []