khalti 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +16 -0
- data/.travis.yml +8 -4
- data/Gemfile.lock +3 -3
- data/khalti.gemspec +1 -1
- data/lib/khalti/request_helper.rb +1 -2
- data/lib/khalti/verification.rb +2 -4
- data/lib/khalti/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fc1c7d7e2ea71c02b8b13ee6fe76bfa2e64afd8c2012210b31d7dd477ea5bac
|
4
|
+
data.tar.gz: 29f86229897532fd83c5dfd3c121ccc696af12e0ebaebf406b80fd0f6e145600
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82e908232caac20504906f679e46d7e644fd3f14a6b2b990ace2d8cea4e2b19bef0b082143988523d11ba4e9ff88ceffbd54cbcd9f55bc609d5f3ddf69bf83df
|
7
|
+
data.tar.gz: edd0ce4ffddc9928e3f2e78f0227524c1373ab8ca24ba0cd79e9311f7b7ca6d15f5d6d7e5ea197fb67f74183df16d3b78e21a6eededb0128b89344f611a9635d
|
data/.rubocop.yml
CHANGED
@@ -1,2 +1,18 @@
|
|
1
1
|
AllCops:
|
2
2
|
TargetRubyVersion: 2.5
|
3
|
+
|
4
|
+
# Commonly used screens these days easily fit more than 80 characters.
|
5
|
+
Metrics/LineLength:
|
6
|
+
Max: 120
|
7
|
+
|
8
|
+
# Too short methods lead to extraction of single-use methods, which can make
|
9
|
+
# the code easier to read (by naming things), but can also clutter the class
|
10
|
+
Metrics/MethodLength:
|
11
|
+
Max: 20
|
12
|
+
|
13
|
+
# The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
|
14
|
+
Metrics/ClassLength:
|
15
|
+
Max: 1500
|
16
|
+
|
17
|
+
Metrics/BlockLength:
|
18
|
+
ExcludedMethods: ['describe', 'context']
|
data/.travis.yml
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
|
1
|
+
os:
|
2
|
+
- linux
|
3
|
+
dist: bionic
|
2
4
|
language: ruby
|
3
5
|
rvm:
|
4
|
-
- 2.
|
6
|
+
- 2.6
|
7
|
+
- 2.5
|
5
8
|
before_install: gem install bundler -v 1.16.1
|
9
|
+
env:
|
10
|
+
- KHALTI_SECRET_KEY=your_secret_key
|
6
11
|
script:
|
7
|
-
-
|
8
|
-
- bundle exec rspec spec
|
12
|
+
- bundle exec rspec
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
khalti (0.2.
|
4
|
+
khalti (0.2.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
hashdiff (0.3.7)
|
20
20
|
json (2.1.0)
|
21
21
|
public_suffix (3.0.2)
|
22
|
-
rake (
|
22
|
+
rake (13.0.1)
|
23
23
|
rspec (3.7.0)
|
24
24
|
rspec-core (~> 3.7.0)
|
25
25
|
rspec-expectations (~> 3.7.0)
|
@@ -52,7 +52,7 @@ DEPENDENCIES
|
|
52
52
|
bundler (~> 1.16)
|
53
53
|
codecov (~> 0.1)
|
54
54
|
khalti!
|
55
|
-
rake (~>
|
55
|
+
rake (~> 13.0)
|
56
56
|
rspec (~> 3.0)
|
57
57
|
webmock (~> 3.3)
|
58
58
|
|
data/khalti.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
|
33
33
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
34
34
|
spec.add_development_dependency 'codecov', '~> 0.1'
|
35
|
-
spec.add_development_dependency 'rake', '~>
|
35
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
36
36
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
37
37
|
spec.add_development_dependency 'webmock', '~> 3.3'
|
38
38
|
end
|
@@ -37,8 +37,7 @@ module Khalti
|
|
37
37
|
|
38
38
|
def validate_content_type(content_type)
|
39
39
|
return if content_type == 'application/json'
|
40
|
-
raise Errors::InvalidResponseError,
|
41
|
-
'Content-type is not application/json.'
|
40
|
+
raise Errors::InvalidResponseError, 'Content-type is not application/json.'
|
42
41
|
end
|
43
42
|
|
44
43
|
def extract_response(res)
|
data/lib/khalti/verification.rb
CHANGED
@@ -25,14 +25,12 @@ module Khalti
|
|
25
25
|
|
26
26
|
def validate_token_length(val)
|
27
27
|
return if val.strip.size >= 22
|
28
|
-
raise Errors::InvalidTokenError, 'Ensure token has at least '
|
29
|
-
'22 characters.'
|
28
|
+
raise Errors::InvalidTokenError, 'Ensure token has at least 22 characters.'
|
30
29
|
end
|
31
30
|
|
32
31
|
def validate_ammount(val)
|
33
32
|
return if Integer(val).positive?
|
34
|
-
raise Errors::InvalidAmountError, 'Ensure amount is '
|
35
|
-
'greater than 0 paisa.'
|
33
|
+
raise Errors::InvalidAmountError, 'Ensure amount is greater than 0 paisa.'
|
36
34
|
end
|
37
35
|
end
|
38
36
|
end
|
data/lib/khalti/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: khalti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Degendra Sivakoti
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,8 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
|
-
|
129
|
-
rubygems_version: 2.7.3
|
128
|
+
rubygems_version: 3.0.3
|
130
129
|
signing_key:
|
131
130
|
specification_version: 4
|
132
131
|
summary: Ruby gem for Khalti online transaction platform.
|