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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f111f1a460d9cbad9e6a206200f6528b37c7af5
4
- data.tar.gz: f008b090fd1b3a110ba240f9e4e10ebef59e4e3e
3
+ metadata.gz: 632b06b4dacdfb12cda321a8e827d2790207a960
4
+ data.tar.gz: e568662618b04ffef0609818544f40ef9781dd07
5
5
  SHA512:
6
- metadata.gz: '0469d96b86f876f1d6d83806baebd09e13dc3c67fe74b4ebbdefd82718486c360f9024e2d9a24654cf36b9484df96ee369ab9a19b8c5d663896dcb7c09a23123'
7
- data.tar.gz: 8223bdbdd742c950f68385281ff215846c23d9116a75b06f221c2d68d0abee80a9ce31696586ff19aa308dc42488919323077dd389bc52589f69a38e9eeab293
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:
@@ -1,3 +1,3 @@
1
1
  module DeLogger
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -1 +1 @@
1
- (function(){var t=[].slice;this.DeLogger=function(){function e(t){var e,o;null==t&&(t={}),e=t.disabled||!1,o=null==t.formatStrings||t.formatStrings,this.settings={disabled:e,formatStrings:o}}var o,n,r;return e.prototype.log=function(){return this.print.apply(this,["log"].concat(t.call(arguments)))},e.prototype.info=function(){return this.print.apply(this,["info"].concat(t.call(arguments)))},e.prototype.debug=function(){return this.print.apply(this,["debug"].concat(t.call(arguments)))},e.prototype.warn=function(){return this.print.apply(this,["warn"].concat(t.call(arguments)))},e.prototype.error=function(){return this.print.apply(this,["error"].concat(t.call(arguments)))},e.prototype.enable=function(){return localStorage.setItem("deloggerEnabled",!0)},e.prototype.disable=function(){return localStorage.removeItem("deloggerEnabled")},e.prototype.focus=function(){return arguments.length<1?localStorage.setItem("deloggerFocus",!0):this.print.apply(this,["focus"].concat(t.call(arguments)))},e.prototype.unfocus=function(){return localStorage.removeItem("deloggerFocus")},e.prototype.print=function(){var e,r,l,a,c,i,u,p,s,g,d;if(i=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],this.canPrint(i)){for(d="",g=[],l=0,"focus"===i&&(d+="%cFOCUS%c ",g.push(o("badge blue bold")),g.push(o("default"))),a=0,c=r.length;a<c&&(e=r[a],"string"==typeof e&&this.settings.formatStrings);a++)u=n(e),p=u[0],s=u[1],d+=p,g.push.apply(g,s),l+=1;return r.splice(0,l),"focus"===i&&(i="log"),console[i].apply(console,[d].concat(t.call(g),t.call(r)))}},e.prototype.canPrint=function(t){return!this.settings.disabled&&null!=localStorage.deloggerEnabled&&("focus"===t||null==localStorage.deloggerFocus)},n=function(t){var e,n,r;for(e=[],r=/\(([^\(\)]+)\)(\.[\.\w]+)/;n=t.match(r);)e.push(o(n[2].split(".").join(" "))),e.push(o("default")),t=t.replace(r,"%c"+n[1]+"%c");return[t,e]},o=function(t){var e,o,n,l;return o=document.createElement("div"),o.id="delogger",o.className=t,o.style="display: none;",document.getElementsByTagName("body")[0].appendChild(o),e=getComputedStyle(o),l=function(){var t,o,l;for(l=[],t=0,o=r.length;t<o;t++)n=r[t],l.push(n+":"+e.getPropertyValue(n));return l}().join(";"),o.parentNode.removeChild(o),l},r=["margin-right","color","background-color","border-radius","padding","font-weight","font-style"],e}()}).call(this);
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.0
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-06 00:00:00.000000000 Z
11
+ date: 2017-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler