-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
put messaging into GeoConcerns namespace
- Loading branch information
1 parent
3dd0b96
commit d9bd6a8
Showing
11 changed files
with
49 additions
and
46 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
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
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
lib/generators/geo_concerns/templates/config/initializers/geo_concerns_messaging_config.rb
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,37 @@ | ||
module GeoConcerns | ||
module Messaging | ||
def config | ||
@config ||= config_yaml.with_indifferent_access | ||
end | ||
|
||
def messenger | ||
GeoConcerns::EventsGenerator.new | ||
end | ||
|
||
def geoblacklight_client | ||
local_client | ||
end | ||
|
||
def geoserver_client | ||
local_client | ||
end | ||
|
||
private | ||
|
||
def config_yaml | ||
config_file = "#{Rails.root}/config/geo_concerns_messaging.yml" | ||
YAML.load(ERB.new(File.read(config_file)).result)[Rails.env] | ||
end | ||
|
||
def local_client | ||
GeoConcerns::LocalMessagingClient.new | ||
end | ||
|
||
def rabbit_client | ||
GeoConcerns::RabbitMessagingClient.new(Messaging.config['events']['server']) | ||
end | ||
|
||
module_function :config, :config_yaml, :messenger, :local_client, | ||
:rabbit_client, :geoblacklight_client, :geoserver_client | ||
end | ||
end |
34 changes: 0 additions & 34 deletions
34
lib/generators/geo_concerns/templates/config/initializers/messaging_config.rb
This file was deleted.
Oops, something went wrong.
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