ember_script 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -1
- data/Gemfile.lock +8 -2
- data/README.md +1 -17
- data/ember_script.gemspec +2 -0
- data/lib/ember_script/version.rb +1 -1
- data/lib/ember_script.rb +17 -8
- data/spec/ember_script_spec.rb +4 -0
- metadata +34 -2
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ember_script (0.0.
|
4
|
+
ember_script (0.0.4)
|
5
|
+
ember_script-source (>= 0.0.2)
|
6
|
+
execjs
|
5
7
|
tilt
|
6
8
|
|
7
9
|
GEM
|
8
10
|
remote: http://rubygems.org/
|
9
11
|
specs:
|
10
12
|
diff-lcs (1.1.3)
|
13
|
+
ember_script-source (0.0.2)
|
14
|
+
execjs (1.4.0)
|
15
|
+
multi_json (~> 1.0)
|
16
|
+
multi_json (1.7.2)
|
11
17
|
rspec (2.12.0)
|
12
18
|
rspec-core (~> 2.12.0)
|
13
19
|
rspec-expectations (~> 2.12.0)
|
@@ -16,7 +22,7 @@ GEM
|
|
16
22
|
rspec-expectations (2.12.0)
|
17
23
|
diff-lcs (~> 1.1.3)
|
18
24
|
rspec-mocks (2.12.0)
|
19
|
-
tilt (1.3.
|
25
|
+
tilt (1.3.6)
|
20
26
|
|
21
27
|
PLATFORMS
|
22
28
|
ruby
|
data/README.md
CHANGED
@@ -6,24 +6,8 @@ Provides a lightweight ruby wrapper around [EmberScript](https://github.com/ghem
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
This gem requires that an `ember-script` command be available in the current path. Being as EmberScript is still in early development, it is best to install via npm from git. After installing [Node.js](http://nodejs.org/), run the following command:
|
10
|
-
|
11
|
-
```
|
12
|
-
sudo npm install -g 'git://github.com/ghempton/ember-script.git#HEAD'
|
13
|
-
```
|
14
|
-
|
15
|
-
## Rails Integration
|
16
|
-
|
17
|
-
After following the installation instructions above, simply add the following to your gemfile:
|
18
|
-
|
19
|
-
```
|
20
|
-
gem 'ember_script-rails'
|
21
|
-
```
|
22
|
-
|
23
|
-
## Plain Ruby
|
24
|
-
|
25
9
|
```
|
26
|
-
gem
|
10
|
+
gem install ember_script
|
27
11
|
```
|
28
12
|
|
29
13
|
## Contributing to EmberScript-Ruby
|
data/ember_script.gemspec
CHANGED
data/lib/ember_script/version.rb
CHANGED
data/lib/ember_script.rb
CHANGED
@@ -1,24 +1,33 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
require 'execjs'
|
3
4
|
require 'tilt'
|
4
|
-
require 'open3'
|
5
5
|
|
6
|
+
require 'ember_script/source'
|
6
7
|
require 'ember_script/version'
|
7
8
|
|
8
9
|
module EmberScript
|
9
10
|
|
10
|
-
|
11
|
-
def
|
11
|
+
module Source
|
12
|
+
def self.path
|
13
|
+
@path ||= ENV['EMBERSCRIPT_SOURCE_PATH'] || bundled_path
|
12
14
|
end
|
13
15
|
|
14
|
-
def
|
16
|
+
def self.contents
|
17
|
+
@contents ||= File.read(path)
|
15
18
|
end
|
16
19
|
|
17
|
-
def version
|
18
|
-
|
20
|
+
def self.version
|
21
|
+
Source.context.eval("EmberScript.VERSION")
|
19
22
|
end
|
20
23
|
|
21
|
-
|
24
|
+
def self.context
|
25
|
+
@context ||= ExecJS.compile(contents)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class << self
|
30
|
+
# Compile an EmberScript file to JavaScript
|
22
31
|
# or generate the source maps.
|
23
32
|
#
|
24
33
|
# @param [String,#read] the source string or IO
|
@@ -37,7 +46,7 @@ module EmberScript
|
|
37
46
|
end
|
38
47
|
bare = options[:bare] ? "--bare" : ""
|
39
48
|
|
40
|
-
|
49
|
+
Source.context.call("EmberScript.em2js", script, options)
|
41
50
|
end
|
42
51
|
end
|
43
52
|
|
data/spec/ember_script_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember_script
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: tilt
|
@@ -27,6 +27,38 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: execjs
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: ember_script-source
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.0.2
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.0.2
|
30
62
|
- !ruby/object:Gem::Dependency
|
31
63
|
name: rspec
|
32
64
|
requirement: !ruby/object:Gem::Requirement
|