delogger 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/delogger/version.rb +1 -1
- data/vendor/assets/javascripts/delogger.js +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 632b06b4dacdfb12cda321a8e827d2790207a960
|
4
|
+
data.tar.gz: e568662618b04ffef0609818544f40ef9781dd07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1065527da6920ea8ae66b544682e61cf7a23f45af7bc7da27d34d1d5562876de257b80504c06c756f726c2731e196813513280d6ca2ce03cada4c744ced53b5
|
7
|
+
data.tar.gz: 81cb7dae6a5d3ea6636bffb94022b489e154c1d5bc959fefa88d864b76ab0f8c3d8792ea6759ddba76874e7a5612528aa51a9242f3a7021be1deded98d96a6de
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ This gem is a simple wrapper for the browser's console. It can be turned off bot
|
|
14
14
|
|
15
15
|
Add the gem to your Gemfile:
|
16
16
|
```ruby
|
17
|
-
gem 'delogger'
|
17
|
+
gem 'delogger', '~> 0.3.0'
|
18
18
|
```
|
19
19
|
|
20
20
|
Add this to your `application.js`:
|
@@ -54,6 +54,9 @@ DeLogger supports same output methods as console:
|
|
54
54
|
|
55
55
|
![error](/images/error.png?raw=true)
|
56
56
|
|
57
|
+
Also supported: `log`, `assert`, `count`, `dir`, `dirxml`, `group`, `groupCollapsed`, `groupEnd`,
|
58
|
+
`profile`, `time`, `timeEnd`, `trace`.
|
59
|
+
|
57
60
|
### Options
|
58
61
|
|
59
62
|
You can pass options to DeLogger upon initialization:
|
data/lib/delogger/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
(function(){var t=[].slice;this.DeLogger=function(){function
|
1
|
+
(function(){var t=[].slice;this.DeLogger=function(){function o(t){var o,n;null==t&&(t={}),o=t.disabled||!1,n=null==t.formatStrings||t.formatStrings,this.settings={disabled:o,formatStrings:n}}var n,e,r;return o.prototype.log=function(){return this.print.apply(this,["log"].concat(t.call(arguments)))},o.prototype.info=function(){return this.print.apply(this,["info"].concat(t.call(arguments)))},o.prototype.debug=function(){return this.print.apply(this,["debug"].concat(t.call(arguments)))},o.prototype.warn=function(){return this.print.apply(this,["warn"].concat(t.call(arguments)))},o.prototype.error=function(){return this.print.apply(this,["error"].concat(t.call(arguments)))},o.prototype.group=function(){return this.print.apply(this,["group"].concat(t.call(arguments)))},o.prototype.groupCollapsed=function(){return this.print.apply(this,["groupCollapsed"].concat(t.call(arguments)))},o.prototype.groupEnd=function(){if(this.canPrint)return console.groupEnd.apply(console)},o.prototype.assert=function(){if(this.canPrint)return console.assert.apply(console,arguments)},o.prototype.count=function(){if(this.canPrint)return console.count.apply(console,arguments)},o.prototype.dir=function(){if(this.canPrint)return console.dir.apply(console,arguments)},o.prototype.dirxml=function(){if(this.canPrint)return console.dirxml.apply(console,arguments)},o.prototype.profile=function(){if(this.canPrint)return console.profile.apply(console,arguments)},o.prototype.time=function(){if(this.canPrint)return console.time.apply(console,arguments)},o.prototype.timeEnd=function(){if(this.canPrint)return console.timeEnd.apply(console)},o.prototype.trace=function(){if(this.canPrint)return console.trace.apply(console,arguments)},o.prototype.enable=function(){return localStorage.setItem("deloggerEnabled",!0)},o.prototype.disable=function(){return localStorage.removeItem("deloggerEnabled")},o.prototype.focus=function(){return arguments.length<1?localStorage.setItem("deloggerFocus",!0):this.print.apply(this,["focus"].concat(t.call(arguments)))},o.prototype.unfocus=function(){return localStorage.removeItem("deloggerFocus")},o.prototype.print=function(){var o,r,l,i,c,p,a,s,u,f,g;if(p=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],this.canPrint(p)){for(g="",f=[],l=0,"focus"===p&&(g+="%cFOCUS%c ",f.push(n("badge blue bold")),f.push(n("default"))),i=0,c=r.length;i<c&&(o=r[i],"string"==typeof o&&this.settings.formatStrings);i++)a=e(o),s=a[0],u=a[1],g+=s,f.push.apply(f,u),l+=1;return r.splice(0,l),"focus"===p&&(p="log"),console[p].apply(console,[g].concat(t.call(f),t.call(r)))}},o.prototype.canPrint=function(t){return!this.settings.disabled&&null!=localStorage.deloggerEnabled&&("focus"===t||null==localStorage.deloggerFocus)},e=function(t){var o,e,r;for(o=[],r=/\(([^\(\)]+)\)(\.[\.\w]+)/;e=t.match(r);)o.push(n(e[2].split(".").join(" "))),o.push(n("default")),t=t.replace(r,"%c"+e[1]+"%c");return[t,o]},n=function(t){var o,n,e,l;return n=document.createElement("div"),n.id="delogger",n.className=t,n.style="display: none;",document.getElementsByTagName("body")[0].appendChild(n),o=getComputedStyle(n),l=function(){var t,n,l;for(l=[],t=0,n=r.length;t<n;t++)e=r[t],l.push(e+":"+o.getPropertyValue(e));return l}().join(";"),n.parentNode.removeChild(n),l},r=["margin-right","color","background-color","border-radius","padding","font-weight","font-style"],o}()}).call(this);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delogger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Komarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|