Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Merge tag 'v1.2.0'
Browse files Browse the repository at this point in the history
Version 1.2.0

* tag 'v1.2.0':
  Modify .travis.yml to address build config validation feedback
  Bump to version 1.2.0
  Don't use GitHub Actions for Figaro v1
  Update the .gitignore file
  Add an optional build to keep an eye on latest Rails
  Set the entire ENV (plus explicit configuration) in CLI tasks
  Bring the test suite up-to-date
  Update Rubies built in the Travis configuration
  Remove Code Climate, which is causing build failures
  Start exploring CI via GitHub Actions
  Create FUNDING.yml
  • Loading branch information
danarnold committed Dec 14, 2020
2 parents f0834bd + 6ae998e commit cf58e4c
Show file tree
Hide file tree
Showing 22 changed files with 102 additions and 141 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [laserlemon]
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.bundle
.ruby-version
/Gemfile.lock
/coverage
/gemfiles/*.gemfile.lock
/pkg
/tmp
29 changes: 9 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,18 @@ before_script:
branches:
only:
- master
cache: bundler
env:
global:
secure: | # CODECLIMATE_REPO_TOKEN
Pm3j2/BtAzMtqRMP83rFvDtpUNeIAdLMzwH62In+3h/AE8gHDArGYS+jmChw
2hKVjwzVUTWZlpSEocqAg/YIDB3BJzWmyc6UP+VA0gji6HsufXYTmKAVPSVY
TQ7mPPP7hm95e3SkFbLdLbGkQfLdjIKeMY5lY/knX+QKUCjO52Y=
gemfile:
- gemfiles/rails30.gemfile
- gemfiles/rails31.gemfile
- gemfiles/rails32.gemfile
- gemfiles/rails40.gemfile
- gemfiles/rails41.gemfile
- gemfiles/rails42.gemfile
language: ruby
matrix:
- gemfiles/rails52.gemfile
- gemfiles/rails60.gemfile
- gemfiles/rails6.gemfile
jobs:
allow_failures:
- rvm: ruby-head
- gemfile: gemfiles/rails6.gemfile
language: ruby
rvm:
- 1.9.3
- "2.0"
- "2.1"
- "2.2"
- "2.5"
- "2.6"
- "2.7"
- ruby-head
script: bundle exec rspec
sudo: false
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.2.0 / 2020-05-10

* [ENHANCEMENT] Drop support for Rubies 1.9.3, 2.0, 2.1, and 2.2
* [ENHANCEMENT] Add support for Rubies 2.5, 2.6, and 2.7
* [ENHANCEMENT] Drop support for Rails 3 and 4
* [ENHANCEMENT] Add support for Rails 5.2 and 6.0
* [ENHANCEMENT] Proxy all ENV values via CLI to the "heroku" command

## 1.1.1 / 2015-04-30

* [BUGFIX] Fix crash when environment-specific configuration is `nil`
Expand Down
9 changes: 4 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ source "https://rubygems.org"

gemspec

gem "rails", ">= 3.0.3", "< 4.3"
gem "rails", ">= 5.2.0", "< 6.1"

group :test do
gem "aruba", "~> 0.6.2"
gem "codeclimate-test-reporter", require: false
gem "rspec", "~> 3.1"
gem "sqlite3", "~> 1.3"
gem "aruba", "~> 1.0"
gem "rspec", "~> 3.9"
gem "sqlite3"
end
8 changes: 4 additions & 4 deletions figaro.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |gem|
gem.name = "figaro"
gem.version = "1.1.2"
gem.version = "1.2.0"

gem.author = "Steve Richert"
gem.email = "[email protected]"
Expand All @@ -11,11 +11,11 @@ Gem::Specification.new do |gem|
gem.homepage = "https://github.com/laserlemon/figaro"
gem.license = "MIT"

gem.add_dependency "thor", "~> 0.14"
gem.add_dependency "hiera-eyaml"
gem.add_dependency "thor", ">= 0.14.0", "< 2"

gem.add_development_dependency "bundler", "~> 1.7"
gem.add_development_dependency "rake", "~> 10.4"
gem.add_development_dependency "bundler", ">= 1.7.0", "< 3"
gem.add_development_dependency "rake", ">= 10.4.0", "< 14"

gem.files = `git ls-files`.split($\)
gem.test_files = gem.files.grep(/^spec/)
Expand Down
12 changes: 0 additions & 12 deletions gemfiles/rails30.gemfile

This file was deleted.

12 changes: 0 additions & 12 deletions gemfiles/rails31.gemfile

This file was deleted.

12 changes: 0 additions & 12 deletions gemfiles/rails32.gemfile

This file was deleted.

12 changes: 0 additions & 12 deletions gemfiles/rails40.gemfile

This file was deleted.

12 changes: 0 additions & 12 deletions gemfiles/rails41.gemfile

This file was deleted.

12 changes: 0 additions & 12 deletions gemfiles/rails42.gemfile

This file was deleted.

11 changes: 11 additions & 0 deletions gemfiles/rails52.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source "https://rubygems.org"

gemspec path: ".."

gem "rails", "~> 5.2.0"

group :test do
gem "aruba", "~> 1.0"
gem "rspec", "~> 3.9"
gem "sqlite3"
end
11 changes: 11 additions & 0 deletions gemfiles/rails6.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source "https://rubygems.org"

gemspec path: ".."

gem "rails", "~> 6.0"

group :test do
gem "aruba", "~> 1.0"
gem "rspec", "~> 3.9"
gem "sqlite3"
end
11 changes: 11 additions & 0 deletions gemfiles/rails60.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source "https://rubygems.org"

gemspec path: ".."

gem "rails", "~> 6.0.0"

group :test do
gem "aruba", "~> 1.0"
gem "rspec", "~> 3.9"
gem "sqlite3"
end
2 changes: 1 addition & 1 deletion lib/figaro/cli/heroku_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Figaro
class CLI < Thor
class HerokuSet < Task
def run
system(configuration, command)
system(env, command)
end

private
Expand Down
4 changes: 4 additions & 0 deletions lib/figaro/cli/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def initialize(options = {})

private

def env
ENV.to_hash.update(configuration)
end

def configuration
application.configuration
end
Expand Down
14 changes: 7 additions & 7 deletions spec/figaro/cli/heroku_set_spec.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
describe "figaro heroku:set" do
before do
create_dir("example")
create_directory("example")
cd("example")
write_file("config/application.yml", "foo: bar")
end

it "sends Figaro configuration to Heroku" do
run_simple("figaro heroku:set")
run_command_and_stop("figaro heroku:set")

command = commands.last
expect(command.name).to eq("heroku")
Expand All @@ -16,7 +16,7 @@
it "respects path" do
write_file("env.yml", "foo: bar")

run_simple("figaro heroku:set -p env.yml")
run_command_and_stop("figaro heroku:set -p env.yml")

command = commands.last
expect(command.name).to eq("heroku")
Expand All @@ -30,15 +30,15 @@
foo: baz
EOF

run_simple("figaro heroku:set -e test")
run_command_and_stop("figaro heroku:set -e test")

command = commands.last
expect(command.name).to eq("heroku")
expect(command.args).to eq(["config:set", "foo=baz"])
end

it "targets a specific Heroku app" do
run_simple("figaro heroku:set -a foo-bar-app")
run_command_and_stop("figaro heroku:set -a foo-bar-app")

command = commands.last
expect(command.name).to eq("heroku")
Expand All @@ -47,7 +47,7 @@
end

it "targets a specific Heroku git remote" do
run_simple("figaro heroku:set -r production")
run_command_and_stop("figaro heroku:set -r production")

command = commands.last
expect(command.name).to eq("heroku")
Expand All @@ -58,7 +58,7 @@
it "handles values with special characters" do
overwrite_file("config/application.yml", "foo: bar baz")

run_simple("figaro heroku:set")
run_command_and_stop("figaro heroku:set")

command = commands.last
expect(command.name).to eq("heroku")
Expand Down
26 changes: 13 additions & 13 deletions spec/figaro/cli/install_spec.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
describe "figaro install" do
before do
create_dir("example")
create_directory("example")
cd("example")
end

it "creates a configuration file" do
run_simple("figaro install")
run_command_and_stop("figaro install")

check_file_presence(["config/application.yml"], true)
expect("config/application.yml").to be_an_existing_file
end

it "respects path" do
run_simple("figaro install -p env.yml")
run_command_and_stop("figaro install -p env.yml")

check_file_presence(["env.yml"], true)
expect("env.yml").to be_an_existing_file
end

context "with a .gitignore file" do
Expand All @@ -25,25 +25,25 @@
end

it "Git-ignores the configuration file if applicable" do
run_simple("figaro install")
run_command_and_stop("figaro install")

check_file_content(".gitignore", %r(^/foo$), true)
check_file_content(".gitignore", %r(^/bar$), true)
check_file_content(".gitignore", %r(^/config/application\.yml$), true)
expect(".gitignore").to have_file_content(%r(^/foo$))
expect(".gitignore").to have_file_content(%r(^/bar$))
expect(".gitignore").to have_file_content(%r(^/config/application\.yml$))
end

it "respects path" do
run_simple("figaro install -p env.yml")
run_command_and_stop("figaro install -p env.yml")

check_file_content(".gitignore", %r(^/env\.yml$), true)
expect(".gitignore").to have_file_content(%r(^/env\.yml$))
end
end

context "without a .gitignore file" do
it "doesn't generate a new .gitignore file" do
run_simple("figaro install")
run_command_and_stop("figaro install")

check_file_presence([".gitignore"], false)
expect(".gitignore").not_to be_an_existing_file
end
end
end
Loading

0 comments on commit cf58e4c

Please sign in to comment.