Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Added the cconfig gem
Browse files Browse the repository at this point in the history
This way we can remove quite some code from Portus in regards to the
management of the configuration.

Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
  • Loading branch information
mssola committed Aug 8, 2017
1 parent deb2586 commit 9ce311a
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 267 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ end
# If the deployment is done through Puma, include it in the bundle.
gem "puma", "~> 3.7.0" if ENV["PORTUS_PUMA_DEPLOYMENT"] == "yes" || !packaging?

# Configuration management
gem "cconfig", "~> 1.1.0"

# In order to create the Gemfile.lock required for packaging
# meaning that it should contain only the production packages
# run:
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
cconfig (1.1.0)
safe_yaml (~> 1.0.0, >= 1.0.0)
choice (0.2.0)
cliver (0.3.2)
codeclimate-test-reporter (0.4.7)
Expand Down Expand Up @@ -395,6 +397,7 @@ DEPENDENCIES
brakeman
byebug
capybara (~> 2.14.3)
cconfig (~> 1.1.0)
codeclimate-test-reporter
crono
database_cleaner
Expand Down
4 changes: 0 additions & 4 deletions config/initializers/config.rb

This file was deleted.

60 changes: 0 additions & 60 deletions lib/portus/config.rb

This file was deleted.

79 changes: 0 additions & 79 deletions lib/portus/hash_utils.rb

This file was deleted.

9 changes: 5 additions & 4 deletions lib/tasks/info.rake
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
namespace :portus do
desc "Get general info about the running instance"
task info: :environment do
# We cannot pass it with the dependency-syntax because we need to pass it an
# argument.
Rake::Task["cconfig:info"].reenable
Rake::Task["cconfig:info"].invoke("portus")

puts "\nPortus version: #{Version.value}"
default = File.join(Rails.root, "config", "config.yml")
local = ENV["PORTUS_LOCAL_CONFIG_PATH"] || File.join(Rails.root, "config", "config-local.yml")
cfg = Portus::Config.new(default, local)
puts "Portus has evaluated the following configuration:\n#{cfg}"
end
end
1 change: 0 additions & 1 deletion spec/fixtures/bad.yml

This file was deleted.

16 changes: 0 additions & 16 deletions spec/fixtures/config.yml

This file was deleted.

7 changes: 0 additions & 7 deletions spec/fixtures/local.yml

This file was deleted.

96 changes: 0 additions & 96 deletions spec/lib/portus/config_spec.rb

This file was deleted.

0 comments on commit 9ce311a

Please sign in to comment.