rails_assistant 1.0.0 → 1.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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjdmZWY3MjA0NzliNzlkODI3MGZiYjAxOGE1MWNkMGMyNzgzZmVkOQ==
5
+ data.tar.gz: !binary |-
6
+ Njc5NjgzNWRlN2UwZGEzZDNjY2IxZTUxNzQzZjMxNTVkNDE3ZGRhMA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NDk3MjExMDFiZWNkODM0MjI3YTdiOTU5YzFlNWZlOTUyMTlkZThiNTFmOTRm
10
+ NmRjMDE5MTdjYWY2ZjNhZGNmZDMwZDI3MjFkMjk4ZTYyMDJlZTRkZDFhMGJl
11
+ ZWMzYzEwNGU1NWZhZmJjOWJkZGM5NTdjM2MzN2I3NzkxN2RjNWQ=
12
+ data.tar.gz: !binary |-
13
+ Y2MyMTY5ZDUzZDZmNmUyZTZlMDM2NzM1ZmU3MmE5Mzc4MTg1NmNiNzkxMmFj
14
+ YTI5NDg1YThjNTA1Zjc1YTliMjBhYTM3ODI5MzZkZWYyODQ1MDk5ODM4OTJm
15
+ Mjg3ZjNhM2NlNTljMDk0NjA0ZjNmZjVhODJmZmQyZmE1MmExMzE=
data/README.mdown CHANGED
@@ -1,6 +1,7 @@
1
1
  # Rails Assistant
2
2
 
3
3
  ![Rails Assistant Icon](http://railsassistant.com/assets/IconMedium.png)
4
+ [![Gem Version](https://badge.fury.io/rb/rails_assistant.png)](http://badge.fury.io/rb/rails_assistant)
4
5
 
5
6
  The rails_assistant gem connects via a Websocket to your [http://railsassistant.com](Rails Assistant) project, currently this allows Rails Assistant to reload the site on project restart.
6
7
 
@@ -8,7 +9,7 @@ In future we'll use it to facilitate more advanced communication between the bro
8
9
 
9
10
  Note: This gem will not affect your production environment, or your development environment outside of Rails Assistant.
10
11
 
11
- Currently tested on Rails 3.1+
12
+ Currently tested on Rails 3.1, 3.2 and 4.0 (with turbolinks)
12
13
 
13
14
  ## Installation
14
15
  In your `Gemfile`, add gem 'rails_assistant':
@@ -37,25 +38,29 @@ Note: You can can technically add "= require rails_assistant/rails_assistant" in
37
38
  Now run your Rails App with Rails Assistant
38
39
 
39
40
  ## Not Rails
40
- Currently this gem is a convenience wrapper for some javascript and a stylesheet. If you're project isn't Rails based, then incorporating the following files will work just as well
41
+ Currently this gem is a convenience wrapper for some javascript and a stylesheet. If your project isn't Rails based, then incorporating the following files will work just as well
41
42
 
42
43
  Required:
43
44
 
44
- [rails_assistant/rails_assistant.js](https://github.com/NocturnalCode/rails_assistant/blob/master/app/assets/javascripts/rails_assistant/rails_assistant.js)
45
+ [rails_assistant/rails_assistant.js](http://github.com/NocturnalCode/rails_assistant/blob/master/app/assets/javascripts/rails_assistant/rails_assistant.js.erb)
46
+
47
+ [rails_assistant/json2.js](https://github.com/NocturnalCode/rails_assistant/blob/master/app/assets/javascripts/rails_assistant/json2.js)
45
48
 
49
+
46
50
  Add this to your html
47
51
 
52
+ <script src="json2.js"></script>
48
53
  <script src="rails_assistant.js"></script>
49
54
 
50
55
  Optional: (aesthetics only)
51
56
 
52
- [rails_assistant/rails_assistant.css](https://github.com/NocturnalCode/rails_assistant/blob/master/app/assets/stylesheets/rails_assistant/rails_assistant.css)
57
+ [rails_assistant/rails_assistant.css](http://github.com/NocturnalCode/rails_assistant/blob/master/app/assets/stylesheets/rails_assistant/rails_assistant.css.erb)
53
58
 
54
59
  Add this to your html
55
60
 
56
61
  <link rel="stylesheet" href="rails_assistant.css">
57
62
 
58
- [rails_assistant/icon.png](https://github.com/NocturnalCode/rails_assistant/blob/master/app/assets/images/rails_assistant/icon.png)
63
+ [rails_assistant/icon.png](http://github.com/NocturnalCode/rails_assistant/blob/master/app/assets/images/rails_assistant/icon.png)
59
64
 
60
65
  Add icon to assets folder
61
66
 
@@ -10,8 +10,6 @@
10
10
  // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
11
  // GO AFTER THE REQUIRES BELOW.
12
12
  //
13
- //= require jquery
14
- //= require jquery_ujs
15
13
  //= require_tree .
16
14
 
17
15
  <% if ENV['com.nocturnalcode.RailsAssistant'].present? %>
@@ -22,10 +20,18 @@ var t;
22
20
  function SendMessage() {
23
21
  ws.send(JSON.stringify("ping"));
24
22
  t=setTimeout("SendMessage()",1000);
23
+
24
+ if($("#rails-assistant").length === 0) {
25
+ Insert()
26
+ }
27
+ }
28
+
29
+ function Insert() {
30
+ $('body').append('<div id="rails-assistant"><img src="http://'+ window.location.host +'/assets/rails_assistant/icon.png"/></div>')
25
31
  }
26
32
 
27
33
  function Connect() {
28
- ws = new WebSocket("ws://localhost:2999/service");
34
+ ws = new WebSocket("ws://" + window.location.host.split(':')[0] + ":2999/service");
29
35
  ws.onopen = function() {
30
36
  ws.send(JSON.stringify( {"action":"identifier","identifier":$(location).attr('port')} ))
31
37
  t=setTimeout("SendMessage()",1000);
@@ -39,6 +45,8 @@ function Connect() {
39
45
 
40
46
  // $('#rails-assistant').css({opacity: 0.9});
41
47
  // $('#rails-assistant').animate({opacity: 1}, 100 );
48
+ $("#rails-assistant").addClass("connected");
49
+ $('#rails-assistant img').attr('title', 'Rails Assistant: Websocket connected');
42
50
 
43
51
  if (json["action"] == "refresh") {
44
52
  window.location.reload(true);
@@ -57,7 +65,7 @@ function Connect() {
57
65
  $(window).load(function() {
58
66
 
59
67
  if ("WebSocket" in window) {
60
- $('body').append('<div id="rails-assistant"><img src="assets/rails_assistant/icon.png"/></div>')
68
+ Insert();
61
69
  Connect();
62
70
  }
63
71
  });
@@ -1,3 +1,3 @@
1
1
  module RailsAssistant
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_assistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.0.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Daniel Brooker
@@ -10,12 +9,11 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-03-01 00:00:00.000000000 Z
12
+ date: 2013-07-29 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rails
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ! '>'
21
19
  - !ruby/object:Gem::Version
@@ -23,7 +21,6 @@ dependencies:
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - ! '>'
29
26
  - !ruby/object:Gem::Version
@@ -31,7 +28,6 @@ dependencies:
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: sqlite3
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
32
  - - ! '>='
37
33
  - !ruby/object:Gem::Version
@@ -39,7 +35,6 @@ dependencies:
39
35
  type: :development
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
39
  - - ! '>='
45
40
  - !ruby/object:Gem::Version
@@ -47,7 +42,6 @@ dependencies:
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: rspec-rails
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
46
  - - ! '>='
53
47
  - !ruby/object:Gem::Version
@@ -55,7 +49,6 @@ dependencies:
55
49
  type: :development
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
53
  - - ! '>='
61
54
  - !ruby/object:Gem::Version
@@ -165,28 +158,27 @@ files:
165
158
  - spec/spec_helper.rb
166
159
  homepage: http://www.railsassistant.com
167
160
  licenses: []
161
+ metadata: {}
168
162
  post_install_message:
169
163
  rdoc_options: []
170
164
  require_paths:
171
165
  - lib
172
166
  required_ruby_version: !ruby/object:Gem::Requirement
173
- none: false
174
167
  requirements:
175
168
  - - ! '>='
176
169
  - !ruby/object:Gem::Version
177
170
  version: '0'
178
171
  required_rubygems_version: !ruby/object:Gem::Requirement
179
- none: false
180
172
  requirements:
181
173
  - - ! '>='
182
174
  - !ruby/object:Gem::Version
183
175
  version: '0'
184
176
  requirements: []
185
177
  rubyforge_project:
186
- rubygems_version: 1.8.24
178
+ rubygems_version: 2.0.3
187
179
  signing_key:
188
- specification_version: 3
189
- summary: Websocket connection to Rails Asssistant Mac App
180
+ specification_version: 4
181
+ summary: Websocket connection to Rails Assistant Mac App
190
182
  test_files:
191
183
  - spec/dummy/app/assets/javascripts/application.js
192
184
  - spec/dummy/app/assets/javascripts/home.js