scale.rb 0.2.15 → 0.2.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -16
- data/lib/scale.rb +19 -3
- data/lib/scale/version.rb +1 -1
- data/scale.gemspec +0 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '06486e89da3732a84ca4f980e8b01e135521e51b4a26b0d67d5684e9abc5ad85'
|
4
|
+
data.tar.gz: b23b2ba8bd7ca6b9746caa8019f73710a6c2cd4613576fb6d0ac4da433aeb0ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9407464fea76e85c960219fd19eea5db480f207db7b6f24a96ddfb819c06ce822c1b3649c1a3064e2be697bb3305b0328e0dbb9d04fc8f69851673b3b6a54bbe
|
7
|
+
data.tar.gz: 6c54d51a1af71fc24504eb77a1182248923386629ebc1e0a86002d8a3b299ef1deea19c388561430c4e7cb4102b3e7669726d5ec6fa9479f6a04c82feeac7863
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
scale.rb (0.2.
|
5
|
-
activesupport (~> 6.0.0)
|
4
|
+
scale.rb (0.2.16)
|
6
5
|
json (~> 2.3.0)
|
7
6
|
kontena-websocket-client (~> 0.1.1)
|
8
7
|
substrate_common.rb (~> 0.1.10)
|
@@ -11,25 +10,15 @@ PATH
|
|
11
10
|
GEM
|
12
11
|
remote: https://rubygems.org/
|
13
12
|
specs:
|
14
|
-
activesupport (6.0.3.4)
|
15
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
|
-
i18n (>= 0.7, < 2)
|
17
|
-
minitest (~> 5.1)
|
18
|
-
tzinfo (~> 1.1)
|
19
|
-
zeitwerk (~> 2.2, >= 2.2.2)
|
20
13
|
base58 (0.2.3)
|
21
14
|
blake2b (0.10.0)
|
22
15
|
coderay (1.1.2)
|
23
|
-
concurrent-ruby (1.1.8)
|
24
16
|
diff-lcs (1.3)
|
25
17
|
ffi (1.12.2)
|
26
|
-
i18n (1.8.8)
|
27
|
-
concurrent-ruby (~> 1.0)
|
28
18
|
json (2.3.1)
|
29
19
|
kontena-websocket-client (0.1.1)
|
30
20
|
websocket-driver (~> 0.6.5)
|
31
21
|
method_source (0.9.2)
|
32
|
-
minitest (5.14.3)
|
33
22
|
pry (0.12.2)
|
34
23
|
coderay (~> 1.1.0)
|
35
24
|
method_source (~> 0.9.0)
|
@@ -52,14 +41,10 @@ GEM
|
|
52
41
|
blake2b
|
53
42
|
xxhash
|
54
43
|
thor (0.19.4)
|
55
|
-
thread_safe (0.3.6)
|
56
|
-
tzinfo (1.2.9)
|
57
|
-
thread_safe (~> 0.1)
|
58
44
|
websocket-driver (0.6.5)
|
59
45
|
websocket-extensions (>= 0.1.0)
|
60
46
|
websocket-extensions (0.1.5)
|
61
47
|
xxhash (0.4.0)
|
62
|
-
zeitwerk (2.4.2)
|
63
48
|
|
64
49
|
PLATFORMS
|
65
50
|
ruby
|
data/lib/scale.rb
CHANGED
@@ -2,8 +2,6 @@ require "scale/version"
|
|
2
2
|
|
3
3
|
require "substrate_common"
|
4
4
|
require "json"
|
5
|
-
require "active_support"
|
6
|
-
require "active_support/core_ext/string"
|
7
5
|
require "singleton"
|
8
6
|
|
9
7
|
require "scale/base"
|
@@ -31,6 +29,24 @@ require "logger"
|
|
31
29
|
require "helper"
|
32
30
|
require 'kontena-websocket-client'
|
33
31
|
|
32
|
+
class String
|
33
|
+
def upcase_first
|
34
|
+
self.sub(/\S/, &:upcase)
|
35
|
+
end
|
36
|
+
|
37
|
+
def camelize
|
38
|
+
self.split('_').collect(&:upcase_first).join
|
39
|
+
end
|
40
|
+
|
41
|
+
def underscore
|
42
|
+
self.gsub(/::/, '/').
|
43
|
+
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
|
44
|
+
gsub(/([a-z\d])([A-Z])/,'\1_\2').
|
45
|
+
tr("-", "_").
|
46
|
+
downcase
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
34
50
|
module Scale
|
35
51
|
class Error < StandardError; end
|
36
52
|
|
@@ -261,7 +277,7 @@ module Scale
|
|
261
277
|
include Scale::Types.type_of(type_str)
|
262
278
|
inner_type inner_type_str
|
263
279
|
end
|
264
|
-
name = "#{type_str}
|
280
|
+
name = "#{type_str}<#{inner_type_str.camelize}>_#{klass.object_id}"
|
265
281
|
Scale::Types.const_set fix(name), klass
|
266
282
|
else
|
267
283
|
raise "#{type_str} not support inner type: #{type_string}"
|
data/lib/scale/version.rb
CHANGED
data/scale.gemspec
CHANGED
@@ -34,7 +34,6 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.require_paths = ["lib"]
|
35
35
|
|
36
36
|
spec.add_dependency "substrate_common.rb", "~> 0.1.10"
|
37
|
-
spec.add_dependency "activesupport", "~> 6.0.0"
|
38
37
|
spec.add_dependency "json", "~> 2.3.0"
|
39
38
|
spec.add_dependency "thor", "~> 0.19.0"
|
40
39
|
spec.add_dependency "kontena-websocket-client", "~> 0.1.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scale.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wu Minzhe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: substrate_common.rb
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.1.10
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: activesupport
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 6.0.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 6.0.0
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: json
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|