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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86e0ed29296d0fe1ec72fdffb4b1f3121ea9617d
4
- data.tar.gz: 1ac0f72f93e101fdf2710da90013124036a511c5
3
+ metadata.gz: 3cd49b7b4ca549fc5c73c150613690f7251dae90
4
+ data.tar.gz: afe0469e7ddbbb58f869b5cc6573a9a332db22a5
5
5
  SHA512:
6
- metadata.gz: 997f992ba82729f6624072e0631694eff8367ecea6203645293b39ecf0bd9a18aeff9c89567ee64e3ece2bbd90be5a3a4af68660f101c8728f86b5436c33a470
7
- data.tar.gz: 7f2c61126b2b21cec5189d6e15939050321f05d07dbba4c1e522613f00e08486a31494dfd77d043faa532b90d2aae376123e4110bd0ea0e253a8f5ae7ff7a356
6
+ metadata.gz: a046c76856558e05f71a531e6e32106840fd0648414e41d489df85f4756b59c1a94de2eeeaa03aebd48e86692ea027c0f8c702584bca3e54b0877f5bda5c3fe7
7
+ data.tar.gz: 60763a23c5b3c675f3455fbe78bf4d267900fbd84baccc03dbbf30264e1457f5f8862d5570dd39f805be0ea9500d8d782d8aa2191cefe4d8c56eb26d9f5a8d02
@@ -1,3 +1,3 @@
1
1
  module GoogleTravelAgent
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -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) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-api-middle_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun Dern