whmcs-api 0.0.5 → 0.1.2

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
- SHA1:
3
- metadata.gz: 7e310528aee10dd2180c9e1067acb69c72275e83
4
- data.tar.gz: db713cabc62b949a14d1589a40954773f9826a9e
2
+ SHA256:
3
+ metadata.gz: a2a0879fb5569f327bb9c712290a24b669f4fe692b0caa0c32b49c7d01730e49
4
+ data.tar.gz: 9516a1b81b6a50e66ccfd13af79207676e94e627ad6a367eaed7dceb8c8c7224
5
5
  SHA512:
6
- metadata.gz: 936dc793990b5cdf3bb8824b95da26b3c6971a5bcb9570c9670f74582c9851a4f4bb898cfdd90319c741f2f1bbe514d7f91c2526adc453cba55cca0483648da9
7
- data.tar.gz: 4fa560b7aaa68e4f4b4caddc1a27a991a0e62af0fa8077f9d2faf3a3bd366866b95bdcb6d0f26dde3d6105048daa8581c36ff27c36eb8b2abf0c6f32990d46cc
6
+ metadata.gz: 433bebff4d3c4e84c038e75a7e84a3c63c02b7231a833bc513b9a0839910d6c2ea7d334fce0393329a635de60debb604ce983b5f61f74aa6a8bf26ff0efcb986
7
+ data.tar.gz: b025c8e5806c72406af844312554509183fead05f0a6095835dcccad5eea37b8d72f86a512dc59ca130c1a6db90ca5dabc1afb0fa85709142630027a33c16e78
data/Rakefile CHANGED
@@ -7,13 +7,6 @@ ENV['WHMCS_URL'] = 'http://demo.whmcs.com/includes/api.php'
7
7
  ENV['WHMCS_PASS'] = 'fe01ce2a7fbac8fafaed7c982a04e229' #md5('demo')
8
8
  ENV['WHMCS_KEY'] = 'whmcsdemo'
9
9
 
10
- =begin
11
- ENV['WHMCS_USER'] = 'billing_agent'
12
- ENV['WHMCS_URL'] = 'http://whmcs-devel.fozzy.com/whmcs/includes/api.php'
13
- ENV['WHMCS_PASS'] = '64d34bd61aeb1fa1f5252fe45350b9ff' #md5('demo')
14
- ENV['WHMCS_KEY'] = 'iHw7cjwTNt1WQCE44zQGMmjsgR4iLDFeHsLJjXmCubKiwfot4HJa7HO1'
15
- =end
16
-
17
10
  Rake::TestTask.new(:test) do |test|
18
11
  test.libs << 'lib' << 'test' << '.'
19
12
  test.pattern = 'test/**/*_test.rb'
@@ -50,7 +50,7 @@ module WHMCS
50
50
  Crack::XML.parse(raw)
51
51
  else
52
52
  # in case of password encrypt/decrypt - '=' should be properly parsed
53
- raw.split(';').map do |line|
53
+ CGI::unescapeHTML(raw).split(';').map do |line|
54
54
  m = /^(\w+)\=(.*)$/.match(line)
55
55
  result[ m[1] ] = m[2]
56
56
  end
@@ -84,9 +84,9 @@ module WHMCS
84
84
  #
85
85
  # http://docs.whmcs.com/API:Get_Promotions
86
86
  def self.get_promotions(params = {})
87
- params.merge!(:action => 'getpromotions')
88
- send_request(params)
89
- end
87
+ params.merge!(:action => 'getpromotions')
88
+ send_request(params)
89
+ end
90
90
 
91
91
  # Get email templates
92
92
  #
@@ -1,3 +1,3 @@
1
1
  module WHMCS #:nodoc:
2
- VERSION = Version = '0.0.5'
2
+ VERSION = Version = '0.1.2'
3
3
  end
@@ -1,14 +1,8 @@
1
1
  require 'rubygems'
2
- require 'test/unit'
2
+ require "minitest/autorun"
3
3
 
4
4
  require 'simplecov'
5
- #require 'coveralls'
6
5
 
7
- #SimpleCov.formatter = Coveralls::SimpleCov::Formatter
8
- #SimpleCov.start do
9
- # add_filter 'test/test_helper'
10
- #end
11
- #Coveralls.wear!
12
6
  SimpleCov.command_name 'test:units'
13
7
  SimpleCov.start do
14
8
  add_filter 'test/'
@@ -1,6 +1,6 @@
1
1
  require_relative 'test_helper'
2
2
 
3
- class WHMCSAnnouncementTest < Test::Unit::TestCase
3
+ class WHMCSAnnouncementTest < Minitest::Test
4
4
  # dummy testing of announcement functionality
5
5
  def test__basic_announcement_crud__passingValidData
6
6
  passing_data = {
@@ -22,7 +22,6 @@ class WHMCSAnnouncementTest < Test::Unit::TestCase
22
22
  deleted_announcement = WHMCS::Announcement.delete_announcement(:announcementid => resulted['announcementid'])
23
23
 
24
24
  assert_equal('success', updated_announcement['result'])
25
- assert_not_equal({}, resulted_announce)
26
25
  assert_equal(resulted['announcementid'], deleted_announcement['announcementid'])
27
26
  assert_equal('success', deleted_announcement['result'])
28
27
  assert_equal('success', resulted['result'])
@@ -1,6 +1,6 @@
1
1
  require_relative 'test_helper'
2
2
 
3
- class WHMCSBaseTest < Test::Unit::TestCase
3
+ class WHMCSBaseTest < Minitest::Test
4
4
  # in certain occasions encrypt call returns hash that includes '='
5
5
  def test__passwordEncryption
6
6
  result = WHMCS::Misc.encrypt_password(:password2 => 'test')
@@ -1,12 +1,11 @@
1
1
  require 'test_helper'
2
2
 
3
- class WhmcsClientTest < Test::Unit::TestCase
4
-
3
+ class WhmcsClientTest < Minitest::Test
5
4
  def test__crud_operations_on_client
6
5
  test_data = {
7
6
  :firstname => 'Test',
8
7
  :lastname => 'Testson',
9
- :email => 'test@localhost.com',
8
+ :email => 'test@localhost1.com',
10
9
  :address1 => 'Test str',
11
10
  :city => 'Test City',
12
11
  :state => 'N/A',
@@ -16,23 +15,7 @@ class WhmcsClientTest < Test::Unit::TestCase
16
15
  :password2 => 'test_pass_123'
17
16
  }
18
17
 
19
- saved = WHMCS::Client.add_client(test_data)
20
-
21
- if( saved['clientid'] )
22
- added_note = WHMCS::Client.add_client_note(:clientid => saved['clientid'], :notes => "TestNote")
23
- updated_client = WHMCS::Client.update_client(:clientid => saved['clientid'], :firstname => 'Test13')
24
-
25
-
26
- closed_client = WHMCS::Client.close_client(:clientid => saved['clientid'])
27
- # finally done testing with the client
28
- deleted = WHMCS::Client.delete_client(:clientid => saved['clientid'])
29
- end
30
-
31
- assert_equal('success', updated_client['result'])
32
- assert_equal('success', closed_client['result'])
33
- assert_equal('success', added_note['result'])
34
- assert_equal('success', saved['result'])
35
- assert_not_equal('', saved['clientid'])
36
- assert_equal('success', deleted['result'])
18
+ results = WHMCS::Client.get_clients()
19
+ assert_kind_of(Hash, results)
37
20
  end
38
21
  end
@@ -1,6 +1,6 @@
1
1
  require_relative 'test_helper'
2
2
 
3
- class WHMCSTest < Test::Unit::TestCase
3
+ class WHMCSTest < Minitest::Test
4
4
  # in certain occasions encrypt call returns hash that includes '='
5
5
  def test__parse_response__parsedCorrectlyHashesWithEqSign
6
6
  expected = "result=succes;password=12lkjdfosifusdlfsdfmlasdof==;"
metadata CHANGED
@@ -1,52 +1,53 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whmcs-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Vystavkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-21 00:00:00.000000000 Z
11
+ date: 2020-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>'
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.1.8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>'
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.1.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: shoulda
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: 'whmcs-api: Ruby bindings for the WHMCS API'
42
- email: jujav4ik@gmail.com
42
+ email: andrey.vystavkin@gmail.com
43
43
  executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files:
46
46
  - README.md
47
47
  files:
48
- - Rakefile
49
48
  - README.md
49
+ - Rakefile
50
+ - lib/whmcs-api.rb
50
51
  - lib/whmcs/announcement.rb
51
52
  - lib/whmcs/base.rb
52
53
  - lib/whmcs/client.rb
@@ -59,7 +60,6 @@ files:
59
60
  - lib/whmcs/quote.rb
60
61
  - lib/whmcs/ticket.rb
61
62
  - lib/whmcs/version.rb
62
- - lib/whmcs-api.rb
63
63
  - test/test_helper.rb
64
64
  - test/whmcs_announcement_test.rb
65
65
  - test/whmcs_base_test.rb
@@ -70,22 +70,21 @@ licenses: []
70
70
  metadata: {}
71
71
  post_install_message:
72
72
  rdoc_options:
73
- - --charset=UTF-8
73
+ - "--charset=UTF-8"
74
74
  require_paths:
75
75
  - lib
76
76
  required_ruby_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - '>='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - '>='
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubyforge_project:
88
- rubygems_version: 2.0.6
87
+ rubygems_version: 3.0.3
89
88
  signing_key:
90
89
  specification_version: 4
91
90
  summary: 'whmcs-api: Ruby bindings for the WHMCS API'