opal-cj 0.7.0.beta1 → 0.7.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.inch.yml +19 -0
- data/README.md +2 -2
- data/bin/opal +5 -1
- data/lib/opal/cli.rb +5 -3
- data/lib/opal/version.rb +1 -1
- data/opal.gemspec +0 -1
- data/opal/corelib/regexp.rb +7 -2
- data/opal/corelib/runtime.js +1 -9
- metadata +2 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb2973ee564bb9b4596674853843da748da3a01c
|
4
|
+
data.tar.gz: 854ecb9072a230fe3fa74458e4a3584f169af22e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1b1b5f52695d7f10cb506084430bd5dfcf9b98c85cca18a7d40bf9780324a7852874844a724e8736db9b8f5b07c18fa31946bf7f171c33f25976e58e8062b7e
|
7
|
+
data.tar.gz: e35c34b07f47e5d0a67480bc767fb54a0945868b1b1725f401d57ef0698fd0f800b600c1b67a57524e04f2a0536d3b70c92e4f7be2e1e29e06c989207a6c745c
|
data/.inch.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# files:
|
2
|
+
# # define files included in the analysis (defaults to ["{app,lib}/**/*.rb"])
|
3
|
+
# included:
|
4
|
+
# - plugins/**/*.rb
|
5
|
+
# # define files excluded from the analysis (defaults to [])
|
6
|
+
# excluded:
|
7
|
+
# # you can use file paths
|
8
|
+
# - plugins/vendor/sparkr/sparkr.rb
|
9
|
+
# # or globs
|
10
|
+
# - plugins/vendor/**/*.rb
|
11
|
+
# # or regular expressions
|
12
|
+
# - !ruby/regexp /vendor/
|
13
|
+
|
14
|
+
|
15
|
+
files:
|
16
|
+
included:
|
17
|
+
- lib/**/*.rb
|
18
|
+
excluded:
|
19
|
+
- lib/opal/parser/grammar.rb
|
data/README.md
CHANGED
@@ -11,9 +11,9 @@ Opal is [hosted on github](http://github.com/opal/opal), and there
|
|
11
11
|
is a Freenode IRC channel at [#opal](http://webchat.freenode.net/?channels=opal),
|
12
12
|
ask questions on [stackoverflow (tag #opalrb)](http://stackoverflow.com/questions/ask?tags=opalrb).
|
13
13
|
|
14
|
-
[![
|
15
|
-
[![API doc](http://img.shields.io/badge/doc-api-blue.svg?style=flat)](http://opalrb.org/docs/api)
|
14
|
+
[![Inline docs](http://inch-ci.org/github/opal/opal.svg?branch=master&style=flat)](http://opalrb.org/docs/api)
|
16
15
|
[![Gitter chat](http://img.shields.io/badge/gitter-opal%2Fopal-009966.svg?style=flat)](https://gitter.im/opal/opal)
|
16
|
+
[![Stack Overflow](http://img.shields.io/badge/stackoverflow-%23opalrb-orange.svg?style=flat)](http://stackoverflow.com/questions/ask?tags=opalrb)
|
17
17
|
|
18
18
|
|
19
19
|
|
data/bin/opal
CHANGED
@@ -12,7 +12,11 @@ rescue OptionParser::InvalidOption => e
|
|
12
12
|
end
|
13
13
|
|
14
14
|
require 'opal/cli'
|
15
|
-
cli = Opal::CLI.new options.options.merge(
|
15
|
+
cli = Opal::CLI.new options.options.merge(
|
16
|
+
file: ARGF.file,
|
17
|
+
filename: ARGF.filename,
|
18
|
+
argv: ARGV.dup
|
19
|
+
)
|
16
20
|
|
17
21
|
begin
|
18
22
|
cli.run
|
data/lib/opal/cli.rb
CHANGED
@@ -6,7 +6,8 @@ require 'opal/cli_runners'
|
|
6
6
|
module Opal
|
7
7
|
class CLI
|
8
8
|
attr_reader :options, :file, :compiler_options, :evals, :load_paths, :argv,
|
9
|
-
:output, :requires, :gems, :stubs, :verbose, :port, :preload
|
9
|
+
:output, :requires, :gems, :stubs, :verbose, :port, :preload,
|
10
|
+
:filename
|
10
11
|
|
11
12
|
def compile?
|
12
13
|
@compile
|
@@ -44,6 +45,7 @@ module Opal
|
|
44
45
|
@preload = options.delete(:preload) || []
|
45
46
|
@output = options.delete(:output) || self.class.stdout || $stdout
|
46
47
|
@verbose = options.fetch(:verbose, false); options.delete(:verbose)
|
48
|
+
@filename = options.fetch(:filename) { @file && @file.path }; options.delete(:filename)
|
47
49
|
@skip_opal_require = options.delete(:skip_opal_require)
|
48
50
|
@compiler_options = Hash[
|
49
51
|
*processor_option_names.map do |option|
|
@@ -97,8 +99,8 @@ module Opal
|
|
97
99
|
if evals.any?
|
98
100
|
builder.build_str(evals.join("\n"), '-e')
|
99
101
|
else
|
100
|
-
if file and (
|
101
|
-
builder.build_str(file.read,
|
102
|
+
if file and (filename != '-' or evals.empty?)
|
103
|
+
builder.build_str(file.read, filename)
|
102
104
|
end
|
103
105
|
end
|
104
106
|
|
data/lib/opal/version.rb
CHANGED
data/opal.gemspec
CHANGED
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_dependency 'sourcemap', '~> 0.1.0'
|
24
24
|
s.add_dependency 'sprockets', '>= 2.2.1', '< 4.0.0'
|
25
25
|
s.add_dependency 'hike', '~> 1.2'
|
26
|
-
s.add_dependency 'tilt', '~> 1.4'
|
27
26
|
|
28
27
|
s.add_development_dependency 'mspec', '1.5.20'
|
29
28
|
s.add_development_dependency 'rake'
|
data/opal/corelib/regexp.rb
CHANGED
@@ -66,12 +66,17 @@ class Regexp
|
|
66
66
|
|
67
67
|
if (result) {
|
68
68
|
#{$~ = MatchData.new(`re`, `result`)};
|
69
|
+
|
70
|
+
for (var i = 1, ii = result.length; i < ii; i++) {
|
71
|
+
$opal.gvars[String(i)] = result[i];
|
72
|
+
}
|
73
|
+
|
74
|
+
return result.index;
|
69
75
|
}
|
70
76
|
else {
|
71
77
|
#{$~ = $` = $' = nil};
|
78
|
+
return nil;
|
72
79
|
}
|
73
|
-
|
74
|
-
return result ? result.index : nil;
|
75
80
|
}
|
76
81
|
end
|
77
82
|
|
data/opal/corelib/runtime.js
CHANGED
@@ -1048,8 +1048,7 @@
|
|
1048
1048
|
require_table = {'corelib/runtime.js': true},
|
1049
1049
|
modules = {};
|
1050
1050
|
|
1051
|
-
var current_dir = '.'
|
1052
|
-
current_file = '.';
|
1051
|
+
var current_dir = '.';
|
1053
1052
|
|
1054
1053
|
function mark_as_loaded(filename) {
|
1055
1054
|
if (require_table[filename]) {
|
@@ -1085,12 +1084,7 @@
|
|
1085
1084
|
var module = modules[path];
|
1086
1085
|
|
1087
1086
|
if (module) {
|
1088
|
-
var tmp = current_file;
|
1089
|
-
current_file = path;
|
1090
|
-
|
1091
1087
|
module(Opal);
|
1092
|
-
|
1093
|
-
current_file = tmp;
|
1094
1088
|
}
|
1095
1089
|
else {
|
1096
1090
|
var severity = Opal.dynamic_require_severity || 'warning';
|
@@ -1123,8 +1117,6 @@
|
|
1123
1117
|
|
1124
1118
|
Opal.load = load;
|
1125
1119
|
Opal.require = require;
|
1126
|
-
|
1127
|
-
Opal.current_file = current_file;
|
1128
1120
|
})(Opal);
|
1129
1121
|
|
1130
1122
|
// Initialization
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-cj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.0.
|
4
|
+
version: 0.7.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Beynon
|
@@ -58,20 +58,6 @@ dependencies:
|
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '1.2'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: tilt
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '1.4'
|
68
|
-
type: :runtime
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '1.4'
|
75
61
|
- !ruby/object:Gem::Dependency
|
76
62
|
name: mspec
|
77
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,6 +182,7 @@ extra_rdoc_files: []
|
|
196
182
|
files:
|
197
183
|
- ".gitignore"
|
198
184
|
- ".gitmodules"
|
185
|
+
- ".inch.yml"
|
199
186
|
- ".rspec"
|
200
187
|
- ".spectator"
|
201
188
|
- ".spectator-mspec"
|