lib/lotus/lotusrc.rb in lotusrb-0.3.2 vs lib/lotus/lotusrc.rb in lotusrb-0.4.0

- old
+ new

@@ -1,7 +1,7 @@ require 'pathname' -require 'dotenv' +require 'dotenv/parser' module Lotus # Create and read the .lotusrc file in the root of the application # # @since 0.3.0 @@ -91,12 +91,13 @@ # options = { architect: 'application', test: 'rspec', template: 'slim' } # Lotus::Lotusrc.new(Pathname.new(Dir.pwd), options).read # # => { architecture: 'application', test: 'rspec', template: 'slim' } def read if exists? - lotusrc_options = Dotenv.load path_file - Utils::Hash.new(lotusrc_options).symbolize! + Utils::Hash.new( + Dotenv::Parser.call(content) + ).symbolize! end end private @@ -139,8 +140,12 @@ # @return [Pathname] lotusrc file's path # # @see Lotus::Lotusrc::FILE_NAME def path_file @root.join FILE_NAME + end + + def content + path_file.read end end end