ogone-rails 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -32,7 +32,8 @@ Define ogone parameters in a yaml config file:
32
32
  language: "nl_NL"
33
33
  mode: 'live'
34
34
 
35
- Configure ogone-rails in an initializer:
35
+ __Deprecated in version >= 0.1.3__, configure ogone-rails in an initializer:
36
+
36
37
 
37
38
  # initializers/ogone.rb
38
39
  ogone_config = YAML.load_file('config/ogone.yml')[Rails.env].symbolize_keys
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
data/lib/ogone-rails.rb CHANGED
@@ -7,4 +7,28 @@ require 'ogone-rails/rails'
7
7
  require 'ogone-rails/form'
8
8
  require 'ogone-rails/string-to-hash'
9
9
  require 'ogone-rails/helpers'
10
- require 'ogone-rails/check-auth'
10
+ require 'ogone-rails/check-auth'
11
+
12
+
13
+ module OgoneRails
14
+ ASSET_ROOT = File.expand_path((defined?(Rails) && Rails.root.to_s.length > 0) ? Rails.root : ENV['RAILS_ROOT'] || '.') unless defined?(ASSET_ROOT)
15
+ DEFAULT_CONFIG = File.join( ASSET_ROOT, 'config', 'ogone.yml')
16
+
17
+ class MissingConfiguration < NameError; end
18
+
19
+ def load!
20
+ load_config DEFAULT_CONFIG
21
+ end
22
+
23
+ def load_config config_path
24
+ exists = config_path && File.exists?(config_path)
25
+ return false if !exists
26
+ raise MissingConfiguration, "Could not find the #{ config_path } configuration file" unless exists
27
+
28
+ # load ogone configuration
29
+ config = YAML.load_file('config/ogone.yml')[Rails.env].symbolize_keys
30
+ OgoneRails::config (config)
31
+ end
32
+ end
33
+
34
+ OgoneRails.load!
data/ogone-rails.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ogone-rails"
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Robin Houdmeyers"]
12
- s.date = "2012-12-11"
12
+ s.date = "2012-12-13"
13
13
  s.description = "Add Ogone payments functionality to your Rails application"
14
14
  s.email = "houdmeyers@gmail.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ogone-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-11 00:00:00.000000000 Z
12
+ date: 2012-12-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
@@ -139,7 +139,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  segments:
141
141
  - 0
142
- hash: -718371390523835808
142
+ hash: 448932477420404322
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  none: false
145
145
  requirements: