cosing 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c1d24a9645d88deb596a2e1be49ed985f87ff340581bb80b105944a1b85683c
4
- data.tar.gz: dc7ba8882733e0826751ba07ff486e06b5b153edbde606b2cf37558cb3e45e63
3
+ metadata.gz: 7dfb5f935089d6b9d78f73bd7ccc35a478f5b817379044d576ed24dc297416ed
4
+ data.tar.gz: 2470118e7ec2e55e46d85467fe90068e065fd1815143b14611b9832cda817aa1
5
5
  SHA512:
6
- metadata.gz: ce698dfb511c4054ba58a7781ad0bd6d404b12d6006b58cfe3239386f4c279dde97db90dcf6012dec02a4b6f87b3b29d613d80656aa3180be2f3dc15c9c5ab9b
7
- data.tar.gz: 913dc114a5948ece59fcb6dccdc4071d5ab59cd9a68d119f6d929d66c818e7031d3159af61cf71a385677374ef37a99a44a69173c9ea7a9ddd75b39186717255
6
+ metadata.gz: 8e9db53909ceb9c486ecef699720e781618c3c225e7e6dc1d61f9e35ab66273771f6c6191580676d57bc54e874a790130526620b23a822550ea01063dedb99f9
7
+ data.tar.gz: 759f0abe043e934a5f1a17d4514146aa7bfec2c3b41e340a5af5c7d0f2ec8d3d13102ae6a05bba6306fec4361d7aea87408841131f9f2d95e8702eb3e4de9036
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2023-12-03
4
+
5
+ - Fixes gem paths
6
+
3
7
  ## [0.1.0] - 2023-12-03
4
8
 
5
9
  - Initial release
data/lib/cosing/annex.rb CHANGED
@@ -15,7 +15,7 @@ module Cosing
15
15
 
16
16
  def parse(path)
17
17
  CSV.parse(
18
- File.read(path),
18
+ File.read(Cosing.gem_path(path)),
19
19
  headers: true,
20
20
  liberal_parsing: true,
21
21
  header_converters: :symbol
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cosing
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/cosing.rb CHANGED
@@ -13,12 +13,15 @@ require_relative "cosing/database"
13
13
  module Cosing
14
14
  module_function
15
15
 
16
+ GEM_ROOT = File.expand_path("..", __dir__)
17
+
16
18
  class Error < StandardError; end
17
19
  # Your code goes here...
18
20
 
19
21
  def load
20
22
  Database.new(Annex.load).tap do |database|
21
- ingredient_file = File.read("data/ingredients.csv").delete("\r")
23
+ path = gem_path("data/ingredients.csv")
24
+ ingredient_file = File.read(path).delete("\r")
22
25
 
23
26
  CSV.parse(
24
27
  ingredient_file,
@@ -36,4 +39,8 @@ module Cosing
36
39
  end
37
40
  end
38
41
  end
42
+
43
+ def gem_path(path)
44
+ Pathname.new(GEM_ROOT).join(path)
45
+ end
39
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cosing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nolan J Tait