Skip to content

Commit

Permalink
Merge pull request #458 from bkeepers/eol-ruby
Browse files Browse the repository at this point in the history
Continue to support EOL'd Ruby versions
  • Loading branch information
bkeepers committed Jul 27, 2022
2 parents 36c117c + 93a3b0f commit 45b712a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2']
ruby: ['2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
steps:
- name: Check out repository code
uses: actions/checkout@v3
Expand Down
5 changes: 5 additions & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ruby_version: 2.5

ignore:
- lib/dotenv/parser.rb:
- Lint/InheritException
6 changes: 5 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

[Unreleased changes](https://github.com/bkeepers/dotenv/compare/v2.8.0...master)
[Unreleased changes](https://github.com/bkeepers/dotenv/compare/v2.8.1...master)

## 2.8.1 - July 27, 2022

* Restore support for EOL'd Ruby versions (2.5, 2.6) (#458)[https://github.com/bkeepers/dotenv/pull/458]

## 2.8.0 - July 26, 2022

Expand Down
2 changes: 1 addition & 1 deletion lib/dotenv/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def expand_newlines(value)
end

def variable_not_set?(line)
!line.split[1..].all? { |var| @hash.member?(var) }
!line.split[1..-1].all? { |var| @hash.member?(var) }
end

def unescape_value(value, maybe_quote)
Expand Down
2 changes: 1 addition & 1 deletion lib/dotenv/substitutions/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def call(value, _env, _is_load)

if $LAST_MATCH_INFO[:backslash]
# Command is escaped, don't replace it.
$LAST_MATCH_INFO[0][1..]
$LAST_MATCH_INFO[0][1..-1]
else
# Execute the command and return the value
`#{command}`.chomp
Expand Down
2 changes: 1 addition & 1 deletion lib/dotenv/substitutions/variable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def call(value, env, is_load)

def substitute(match, variable, env)
if match[1] == "\\"
variable[1..]
variable[1..-1]
elsif match[3]
env.fetch(match[3], "")
else
Expand Down
2 changes: 1 addition & 1 deletion lib/dotenv/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Dotenv
VERSION = "2.8.0".freeze
VERSION = "2.8.1".freeze
end

0 comments on commit 45b712a

Please sign in to comment.