apphoshies-ruby-client 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +1 -0
- data/lib/apphoshies_client.rb +1 -1
- data/lib/apphoshies_client/configuration.rb +24 -0
- metadata +4 -3
data/Manifest.txt
CHANGED
data/lib/apphoshies_client.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
class ApphoshiesClient::Configuration
|
2
|
+
attr_accessor :site, :username, :api_key, :app_id
|
3
|
+
|
4
|
+
def config(scope = 'default')
|
5
|
+
@config ||= read_config
|
6
|
+
self.username = @config[scope]['username']
|
7
|
+
self.api_key = @config[scope]['api_key']
|
8
|
+
self.app_id = @config[scope]['app_id']
|
9
|
+
end
|
10
|
+
|
11
|
+
def read_config
|
12
|
+
if File.exists?("apphoshies.yml")
|
13
|
+
puts "Using config in this directory"
|
14
|
+
@config = YAML.load(File.read("apphoshies.yml"))
|
15
|
+
else
|
16
|
+
begin
|
17
|
+
puts "Using config in your home directory"
|
18
|
+
@config = YAML.load(File.read("#{ENV['HOME']}/.apphoshies.yml"))
|
19
|
+
rescue Errno::ENOENT
|
20
|
+
raise "apphoshies.yml expected in current directory or ~/.apphoshies.yml"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
version: "0.
|
7
|
+
- 2
|
8
|
+
version: "0.2"
|
9
9
|
platform: ruby
|
10
10
|
authors:
|
11
11
|
- Oliver Kiessler
|
@@ -13,7 +13,7 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
|
16
|
-
date: 2010-07-
|
16
|
+
date: 2010-07-10 00:00:00 +02:00
|
17
17
|
default_executable:
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- README.rdoc
|
77
77
|
- Rakefile
|
78
78
|
- lib/apphoshies_client.rb
|
79
|
+
- lib/apphoshies_client/configuration.rb
|
79
80
|
- lib/apphoshies_client/device_token.rb
|
80
81
|
- lib/apphoshies_client/document.rb
|
81
82
|
- lib/apphoshies_client/message.rb
|