storesapp-rb 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/base.rb +10 -4
- metadata +3 -3
data/app/models/base.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
class Base < ActiveResource::Base
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
begin
|
4
|
+
CONFIG = YAML::load(File.open(File.join(Rails.root, 'config', 'storesapp.yml')))[Rails.env]
|
5
|
+
self.site = CONFIG['url'] || "http://api.storesapp.com/v1"
|
6
|
+
self.user = CONFIG['subdomain']
|
7
|
+
self.password = CONFIG['api_key']
|
8
|
+
rescue Exception => e
|
9
|
+
self.site = ENV['STORESAPP_URL'] || "http://api.storesapp.com/v1"
|
10
|
+
self.user = ENV['STORESAPP_SUBDOMAIN']
|
11
|
+
self.password = ENV['STORESAPP_API_KEY']
|
12
|
+
end
|
7
13
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: storesapp-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 7
|
10
|
+
version: 0.2.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Next Feature
|