lifecell_api 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc9d7e6af4706e51d9547c821cb7167c15f2ac837bc44b7b85939608622e66b8
4
- data.tar.gz: 859f0f786da1feb7255b04b6c301b41dc0390293e9b397059f1c2503fe43fde3
3
+ metadata.gz: 65a60e7b377fefdac70e87d6508e4582e19fc0d825748d1b66c7951fc5ff68e3
4
+ data.tar.gz: b395d2d4ca9d5cc23586d413b2ddb0b826ac8253c901605fd16772ed7195b10d
5
5
  SHA512:
6
- metadata.gz: '0649856738cc83c20f024ca748bfcf0c8e6fda2f6d2fad044c3b76b60d42921679d8775f7825c7a5b5db5ba4a24f365656e481ab2d1d4d508a93e3bd9ccaa341'
7
- data.tar.gz: e6c9afdac89deffa06cb70d67f550830857c6df157427589a76c187039b343f9132814b42069d1b2c1c45b44b58b4f4d609ed681ac6d11fa3cf4ab9d32727c13
6
+ metadata.gz: ea55e6dec4eef392d741895938ab44c5cd97339a9bf82756640c6d0cb4235fd6e6327e5009af6795c037e8c4826b99aa823450142d0a1e3763287bee662f6f4f
7
+ data.tar.gz: 37a157b15355cb5432a0ac59ee9c066746e1841e38e2d257f0d639558d25fecd19dfe3e183a6bedee0ed51cd4afab4769dde7b4f1f801df09b3fba208a0360d5
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.0
1
+ 2.6.0
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A Ruby library for interfacing with lifecell's undocumented/unannounced API.
4
4
 
5
+ Formerly known as `life-api`.
6
+
5
7
  [lifecell](http://lifecell.com.ua) — GSM operator in Ukraine.
6
8
 
7
9
  ## Installation
data/lib/lifecell_api.rb CHANGED
@@ -27,6 +27,7 @@ require 'lifecell_api/version'
27
27
  #
28
28
  module Lifecell
29
29
  class MethodError < ArgumentError; end
30
+ class StatusError < ArgumentError; end
30
31
 
31
32
  RESPONSE_CODES = {
32
33
  '0' => 'SUCCESSFULY_PERFORMED',
@@ -106,10 +107,15 @@ module Lifecell
106
107
 
107
108
  response = response(url)
108
109
 
110
+ unless response.code == '200'
111
+ raise StatusError, "Received status code #{response.code} from server"
112
+ end
113
+
109
114
  log&.debug("[#{method}] response: #{response.body}")
110
115
 
111
116
  xml = parse_xml(response.body)
112
117
  return xml if xml['responseCode'] == '0'
118
+
113
119
  raise_error!(xml)
114
120
  end
115
121
 
@@ -67,9 +67,9 @@ module Lifecell
67
67
  def ui_properties(language_id, last_date_update)
68
68
  request(
69
69
  'getUIProperties',
70
- accessKeyCode: @access_key_code,
71
- languageId: language_id,
72
- osType: @os_type,
70
+ accessKeyCode: @access_key_code,
71
+ languageId: language_id,
72
+ osType: @os_type,
73
73
  lastDateUpdate: last_date_update
74
74
  )
75
75
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lifecell
4
4
  class API
5
- VERSION = '0.4.0'
5
+ VERSION = '0.5.0'
6
6
  end
7
7
  end
data/lifecell_api.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'lifecell_api/version'
6
6
 
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.email = ['anton.maminov@gmail.com']
12
12
  gem.description = 'A Ruby interface to the lifecell API'
13
13
  gem.summary = <<-SUMMARY
14
- The Life::API library is used for interactions
14
+ The Lifecell::API library is used for interactions
15
15
  with api.life.com.ua
16
16
  SUMMARY
17
17
  gem.homepage = 'https://github.com/mamantoha/lifecell_api'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lifecell_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Maminov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-31 00:00:00.000000000 Z
11
+ date: 2018-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple
@@ -89,9 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubyforge_project:
93
- rubygems_version: 2.7.3
92
+ rubygems_version: 3.0.1
94
93
  signing_key:
95
94
  specification_version: 4
96
- summary: The Life::API library is used for interactions with api.life.com.ua
95
+ summary: The Lifecell::API library is used for interactions with api.life.com.ua
97
96
  test_files: []