sprockets-illusionist 0.0.1 → 0.0.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 171987302d4fbf78eedcd397cb70d687da9af4ce
|
4
|
+
data.tar.gz: 9887933990182998b6b90abc45ceafab683d63d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa841fa874664c7d16a3771523fc97dcc4a0d43692475cb5839e4334603b818867d355e8a2bff0a2be914248d871aabc646256c36ce929360c8633bd289c6883
|
7
|
+
data.tar.gz: 592b00fe9038ec624cd578dd47886333d169ee299fb5560e273d3a62a8d36c58c704640c1e45b114aa6e11ed187e688f6fda0c3d18b95e92f17f3273f8125e04
|
data/README.md
CHANGED
@@ -35,6 +35,10 @@ Create an initializer:
|
|
35
35
|
```ruby
|
36
36
|
SprocketsIllusionist::Config.configure do |config|
|
37
37
|
config.base_path = Rails.root.join('app', 'assets', 'javascripts')
|
38
|
+
|
39
|
+
# You can also choose which module format you want.
|
40
|
+
# 'amd' is the default, other options are: 'cjs' and 'globals'
|
41
|
+
config.module_type = 'amd'
|
38
42
|
end
|
39
43
|
```
|
40
44
|
|
@@ -61,6 +65,6 @@ See the [`LICENSE.md`](https://github.com/mirego/sprockets-illusionist/blob/mast
|
|
61
65
|
|
62
66
|
## About Mirego
|
63
67
|
|
64
|
-
Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We
|
68
|
+
[Mirego](http://mirego.com) is a team of passionate people who believe that work is a place where you can innovate and have fun. We're a team of [talented people](http://life.mirego.com) who imagine and build beautiful Web and mobile applications. We come together to share ideas and [change the world](http://mirego.org).
|
65
69
|
|
66
|
-
We also love
|
70
|
+
We also [love open-source software](http://open.mirego.com) and we try to give back to the community as much as we can.
|
@@ -6,6 +6,16 @@ module SprocketsIllusionist
|
|
6
6
|
class IllusionistTemplate < Tilt::Template
|
7
7
|
self.default_mime_type = 'application/javascript'
|
8
8
|
|
9
|
+
def prepare
|
10
|
+
end
|
11
|
+
|
12
|
+
def evaluate(scope, locals, &block)
|
13
|
+
stdout, _stderr, _status = Open3.capture3("illusionist #{option_string_from_config}", stdin_data: data)
|
14
|
+
stdout
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
9
19
|
def amd_module_name
|
10
20
|
base_path = SprocketsIllusionist::Config.base_path
|
11
21
|
file_name = File.basename(file, '.js.es6')
|
@@ -24,12 +34,15 @@ module SprocketsIllusionist
|
|
24
34
|
end
|
25
35
|
end
|
26
36
|
|
27
|
-
def
|
28
|
-
|
37
|
+
def option_string_from_config
|
38
|
+
module_type = SprocketsIllusionist::Config.try(:module_type)
|
39
|
+
options = ["-m #{amd_module_name}"]
|
29
40
|
|
30
|
-
|
31
|
-
|
32
|
-
|
41
|
+
if (!module_type.nil? && %w(amd cjs globals).include?(module_type))
|
42
|
+
options << "-M #{module_type}"
|
43
|
+
end
|
44
|
+
|
45
|
+
options.join(' ')
|
33
46
|
end
|
34
47
|
end
|
35
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-illusionist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Demers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|