rconsole 0.1.0 → 0.1.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 +4 -4
- data/README.md +9 -7
- data/app/helpers/rconsole_helper.rb +5 -0
- data/lib/rconsole/engine.rb +1 -1
- data/lib/rconsole/version.rb +1 -1
- data/vendor/assets/javascripts/rconsole.js +26 -20
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcd5ecc7e227b5fe16e113c26d569118fb7e0c89
|
4
|
+
data.tar.gz: 0f34657ac86e5c1e16f9d97349a5746ccb6a25ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c72a85429baa82ec87bd4d11306892cd05deabecbea097b271d6f1b1aab60e3c2de2f088c975d4a4fa363d947f16d9585f85d0ad3fc30e2b73fa57d293bde1c
|
7
|
+
data.tar.gz: f7299cdb3158a5252213a7acdb6e05b2ba4b56b21c911ccc104f819a3a8d5af486e4dfdc46ca55a7d0a9155137ef554c35a3fef4cb69a387daa229d49b5d7049
|
data/README.md
CHANGED
@@ -9,8 +9,8 @@ browser console.
|
|
9
9
|
First add the following lines to your application `Gemfile`:
|
10
10
|
|
11
11
|
``` ruby
|
12
|
-
group :development
|
13
|
-
gem 'rconsole', '~> 0.1.
|
12
|
+
group :development do
|
13
|
+
gem 'rconsole', '~> 0.1.1'
|
14
14
|
end
|
15
15
|
```
|
16
16
|
|
@@ -23,6 +23,12 @@ your layout view:
|
|
23
23
|
javascript_include_tag(:rconsole) if Rails.env.development?
|
24
24
|
```
|
25
25
|
|
26
|
+
or simply (only for Rails):
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
javascript_include_rconsole_tag
|
30
|
+
```
|
31
|
+
|
26
32
|
Really easy!
|
27
33
|
|
28
34
|
## Usage
|
@@ -44,10 +50,6 @@ Then you will see the message on your browser console. Just like this:
|
|
44
50
|
|
45
51
|
Enjoy!
|
46
52
|
|
47
|
-
## Contributors
|
48
|
-
|
49
|
-
+ [Sergey Rezvanov](http://github.com/rezwyi)
|
50
|
-
|
51
53
|
## Copyright
|
52
54
|
|
53
|
-
See LICENSE file.
|
55
|
+
See LICENSE file.
|
data/lib/rconsole/engine.rb
CHANGED
data/lib/rconsole/version.rb
CHANGED
@@ -1,23 +1,29 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
if (console && console.log) {
|
2
|
+
var Rconsole = {};
|
3
|
+
XMLHttpRequest.prototype.originOpen = XMLHttpRequest.prototype.open;
|
3
4
|
|
4
|
-
(Rconsole.dump = function() {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
xhr.originOpen('get', '/rconsole.json', false);
|
10
|
-
xhr.send();
|
11
|
-
|
12
|
-
if (xhr.readyState === 4 && xhr.status === 200) {
|
13
|
-
dump = JSON.parse(xhr.responseText);
|
14
|
-
for (i; i < dump.length; i++) console.log(dump[i]);
|
15
|
-
}
|
16
|
-
})();
|
5
|
+
(Rconsole.dump = function() {
|
6
|
+
var xhr = new XMLHttpRequest(),
|
7
|
+
dump = [],
|
8
|
+
i = 0;
|
17
9
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
10
|
+
xhr.originOpen('get', '/rconsole.json', false);
|
11
|
+
xhr.send();
|
12
|
+
|
13
|
+
if (xhr.readyState === 4 && xhr.status === 200) {
|
14
|
+
dump = JSON.parse(xhr.responseText);
|
15
|
+
for (i; i < dump.length; i++) {
|
16
|
+
console.log(dump[i]);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
})();
|
20
|
+
|
21
|
+
XMLHttpRequest.prototype.open = function() {
|
22
|
+
this.addEventListener('readystatechange', function(){
|
23
|
+
if (this.readyState === 4 && this.status === 200) {
|
24
|
+
Rconsole.dump();
|
25
|
+
}
|
26
|
+
});
|
27
|
+
XMLHttpRequest.prototype.originOpen.apply(this, arguments);
|
28
|
+
};
|
23
29
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rconsole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Rezvanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Simple way to print debug messages from ruby code directly to browser
|
14
14
|
console
|
@@ -22,6 +22,7 @@ files:
|
|
22
22
|
- LICENSE
|
23
23
|
- README.md
|
24
24
|
- app/controllers/rconsole_controller.rb
|
25
|
+
- app/helpers/rconsole_helper.rb
|
25
26
|
- config/routes.rb
|
26
27
|
- lib/rconsole.rb
|
27
28
|
- lib/rconsole/base.rb
|
@@ -51,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
52
|
version: '0'
|
52
53
|
requirements: []
|
53
54
|
rubyforge_project:
|
54
|
-
rubygems_version: 2.0.
|
55
|
+
rubygems_version: 2.0.6
|
55
56
|
signing_key:
|
56
57
|
specification_version: 4
|
57
58
|
summary: Simple way to print debug messages from ruby code directly to browser console
|