lib/cosing.rb in cosing-0.2.0 vs lib/cosing.rb in cosing-0.2.1
- old
+ new
@@ -5,10 +5,12 @@
require "pathname"
require "dry/types"
require "dry/struct"
require_relative "cosing/version"
require_relative "cosing/types"
+require_relative "cosing/parser"
+require_relative "cosing/patterns"
require_relative "cosing/ingredient"
require_relative "cosing/annex"
require_relative "cosing/database"
module Cosing
@@ -28,16 +30,13 @@
ingredient_file,
headers: true,
liberal_parsing: true,
header_converters: :symbol
) do |row|
- row =
- row
- .to_h
- .transform_values(&:to_s)
- .transform_values(&:strip)
-
- database.add_ingredient(row)
+ row
+ .to_h
+ .transform_values! { |value| value.to_s.strip }
+ .then { |row| database.add_ingredient(row) }
end
end
end
def gem_path(path)