apphoshies-ruby-client 0.3 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/apphoshies_client.rb +3 -2
- data/lib/apphoshies_client/configuration.rb +8 -5
- metadata +3 -2
data/lib/apphoshies_client.rb
CHANGED
@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
|
|
2
2
|
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
3
|
|
4
4
|
module ApphoshiesClient
|
5
|
-
VERSION = '0.3'
|
5
|
+
VERSION = '0.3.1'
|
6
6
|
end
|
7
7
|
|
8
8
|
require "rubygems"
|
@@ -13,8 +13,9 @@ ActiveResource::Base.include_root_in_json = true
|
|
13
13
|
|
14
14
|
require 'apphoshies_client/configuration'
|
15
15
|
@@apphoshies_configuration = ApphoshiesClient::Configuration.new
|
16
|
-
@@apphoshies_configuration.config
|
17
16
|
@@apphoshies_configuration.site = 'https://service.apphoshies.com'
|
17
|
+
@@apphoshies_configuration.username = ''
|
18
|
+
@@apphoshies_configuration.api_key = ''
|
18
19
|
|
19
20
|
require 'apphoshies_client/device_token'
|
20
21
|
require 'apphoshies_client/document'
|
@@ -2,10 +2,13 @@ class ApphoshiesClient::Configuration
|
|
2
2
|
attr_accessor :site, :username, :api_key, :app_id
|
3
3
|
|
4
4
|
def config(scope = 'default', cfg_path = "apphoshies.yml")
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
read_config(cfg_path)
|
6
|
+
if @config and @config[scope]
|
7
|
+
self.username = @config[scope]['username']
|
8
|
+
self.api_key = @config[scope]['api_key']
|
9
|
+
self.app_id = @config[scope]['app_id']
|
10
|
+
end
|
11
|
+
self.site = 'https://service.apphoshies.com'
|
9
12
|
end
|
10
13
|
|
11
14
|
def read_config(cfg_path)
|
@@ -17,7 +20,7 @@ class ApphoshiesClient::Configuration
|
|
17
20
|
puts "Using config in your home directory"
|
18
21
|
@config = YAML.load(File.read("#{ENV['HOME']}/.apphoshies.yml"))
|
19
22
|
rescue Errno::ENOENT
|
20
|
-
|
23
|
+
puts ">>> apphoshies.yml expected in current directory or ~/.apphoshies.yml"
|
21
24
|
end
|
22
25
|
end
|
23
26
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apphoshies-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Oliver Kiessler
|