megam_api 0.55 → 0.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/megam/api.rb +1 -23
- data/lib/megam/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9818fe4610d915f4fef1e1eee4b70f76bc1b85a8
|
4
|
+
data.tar.gz: 0ecdd3cd204d83031c52135fad8f8d505d2501ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 129876ce490a1527e75b132c010196b537c4f8c6b95dbd13fdd23305cc90ebe2e0bff64f200a3fd0bd6ee5cbe1431f2c128cfa0a5f66724db2a752acdefaba20
|
7
|
+
data.tar.gz: 4a90716b93c566e299f406964fdc02ab2882a205496d3ba36b6f149e0ed98b7455012cce3de6f583b731eccb71660c9ccf3b5f476ef6c2a4154a5d0e7d015931
|
data/lib/megam/api.rb
CHANGED
@@ -139,11 +139,6 @@ module Megam
|
|
139
139
|
# 3. Upon merge of the options, the api_key, email as available in the @options is deleted.
|
140
140
|
def initialize(options={})
|
141
141
|
@options = OPTIONS.merge(options)
|
142
|
-
if File.exist?("#{ENV['MEGAM_HOME']}/nilavu.yml")
|
143
|
-
@common = YAML.load_file("#{ENV['MEGAM_HOME']}/nilavu.yml") #COMMON YML
|
144
|
-
@options[:host] = "#{@common["api"]["host"]}"
|
145
|
-
@options[:scheme] = "#{@common["api"]["scheme"]}"
|
146
|
-
end
|
147
142
|
@api_key = @options.delete(:api_key) || ENV['MEGAM_API_KEY']
|
148
143
|
@email = @options.delete(:email)
|
149
144
|
raise ArgumentError, "You must specify [:email, :api_key]" if @email.nil? || @api_key.nil?
|
@@ -232,24 +227,7 @@ module Megam
|
|
232
227
|
X_Megam_HMAC => encoded_api_header[:hmac],
|
233
228
|
X_Megam_DATE => encoded_api_header[:date],
|
234
229
|
}).merge(@options[:headers])
|
235
|
-
|
236
|
-
|
237
|
-
if @options[:scheme] == "https"
|
238
|
-
|
239
|
-
if !File.exist?(File.expand_path(File.join("#{ENV['MEGAM_HOME']}", "#{@common["api"]["pub_key"]}")))
|
240
|
-
text.warn("Certificate file does not exist. SSL_VERIFY_PEER set as false")
|
241
|
-
Excon.defaults[:ssl_verify_peer] = false
|
242
|
-
@options[:scheme] == "http"
|
243
|
-
elsif !File.exist?(File.expand_path(File.join(File.dirname(__FILE__), "..", "certs", "cacert.pem")))
|
244
|
-
text.warn("Certificate file does not exist. SSL_VERIFY_PEER set as false")
|
245
|
-
Excon.defaults[:ssl_verify_peer] = false
|
246
|
-
@options[:scheme] == "http"
|
247
|
-
else
|
248
|
-
Megam::Log.debug("Certificate found")
|
249
|
-
Excon.defaults[:ssl_verify_peer] = true
|
250
|
-
Excon.defaults[:ssl_ca_file] = File.expand_path(File.join("#{ENV['MEGAM_HOME']}", "#{@common["api"]["pub_key"]}")) || File.expand_path(File.join(File.dirname(__FILE__), "..", "certs", "cacert.pem"))
|
251
|
-
end
|
252
|
-
end
|
230
|
+
|
253
231
|
|
254
232
|
Megam::Log.debug("HTTP Request Data:")
|
255
233
|
Megam::Log.debug("> HTTP #{@options[:scheme]}://#{@options[:host]}")
|
data/lib/megam/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: megam_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.56'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajthilak, Kishorekumar Neelamegam, Thomas Alrin, Yeshwanth Kumar, Subash Sethurajan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|