unitsml 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a08ed1b145023452764dc89296ba34e9ca5eb00cdbaa48cdd053bdc0ead1dbb9
4
- data.tar.gz: a74caaa5c72e9752d97c4c7c753d82f2af0f7ede94463bbc51eb084f1f009275
3
+ metadata.gz: 8f0676fee5095b81368dd8e08790871d2574ad050a51f961bdcc78e6b2d7f672
4
+ data.tar.gz: 8d07b05cd55203eef4dbeb32c9797a8b04ffccf4db583e7d775b300bf8c96f0a
5
5
  SHA512:
6
- metadata.gz: 8f46a6311181f3cd1e199bfb1478ca7fe5a1aeebc51b6523add6af95dd17b3abfc0ed8aabe68e45d03ded5bcd6f28ce480155f7c6aa94ef7345819f25499b338
7
- data.tar.gz: 790714452652b58d3e37056a6359193f42b7ff11d490cf6130005dd7059653eb90b61c54f39e712ea7cd92f52452b8c4485181adbb2bebd2e27c752e83ba46d3
6
+ metadata.gz: '019dcd68566106aa6b6dcf94fd4738892c43d7f9ee018f754dfc990d0eb7b8798cdc9f66b89e12772c191c2b0f7588876e3f12e9f7b59cff5070a53cb5c358d1'
7
+ data.tar.gz: d510361071f2653e4cda7dd6b500080821cb7e49f3e20b1fb4d74153c95e8f3f37462f3c483a088c3d032aaa20db7be2e0964524f1bf80ef415d4aaaa1babc2e
data/.gitmodules CHANGED
@@ -1,6 +1,6 @@
1
1
  [submodule "unitsdb"]
2
2
  path = unitsdb
3
- url = git@github.com:unitsml/unitsdb.git
3
+ url = https://github.com/unitsml/unitsdb.git
4
4
  [submodule "vendor/unitsdb"]
5
5
  path = vendor/unitsdb
6
- url = git@github.com:unitsml/unitsdb.git
6
+ url = https://github.com/unitsml/unitsdb.git
@@ -6,16 +6,15 @@ module Unitsml
6
6
  class << self
7
7
  def load_yaml(file_name)
8
8
  @@hash ||= {}
9
- file_path = File.path(valid_path(file_name))
10
- @@hash[file_name.to_sym] ||= YAML.load_file(file_path)
9
+ @@hash[file_name] ||= YAML.load_file(valid_path(file_name))
11
10
  end
12
11
 
13
12
  def load_dimensions
14
- @@dim_file = load_yaml("dimensions")
13
+ @@dim_file = load_yaml(:dimensions)
15
14
  end
16
15
 
17
16
  def load_units
18
- @@units_file = load_yaml("units")
17
+ @@units_file = load_yaml(:units)
19
18
  end
20
19
 
21
20
  def units
@@ -47,7 +46,7 @@ module Unitsml
47
46
  end
48
47
 
49
48
  def quantities
50
- @@quantities ||= load_yaml("quantities")
49
+ @@quantities ||= load_yaml(:quantities)
51
50
  end
52
51
 
53
52
  def filtered_units
@@ -57,7 +56,7 @@ module Unitsml
57
56
  end
58
57
 
59
58
  def prefixes_hash
60
- @@prefixes_hashes ||= prefixs_ids(load_yaml("prefixes"))
59
+ @@prefixes_hashes ||= prefixs_ids(load_yaml(:prefixes))
61
60
  end
62
61
 
63
62
  def dimensions_hash
@@ -95,8 +94,9 @@ module Unitsml
95
94
  end
96
95
 
97
96
  def valid_path(file_name)
98
- path = "unitsdb/#{file_name}.yaml"
99
- File.file?(path) ? path : "../#{path}"
97
+ File.expand_path(
98
+ File.join(__dir__, "..", "..","unitsdb", "#{file_name}.yaml")
99
+ )
100
100
  end
101
101
  end
102
102
  end
@@ -1,3 +1,3 @@
1
1
  module Unitsml
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/unitsml.gemspec CHANGED
@@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib", "unitsdb/**/*.yaml"]
29
29
 
30
- spec.add_dependency "parslet"
31
30
  spec.add_dependency "plurimath"
32
31
  spec.add_dependency "htmlentities"
33
32
  spec.add_development_dependency "byebug"
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unitsml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-25 00:00:00.000000000 Z
11
+ date: 2023-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: parslet
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: plurimath
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -163,7 +149,6 @@ files:
163
149
  - ".gitmodules"
164
150
  - ".rspec"
165
151
  - Gemfile
166
- - Gemfile.lock
167
152
  - LICENSE.txt
168
153
  - Rakefile
169
154
  - bin/console
@@ -213,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
198
  - !ruby/object:Gem::Version
214
199
  version: '0'
215
200
  requirements: []
216
- rubygems_version: 3.1.2
201
+ rubygems_version: 3.3.26
217
202
  signing_key:
218
203
  specification_version: 4
219
204
  summary: Gem-wrapper for working with unitsdb
data/Gemfile.lock DELETED
@@ -1,83 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- unitsml (0.2.0)
5
- htmlentities
6
- parslet
7
- plurimath
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- ast (2.4.2)
13
- byebug (11.1.3)
14
- coderay (1.1.3)
15
- diff-lcs (1.4.4)
16
- docile (1.3.5)
17
- equivalent-xml (0.6.0)
18
- nokogiri (>= 1.4.3)
19
- htmlentities (4.3.4)
20
- method_source (0.9.2)
21
- mini_portile2 (2.8.1)
22
- nokogiri (1.14.0)
23
- mini_portile2 (~> 2.8.0)
24
- racc (~> 1.4)
25
- ox (2.14.17)
26
- parallel (1.20.1)
27
- parser (3.0.0.0)
28
- ast (~> 2.4.1)
29
- parslet (2.0.0)
30
- plurimath (0.3.6)
31
- ox
32
- parslet
33
- powerpack (0.1.3)
34
- pry (0.12.2)
35
- coderay (~> 1.1.0)
36
- method_source (~> 0.9.0)
37
- racc (1.6.2)
38
- rainbow (3.0.0)
39
- rake (12.3.3)
40
- rspec (3.10.0)
41
- rspec-core (~> 3.10.0)
42
- rspec-expectations (~> 3.10.0)
43
- rspec-mocks (~> 3.10.0)
44
- rspec-core (3.10.1)
45
- rspec-support (~> 3.10.0)
46
- rspec-expectations (3.10.1)
47
- diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.10.0)
49
- rspec-mocks (3.10.2)
50
- diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.10.0)
52
- rspec-support (3.10.2)
53
- rubocop (0.54.0)
54
- parallel (~> 1.10)
55
- parser (>= 2.5)
56
- powerpack (~> 0.1)
57
- rainbow (>= 2.2.2, < 4.0)
58
- ruby-progressbar (~> 1.7)
59
- unicode-display_width (~> 1.0, >= 1.0.1)
60
- ruby-progressbar (1.11.0)
61
- simplecov (0.21.2)
62
- docile (~> 1.1)
63
- simplecov-html (~> 0.11)
64
- simplecov_json_formatter (~> 0.1)
65
- simplecov-html (0.12.3)
66
- simplecov_json_formatter (0.1.2)
67
- unicode-display_width (1.7.0)
68
-
69
- PLATFORMS
70
- ruby
71
-
72
- DEPENDENCIES
73
- byebug
74
- equivalent-xml
75
- pry (~> 0.12.2)
76
- rake
77
- rspec (~> 3.6)
78
- rubocop (= 0.54.0)
79
- simplecov (~> 0.15)
80
- unitsml!
81
-
82
- BUNDLED WITH
83
- 2.3.25