Skip to content

Commit

Permalink
Use methods compatible with Ruby 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benforeva committed Oct 23, 2020
1 parent 76d4ba9 commit b374d8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/dotenv/template.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module Dotenv
EXPORT_COMMAND = "export ".freeze
# Class for creating a template from a env file
class EnvTemplate
def initialize(env_file)
Expand All @@ -17,7 +18,7 @@ def create_template

def template_line(line)
var, value = line.split("=")
template = var.delete_prefix "export "
template = var.gsub(EXPORT_COMMAND, "")
is_a_comment = var.strip[0].eql?("#")
value.nil? || is_a_comment ? line : "#{var}=#{template}"
end
Expand Down

0 comments on commit b374d8e

Please sign in to comment.