lifecell_api 0.5.2 → 0.6.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: e161334834d9819499fa1b81a404fe5b14c4ce8932d7b714eb010c9d8cb0e7f3
4
- data.tar.gz: eee3cbe67cf7464bade5da1ce92dd037548fa414304ae5e18cdc6120ee5c9f37
3
+ metadata.gz: 885c29793bebd74a83ba1dbecbd119a53a28949d2846b7d30d62a47eebb9e3eb
4
+ data.tar.gz: edf6c79001b5ffc38106e88f8c9900d30537d2c60274aef5037f514855daa5c0
5
5
  SHA512:
6
- metadata.gz: caa06fd50e0a51f6cef47716e9e0912cb5a29e952d9d15753d1eac7baca51377daae4e04634e33877c2570743c334634655e7a6ee2e786b65cf387f7c171129f
7
- data.tar.gz: d21da4225c601fdd0ec6b9743bcba3d60123ed515e0771d34af8c4480a3621b4b89389bf7be60d5c5b779dda9d718ef806a3aae309e5e2a324393a91edfa5559
6
+ metadata.gz: 3a08a1b0bc6037c5aa5662a3e911ffc618bd81240e57b3c2bd81b7c72472e9530fa75df158ba35e23f0b9eba95c604eb07d3e494760573849be82eb36ccc4eaf
7
+ data.tar.gz: 893538d44dd5b1914100c31f2a324983b77f86aacd863a004d39dc722ed6a02634779873b1cb0757bd197016b0cddcacb4aac2f426d99b95db20549f44d81fc4
data/.rubocop.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  AllCops:
2
2
  NewCops: enable
3
+ TargetRubyVersion: 2.7
3
4
 
4
5
  Metrics/AbcSize:
5
6
  Max: 17
data/Gemfile CHANGED
@@ -4,3 +4,8 @@ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in life-api.gemspec
6
6
  gemspec
7
+
8
+ group :development do
9
+ gem 'pry'
10
+ gem 'rubocop', require: false
11
+ end
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013-2020 Anton Maminov
1
+ Copyright (c) 2013-2023 Anton Maminov
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -206,6 +206,6 @@ Tested with the following Ruby versions:
206
206
 
207
207
  ## License and Author
208
208
 
209
- Copyright (c) 2013-2020 by Anton Maminov
209
+ Copyright (c) 2013-2023 by Anton Maminov
210
210
 
211
211
  This library is distributed under the MIT license. Please see the LICENSE file.
@@ -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.mktime(line_suspend_date).strftime('%d.%m.%Y')
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lifecell
4
4
  class API
5
- VERSION = '0.5.2'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
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.life.com.ua.
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.life.com.ua/mobile/'
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 + '?' + query + '&signature='
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.life.com.ua
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.add_development_dependency('pry')
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.5.2
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: 2020-05-26 00:00:00.000000000 Z
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
- post_install_message:
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: '0'
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.1.2
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.life.com.ua
68
+ summary: The Lifecell::API library is used for interactions with api.lifecell.com.ua
96
69
  test_files: []