sipp 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +0 -2
- data/README.md +28 -11
- data/lib/sipp/extended_dictionary.rb +13 -13
- data/lib/sipp/inverted_dictionary.rb +30 -24
- data/lib/sipp/version.rb +1 -1
- data/sipp.gemspec +14 -14
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9b784f915b2c0017b3d19bf32422d016347800df9f0a35263da09a3ff22f3c1b
|
4
|
+
data.tar.gz: 89a1c0aaeef4a61937741945a2d8158accbdc60d49c56c12cfc929937aa30c9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b74a7bc1ff32cf0d89a7e46537a7c3d1be88a79cccbc4adbf9ff7c5d282420843e0e2aa16f650ee7fff4430e0392f8300120af3c1f4c95e258bcee5ddb98e73
|
7
|
+
data.tar.gz: 0ccd26d12d91e3be60c49683ca7b69e864728d19ca2899ab650a7572fabbc19b0b2fc9ec32b84cf24c5a25aa8fe5cd3f4137461d0e1ba7f5ba6a5035208df531
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -115,22 +115,23 @@ Generates an Extended-SIPP code from capabilities provided and translates capabi
|
|
115
115
|
|
116
116
|
Should be tried and discussed.
|
117
117
|
|
118
|
+
Generating an e-sipp code from capabilities:
|
118
119
|
```ruby
|
119
|
-
SIPP::Extended.
|
120
|
-
|
121
|
-
{
|
120
|
+
SIPP::Extended.generate({
|
122
121
|
category: :compact,
|
123
|
-
type: :
|
122
|
+
type: :two_three_door,
|
124
123
|
transmission: :manual,
|
125
124
|
drive: :front,
|
126
|
-
fuel: :
|
125
|
+
fuel: :petrol,
|
127
126
|
ac: :air,
|
128
|
-
doors:
|
129
|
-
seats:
|
130
|
-
bags_big:
|
131
|
-
bags_small:
|
132
|
-
}
|
133
|
-
|
127
|
+
doors: 2,
|
128
|
+
seats: 2,
|
129
|
+
bags_big: 3,
|
130
|
+
bags_small: 4,
|
131
|
+
}) # => 'CBMFPA2234'
|
132
|
+
```
|
133
|
+
And capabilities from a code, just like a usual SIPP:
|
134
|
+
```ruby
|
134
135
|
SIPP::Extended.new('CBMFPN2234').as_json
|
135
136
|
{
|
136
137
|
category: :compact,
|
@@ -144,7 +145,23 @@ SIPP::Extended.new('CBMFPN2234').as_json
|
|
144
145
|
bags_big: 3,
|
145
146
|
bags_small: 4,
|
146
147
|
}
|
148
|
+
```
|
147
149
|
|
150
|
+
Puts `:unspecified` if cannot decode a capability:
|
151
|
+
```ruby
|
152
|
+
SIPP::Extended.new('CCMFDA55').as_json
|
153
|
+
{
|
154
|
+
category: :compact,
|
155
|
+
type: :two_four_door,
|
156
|
+
transmission: :manual,
|
157
|
+
drive: :front,
|
158
|
+
fuel: :diesel,
|
159
|
+
ac: :air,
|
160
|
+
doors: 5,
|
161
|
+
seats: 5,
|
162
|
+
bags_big: :unspecified,
|
163
|
+
bags_small: :unspecified,
|
164
|
+
}
|
148
165
|
```
|
149
166
|
|
150
167
|
## TODO
|
@@ -23,21 +23,21 @@ module SIPP
|
|
23
23
|
front: 'F',
|
24
24
|
rear: 'R',
|
25
25
|
all: 'A', # AWD
|
26
|
-
fwd:
|
26
|
+
fwd: 'X', # 4x4
|
27
27
|
}.merge(WILDCARDS)
|
28
28
|
|
29
29
|
# Fuel type. Mostly compatible with SIPP but you know... Made more human-guessable
|
30
30
|
FUEL = {
|
31
|
-
compressed_gas:
|
32
|
-
diesel:
|
33
|
-
electric:
|
34
|
-
electric_plus:
|
35
|
-
ethanol:
|
36
|
-
hybrid:
|
37
|
-
hybrid_plug_in:
|
38
|
-
hydrogen:
|
39
|
-
multi_fuel:
|
40
|
-
petrol:
|
31
|
+
compressed_gas: 'G',
|
32
|
+
diesel: 'D',
|
33
|
+
electric: 'E',
|
34
|
+
electric_plus: 'C',
|
35
|
+
ethanol: 'U',
|
36
|
+
hybrid: 'H',
|
37
|
+
hybrid_plug_in: 'I',
|
38
|
+
hydrogen: 'A',
|
39
|
+
multi_fuel: 'M',
|
40
|
+
petrol: 'P',
|
41
41
|
}.merge(WILDCARDS)
|
42
42
|
|
43
43
|
# Most probably is subject to change in the future
|
@@ -46,8 +46,8 @@ module SIPP
|
|
46
46
|
multi_zone: 'M',
|
47
47
|
present: 'A',
|
48
48
|
absent: 'N',
|
49
|
-
false
|
50
|
-
true
|
49
|
+
false => 'N',
|
50
|
+
true => 'A',
|
51
51
|
air: 'A',
|
52
52
|
no_air: 'N',
|
53
53
|
}.merge(WILDCARDS)
|
@@ -5,33 +5,39 @@ module SIPP
|
|
5
5
|
TYPE = SIPP::Code::TYPE.invert
|
6
6
|
|
7
7
|
TRANSMISSION_DRIVE = {
|
8
|
-
[:manual, :unspecified] =>
|
9
|
-
[:manual, :
|
10
|
-
[:manual, :
|
11
|
-
[:
|
12
|
-
[:
|
13
|
-
[:
|
8
|
+
[:manual, :unspecified] => 'M',
|
9
|
+
[:manual, :single] => 'M',
|
10
|
+
[:manual, :front] => 'M',
|
11
|
+
[:manual, :rear] => 'M',
|
12
|
+
[:manual, :four_wd] => 'N',
|
13
|
+
[:manual, :awd] => 'C',
|
14
|
+
[:auto, :unspecified] => 'A',
|
15
|
+
[:auto, :single] => 'A',
|
16
|
+
[:auto, :front] => 'A',
|
17
|
+
[:auto, :rear] => 'A',
|
18
|
+
[:auto, :four_wd] => 'B',
|
19
|
+
[:auto, :awd] => 'D'
|
14
20
|
}
|
15
21
|
|
16
22
|
FUEL_AC = {
|
17
|
-
[:unspecified, :air] =>
|
18
|
-
[:unspecified, :no_air] =>
|
19
|
-
[:diesel, :air] =>
|
20
|
-
[:diesel, :no_air] =>
|
21
|
-
[:hybrid, :air] =>
|
22
|
-
[:hybrid_plug_in, :air] =>
|
23
|
-
[:electric, :air] =>
|
24
|
-
[:electric_plus, :air] =>
|
25
|
-
[:compressed_gas, :air] =>
|
26
|
-
[:compressed_gas, :no_air] =>
|
27
|
-
[:hydrogen, :air] =>
|
28
|
-
[:hydrogen, :no_air] =>
|
29
|
-
[:multi_fuel, :air] =>
|
30
|
-
[:multi_fuel, :no_air] =>
|
31
|
-
[:petrol, :air] =>
|
32
|
-
[:petrol, :no_air] =>
|
33
|
-
[:ethanol, :air] =>
|
34
|
-
[:ethanol, :no_air] =>
|
23
|
+
[:unspecified, :air] => 'R',
|
24
|
+
[:unspecified, :no_air] => 'N',
|
25
|
+
[:diesel, :air] => 'D',
|
26
|
+
[:diesel, :no_air] => 'Q',
|
27
|
+
[:hybrid, :air] => 'H',
|
28
|
+
[:hybrid_plug_in, :air] => 'I',
|
29
|
+
[:electric, :air] => 'E',
|
30
|
+
[:electric_plus, :air] => 'C',
|
31
|
+
[:compressed_gas, :air] => 'L',
|
32
|
+
[:compressed_gas, :no_air] => 'S',
|
33
|
+
[:hydrogen, :air] => 'A',
|
34
|
+
[:hydrogen, :no_air] => 'B',
|
35
|
+
[:multi_fuel, :air] => 'M',
|
36
|
+
[:multi_fuel, :no_air] => 'F',
|
37
|
+
[:petrol, :air] => 'V',
|
38
|
+
[:petrol, :no_air] => 'Z',
|
39
|
+
[:ethanol, :air] => 'U',
|
40
|
+
[:ethanol, :no_air] => 'X',
|
35
41
|
}
|
36
42
|
end
|
37
43
|
end
|
data/lib/sipp/version.rb
CHANGED
data/sipp.gemspec
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require 'sipp/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'sipp'
|
8
8
|
spec.version = SIPP::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Max Buslaev']
|
10
|
+
spec.email = ['max@buslaev.net']
|
11
11
|
|
12
12
|
spec.summary = %q{SIPP aka ACRISS code dictionary}
|
13
13
|
spec.description = %q{Translates car SIPP/ACRISS codes into something meaningful}
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
14
|
+
spec.homepage = 'https://github.com/austerlitz/sipp'
|
15
|
+
spec.license = 'MIT'
|
16
16
|
|
17
17
|
# Specify which files should be added to the gem when it is released.
|
18
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
19
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
20
20
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
21
|
end
|
22
|
-
spec.bindir =
|
22
|
+
spec.bindir = 'exe'
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
-
spec.require_paths = [
|
24
|
+
spec.require_paths = ['lib']
|
25
25
|
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.17'
|
27
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
29
|
+
spec.add_development_dependency 'pry'
|
30
30
|
|
31
|
-
spec.add_dependency
|
31
|
+
spec.add_dependency 'i18n'
|
32
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sipp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Buslaev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -129,8 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
|
133
|
-
rubygems_version: 2.5.2
|
132
|
+
rubygems_version: 3.0.3
|
134
133
|
signing_key:
|
135
134
|
specification_version: 4
|
136
135
|
summary: SIPP aka ACRISS code dictionary
|