machine_setup 0.4.1 → 0.5.0
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 +15 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/bin/setup_config_gen +7 -7
- data/lib/setup_configuration.rb +1 -0
- data/lib/setup_configuration/binary_coded_values.rb +43 -0
- data/lib/setup_configuration/encoding.rb +1 -1
- data/lib/setup_configuration/generator_module.rb +9 -9
- data/lib/setup_configuration/legacy/importer.rb +32 -57
- data/lib/setup_configuration/legacy/legacy.rb +1 -0
- data/lib/setup_configuration/legacy/parameter.rb +17 -4
- data/lib/setup_configuration/legacy/parameter_extractor.rb +83 -0
- data/lib/setup_configuration/legacy/templates/setup.param.erb +6 -0
- data/lib/setup_configuration/mps_template_binding.rb +55 -4
- data/lib/setup_configuration/parameter_template_binding.rb +7 -6
- data/lib/setup_configuration/setup_code_generator.rb +1 -1
- data/lib/setup_configuration/setup_config.rb +76 -11
- data/lib/setup_configuration/suite_generator.rb +1 -1
- data/lib/setup_configuration/templates/mps3.ini.erb +7 -1
- data/lib/setup_configuration/translation.rb +12 -8
- data/test/setup_configuration/legacy/data/v1/mps3.ini +35 -0
- data/test/setup_configuration/legacy/data/v2/mps3.ini +41 -0
- data/test/setup_configuration/legacy/importer_test.rb +54 -0
- data/test/setup_configuration/mps_template_binding_test.rb +28 -0
- data/test/setup_configuration/options_test.rb +40 -0
- data/test/setup_configuration/roles_test.rb +64 -0
- data/test/test_helper.rb +1 -1
- metadata +76 -90
@@ -0,0 +1,41 @@
|
|
1
|
+
[EINSTELLUNG]
|
2
|
+
TABSTART=2
|
3
|
+
DRUCK=0
|
4
|
+
DATKONVERT=0
|
5
|
+
|
6
|
+
[SPRACHE]
|
7
|
+
AKTUELL=0
|
8
|
+
SPRACHE0=DEUTSCH
|
9
|
+
SPRACHE1=ENGLISH
|
10
|
+
|
11
|
+
[MINMAXWERTE]
|
12
|
+
BEGIN_MIN=0
|
13
|
+
END_MIN=0
|
14
|
+
BEGIN_MAX=0
|
15
|
+
END_MAX=0
|
16
|
+
BEGIN_WAAG_MIN=3000
|
17
|
+
END_WAAG_MIN=3029
|
18
|
+
BEGIN_WAAG_MAX=3030
|
19
|
+
END_WAAG_MAX=3059
|
20
|
+
|
21
|
+
[MASCHINENTYP]
|
22
|
+
BEGIN_TYP0=1000
|
23
|
+
BEGIN_TYP1=2000
|
24
|
+
BEGIN_TYP2=3000
|
25
|
+
|
26
|
+
[PARAMANZEIGE]
|
27
|
+
4CF1a=16,8,4,2
|
28
|
+
3CF1a=2,1,3,0
|
29
|
+
2CF1a=-1,-1,-1,31
|
30
|
+
1CF1a=0,0,0,0
|
31
|
+
TAB1a=29,30,31,32
|
32
|
+
4CF1b=
|
33
|
+
3CF1b=
|
34
|
+
2CF1b=
|
35
|
+
1CF1b=
|
36
|
+
TAB1b=
|
37
|
+
4CF1c=
|
38
|
+
3CF1c=
|
39
|
+
2CF1c=
|
40
|
+
1CF1c=
|
41
|
+
TAB1c=
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.dirname(__FILE__) + "/../../test_helper"
|
3
|
+
|
4
|
+
class ImporterTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
# Called before every test method runs. Can be used
|
7
|
+
# to set up fixture information.
|
8
|
+
def setup
|
9
|
+
@mps3_v1 = IniFile.load(File.join(File.dirname(__FILE__),'data/v1/mps3.ini'))
|
10
|
+
@mps3_v2 = IniFile.load(File.join(File.dirname(__FILE__),'data/v2/mps3.ini'))
|
11
|
+
end
|
12
|
+
|
13
|
+
# Called after every test method runs. Can be used to tear
|
14
|
+
# down fixture information.
|
15
|
+
|
16
|
+
def teardown
|
17
|
+
# Do nothing
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_mps3_v1
|
21
|
+
pe = SetupConfiguration::Legacy::ParameterExtractor.new(@mps3_v1['PARAMANZEIGE'])
|
22
|
+
assert_not_nil pe
|
23
|
+
level = '1a'
|
24
|
+
assert_not_nil pe.param_dependencies(level)
|
25
|
+
count = 4
|
26
|
+
assert_equal count, pe.param_dependencies(level).length
|
27
|
+
|
28
|
+
assert_not_nil pe.machine_types(level)
|
29
|
+
assert_equal count, pe.machine_types(level).length
|
30
|
+
|
31
|
+
assert_nil pe.param_options(level)
|
32
|
+
|
33
|
+
assert_nil pe.roles(level)
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_mps3_v2
|
37
|
+
pe = SetupConfiguration::Legacy::ParameterExtractor.new(@mps3_v2['PARAMANZEIGE'])
|
38
|
+
assert_not_nil pe
|
39
|
+
level = '1a'
|
40
|
+
count = 4
|
41
|
+
assert_not_nil pe.param_dependencies(level)
|
42
|
+
assert_equal count, pe.param_dependencies(level).length
|
43
|
+
|
44
|
+
assert_not_nil pe.machine_types(level)
|
45
|
+
assert_equal count, pe.machine_types(level).length
|
46
|
+
|
47
|
+
assert_not_nil pe.param_options(level)
|
48
|
+
assert_equal count, pe.param_options(level).length
|
49
|
+
|
50
|
+
assert_not_nil pe.roles(level)
|
51
|
+
assert_equal count, pe.roles(level).length
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.dirname(__FILE__) + "/../test_helper"
|
3
|
+
|
4
|
+
class MPSTemplateBindingTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
# Called before every test method runs. Can be used
|
7
|
+
# to set up fixture information.
|
8
|
+
def setup
|
9
|
+
@mps = SetupConfiguration::Generator::MPSTemplateBinding.new
|
10
|
+
end
|
11
|
+
|
12
|
+
# Called after every test method runs. Can be used to tear
|
13
|
+
# down fixture information.
|
14
|
+
def teardown
|
15
|
+
# Do nothing
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_create_instance
|
19
|
+
assert_not_nil @mps
|
20
|
+
assert_not_nil SetupConfiguration::Generator::MPSTemplateBinding.new {}
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_sanitize_do_nothing
|
24
|
+
bundle = []
|
25
|
+
5.times { bundle << (1..3).to_a }
|
26
|
+
assert_equal bundle, @mps.send(:sanitize, bundle)
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.dirname(__FILE__) + "/../test_helper"
|
3
|
+
|
4
|
+
class SoftwareOptionsTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
# Called before every test method runs. Can be used
|
7
|
+
# to set up fixture information.
|
8
|
+
def setup
|
9
|
+
@options = SetupConfiguration::SoftwareOptions.new
|
10
|
+
end
|
11
|
+
|
12
|
+
# Called after every test method runs. Can be used to tear
|
13
|
+
# down fixture information.
|
14
|
+
def teardown
|
15
|
+
# Do nothing
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_values
|
19
|
+
assert_equal(@options.number(:do_not_copy), 1)
|
20
|
+
assert_equal(@options.number(:needs_licence), 2)
|
21
|
+
assert_raise ArgumentError do
|
22
|
+
@options.number(:lari_fari_ga_ga)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_reverse
|
27
|
+
assert_equal [], @options.compute_options(0)
|
28
|
+
assert_equal [:do_not_copy], @options.compute_options(1)
|
29
|
+
assert_equal [:needs_licence], @options.compute_options(2)
|
30
|
+
assert_equal [:do_not_copy, :needs_licence], @options.compute_options(3)
|
31
|
+
|
32
|
+
# actually more than 3 is not possible yet - there are just two options...
|
33
|
+
assert_equal [], @options.compute_options(4)
|
34
|
+
assert_equal [:do_not_copy], @options.compute_options(5)
|
35
|
+
assert_equal [:needs_licence], @options.compute_options(6)
|
36
|
+
assert_equal [:do_not_copy, :needs_licence], @options.compute_options(7)
|
37
|
+
assert_equal [], @options.compute_options(8)
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.dirname(__FILE__) + "/../test_helper"
|
3
|
+
|
4
|
+
class RoleTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
# Called before every test method runs. Can be used
|
7
|
+
# to set up fixture information.
|
8
|
+
def setup
|
9
|
+
@r = SetupConfiguration::Roles.new
|
10
|
+
end
|
11
|
+
|
12
|
+
# Called after every test method runs. Can be used to tear
|
13
|
+
# down fixture information.
|
14
|
+
def teardown
|
15
|
+
# Do nothing
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_numeric_values
|
19
|
+
assert_equal 1, @r.number(:foreman)
|
20
|
+
assert_equal 2, @r.number(:service)
|
21
|
+
assert_equal 4, @r.number(:application_engineer)
|
22
|
+
assert_equal 8, @r.number(:test_bay)
|
23
|
+
assert_equal 16, @r.number(:developer)
|
24
|
+
assert_raise ArgumentError do
|
25
|
+
@r.number(:lari_fari_ga_ga)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_reverse
|
30
|
+
assert_equal [], @r.compute_roles(0)
|
31
|
+
assert_equal [:foreman], @r.compute_roles(1)
|
32
|
+
assert_equal [:service], @r.compute_roles(2)
|
33
|
+
assert_equal [:foreman, :service], @r.compute_roles(3)
|
34
|
+
assert_equal [:application_engineer], @r.compute_roles(4)
|
35
|
+
assert_equal [:foreman, :application_engineer], @r.compute_roles(5)
|
36
|
+
assert_equal [:service, :application_engineer], @r.compute_roles(6)
|
37
|
+
assert_equal [:foreman, :service, :application_engineer], @r.compute_roles(7)
|
38
|
+
assert_equal [:test_bay], @r.compute_roles(8)
|
39
|
+
assert_equal [:foreman, :test_bay], @r.compute_roles(9)
|
40
|
+
assert_equal [:service, :test_bay], @r.compute_roles(10)
|
41
|
+
assert_equal [:foreman, :service, :test_bay], @r.compute_roles(11)
|
42
|
+
assert_equal [:application_engineer, :test_bay], @r.compute_roles(12)
|
43
|
+
assert_equal [:foreman, :application_engineer, :test_bay], @r.compute_roles(13)
|
44
|
+
assert_equal [:service, :application_engineer, :test_bay], @r.compute_roles(14)
|
45
|
+
assert_equal [:foreman, :service, :application_engineer, :test_bay], @r.compute_roles(15)
|
46
|
+
assert_equal [:developer], @r.compute_roles(16)
|
47
|
+
assert_equal [:foreman, :developer], @r.compute_roles(17)
|
48
|
+
assert_equal [:service, :developer], @r.compute_roles(18)
|
49
|
+
assert_equal [:foreman, :service, :developer], @r.compute_roles(19)
|
50
|
+
assert_equal [:application_engineer, :developer], @r.compute_roles(20)
|
51
|
+
assert_equal [:foreman, :application_engineer, :developer], @r.compute_roles(21)
|
52
|
+
assert_equal [:service, :application_engineer, :developer], @r.compute_roles(22)
|
53
|
+
assert_equal [:foreman, :service, :application_engineer, :developer], @r.compute_roles(23)
|
54
|
+
assert_equal [:test_bay, :developer], @r.compute_roles(24)
|
55
|
+
assert_equal [:foreman, :test_bay, :developer], @r.compute_roles(25)
|
56
|
+
assert_equal [:service, :test_bay, :developer], @r.compute_roles(26)
|
57
|
+
assert_equal [:foreman, :service, :test_bay, :developer], @r.compute_roles(27)
|
58
|
+
assert_equal [:application_engineer, :test_bay, :developer], @r.compute_roles(28)
|
59
|
+
assert_equal [:foreman, :application_engineer, :test_bay, :developer], @r.compute_roles(29)
|
60
|
+
assert_equal [:service, :application_engineer, :test_bay, :developer], @r.compute_roles(30)
|
61
|
+
assert_equal [:foreman, :service, :application_engineer, :test_bay, :developer], @r.compute_roles(31)
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,93 +1,82 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: machine_setup
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 4
|
9
|
-
- 1
|
10
|
-
version: 0.4.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- robi-wan
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-07-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: i18n
|
22
|
-
|
23
|
-
|
24
|
-
none: false
|
25
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
26
17
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 6
|
32
|
-
version: "0.6"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.6'
|
33
20
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: inifile
|
37
21
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: inifile
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
41
31
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
segments:
|
45
|
-
- 1
|
46
|
-
- 1
|
47
|
-
version: "1.1"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.0'
|
48
34
|
type: :runtime
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: erubis
|
52
35
|
prerelease: false
|
53
|
-
|
54
|
-
|
55
|
-
requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
56
38
|
- - ~>
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: erubis
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.7'
|
63
48
|
type: :runtime
|
64
|
-
version_requirements: *id003
|
65
|
-
- !ruby/object:Gem::Dependency
|
66
|
-
name: shoulda
|
67
49
|
prerelease: false
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: shoulda
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
77
62
|
type: :development
|
78
|
-
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
79
69
|
description: Helps generating configuration files for machine setup parameters.
|
80
70
|
email: robi-wan@suyu.de
|
81
|
-
executables:
|
71
|
+
executables:
|
82
72
|
- setup_config_gen
|
83
73
|
- setup_init_dsl
|
84
74
|
- setup_analyze_dat
|
85
75
|
extensions: []
|
86
|
-
|
87
|
-
extra_rdoc_files:
|
76
|
+
extra_rdoc_files:
|
88
77
|
- README.rdoc
|
89
78
|
- TODO
|
90
|
-
files:
|
79
|
+
files:
|
91
80
|
- .document
|
92
81
|
- MIT-LICENSE
|
93
82
|
- README.rdoc
|
@@ -104,6 +93,7 @@ files:
|
|
104
93
|
- examples/underleaver/underleaver.setup.param.de.yml
|
105
94
|
- examples/underleaver/underleaver.setup.param.en.yml
|
106
95
|
- lib/setup_configuration.rb
|
96
|
+
- lib/setup_configuration/binary_coded_values.rb
|
107
97
|
- lib/setup_configuration/core_ext.rb
|
108
98
|
- lib/setup_configuration/core_ext/array.rb
|
109
99
|
- lib/setup_configuration/core_ext/array/grouping.rb
|
@@ -113,6 +103,7 @@ files:
|
|
113
103
|
- lib/setup_configuration/legacy/language_context.rb
|
114
104
|
- lib/setup_configuration/legacy/legacy.rb
|
115
105
|
- lib/setup_configuration/legacy/parameter.rb
|
106
|
+
- lib/setup_configuration/legacy/parameter_extractor.rb
|
116
107
|
- lib/setup_configuration/legacy/templates/setup.param.erb
|
117
108
|
- lib/setup_configuration/legacy/templates/setup.param.language.yml.erb
|
118
109
|
- lib/setup_configuration/mps_template_binding.rb
|
@@ -128,44 +119,39 @@ files:
|
|
128
119
|
- lib/setup_configuration/templates/logcodesetup.exp.erb
|
129
120
|
- lib/setup_configuration/templates/mps3.ini.erb
|
130
121
|
- lib/setup_configuration/translation.rb
|
122
|
+
- test/setup_configuration/legacy/data/v1/mps3.ini
|
123
|
+
- test/setup_configuration/legacy/data/v2/mps3.ini
|
124
|
+
- test/setup_configuration/legacy/importer_test.rb
|
131
125
|
- test/setup_configuration/machine_type_test.rb
|
126
|
+
- test/setup_configuration/mps_template_binding_test.rb
|
127
|
+
- test/setup_configuration/options_test.rb
|
132
128
|
- test/setup_configuration/parameter_factory_test.rb
|
133
129
|
- test/setup_configuration/parameter_test.rb
|
130
|
+
- test/setup_configuration/roles_test.rb
|
134
131
|
- test/setup_configuration/setup_configuration_test.rb
|
135
132
|
- test/setup_configuration/translation_test.rb
|
136
133
|
- test/test_helper.rb
|
137
134
|
homepage: http://github.com/robi-wan/machine_setup
|
138
135
|
licenses: []
|
139
|
-
|
136
|
+
metadata: {}
|
140
137
|
post_install_message:
|
141
138
|
rdoc_options: []
|
142
|
-
|
143
|
-
require_paths:
|
139
|
+
require_paths:
|
144
140
|
- lib
|
145
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
none: false
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
hash: 3
|
160
|
-
segments:
|
161
|
-
- 0
|
162
|
-
version: "0"
|
141
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ! '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - ! '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
163
151
|
requirements: []
|
164
|
-
|
165
152
|
rubyforge_project:
|
166
|
-
rubygems_version:
|
153
|
+
rubygems_version: 2.3.0
|
167
154
|
signing_key:
|
168
|
-
specification_version:
|
155
|
+
specification_version: 4
|
169
156
|
summary: Generating configuration for machine setup parameters.
|
170
157
|
test_files: []
|
171
|
-
|