whmcs 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/VERSION +1 -1
  4. data/lib/whmcs/base.rb +9 -26
  5. data/whmcs.gemspec +78 -0
  6. metadata +17 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fbacb82a4243ea53460f437de45574b17e8cb0d
4
- data.tar.gz: 5694b362cb8d253393d3d9275442614a886c5b6d
3
+ metadata.gz: dc4a1f03b074f2078e37c49004a7e8cc1c220acb
4
+ data.tar.gz: bdd69161bba3acda16085711cab4f80bab1ec467
5
5
  SHA512:
6
- metadata.gz: 1952b45aac539b64481f312f9777be7fc365ce1eba21c75021709e73a16b292907a6774a9faa3a1cf7677ba51c6aa9147557eee94f5feb2743e7583ac950e3cc
7
- data.tar.gz: b313326186bbf7bc146facb2dfff4e02b4c101df0585cdc2a17e177a656b1baf029da8b924eb8fdc2bf4dc5fefe1e69b1c10a3ee6c94fc3d66a2e92e59ec5fa7
6
+ metadata.gz: c944e40753085097380c95071cbdaf0d3174be10263ed533650b9cf569aa4b70ed80087407b72ffe07062a4d9b372e46b0394075fa855b47741514613646628e
7
+ data.tar.gz: fbfc02643a86c2fc8686570803bd740d5ba0f6e87104ff4bfd6e33a444ef3e55e7466951364a310ac082ae1d19a3ddb9357bb564081c68e6bd43e0341347402b
data/Gemfile CHANGED
@@ -3,6 +3,7 @@ source "http://rubygems.org"
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
5
  gem "crack", "= 0.1.8"
6
+ gem 'faraday'
6
7
 
7
8
  # Add dependencies to develop your gem here.
8
9
  # Include everything needed to run rake, tests, features, etc.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 1.0.0
data/lib/whmcs/base.rb CHANGED
@@ -24,17 +24,18 @@ module WHMCS
24
24
 
25
25
  url = URI.parse(WHMCS.config.api_url)
26
26
 
27
- http = Net::HTTP.new(url.host, url.port)
28
-
29
- if url.port == 443
30
- http.use_ssl = true
27
+ # TODO: Configure Faraday for HTTPS requests
28
+ conn = Faraday.new(:url => url) do |faraday|
29
+ faraday.request :url_encoded # form-encode POST params
30
+ faraday.response :logger # log requests to STDOUT
31
+ faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
31
32
  end
32
33
 
33
- req = Net::HTTP::Post.new(url.path)
34
- req.set_form_data(params)
34
+ response = conn.post do |req|
35
+ req.body = params
36
+ end
35
37
 
36
- res = http.start { |http| http.request(req) }
37
- parse_response(res.body)
38
+ parse_response(response.body)
38
39
  end
39
40
 
40
41
  # Converts the API response to a Hash
@@ -49,21 +50,3 @@ module WHMCS
49
50
  end
50
51
  end
51
52
  end
52
-
53
- # Fix Net::HTTP so we dont get
54
- # warning: peer certificate won't be verified in this SSL session
55
- #
56
- # See:
57
- #
58
- # http://www.5dollarwhitebox.org/drupal/node/64
59
- module Net #:nodoc:all
60
- class HTTP
61
- alias_method :old_initialize, :initialize
62
-
63
- def initialize(*args)
64
- old_initialize(*args)
65
- @ssl_context = OpenSSL::SSL::SSLContext.new
66
- @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
67
- end
68
- end
69
- end
data/whmcs.gemspec ADDED
@@ -0,0 +1,78 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: whmcs 1.0.0 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "whmcs"
9
+ s.version = "1.0.0"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Matthew J.W. Basterfield"]
14
+ s.date = "2015-02-14"
15
+ s.description = "whmcs: A ruby wrapper for the WHMCS API - a port of the whmcs-ruby gem (https://github.com/dotblock/whmcs-ruby)"
16
+ s.email = "mjwb@flexbox.co.za"
17
+ s.extra_rdoc_files = [
18
+ "LICENSE.txt",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".editorconfig",
24
+ "Gemfile",
25
+ "LICENSE.txt",
26
+ "README.rdoc",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "lib/whmcs.rb",
30
+ "lib/whmcs/base.rb",
31
+ "lib/whmcs/client.rb",
32
+ "lib/whmcs/config.rb",
33
+ "lib/whmcs/invoice.rb",
34
+ "lib/whmcs/misc.rb",
35
+ "lib/whmcs/module.rb",
36
+ "lib/whmcs/order.rb",
37
+ "lib/whmcs/quote.rb",
38
+ "lib/whmcs/ticket.rb",
39
+ "test/helper.rb",
40
+ "test/test_whmcs.rb",
41
+ "whmcs.gemspec"
42
+ ]
43
+ s.homepage = "http://github.com/mjwb/whmcs"
44
+ s.licenses = ["MIT"]
45
+ s.rubygems_version = "2.4.5"
46
+ s.summary = "whmcs: A Ruby wrapper for the WHMCS API."
47
+
48
+ if s.respond_to? :specification_version then
49
+ s.specification_version = 4
50
+
51
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
+ s.add_runtime_dependency(%q<crack>, ["= 0.1.8"])
53
+ s.add_runtime_dependency(%q<faraday>, [">= 0"])
54
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
55
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
56
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
57
+ s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
58
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
59
+ else
60
+ s.add_dependency(%q<crack>, ["= 0.1.8"])
61
+ s.add_dependency(%q<faraday>, [">= 0"])
62
+ s.add_dependency(%q<shoulda>, [">= 0"])
63
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
64
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
65
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
66
+ s.add_dependency(%q<simplecov>, [">= 0"])
67
+ end
68
+ else
69
+ s.add_dependency(%q<crack>, ["= 0.1.8"])
70
+ s.add_dependency(%q<faraday>, [">= 0"])
71
+ s.add_dependency(%q<shoulda>, [">= 0"])
72
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
73
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
74
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
75
+ s.add_dependency(%q<simplecov>, [">= 0"])
76
+ end
77
+ end
78
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whmcs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew J.W. Basterfield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-13 00:00:00.000000000 Z
11
+ date: 2015-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crack
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.1.8
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: shoulda
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +136,7 @@ files:
122
136
  - lib/whmcs/ticket.rb
123
137
  - test/helper.rb
124
138
  - test/test_whmcs.rb
139
+ - whmcs.gemspec
125
140
  homepage: http://github.com/mjwb/whmcs
126
141
  licenses:
127
142
  - MIT