Skip to content

Commit

Permalink
Use ‘system’ as the default system directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcroome committed Sep 20, 2016
1 parent e88c246 commit 7982360
Show file tree
Hide file tree
Showing 19 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ begin
rescue LoadError
end

require_relative "component/app_prototype/container"
require_relative "system/app_prototype/container"

AppPrototype::Container.boot! :bugsnag
require "bugsnag/rake"
Expand Down
2 changes: 1 addition & 1 deletion apps/main/component/main/container.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Main
class Container < Dry::Web::Container
require root.join("component/app_prototype/container")
require root.join("system/app_prototype/container")
import AppPrototype::Container

configure do |config|
Expand Down
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
require "bundler/setup"

require "dry/web/console"
require_relative "../component/boot"
require_relative "../system/boot"

Dry::Web::Console.start
2 changes: 1 addition & 1 deletion config.ru
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_relative "component/boot"
require_relative "system/boot"
run AppPrototype::Application.freeze.app
2 changes: 1 addition & 1 deletion docs/rom.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We use [ROM](http://rom-rb.org) for working with the app’s Postgres database.

## Setup

ROM is set up [in a boot file](component/boot/rom.rb) in core app component. In this file, we:
ROM is set up [in a boot file](system/boot/rom.rb) in core app component. In this file, we:

* Configure ROM's underlying [Sequel](https://github.com/jeremyevans/sequel) SQL adapter, informing it about timezones, and enabling some plugins to make working with Postgresql better (e.g. having it show full error messages, and enabling support for working with array and JSON columns).
* Configure ROM to use our app's `database_url`.
Expand Down
2 changes: 1 addition & 1 deletion docs/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Each sub-app, located in `apps/<sub_app>`, is a `Dry::Web::Roda::Application`, w

Each sub-app imports the "core" component, which allows the sub-apps to share common logic and functionality. Right now, the core component is used for the following:

* Booting application-wide sub-systems and integrations with 3rd party services (in `component/boot/`)
* Booting application-wide sub-systems and integrations with 3rd party services (in `system/boot/`)
* Setting up ROM for persistence and exposing the basic ROM commands and relations for the sub-apps to build upon with their own repositories ([learn more about the ROM setup here](rom.md))
2 changes: 1 addition & 1 deletion spec/app_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Dir[SPEC_ROOT.join("support/app/*.rb").to_s].each(&method(:require))
Dir[SPEC_ROOT.join("shared/app/*.rb").to_s].each(&method(:require))

require SPEC_ROOT.join("../component/boot").realpath
require SPEC_ROOT.join("../system/boot").realpath

Capybara.app = AppPrototype::Application.app
Capybara.server_port = 3001
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ module AppPrototype
class Container < Dry::Web::Umbrella
configure do |config|
config.name = :core
config.system_dir = "component"
config.settings_loader = AppPrototype::Settings
config.auto_register = %w[lib/authentication]
end

load_paths! "lib", "component"
load_paths! "lib", "system"

def self.settings
config.settings
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7982360

Please sign in to comment.