ember-auth-session-cookie-source 1.0.0
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 +7 -0
- data/dist/ember-auth-session-cookie.js +121 -0
- data/lib/ember/auth/session/cookie/source.rb +15 -0
- metadata +74 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e9e092e755d74fda135227d69740fc47be1ca01b
|
4
|
+
data.tar.gz: b010cb1a4a854faf8f2c1056904079811a2bc258
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 28d1da0ec802c48a2b9759ae19e32deeb2a6a72fc869439e57d686e8b11c6e1895c084cd893be545dc04a412c95013c30d68b03cee6cf25f3874e130cfb55e2b
|
7
|
+
data.tar.gz: 4f5881d4321fdaa33fd86e878f7dbd7dc0842b0605fe3e00e1dcfbfd55c3cd95692b23c701b1ec9edf4de909618328654d0e717d84fcba2255ce39b2fb3ec111
|
@@ -0,0 +1,121 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery Cookie Plugin v1.3.1
|
3
|
+
* https://github.com/carhartl/jquery-cookie
|
4
|
+
*
|
5
|
+
* Copyright 2013 Klaus Hartl
|
6
|
+
* Released under the MIT license
|
7
|
+
*/
|
8
|
+
|
9
|
+
(function (factory) {
|
10
|
+
if (typeof define === 'function' && define.amd && define.amd.jQuery) {
|
11
|
+
// AMD. Register as anonymous module.
|
12
|
+
define(['jquery'], factory);
|
13
|
+
} else {
|
14
|
+
// Browser globals.
|
15
|
+
factory(jQuery);
|
16
|
+
}
|
17
|
+
}(function ($) {
|
18
|
+
|
19
|
+
var pluses = /\+/g;
|
20
|
+
|
21
|
+
function raw(s) {
|
22
|
+
return s;
|
23
|
+
}
|
24
|
+
|
25
|
+
function decoded(s) {
|
26
|
+
return decodeURIComponent(s.replace(pluses, ' '));
|
27
|
+
}
|
28
|
+
|
29
|
+
function converted(s) {
|
30
|
+
if (s.indexOf('"') === 0) {
|
31
|
+
// This is a quoted cookie as according to RFC2068, unescape
|
32
|
+
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
33
|
+
}
|
34
|
+
try {
|
35
|
+
return config.json ? JSON.parse(s) : s;
|
36
|
+
} catch(er) {}
|
37
|
+
}
|
38
|
+
|
39
|
+
var config = $.cookie = function (key, value, options) {
|
40
|
+
|
41
|
+
// write
|
42
|
+
if (value !== undefined) {
|
43
|
+
options = $.extend({}, config.defaults, options);
|
44
|
+
|
45
|
+
if (typeof options.expires === 'number') {
|
46
|
+
var days = options.expires, t = options.expires = new Date();
|
47
|
+
t.setDate(t.getDate() + days);
|
48
|
+
}
|
49
|
+
|
50
|
+
value = config.json ? JSON.stringify(value) : String(value);
|
51
|
+
|
52
|
+
return (document.cookie = [
|
53
|
+
encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
|
54
|
+
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
55
|
+
options.path ? '; path=' + options.path : '',
|
56
|
+
options.domain ? '; domain=' + options.domain : '',
|
57
|
+
options.secure ? '; secure' : ''
|
58
|
+
].join(''));
|
59
|
+
}
|
60
|
+
|
61
|
+
// read
|
62
|
+
var decode = config.raw ? raw : decoded;
|
63
|
+
var cookies = document.cookie.split('; ');
|
64
|
+
var result = key ? undefined : {};
|
65
|
+
for (var i = 0, l = cookies.length; i < l; i++) {
|
66
|
+
var parts = cookies[i].split('=');
|
67
|
+
var name = decode(parts.shift());
|
68
|
+
var cookie = decode(parts.join('='));
|
69
|
+
|
70
|
+
if (key && key === name) {
|
71
|
+
result = converted(cookie);
|
72
|
+
break;
|
73
|
+
}
|
74
|
+
|
75
|
+
if (!key) {
|
76
|
+
result[name] = converted(cookie);
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
return result;
|
81
|
+
};
|
82
|
+
|
83
|
+
config.defaults = {};
|
84
|
+
|
85
|
+
$.removeCookie = function (key, options) {
|
86
|
+
if ($.cookie(key) !== undefined) {
|
87
|
+
$.cookie(key, '', $.extend(options, { expires: -1 }));
|
88
|
+
return true;
|
89
|
+
}
|
90
|
+
return false;
|
91
|
+
};
|
92
|
+
|
93
|
+
}));
|
94
|
+
// Generated by EmberScript 0.0.7
|
95
|
+
var get$ = Ember.get;
|
96
|
+
Em.onLoad('Ember.Application', function (application) {
|
97
|
+
return application.initializer({
|
98
|
+
name: 'ember-auth.session.cookie',
|
99
|
+
before: 'ember-auth-load',
|
100
|
+
initialize: function (container, app) {
|
101
|
+
return app.register('authSession:cookie', get$(get$(Em, 'Auth'), 'CookieAuthSession'));
|
102
|
+
}
|
103
|
+
});
|
104
|
+
});// Generated by EmberScript 0.0.7
|
105
|
+
void function () {
|
106
|
+
var $;
|
107
|
+
var get$ = Ember.get;
|
108
|
+
var set$ = Ember.set;
|
109
|
+
$ = jQuery;
|
110
|
+
set$(get$(Em, 'Auth'), 'CookieAuthSession', get$(get$(Em, 'Auth'), 'AuthSession').extend({
|
111
|
+
retrieve: function (key, opts) {
|
112
|
+
return $.cookie(key);
|
113
|
+
},
|
114
|
+
store: function (key, value, opts) {
|
115
|
+
return $.cookie(key, value, $.extend(true, { path: '/' }, opts));
|
116
|
+
},
|
117
|
+
remove: function (key, opts) {
|
118
|
+
return $.removeCookie(key, $.extend(true, { path: '/' }, opts));
|
119
|
+
}
|
120
|
+
}));
|
121
|
+
}.call(this);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Ember
|
2
|
+
module Auth
|
3
|
+
module Session
|
4
|
+
module Cookie
|
5
|
+
module Source
|
6
|
+
def self.bundled_path
|
7
|
+
path = File.join '..', '..', '..', '..', '..', '..', \
|
8
|
+
'dist', 'ember-auth-session-cookie.js'
|
9
|
+
File.expand_path path, __FILE__
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ember-auth-session-cookie-source
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- heartsentwined
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ember-source
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ember-auth-source
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '9.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '9.0'
|
41
|
+
description: Ember-auth cookie session adapter source code wrapper for ruby libs.
|
42
|
+
email:
|
43
|
+
- heartsentwined.me@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- dist/ember-auth-session-cookie.js
|
49
|
+
- lib/ember/auth/session/cookie/source.rb
|
50
|
+
homepage: https://github.com/heartsentwined/ember-auth-session-cookie
|
51
|
+
licenses:
|
52
|
+
- MIT
|
53
|
+
metadata: {}
|
54
|
+
post_install_message:
|
55
|
+
rdoc_options: []
|
56
|
+
require_paths:
|
57
|
+
- lib
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
requirements: []
|
69
|
+
rubyforge_project:
|
70
|
+
rubygems_version: 2.0.3
|
71
|
+
signing_key:
|
72
|
+
specification_version: 4
|
73
|
+
summary: Ember-auth cookie session adapter source code wrapper
|
74
|
+
test_files: []
|