This repository has been archived by the owner on Dec 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Igor Rzegocki
committed
Apr 14, 2016
1 parent
2e9947b
commit 79d2d64
Showing
7 changed files
with
112 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
module Drivers | ||
module Framework | ||
class Base < Drivers::Base | ||
include Drivers::Dsl::Output | ||
|
||
def out | ||
handle_output(raw_out) | ||
end | ||
|
||
def raw_out | ||
node['defaults']['framework'].merge( | ||
node['deploy'][app['shortname']]['framework'] || {} | ||
).symbolize_keys | ||
end | ||
|
||
def validate_app_engine | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
module Drivers | ||
module Framework | ||
class Factory | ||
def self.build(app, node, options = {}) | ||
engine = detect_engine(app, node, options) | ||
raise StandardError, 'There is no supported Framework driver for given configuration.' if engine.blank? | ||
engine.new(app, node, options) | ||
end | ||
|
||
def self.detect_engine(app, node, _options) | ||
Drivers::Framework::Base.descendants.detect do |framework_driver| | ||
framework_driver.allowed_engines.include?( | ||
node['deploy'][app['shortname']]['framework'].try(:[], 'adapter') || | ||
node['defaults']['framework']['adapter'] | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
module Drivers | ||
module Framework | ||
class Rails < Drivers::Framework::Base | ||
adapter :rails | ||
allowed_engines :rails | ||
output filter: [:migrate, :migration_command, :deploy_environment] | ||
|
||
def raw_out | ||
super.merge(deploy_environment: { 'RAILS_ENV' => 'production' }) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters