statsmix 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/statsmix.rb +13 -2
  3. data/statsmix.gemspec +1 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/lib/statsmix.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'net/http'
2
+ require 'net/https'
2
3
  require 'rubygems'
3
4
  require 'json'
4
5
 
@@ -263,12 +264,12 @@ class StatsMix
263
264
  self.setup
264
265
 
265
266
  if @api_key.nil?
266
- raise "API key not set. You must set it frist with StatsMix.api_key = [your api key]"
267
+ raise "API key not set. You must set it first with StatsMix.api_key = [your api key]"
267
268
  end
268
269
  # Resources available: stats, metrics, TODO: profiles
269
270
  @url = URI.parse(BASE_URI + resource)
270
271
  @connection = Net::HTTP.new(@url.host, @url.port)
271
-
272
+ @connection.use_ssl = (@url.scheme == 'https')
272
273
  @request = Hash.new
273
274
  @request["User-Agent"] = @user_agent
274
275
  @params = Hash.new
@@ -295,4 +296,14 @@ class StatsMix
295
296
  end
296
297
  end
297
298
 
299
+ #added to suppress ssl warnings per advice at http://www.5dollarwhitebox.org/drupal/node/64
300
+ class Net::HTTP
301
+ alias_method :old_initialize, :initialize
302
+ def initialize(*args)
303
+ old_initialize(*args)
304
+ @ssl_context = OpenSSL::SSL::SSLContext.new
305
+ @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
306
+ end
307
+ end
308
+
298
309
  StatsMix.api_from_env
data/statsmix.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{statsmix}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tom Markiewicz", "Derek Scruggs"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statsmix
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tom Markiewicz