Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Ruby 3.0 and Rails 6.1 #471

Merged
merged 5 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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