lifecell_api 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/Gemfile +5 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/examples/get_balance.rb +2 -1
- data/lib/lifecell_api/version.rb +1 -1
- data/lib/lifecell_api.rb +4 -3
- data/lifecell_api.gemspec +3 -4
- metadata +10 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 885c29793bebd74a83ba1dbecbd119a53a28949d2846b7d30d62a47eebb9e3eb
|
4
|
+
data.tar.gz: edf6c79001b5ffc38106e88f8c9900d30537d2c60274aef5037f514855daa5c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a08a1b0bc6037c5aa5662a3e911ffc618bd81240e57b3c2bd81b7c72472e9530fa75df158ba35e23f0b9eba95c604eb07d3e494760573849be82eb36ccc4eaf
|
7
|
+
data.tar.gz: 893538d44dd5b1914100c31f2a324983b77f86aacd863a004d39dc722ed6a02634779873b1cb0757bd197016b0cddcacb4aac2f426d99b95db20549f44d81fc4
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
data/examples/get_balance.rb
CHANGED
@@ -4,6 +4,7 @@ require 'bundler'
|
|
4
4
|
Bundler.setup :default
|
5
5
|
|
6
6
|
require 'logger'
|
7
|
+
require 'time'
|
7
8
|
require 'lifecell_api'
|
8
9
|
|
9
10
|
puts Lifecell::API::VERSION
|
@@ -23,7 +24,7 @@ puts "Tariff: #{tariff}"
|
|
23
24
|
line_suspend_date = summary_data['subscriber']['attribute']
|
24
25
|
.select { |f| f['name'] == 'LINE_SUSPEND_DATE' }
|
25
26
|
.first['content']
|
26
|
-
line_suspend_date = Time.
|
27
|
+
line_suspend_date = Time.parse(line_suspend_date).to_time.strftime('%d.%m.%Y')
|
27
28
|
puts "Suspend date: #{line_suspend_date}"
|
28
29
|
|
29
30
|
puts
|
data/lib/lifecell_api/version.rb
CHANGED
data/lib/lifecell_api.rb
CHANGED
@@ -11,7 +11,7 @@ require 'xmlsimple'
|
|
11
11
|
require 'lifecell_api/methods'
|
12
12
|
require 'lifecell_api/version'
|
13
13
|
|
14
|
-
# The Lifecell::API library is used for interactions with a https://api.
|
14
|
+
# The Lifecell::API library is used for interactions with a https://api.lifecell.com.ua.
|
15
15
|
# lifecell - GSM operator in Ukraine
|
16
16
|
#
|
17
17
|
# == Example
|
@@ -27,6 +27,7 @@ require 'lifecell_api/version'
|
|
27
27
|
#
|
28
28
|
module Lifecell
|
29
29
|
class MethodError < ArgumentError; end
|
30
|
+
|
30
31
|
class StatusError < ArgumentError; end
|
31
32
|
|
32
33
|
RESPONSE_CODES = {
|
@@ -84,7 +85,7 @@ module Lifecell
|
|
84
85
|
|
85
86
|
@os_type = 'ANDROID'
|
86
87
|
|
87
|
-
@api_url = 'https://api.
|
88
|
+
@api_url = 'https://api.lifecell.com.ua/mobile/'
|
88
89
|
@access_key_code = '7'
|
89
90
|
@application_key = 'E6j_$4UnR_)0b'
|
90
91
|
end
|
@@ -138,7 +139,7 @@ module Lifecell
|
|
138
139
|
|
139
140
|
def create_signed_url(method, params)
|
140
141
|
query = create_param(params)
|
141
|
-
str = method
|
142
|
+
str = "#{method}?#{query}&signature="
|
142
143
|
|
143
144
|
digest = OpenSSL::Digest.new('sha1')
|
144
145
|
hash = OpenSSL::HMAC.digest(digest, @application_key, str)
|
data/lifecell_api.gemspec
CHANGED
@@ -12,17 +12,16 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.description = 'A Ruby interface to the lifecell API'
|
13
13
|
gem.summary = <<-SUMMARY
|
14
14
|
The Lifecell::API library is used for interactions
|
15
|
-
with api.
|
15
|
+
with api.lifecell.com.ua
|
16
16
|
SUMMARY
|
17
17
|
gem.homepage = 'https://github.com/mamantoha/lifecell_api'
|
18
18
|
gem.license = 'MIT'
|
19
19
|
|
20
20
|
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
21
21
|
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
22
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
23
22
|
gem.require_paths = ['lib']
|
24
23
|
|
24
|
+
gem.required_ruby_version = '>= 2.7.0'
|
25
25
|
gem.add_runtime_dependency('xml-simple', '~> 1.1.2')
|
26
|
-
gem.
|
27
|
-
gem.add_development_dependency('rubocop')
|
26
|
+
gem.metadata['rubygems_mfa_required'] = 'true'
|
28
27
|
end
|
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
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Maminov
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xml-simple
|
@@ -24,34 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.1.2
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: pry
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubocop
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
27
|
description: A Ruby interface to the lifecell API
|
56
28
|
email:
|
57
29
|
- anton.maminov@gmail.com
|
@@ -73,8 +45,9 @@ files:
|
|
73
45
|
homepage: https://github.com/mamantoha/lifecell_api
|
74
46
|
licenses:
|
75
47
|
- MIT
|
76
|
-
metadata:
|
77
|
-
|
48
|
+
metadata:
|
49
|
+
rubygems_mfa_required: 'true'
|
50
|
+
post_install_message:
|
78
51
|
rdoc_options: []
|
79
52
|
require_paths:
|
80
53
|
- lib
|
@@ -82,15 +55,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
55
|
requirements:
|
83
56
|
- - ">="
|
84
57
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
58
|
+
version: 2.7.0
|
86
59
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
60
|
requirements:
|
88
61
|
- - ">="
|
89
62
|
- !ruby/object:Gem::Version
|
90
63
|
version: '0'
|
91
64
|
requirements: []
|
92
|
-
rubygems_version: 3.
|
93
|
-
signing_key:
|
65
|
+
rubygems_version: 3.4.10
|
66
|
+
signing_key:
|
94
67
|
specification_version: 4
|
95
|
-
summary: The Lifecell::API library is used for interactions with api.
|
68
|
+
summary: The Lifecell::API library is used for interactions with api.lifecell.com.ua
|
96
69
|
test_files: []
|