google-api-middle_man 0.1.0 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google-api-middle_man/version.rb +1 -1
- data/lib/google-api-middle_man.rb +4 -4
- data/spec/lib/google-api-middle_man_spec.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cd49b7b4ca549fc5c73c150613690f7251dae90
|
4
|
+
data.tar.gz: afe0469e7ddbbb58f869b5cc6573a9a332db22a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a046c76856558e05f71a531e6e32106840fd0648414e41d489df85f4756b59c1a94de2eeeaa03aebd48e86692ea027c0f8c702584bca3e54b0877f5bda5c3fe7
|
7
|
+
data.tar.gz: 60763a23c5b3c675f3455fbe78bf4d267900fbd84baccc03dbbf30264e1457f5f8862d5570dd39f805be0ea9500d8d782d8aa2191cefe4d8c56eb26d9f5a8d02
|
@@ -10,14 +10,14 @@ module GoogleAPIMiddleMan
|
|
10
10
|
|
11
11
|
def initialize(config)
|
12
12
|
[:application_name, :key_location, :google_service_email].each do |key|
|
13
|
-
unless config.has_key?(key)
|
13
|
+
unless config.has_key?(key) || config.has_key?(key.to_s)
|
14
14
|
raise MissingConfigOptions, "config is missing #{key}"
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
@application_name = config[:application_name]
|
19
|
-
@key_location = config[:key_location]
|
20
|
-
@google_service_email = config[:google_service_email]
|
18
|
+
@application_name = config[:application_name] || config['application_name']
|
19
|
+
@key_location = config[:key_location] || config['key_location']
|
20
|
+
@google_service_email = config[:google_service_email] || config['google_service_email']
|
21
21
|
|
22
22
|
@client = Google::APIClient.new(application_name: @application_name)
|
23
23
|
end
|
@@ -29,6 +29,16 @@ describe GoogleAPIMiddleMan::Agent do
|
|
29
29
|
GoogleAPIMiddleMan::Agent.new(google_config)
|
30
30
|
end
|
31
31
|
|
32
|
+
it "should allow strings or symbols for keys" do
|
33
|
+
google_config_as_string = {
|
34
|
+
'application_name' => 'foo app',
|
35
|
+
'key_location' => 'some key location',
|
36
|
+
'google_service_email' => 'email stuff'
|
37
|
+
}
|
38
|
+
Google::APIClient.should_receive(:new).with(application_name: 'foo app')
|
39
|
+
GoogleAPIMiddleMan::Agent.new(google_config_as_string)
|
40
|
+
end
|
41
|
+
|
32
42
|
describe "#calendar_events" do
|
33
43
|
let(:calendar_hash) { double }
|
34
44
|
let(:travel_agent) { GoogleAPIMiddleMan::Agent.new(google_config) }
|