livescript-source 1.2.0 → 1.4.0.rc.1
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 +4 -4
- data/LICENSE +23 -0
- data/README.md +48 -0
- data/Rakefile +8 -0
- data/lib/livescript/livescript.js +13986 -4
- data/lib/livescript/source.rb +14 -2
- data/lib/livescript/source/version.rb +2 -2
- data/test/test_livescript_source.rb +17 -0
- metadata +55 -18
data/lib/livescript/source.rb
CHANGED
@@ -1,9 +1,21 @@
|
|
1
|
-
|
1
|
+
require_relative 'source/version'
|
2
2
|
|
3
3
|
module LiveScript
|
4
4
|
module Source
|
5
5
|
def self.bundled_path
|
6
|
-
|
6
|
+
raise 'livescript-source >= 1.4.0 only work with livescript-ruby >= 2.3.0!'
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.raw_contents
|
10
|
+
filepath = File.expand_path('../livescript.js', __FILE__)
|
11
|
+
File.read filepath
|
12
|
+
end
|
13
|
+
|
14
|
+
# contents that expose LiveScript.compile
|
15
|
+
def self.contents
|
16
|
+
filepath = File.expand_path('../livescript.js', __FILE__)
|
17
|
+
# LiveScript >= 1.3 does not expose `LiveScript`
|
18
|
+
File.read(filepath) + "var LiveScript = require('LiveScript');"
|
7
19
|
end
|
8
20
|
end
|
9
21
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'execjs'
|
3
|
+
require 'livescript/source'
|
4
|
+
|
5
|
+
class LiveScriptSourceTest < Minitest::Test
|
6
|
+
def test_contents
|
7
|
+
refute_empty LiveScript::Source.contents
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_compile
|
11
|
+
context = ExecJS.compile LiveScript::Source.contents
|
12
|
+
options = {bare: true, header: false}
|
13
|
+
assert_equal 'alert(1);', context.call('LiveScript.compile', 'alert 1', options)
|
14
|
+
assert_equal 'add(1, 2);', context.call('LiveScript.compile', 'add 1, 2', options)
|
15
|
+
assert_equal %Q{(function(x, y){\n return x + y;\n});}, context.call('LiveScript.compile', '(x, y) -> x + y', options)
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: livescript-source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Hugo Borja
|
8
8
|
- tomchentw
|
9
|
+
- Bian Jiaping
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2016-04-23 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: bundler
|
@@ -17,48 +18,83 @@ dependencies:
|
|
17
18
|
requirements:
|
18
19
|
- - "~>"
|
19
20
|
- !ruby/object:Gem::Version
|
20
|
-
version: '1.
|
21
|
+
version: '1.11'
|
21
22
|
type: :development
|
22
23
|
prerelease: false
|
23
24
|
version_requirements: !ruby/object:Gem::Requirement
|
24
25
|
requirements:
|
25
26
|
- - "~>"
|
26
27
|
- !ruby/object:Gem::Version
|
27
|
-
version: '1.
|
28
|
+
version: '1.11'
|
28
29
|
- !ruby/object:Gem::Dependency
|
29
30
|
name: rake
|
30
31
|
requirement: !ruby/object:Gem::Requirement
|
31
32
|
requirements:
|
32
|
-
- - "
|
33
|
+
- - "~>"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '11.1'
|
36
|
+
type: :development
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '11.1'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: minitest
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '5.8'
|
50
|
+
type: :development
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
33
55
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
56
|
+
version: '5.8'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: execjs
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '2.6'
|
35
64
|
type: :development
|
36
65
|
prerelease: false
|
37
66
|
version_requirements: !ruby/object:Gem::Requirement
|
38
67
|
requirements:
|
39
|
-
- - "
|
68
|
+
- - "~>"
|
40
69
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
42
|
-
description: "LiveScript is a language which compiles to JavaScript
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
70
|
+
version: '2.6'
|
71
|
+
description: "LiveScript is a language which compiles to JavaScript.\n It has a
|
72
|
+
straightforward mapping to JavaScript and allows you to write expressive code devoid
|
73
|
+
of repetitive boilerplate.\n While LiveScript adds many features to assist in
|
74
|
+
functional style programming,\n it also has many improvements for object oriented
|
75
|
+
and imperative programming.\n "
|
47
76
|
email:
|
48
77
|
- vic.borja@gmail.com
|
49
78
|
- developer@tomchentw.com
|
79
|
+
- ssbianjp@gmail.com
|
50
80
|
executables: []
|
51
81
|
extensions: []
|
52
82
|
extra_rdoc_files: []
|
53
83
|
files:
|
84
|
+
- LICENSE
|
85
|
+
- README.md
|
86
|
+
- Rakefile
|
54
87
|
- lib/livescript/livescript.js
|
55
88
|
- lib/livescript/source.rb
|
56
89
|
- lib/livescript/source/version.rb
|
90
|
+
- test/test_livescript_source.rb
|
57
91
|
homepage: https://github.com/Roonin-mx/livescript-source
|
58
92
|
licenses:
|
59
93
|
- MIT
|
60
94
|
metadata: {}
|
61
|
-
post_install_message:
|
95
|
+
post_install_message: |-
|
96
|
+
Notice:
|
97
|
+
livescript-source >= 1.4.0 only work with livescript-ruby >= 2.3.0
|
62
98
|
rdoc_options: []
|
63
99
|
require_paths:
|
64
100
|
- lib
|
@@ -69,13 +105,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
105
|
version: '0'
|
70
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
107
|
requirements:
|
72
|
-
- - "
|
108
|
+
- - ">"
|
73
109
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
110
|
+
version: 1.3.1
|
75
111
|
requirements: []
|
76
112
|
rubyforge_project:
|
77
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.5.1
|
78
114
|
signing_key:
|
79
115
|
specification_version: 4
|
80
|
-
summary:
|
116
|
+
summary: Wrapper of LiveScript official node.js compiler.
|
81
117
|
test_files: []
|
118
|
+
has_rdoc:
|