js_cookie_rails 1.0.0 → 1.0.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: df553567f665ae977943d0c638244208a8002ebd
4
- data.tar.gz: 4f52a2847c86b097b4b76005eef533b209f23812
3
+ metadata.gz: 53b2b3d3ccd0ceb563197aeab2d768e41b349e27
4
+ data.tar.gz: 4da74e08f84e577e6f6c5ed4e7222b0b9648c1ae
5
5
  SHA512:
6
- metadata.gz: cc9ffe4fe8303f95bb34fa98342ddbd9f5a0ccf542bda45345204b9b02acc16a1107f9b2c474a5598742890c228acf047603972d2fc73f89902aae688a02c0ef
7
- data.tar.gz: 0595ff0d1450951d778b3da2044c78ca408a52b35947098738a9a086513725c29a469c9d6d96afcd19cc8e10ca2aa36247f9a73a0296a40d5e1163f584d44214
6
+ metadata.gz: 9052a0d4ed9fa0ae88c17e390acfa8cd39db8e8fac0c2a26009498b79f5ecf60ef392a389af9aa2ba4314b161c1e17a52eedd030fc8dcc3e3da812e6506ca84c
7
+ data.tar.gz: c41c5331635aaaa6642fbb18705ae1ebbedd55a919ca16253331927485b3e78a62283239bcb4745c65c8d782182bc531329b3ab7259549d3e5c4e773c97dd701
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
@@ -1,3 +1,3 @@
1
1
  module JsCookieRails
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * JavaScript Cookie v2.0.0-pre
2
+ * JavaScript Cookie v2.0.3
3
3
  * https://github.com/js-cookie/js-cookie
4
4
  *
5
- * Copyright 2006, 2015 Klaus Hartl
5
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
6
6
  * Released under the MIT license
7
7
  */
8
8
  (function (factory) {
@@ -12,7 +12,7 @@
12
12
  module.exports = factory();
13
13
  } else {
14
14
  var _OldCookies = window.Cookies;
15
- var api = window.Cookies = factory(window.jQuery);
15
+ var api = window.Cookies = factory();
16
16
  api.noConflict = function () {
17
17
  window.Cookies = _OldCookies;
18
18
  return api;
@@ -67,7 +67,7 @@
67
67
  attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE
68
68
  attributes.path && '; path=' + attributes.path,
69
69
  attributes.domain && '; domain=' + attributes.domain,
70
- attributes.secure && '; secure'
70
+ attributes.secure ? '; secure' : ''
71
71
  ].join(''));
72
72
  }
73
73
 
@@ -93,22 +93,24 @@
93
93
  cookie = cookie.slice(1, -1);
94
94
  }
95
95
 
96
- cookie = converter && converter(cookie, name) || cookie.replace(rdecode, decodeURIComponent);
96
+ try {
97
+ cookie = converter && converter(cookie, name) || cookie.replace(rdecode, decodeURIComponent);
97
98
 
98
- if (this.json) {
99
- try {
100
- cookie = JSON.parse(cookie);
101
- } catch (e) {}
102
- }
99
+ if (this.json) {
100
+ try {
101
+ cookie = JSON.parse(cookie);
102
+ } catch (e) {}
103
+ }
103
104
 
104
- if (key === name) {
105
- result = cookie;
106
- break;
107
- }
105
+ if (key === name) {
106
+ result = cookie;
107
+ break;
108
+ }
108
109
 
109
- if (!key) {
110
- result[name] = cookie;
111
- }
110
+ if (!key) {
111
+ result[name] = cookie;
112
+ }
113
+ } catch (e) {}
112
114
  }
113
115
 
114
116
  return result;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js_cookie_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Lepore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2015-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties