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.
@@ -1,9 +1,21 @@
1
- require "livescript/source/version"
1
+ require_relative 'source/version'
2
2
 
3
3
  module LiveScript
4
4
  module Source
5
5
  def self.bundled_path
6
- File.expand_path("../livescript.js", __FILE__)
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
@@ -1,5 +1,5 @@
1
- module Livescript
1
+ module LiveScript
2
2
  module Source
3
- VERSION = "1.2.0"
3
+ VERSION = '1.4.0.rc.1'
4
4
  end
5
5
  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.2.0
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: 2014-02-12 00:00:00.000000000 Z
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.5'
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.5'
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: '0'
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: '0'
42
- description: "LiveScript is a language which compiles to JavaScript. \n It is a
43
- fork of Coco which is in turn derived from CoffeeScript. \n Like those two it
44
- has a relatively straightforward mapping to JavaScript. \n LiveScript is Coco
45
- but much more compatible with CoffeeScript, \n more functional, and more feature
46
- rich. \n LiveScript aims for increased expressiveness and code beauty.\n "
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: '0'
110
+ version: 1.3.1
75
111
  requirements: []
76
112
  rubyforge_project:
77
- rubygems_version: 2.2.1
113
+ rubygems_version: 2.5.1
78
114
  signing_key:
79
115
  specification_version: 4
80
- summary: Provide a compiler for Livescript.
116
+ summary: Wrapper of LiveScript official node.js compiler.
81
117
  test_files: []
118
+ has_rdoc: