sso-elements-fmk 0.1.2 → 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.
@@ -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
- @offsets = []
21
- @fields = []
22
- @types = []
23
- @values = []
24
- end
25
-
26
- def to_json
27
- values.map do |value|
28
- result = {}
29
-
30
- value.each_with_index do |data, index|
31
- result[fields[index]] = {
32
- 'data' => data,
33
- 'type' => types[index]
34
- }
35
- end
36
-
37
- result
38
- end
39
- end
40
-
41
- def elements
42
- return @elements if @elements
43
-
44
- @elements = values.map do |value|
45
- Element.from_value(self, value)
46
- end
47
- end
48
-
49
- def elements_loaded?
50
- !@elements.nil?
51
- end
52
-
53
- def add_element(element)
54
- @values << element.to_value
55
- @elements << element
56
-
57
- true
58
- end
59
-
60
- def find_element_by_id(id)
61
- elements.find do |element|
62
- element.id == id
63
- end
64
- end
65
-
66
- def find_element_by_name(name)
67
- elements.find do |element|
68
- element.name.to_s.downcase == name.to_s.downcase
69
- end
70
- end
71
-
72
- def find_elements_by_name(name)
73
- elements.select do |element|
74
- element.name.to_s.downcase.include?(name.to_s.downcase)
75
- end
76
- end
77
- def grouped_field_quantity
78
- return @fields_quantity if @fields_quantity
79
-
80
- @fields_quantity = {}
81
-
82
- fields.each do |field|
83
- @fields_quantity[field] ||= 0
84
- @fields_quantity[field] += 1
85
- end
86
-
87
- @fields_quantity
88
- end
89
- end
90
- end
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.2"
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
@@ -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
@@ -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.2
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-07-21 00:00:00.000000000 Z
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,10 +17,6 @@ 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
data/.idea/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- # Default ignored files
2
- /shelf/
3
- /workspace.xml
4
- # Editor-based HTTP Client requests
5
- /httpRequests/
6
- # Datasource local storage ignored files
7
- /dataSources/
8
- /dataSources.local.xml
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>
@@ -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>
data/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>