lumberg 1.0.3 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/lumberg.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  $:.unshift(File.dirname(__FILE__))
2
2
 
3
3
  # External Libs
4
+ require 'openssl'
4
5
  require 'json'
5
6
  require 'uri'
6
- require 'excon'
7
7
  require 'faraday'
8
8
  require 'faraday_middleware'
9
9
  require 'logger'
@@ -17,15 +17,15 @@ require 'lumberg/whm/args'
17
17
  require 'lumberg/whm'
18
18
 
19
19
  module Lumberg
20
-
20
+
21
21
  extend self
22
-
22
+
23
23
  attr_accessor :configuration
24
-
24
+
25
25
  def base_path
26
26
  File.dirname(__FILE__)
27
27
  end
28
-
28
+
29
29
  self.configuration ||= Lumberg::Config.new
30
30
 
31
31
  # Specificy the config via block
@@ -43,6 +43,6 @@ module Lumberg
43
43
  yield self.configuration if block_given?
44
44
  self.configuration.options
45
45
  end
46
-
46
+
47
47
  end
48
48
 
@@ -1,3 +1,3 @@
1
1
  module Lumberg
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.6'
3
3
  end
@@ -174,13 +174,17 @@ module Lumberg
174
174
 
175
175
  def do_request(uri, function, params)
176
176
  @response = Faraday.new(:url => uri, :ssl => ssl_options) do |c|
177
- c.basic_auth @user, @hash
177
+ if basic_auth
178
+ c.basic_auth @user, @hash
179
+ else
180
+ c.headers['Authorization'] = "WHM #{@user}:#{@hash}"
181
+ end
178
182
  c.params = params
179
183
  c.request :url_encoded
180
184
  c.response :format_whm, @force_response_type, @key, @boolean_params
181
185
  c.response :logger, create_logger_instance
182
186
  c.response :json
183
- c.adapter :excon
187
+ c.adapter :net_http
184
188
  end.get(function).body
185
189
  @force_response_type = nil
186
190
  @response
data/lumberg.gemspec CHANGED
@@ -14,8 +14,7 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.rubyforge_project = "lumberg"
16
16
 
17
- s.add_dependency 'json', '~> 1.7.3'
18
- s.add_dependency 'excon' , '~> 0.14.0'
17
+ s.add_runtime_dependency 'json', '~> 1.7.3'
19
18
  s.add_runtime_dependency 'faraday', '~> 0.8.1'
20
19
  s.add_runtime_dependency 'faraday_middleware', '~> 0.8.4'
21
20
  s.add_runtime_dependency('jruby-openssl', '~> 0.7.3') if RUBY_PLATFORM == 'java'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lumberg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-15 00:00:00.000000000 Z
12
+ date: 2012-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -27,22 +27,6 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.7.3
30
- - !ruby/object:Gem::Dependency
31
- name: excon
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: 0.14.0
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: 0.14.0
46
30
  - !ruby/object:Gem::Dependency
47
31
  name: faraday
48
32
  requirement: !ruby/object:Gem::Requirement
@@ -254,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
254
238
  version: '0'
255
239
  segments:
256
240
  - 0
257
- hash: 954596705739906551
241
+ hash: 2770939314296025523
258
242
  required_rubygems_version: !ruby/object:Gem::Requirement
259
243
  none: false
260
244
  requirements:
@@ -263,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
247
  version: '0'
264
248
  segments:
265
249
  - 0
266
- hash: 954596705739906551
250
+ hash: 2770939314296025523
267
251
  requirements: []
268
252
  rubyforge_project: lumberg
269
253
  rubygems_version: 1.8.23