ember-emblem-template 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,192 @@
1
+ var define, requireModule, require, requirejs;
2
+
3
+ (function() {
4
+
5
+ var _isArray;
6
+ if (!Array.isArray) {
7
+ _isArray = function (x) {
8
+ return Object.prototype.toString.call(x) === "[object Array]";
9
+ };
10
+ } else {
11
+ _isArray = Array.isArray;
12
+ }
13
+
14
+ var registry = {}, seen = {};
15
+ var FAILED = false;
16
+
17
+ var uuid = 0;
18
+
19
+ function tryFinally(tryable, finalizer) {
20
+ try {
21
+ return tryable();
22
+ } finally {
23
+ finalizer();
24
+ }
25
+ }
26
+
27
+ function unsupportedModule(length) {
28
+ throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `" + length + "` arguments to define`");
29
+ }
30
+
31
+ var defaultDeps = ['require', 'exports', 'module'];
32
+
33
+ function Module(name, deps, callback, exports) {
34
+ this.id = uuid++;
35
+ this.name = name;
36
+ this.deps = !deps.length && callback.length ? defaultDeps : deps;
37
+ this.exports = exports || { };
38
+ this.callback = callback;
39
+ this.state = undefined;
40
+ this._require = undefined;
41
+ }
42
+
43
+
44
+ Module.prototype.makeRequire = function() {
45
+ var name = this.name;
46
+
47
+ return this._require || (this._require = function(dep) {
48
+ return require(resolve(dep, name));
49
+ });
50
+ }
51
+
52
+ define = function(name, deps, callback) {
53
+ if (arguments.length < 2) {
54
+ unsupportedModule(arguments.length);
55
+ }
56
+
57
+ if (!_isArray(deps)) {
58
+ callback = deps;
59
+ deps = [];
60
+ }
61
+
62
+ registry[name] = new Module(name, deps, callback);
63
+ };
64
+
65
+ // we don't support all of AMD
66
+ // define.amd = {};
67
+ // we will support petals...
68
+ define.petal = { };
69
+
70
+ function Alias(path) {
71
+ this.name = path;
72
+ }
73
+
74
+ define.alias = function(path) {
75
+ return new Alias(path);
76
+ };
77
+
78
+ function reify(mod, name, seen) {
79
+ var deps = mod.deps;
80
+ var length = deps.length;
81
+ var reified = new Array(length);
82
+ var dep;
83
+ // TODO: new Module
84
+ // TODO: seen refactor
85
+ var module = { };
86
+
87
+ for (var i = 0, l = length; i < l; i++) {
88
+ dep = deps[i];
89
+ if (dep === 'exports') {
90
+ module.exports = reified[i] = seen;
91
+ } else if (dep === 'require') {
92
+ reified[i] = mod.makeRequire();
93
+ } else if (dep === 'module') {
94
+ mod.exports = seen;
95
+ module = reified[i] = mod;
96
+ } else {
97
+ reified[i] = requireFrom(resolve(dep, name), name);
98
+ }
99
+ }
100
+
101
+ return {
102
+ deps: reified,
103
+ module: module
104
+ };
105
+ }
106
+
107
+ function requireFrom(name, origin) {
108
+ var mod = registry[name];
109
+ if (!mod) {
110
+ throw new Error('Could not find module `' + name + '` imported from `' + origin + '`');
111
+ }
112
+ return require(name);
113
+ }
114
+
115
+ function missingModule(name) {
116
+ throw new Error('Could not find module ' + name);
117
+ }
118
+ requirejs = require = requireModule = function(name) {
119
+ var mod = registry[name];
120
+
121
+
122
+ if (mod && mod.callback instanceof Alias) {
123
+ mod = registry[mod.callback.name];
124
+ }
125
+
126
+ if (!mod) { missingModule(name); }
127
+
128
+ if (mod.state !== FAILED &&
129
+ seen.hasOwnProperty(name)) {
130
+ return seen[name];
131
+ }
132
+
133
+ var reified;
134
+ var module;
135
+ var loaded = false;
136
+
137
+ seen[name] = { }; // placeholder for run-time cycles
138
+
139
+ tryFinally(function() {
140
+ reified = reify(mod, name, seen[name]);
141
+ module = mod.callback.apply(this, reified.deps);
142
+ loaded = true;
143
+ }, function() {
144
+ if (!loaded) {
145
+ mod.state = FAILED;
146
+ }
147
+ });
148
+
149
+ var obj;
150
+ if (module === undefined && reified.module.exports) {
151
+ obj = reified.module.exports;
152
+ } else {
153
+ obj = seen[name] = module;
154
+ }
155
+
156
+ if (obj !== null &&
157
+ (typeof obj === 'object' || typeof obj === 'function') &&
158
+ obj['default'] === undefined) {
159
+ obj['default'] = obj;
160
+ }
161
+
162
+ return (seen[name] = obj);
163
+ };
164
+
165
+ function resolve(child, name) {
166
+ if (child.charAt(0) !== '.') { return child; }
167
+
168
+ var parts = child.split('/');
169
+ var nameParts = name.split('/');
170
+ var parentBase = nameParts.slice(0, -1);
171
+
172
+ for (var i = 0, l = parts.length; i < l; i++) {
173
+ var part = parts[i];
174
+
175
+ if (part === '..') {
176
+ if (parentBase.length === 0) {
177
+ throw new Error('Cannot access parent module of root');
178
+ }
179
+ parentBase.pop();
180
+ } else if (part === '.') { continue; }
181
+ else { parentBase.push(part); }
182
+ }
183
+
184
+ return parentBase.join('/');
185
+ }
186
+
187
+ requirejs.entries = requirejs._eak_seen = registry;
188
+ requirejs.clear = function(){
189
+ requirejs.entries = requirejs._eak_seen = registry = {};
190
+ seen = state = {};
191
+ };
192
+ })();
@@ -0,0 +1 @@
1
+ var Emblem = require('emblem/compiler');
metadata ADDED
@@ -0,0 +1,137 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ember-emblem-template
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Ryunosuke SATO
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sprockets
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '2.1'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '2.1'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: barber
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 0.9.0
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.9.0
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.7'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '1.7'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '10.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '10.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: minitest
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ description: The sprockets template for Ember Emblem.
90
+ email:
91
+ - tricknotes.rs@gmail.com
92
+ executables: []
93
+ extensions: []
94
+ extra_rdoc_files: []
95
+ files:
96
+ - ".gitignore"
97
+ - ".travis.yml"
98
+ - Gemfile
99
+ - LICENSE.txt
100
+ - README.md
101
+ - Rakefile
102
+ - bin/console
103
+ - bin/setup
104
+ - ember-emblem-template.gemspec
105
+ - lib/ember/emblem/config.rb
106
+ - lib/ember/emblem/precompiler.rb
107
+ - lib/ember/emblem/rails.rb
108
+ - lib/ember/emblem/template.rb
109
+ - lib/ember/emblem/version.rb
110
+ - lib/emblem/emblem.amd.js
111
+ - lib/emblem/loader.js
112
+ - lib/emblem/precompiler.js
113
+ homepage: https://github.com/tricknotes/ember-emblem-template
114
+ licenses:
115
+ - MIT
116
+ metadata: {}
117
+ post_install_message:
118
+ rdoc_options: []
119
+ require_paths:
120
+ - lib
121
+ required_ruby_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ required_rubygems_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ requirements: []
132
+ rubyforge_project:
133
+ rubygems_version: 2.2.2
134
+ signing_key:
135
+ specification_version: 4
136
+ summary: The sprockets template for Ember Emblem.
137
+ test_files: []