Skip to content

Commit

Permalink
Merge pull request #471 from bkeepers/rails-improvements
Browse files Browse the repository at this point in the history
Require Ruby 3.0 and Rails 7.1
  • Loading branch information
bkeepers committed Jan 21, 2024
2 parents 9107dc2 + f47d226 commit cb172bf
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ on:
branches: [master]
pull_request:
jobs:
build:
test:
name: Test on Ruby ${{ matrix.ruby }} and Rails ${{ matrix.rails }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.0', '3.1', '3.2', '3.3']
rails: ['6.1.0', '7.0.0', '7.1.0']
env:
RAILS_VERSION: ${{ matrix.rails }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ source "https://rubygems.org"
gemspec name: "dotenv"
gemspec name: "dotenv-rails"

gem "railties", "~> #{ENV["RAILS_VERSION"] || "7.1"}"

group :guard do
gem "guard-rspec"
gem "guard-bundler"
Expand Down
2 changes: 1 addition & 1 deletion dotenv-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Gem::Specification.new "dotenv-rails", Dotenv::VERSION do |gem|
gem.files = `git ls-files lib | grep dotenv-rails.rb`.split("\n") + ["README.md", "LICENSE"]

gem.add_dependency "dotenv", Dotenv::VERSION
gem.add_dependency "railties", ">= 3.2"
gem.add_dependency "railties", ">= 6.1"

gem.add_development_dependency "spring"
end
2 changes: 2 additions & 0 deletions dotenv.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ Gem::Specification.new "dotenv", Dotenv::VERSION do |gem|
gem.add_development_dependency "rake"
gem.add_development_dependency "rspec"
gem.add_development_dependency "standard"

gem.required_ruby_version = ">= 3.0"
end
3 changes: 2 additions & 1 deletion lib/dotenv/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ module Dotenv
# This class inherits from Hash and represents the environment into which
# Dotenv will load key value pairs from a file.
class Environment < Hash
attr_reader :filename
attr_reader :filename, :overwrite

def initialize(filename, overwrite: false)
super()
@filename = filename
@overwrite = overwrite
load
Expand Down
3 changes: 2 additions & 1 deletion lib/dotenv/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Rails < ::Rails::Railtie
attr_accessor :overwrite, :files

def initialize
super()
@overwrite = false
@files = [
root.join(".env.#{env}.local"),
Expand Down Expand Up @@ -81,7 +82,7 @@ def self.load
end

initializer "dotenv.deprecator" do |app|
app.deprecators[:dotenv] = deprecator
app.deprecators[:dotenv] = deprecator if app.respond_to?(:deprecators)
end

config.before_configuration { load }
Expand Down

0 comments on commit cb172bf

Please sign in to comment.