forked from PoundPay/poundpay-ruby
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
creating instructions to use a Rails initializers with yaml configs
- Loading branch information
Showing
5 changed files
with
41 additions
and
34 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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
if defined? Rails and Rails.root.join("config", "poundpay.yml").exist? | ||
if defined? Rails | ||
module Poundpay | ||
@rails_config = YAML::load_file(Rails.root.join("config", "poundpay.yml"))[Rails.env] | ||
Poundpay.configure_from_hash(@rails_config) | ||
def self.configure_from_yaml(path) | ||
pathname = Pathname.new Rails.root.join(path) | ||
raise ArgumentError.new "File does not exist: #{pathname.to_s}" unless pathname.exist? | ||
config = YAML::load_file(pathname)[Rails.env] | ||
Poundpay.configure_from_hash(config) | ||
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Poundpay | ||
VERSION = "0.2.0" | ||
VERSION = "0.2.1" | ||
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