script_core 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 +4 -4
- data/.gitattributes +3 -0
- data/.gitignore +1 -0
- data/Gemfile +1 -4
- data/bin/console +12 -0
- data/ext/enterprise_script_service/mruby_config.rb +1 -3
- data/lib/script_core/engine.rb +6 -5
- data/lib/script_core/version.rb +1 -1
- data/script_core.gemspec +5 -3
- data/spec/script_core_spec.rb +1 -1
- metadata +28 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0f2086b850c4deeb38dc6fc3ca55efcf179633446b0fc39345f8bc7a7f17ce5
|
4
|
+
data.tar.gz: d58f2f9cafb8e47ac0f9d216c83114efd7fc99d0ea9a3df354cad61722023f9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09cea8f698d1a28cfef9bcfb5b44e1ccf0256b6abe36e4f92d319c897a68aa9365d7bb42aea043bcdcf3dcd78dd3448470ed1d9ad78afbf39e3eea8a28f8f198'
|
7
|
+
data.tar.gz: 6a3ace78a146a29033aed57f85ce0493d25c4e25c8c23798c95bd9482ee3600664d51597015dfe7f641cb9b20de2611caab4f9de00c9920f1a530f621f0b4132
|
data/.gitattributes
ADDED
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/bin/console
ADDED
@@ -4,9 +4,7 @@
|
|
4
4
|
|
5
5
|
mruby_engine_gembox_path =
|
6
6
|
if ENV["MRUBY_ENGINE_GEMBOX_PATH"] && File.exist?(ENV["MRUBY_ENGINE_GEMBOX_PATH"])
|
7
|
-
unless ENV["MRUBY_ENGINE_GEMBOX_PATH"].end_with?(".gembox")
|
8
|
-
raise "`#{ENV["MRUBY_ENGINE_GEMBOX_PATH"]}` require `.gembox` extension"
|
9
|
-
end
|
7
|
+
raise "`#{ENV['MRUBY_ENGINE_GEMBOX_PATH']}` require `.gembox` extension" unless ENV["MRUBY_ENGINE_GEMBOX_PATH"].end_with?(".gembox")
|
10
8
|
Pathname.new ENV["MRUBY_ENGINE_GEMBOX_PATH"][0..-8]
|
11
9
|
else
|
12
10
|
Pathname.new(__FILE__).dirname.join("mruby_engine")
|
data/lib/script_core/engine.rb
CHANGED
@@ -4,7 +4,8 @@ module ScriptCore
|
|
4
4
|
class Engine
|
5
5
|
attr_accessor :timeout, :instruction_quota, :instruction_quota_start, :memory_quota, :instructions
|
6
6
|
|
7
|
-
def initialize(bin_path = ScriptCore::DEFAULT_BIN_PATH,
|
7
|
+
def initialize(bin_path = ScriptCore::DEFAULT_BIN_PATH,
|
8
|
+
executable_name: "enterprise_script_service",
|
8
9
|
instructions_name: "enterprise_script_service.mrb")
|
9
10
|
raise Errno::ENOENT, "No such directory - #{bin_path}" unless File.directory?(bin_path)
|
10
11
|
@bin_path = bin_path
|
@@ -19,14 +20,14 @@ def initialize(bin_path = ScriptCore::DEFAULT_BIN_PATH, executable_name: "enterp
|
|
19
20
|
@instructions = File.exist?(preload_instructions_path) ? File.binread(preload_instructions_path) : nil
|
20
21
|
end
|
21
22
|
|
22
|
-
def eval(sources,
|
23
|
+
def eval(sources, input: nil, instruction_quota_start: nil)
|
23
24
|
@executable.run(
|
24
|
-
input:
|
25
|
-
sources: sources
|
25
|
+
input: input || {},
|
26
|
+
sources: sources,
|
26
27
|
instructions: @instructions,
|
27
28
|
timeout: @timeout,
|
28
29
|
instruction_quota: @instruction_quota,
|
29
|
-
instruction_quota_start: @instruction_quota_start,
|
30
|
+
instruction_quota_start: instruction_quota_start || @instruction_quota_start,
|
30
31
|
memory_quota: @memory_quota
|
31
32
|
)
|
32
33
|
end
|
data/lib/script_core/version.rb
CHANGED
data/script_core.gemspec
CHANGED
@@ -33,14 +33,16 @@
|
|
33
33
|
end
|
34
34
|
|
35
35
|
spec.extensions = ["ext/enterprise_script_service/Rakefile"]
|
36
|
-
spec.homepage = "https://github.com/
|
36
|
+
spec.homepage = "https://github.com/rails-engine/script_core"
|
37
37
|
spec.license = "MIT"
|
38
38
|
spec.required_ruby_version = ">= 2.3"
|
39
39
|
|
40
40
|
spec.add_dependency("msgpack", "~> 1.0")
|
41
|
+
spec.add_dependency("rake-compiler", "~> 1.0")
|
42
|
+
|
41
43
|
spec.add_development_dependency("bundler", "~> 1.6")
|
44
|
+
spec.add_development_dependency("pry", "~> 0.11")
|
42
45
|
spec.add_development_dependency("pry-byebug", "~> 3.4")
|
43
|
-
spec.add_development_dependency("rake", "~>
|
44
|
-
spec.add_development_dependency("rake-compiler", "~> 0.9")
|
46
|
+
spec.add_development_dependency("rake", "~> 12.0")
|
45
47
|
spec.add_development_dependency("rspec", "~> 3.5")
|
46
48
|
end
|
data/spec/script_core_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: script_core
|
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
|
- jasl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake-compiler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,47 +53,47 @@ dependencies:
|
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '1.6'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: pry
|
56
|
+
name: pry
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
61
|
+
version: '0.11'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
68
|
+
version: '0.11'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: pry-byebug
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
75
|
+
version: '3.4'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
82
|
+
version: '3.4'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: rake
|
84
|
+
name: rake
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
89
|
+
version: '12.0'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0
|
96
|
+
version: '12.0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rspec
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,6 +115,7 @@ extensions:
|
|
101
115
|
- ext/enterprise_script_service/Rakefile
|
102
116
|
extra_rdoc_files: []
|
103
117
|
files:
|
118
|
+
- ".gitattributes"
|
104
119
|
- ".gitignore"
|
105
120
|
- ".gitmodules"
|
106
121
|
- ".rspec"
|
@@ -113,6 +128,7 @@ files:
|
|
113
128
|
- Rakefile
|
114
129
|
- Vagrantfile
|
115
130
|
- bin/bundler
|
131
|
+
- bin/console
|
116
132
|
- bin/pry
|
117
133
|
- bin/rake
|
118
134
|
- bin/rspec
|
@@ -3561,7 +3577,7 @@ files:
|
|
3561
3577
|
- tests/script_data_test.cpp
|
3562
3578
|
- tests/script_runner_test.cpp
|
3563
3579
|
- tests/timer_test.cpp
|
3564
|
-
homepage: https://github.com/
|
3580
|
+
homepage: https://github.com/rails-engine/script_core
|
3565
3581
|
licenses:
|
3566
3582
|
- MIT
|
3567
3583
|
metadata: {}
|