sso-elements-fmk 0.1.1 → 0.1.3
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/CODE_OF_CONDUCT.md +132 -132
- data/README.md +73 -39
- data/Rakefile +8 -8
- data/examples/npc_creation.rb +33 -0
- data/lib/sso/elements/collection.rb +262 -247
- data/lib/sso/elements/config.rb +92 -90
- data/lib/sso/elements/fmk/version.rb +9 -9
- data/lib/sso/elements/fmk.rb +12 -12
- data/sig/sso/elements/fmk.rbs +8 -8
- metadata +3 -6
- data/.idea/.gitignore +0 -8
- data/.idea/modules.xml +0 -8
- data/.idea/sso-elements-fmk.iml +0 -59
- data/.idea/vcs.xml +0 -6
data/lib/sso/elements/config.rb
CHANGED
@@ -1,91 +1,93 @@
|
|
1
|
-
require_relative 'element'
|
2
|
-
require_relative 'field'
|
3
|
-
|
4
|
-
module SSO
|
5
|
-
module Elements
|
6
|
-
class Config
|
7
|
-
attr_accessor :name,
|
8
|
-
:offset,
|
9
|
-
:type,
|
10
|
-
:fields,
|
11
|
-
:types,
|
12
|
-
:values
|
13
|
-
|
14
|
-
CFG_AVAIL = {
|
15
|
-
150 => 'PW_1.0.2_v150.cfg',
|
16
|
-
152 => 'PW_1.0.2_v152.cfg'
|
17
|
-
}
|
18
|
-
|
19
|
-
def initialize
|
20
|
-
@
|
21
|
-
@
|
22
|
-
@
|
23
|
-
@
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
'
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
@
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
@fields_quantity
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
1
|
+
require_relative 'element'
|
2
|
+
require_relative 'field'
|
3
|
+
|
4
|
+
module SSO
|
5
|
+
module Elements
|
6
|
+
class Config
|
7
|
+
attr_accessor :name,
|
8
|
+
:offset,
|
9
|
+
:type,
|
10
|
+
:fields,
|
11
|
+
:types,
|
12
|
+
:values
|
13
|
+
|
14
|
+
CFG_AVAIL = {
|
15
|
+
150 => 'PW_1.0.2_v150.cfg',
|
16
|
+
152 => 'PW_1.0.2_v152.cfg'
|
17
|
+
}
|
18
|
+
|
19
|
+
def initialize(collection)
|
20
|
+
@collection = collection
|
21
|
+
@offsets = []
|
22
|
+
@fields = []
|
23
|
+
@types = []
|
24
|
+
@values = []
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_json
|
28
|
+
values.map do |value|
|
29
|
+
result = {}
|
30
|
+
|
31
|
+
value.each_with_index do |data, index|
|
32
|
+
result[fields[index]] = {
|
33
|
+
'data' => data,
|
34
|
+
'type' => types[index]
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
result
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def elements
|
43
|
+
return @elements if @elements
|
44
|
+
|
45
|
+
@elements = values.map do |value|
|
46
|
+
Element.from_value(self, value)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def elements_loaded?
|
51
|
+
!@elements.nil?
|
52
|
+
end
|
53
|
+
|
54
|
+
def add_element(element)
|
55
|
+
@values << element.to_value
|
56
|
+
@elements << element
|
57
|
+
@collection.id_set << element.id
|
58
|
+
|
59
|
+
true
|
60
|
+
end
|
61
|
+
|
62
|
+
def find_element_by_id(id)
|
63
|
+
elements.find do |element|
|
64
|
+
element.id == id
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def find_element_by_name(name)
|
69
|
+
elements.find do |element|
|
70
|
+
element.name.to_s.downcase == name.to_s.downcase
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def find_elements_by_name(name)
|
75
|
+
elements.select do |element|
|
76
|
+
element.name.to_s.downcase.include?(name.to_s.downcase)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
def grouped_field_quantity
|
80
|
+
return @fields_quantity if @fields_quantity
|
81
|
+
|
82
|
+
@fields_quantity = {}
|
83
|
+
|
84
|
+
fields.each do |field|
|
85
|
+
@fields_quantity[field] ||= 0
|
86
|
+
@fields_quantity[field] += 1
|
87
|
+
end
|
88
|
+
|
89
|
+
@fields_quantity
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
91
93
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module SSO
|
4
|
-
module Elements
|
5
|
-
module Fmk
|
6
|
-
VERSION = "0.1.
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SSO
|
4
|
+
module Elements
|
5
|
+
module Fmk
|
6
|
+
VERSION = "0.1.3"
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
data/lib/sso/elements/fmk.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "fmk/version"
|
4
|
-
require_relative "collection"
|
5
|
-
|
6
|
-
module SSO
|
7
|
-
module Elements
|
8
|
-
module Fmk
|
9
|
-
class Error < StandardError; end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "fmk/version"
|
4
|
+
require_relative "collection"
|
5
|
+
|
6
|
+
module SSO
|
7
|
+
module Elements
|
8
|
+
module Fmk
|
9
|
+
class Error < StandardError; end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/sig/sso/elements/fmk.rbs
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
module SSO
|
2
|
-
module Elements
|
3
|
-
module Fmk
|
4
|
-
VERSION: String
|
5
|
-
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
1
|
+
module SSO
|
2
|
+
module Elements
|
3
|
+
module Fmk
|
4
|
+
VERSION: String
|
5
|
+
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sso-elements-fmk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kuroro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: simple sso elements editor for ruby
|
14
14
|
email:
|
@@ -17,14 +17,11 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- ".idea/.gitignore"
|
21
|
-
- ".idea/modules.xml"
|
22
|
-
- ".idea/sso-elements-fmk.iml"
|
23
|
-
- ".idea/vcs.xml"
|
24
20
|
- CODE_OF_CONDUCT.md
|
25
21
|
- LICENSE.txt
|
26
22
|
- README.md
|
27
23
|
- Rakefile
|
24
|
+
- examples/npc_creation.rb
|
28
25
|
- lib/sso/elements/collection.rb
|
29
26
|
- lib/sso/elements/config.rb
|
30
27
|
- lib/sso/elements/configs/PW_1.0.2_v150.cfg
|
data/.idea/.gitignore
DELETED
data/.idea/modules.xml
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="ProjectModuleManager">
|
4
|
-
<modules>
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/sso-elements-fmk.iml" filepath="$PROJECT_DIR$/.idea/sso-elements-fmk.iml" />
|
6
|
-
</modules>
|
7
|
-
</component>
|
8
|
-
</project>
|
data/.idea/sso-elements-fmk.iml
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<module type="RUBY_MODULE" version="4">
|
3
|
-
<component name="ModuleRunConfigurationManager">
|
4
|
-
<shared />
|
5
|
-
</component>
|
6
|
-
<component name="NewModuleRootManager">
|
7
|
-
<content url="file://$MODULE_DIR$">
|
8
|
-
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
9
|
-
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
10
|
-
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
11
|
-
</content>
|
12
|
-
<orderEntry type="jdk" jdkName="ruby-3.3.3-p89" jdkType="RUBY_SDK" />
|
13
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
14
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.5.11, ruby-3.3.3-p89) [gem]" level="application" />
|
15
|
-
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.24.1, ruby-3.3.3-p89) [gem]" level="application" />
|
16
|
-
<orderEntry type="library" scope="PROVIDED" name="rake (v13.2.1, ruby-3.3.3-p89) [gem]" level="application" />
|
17
|
-
</component>
|
18
|
-
<component name="RakeTasksCache-v2">
|
19
|
-
<option name="myRootTask">
|
20
|
-
<RakeTaskImpl id="rake">
|
21
|
-
<subtasks>
|
22
|
-
<RakeTaskImpl description="Build sso-elements-fmk-0.1.1.gem into the pkg directory" fullCommand="build" id="build" />
|
23
|
-
<RakeTaskImpl id="build">
|
24
|
-
<subtasks>
|
25
|
-
<RakeTaskImpl description="Generate SHA512 checksum of sso-elements-fmk-0.1.1.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
26
|
-
</subtasks>
|
27
|
-
</RakeTaskImpl>
|
28
|
-
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
29
|
-
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
30
|
-
<RakeTaskImpl description="Build and install sso-elements-fmk-0.1.1.gem into system gems" fullCommand="install" id="install" />
|
31
|
-
<RakeTaskImpl id="install">
|
32
|
-
<subtasks>
|
33
|
-
<RakeTaskImpl description="Build and install sso-elements-fmk-0.1.1.gem into system gems without network access" fullCommand="install:local" id="local" />
|
34
|
-
</subtasks>
|
35
|
-
</RakeTaskImpl>
|
36
|
-
<RakeTaskImpl description="Create tag v0.1.1 and build and push sso-elements-fmk-0.1.1.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
37
|
-
<RakeTaskImpl description="Run the test suite" fullCommand="test" id="test" />
|
38
|
-
<RakeTaskImpl id="test">
|
39
|
-
<subtasks>
|
40
|
-
<RakeTaskImpl description="Print out the test command" fullCommand="test:cmd" id="cmd" />
|
41
|
-
<RakeTaskImpl description="Show which test files fail when run in isolation" fullCommand="test:isolated" id="isolated" />
|
42
|
-
<RakeTaskImpl description="Show bottom 25 tests wrt time" fullCommand="test:slow" id="slow" />
|
43
|
-
<RakeTaskImpl description="" fullCommand="test:deps" id="deps" />
|
44
|
-
</subtasks>
|
45
|
-
</RakeTaskImpl>
|
46
|
-
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
47
|
-
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
48
|
-
<RakeTaskImpl id="release">
|
49
|
-
<subtasks>
|
50
|
-
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
51
|
-
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
52
|
-
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
53
|
-
</subtasks>
|
54
|
-
</RakeTaskImpl>
|
55
|
-
</subtasks>
|
56
|
-
</RakeTaskImpl>
|
57
|
-
</option>
|
58
|
-
</component>
|
59
|
-
</module>
|