Skip to content

Commit

Permalink
Replace container initialization to system folder
Browse files Browse the repository at this point in the history
  • Loading branch information
davydovanton committed Feb 14, 2018
1 parent a6a86a9 commit d06a7d6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'bundler/setup'
require 'hanami/setup'
require 'hanami/model'
require_relative '../system/import'
require_relative '../lib/contributors'
require_relative '../apps/admin/application'
require_relative '../apps/api/application'
Expand Down
7 changes: 2 additions & 5 deletions config/initializers/application.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
require 'dry/system/container'

# Configure the code that will yield each time Admin::Action is included
# This is useful for sharing common functionality
#
# See: http://www.rubydoc.info/gems/hanami-controller#Configuration
ADMIN_USERNAME = ENV.fetch('ADMIN_USERNAME')
ADMIN_PASSWORD = ENV.fetch('ADMIN_PASSWORD')

class Application < Dry::System::Container
configure
end
# Enable pagination helpers for repositories
CommitRepository.enable_pagination!
1 change: 0 additions & 1 deletion config/initializers/enable_pagination.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/contributors.rb
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
Hanami::Utils.require!("#{__dir__}/contributors")
5 changes: 5 additions & 0 deletions system/container.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'dry/system/container'

class Application < Dry::System::Container
configure
end
2 changes: 1 addition & 1 deletion system/import.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require 'system/container'
require_relative './container'
Import = Application.injector

0 comments on commit d06a7d6

Please sign in to comment.