mernis 0.2.5 → 1.0.1
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 +4 -4
- data/.gitignore +9 -0
- data/.ruby-version +1 -0
- data/.travis.yml +8 -0
- data/Gemfile +2 -0
- data/README.md +75 -0
- data/Rakefile +8 -0
- data/lib/mernis.rb +2 -2
- data/lib/mernis/request.rb +2 -2
- data/lib/mernis/version.rb +3 -0
- data/mernis.gemspec +26 -0
- data/spec/mernis/request_spec.rb +59 -0
- data/spec/spec_helper.rb +4 -0
- metadata +20 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94397bd5ea0255f3584432a8346df5a33876a65e
|
4
|
+
data.tar.gz: a08b7869c48d961ad0a72d1818a3b48319b54596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61264c09e30901bc6a5947ac73ca7df4976586976669be62ac9c85f6ef5f580fab5bdd47cf60c6cf97f2e9b88a2f8d8088e518d17347324acf57eec22c80134b
|
7
|
+
data.tar.gz: d83a060e577229e155f3b596491830932d7697fd465698a4458242d607654adfb446ee23050260760c42289809e908c8e89db833c290cc3a277e30fd45ba9b42
|
data/.gitignore
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Ignore GEM files.
|
8
|
+
*.gem
|
9
|
+
*.rbc
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.1
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# MERNİS (KPS)
|
2
|
+
|
3
|
+
SOAP client for KPS (The Identity Information Sharing System) services provided by Ministry of the Interior, Turkey
|
4
|
+
|
5
|
+
[](http://badge.fury.io/rb/mernis)
|
6
|
+
[](https://codeclimate.com/github/msdundar/mernis)
|
7
|
+
|
8
|
+
## Setup
|
9
|
+
|
10
|
+
```
|
11
|
+
$ gem install 'mernis'
|
12
|
+
```
|
13
|
+
|
14
|
+
## Usage Examples
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'mernis'
|
18
|
+
|
19
|
+
# Most basic usage:
|
20
|
+
mernis = Mernis.sorgula("11223344556", "john", "doe", "1990")
|
21
|
+
|
22
|
+
# With parameter names (required only):
|
23
|
+
mernis = Mernis.sorgula(id_number="11223344556", first_name="john", last_name="doe", birth_year="1990")
|
24
|
+
|
25
|
+
# With parameter names (required + extras):
|
26
|
+
mernis = Mernis.sorgula(id_number="11223344556", first_name="john", last_name="doe", birth_year="1990", version = 2, log = false)
|
27
|
+
|
28
|
+
# With all parameters:
|
29
|
+
mernis = Mernis.sorgula(id_number="11223344556", first_name="john", last_name="doe", birth_year="1990", version = 2, open_timeout = 60, read_timeout = 60, log = false, wsdl = "https://somecustomwsdl.com" )
|
30
|
+
|
31
|
+
```
|
32
|
+
|
33
|
+
## Parameters
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
mernis = Mernis.sorgula(
|
37
|
+
id_number = "12345", # identity number
|
38
|
+
first_name = "john", # first name
|
39
|
+
last_name = "doe", # last name
|
40
|
+
birth_year = "1990", # year of birth
|
41
|
+
version = 2, # soap version. should be 1 or 2.
|
42
|
+
open_timeout = 60, # timeout duration until SOAP server opens the connection. in seconds.
|
43
|
+
read_timeout = 60, # timeout duration until SOAP server returns response. in seconds.
|
44
|
+
log = false, # logging
|
45
|
+
wsdl = "https://somecustomwsdl.com" # wsdl uri
|
46
|
+
)
|
47
|
+
```
|
48
|
+
|
49
|
+
## Response
|
50
|
+
|
51
|
+
Returns true if the identity number can be validated and false if not. Both returning values are string!
|
52
|
+
|
53
|
+
## Contributing
|
54
|
+
|
55
|
+
1. `fork` the repo ( https://github.com/msdundar/mernis/fork )
|
56
|
+
2. Create a branch (git checkout -b cool-feature)
|
57
|
+
3. Commit the changes (git commit -am 'My cool features')
|
58
|
+
4. Push the branch (git push origin cool-feature)
|
59
|
+
5. Make a pull request
|
60
|
+
|
61
|
+
# Build
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
gem build mernis.gemspec
|
65
|
+
gem install ./mernis-1.0.1.gem
|
66
|
+
gem push mernis-1.0.1.gem
|
67
|
+
git tag -a v1.0.1 -m "Major updates"
|
68
|
+
git push --tags
|
69
|
+
```
|
70
|
+
|
71
|
+
## Questions
|
72
|
+
|
73
|
+
```
|
74
|
+
msdundars@gmail.com
|
75
|
+
```
|
data/Rakefile
ADDED
data/lib/mernis.rb
CHANGED
data/lib/mernis/request.rb
CHANGED
@@ -29,8 +29,8 @@ class Request
|
|
29
29
|
# Create message pattern
|
30
30
|
message = {
|
31
31
|
"TCKimlikNo" => @id_number.to_s,
|
32
|
-
"Ad" => @first_name,
|
33
|
-
"Soyad" => @last_name,
|
32
|
+
"Ad" => @first_name.tr('ı', 'I').tr('i', 'İ').upcase,
|
33
|
+
"Soyad" => @last_name.tr('ı', 'I').tr('i', 'İ').upcase,
|
34
34
|
"DogumYili" => @birth_year.to_s
|
35
35
|
}
|
36
36
|
|
data/mernis.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'mernis/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "mernis"
|
8
|
+
s.version = "1.0.1"
|
9
|
+
s.platform = Gem::Platform::RUBY
|
10
|
+
s.date = Time.now.strftime("%Y-%m-%d")
|
11
|
+
s.summary = "SOAP client for KPS [MERNIS] services."
|
12
|
+
s.description = "SOAP client for KPS (The Identity Information Sharing System) services provided by Ministry of the Interior, Turkey"
|
13
|
+
s.author = "Mustafa Serhat Dündar"
|
14
|
+
s.email = "msdundars@gmail.com"
|
15
|
+
s.files = ["lib/mernis.rb", "lib/mernis/request.rb"]
|
16
|
+
s.homepage = "https://github.com/msdundar/mernis"
|
17
|
+
s.licenses = ["MIT"]
|
18
|
+
|
19
|
+
s.files = `git ls-files -z`.split("\x0")
|
20
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
22
|
+
s.require_paths = ["lib"]
|
23
|
+
|
24
|
+
s.add_dependency "savon", "~> 2.11"
|
25
|
+
s.required_ruby_version = '>= 2.2.0'
|
26
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'savon'
|
3
|
+
require 'mernis'
|
4
|
+
|
5
|
+
describe 'Request' do
|
6
|
+
before(:each) do
|
7
|
+
@client = Savon.client(
|
8
|
+
wsdl: 'https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL',
|
9
|
+
soap_version: 2,
|
10
|
+
open_timeout: 60,
|
11
|
+
read_timeout: 60,
|
12
|
+
log: false
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'returns true with correct identity' do
|
17
|
+
response = @client.call(:tc_kimlik_no_dogrula, message: {
|
18
|
+
"TCKimlikNo" => "11311152982",
|
19
|
+
"Ad" => "Kuzey Tüner".tr('ı', 'I').tr('i', 'İ').upcase,
|
20
|
+
"Soyad" => "Şenkul".tr('ı', 'I').tr('i', 'İ').upcase,
|
21
|
+
"DogumYili" => "2014"
|
22
|
+
})
|
23
|
+
bool_value = response.body[:tc_kimlik_no_dogrula_response][:tc_kimlik_no_dogrula_result]
|
24
|
+
expect(bool_value).to equal(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'returns true with downcase characters' do
|
28
|
+
response = @client.call(:tc_kimlik_no_dogrula, message: {
|
29
|
+
"TCKimlikNo" => "11311152982",
|
30
|
+
"Ad" => "kuzey tüner".tr('ı', 'I').tr('i', 'İ').upcase,
|
31
|
+
"Soyad" => "şenkul".tr('ı', 'I').tr('i', 'İ').upcase,
|
32
|
+
"DogumYili" => "2014"
|
33
|
+
})
|
34
|
+
bool_value = response.body[:tc_kimlik_no_dogrula_response][:tc_kimlik_no_dogrula_result]
|
35
|
+
expect(bool_value).to equal(true)
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'returns true with upcase characters' do
|
39
|
+
response = @client.call(:tc_kimlik_no_dogrula, message: {
|
40
|
+
"TCKimlikNo" => "11311152982",
|
41
|
+
"Ad" => "KUZEY TÜNER".tr('ı', 'I').tr('i', 'İ').upcase,
|
42
|
+
"Soyad" => "ŞENKUL".tr('ı', 'I').tr('i', 'İ').upcase,
|
43
|
+
"DogumYili" => "2014"
|
44
|
+
})
|
45
|
+
bool_value = response.body[:tc_kimlik_no_dogrula_response][:tc_kimlik_no_dogrula_result]
|
46
|
+
expect(bool_value).to equal(true)
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'returns false with incorrect identity' do
|
50
|
+
response = @client.call(:tc_kimlik_no_dogrula, message: {
|
51
|
+
"TCKimlikNo" => "11311152982",
|
52
|
+
"Ad" => "Kuzey".tr('ı', 'I').tr('i', 'İ').upcase,
|
53
|
+
"Soyad" => "Şenkul".tr('ı', 'I').tr('i', 'İ').upcase,
|
54
|
+
"DogumYili" => "2014"
|
55
|
+
})
|
56
|
+
bool_value = response.body[:tc_kimlik_no_dogrula_response][:tc_kimlik_no_dogrula_result]
|
57
|
+
expect(bool_value).to equal(false)
|
58
|
+
end
|
59
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mernis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mustafa Serhat Dündar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.11'
|
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
|
-
version: '2.
|
26
|
+
version: '2.11'
|
27
27
|
description: SOAP client for KPS (The Identity Information Sharing System) services
|
28
28
|
provided by Ministry of the Interior, Turkey
|
29
29
|
email: msdundars@gmail.com
|
@@ -31,8 +31,18 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
+
- ".gitignore"
|
35
|
+
- ".ruby-version"
|
36
|
+
- ".travis.yml"
|
37
|
+
- Gemfile
|
38
|
+
- README.md
|
39
|
+
- Rakefile
|
34
40
|
- lib/mernis.rb
|
35
41
|
- lib/mernis/request.rb
|
42
|
+
- lib/mernis/version.rb
|
43
|
+
- mernis.gemspec
|
44
|
+
- spec/mernis/request_spec.rb
|
45
|
+
- spec/spec_helper.rb
|
36
46
|
homepage: https://github.com/msdundar/mernis
|
37
47
|
licenses:
|
38
48
|
- MIT
|
@@ -45,7 +55,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
45
55
|
requirements:
|
46
56
|
- - ">="
|
47
57
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
58
|
+
version: 2.2.0
|
49
59
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
60
|
requirements:
|
51
61
|
- - ">="
|
@@ -53,8 +63,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
63
|
version: '0'
|
54
64
|
requirements: []
|
55
65
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.
|
66
|
+
rubygems_version: 2.6.11
|
57
67
|
signing_key:
|
58
68
|
specification_version: 4
|
59
|
-
summary: SOAP client for KPS services.
|
60
|
-
test_files:
|
69
|
+
summary: SOAP client for KPS [MERNIS] services.
|
70
|
+
test_files:
|
71
|
+
- spec/mernis/request_spec.rb
|
72
|
+
- spec/spec_helper.rb
|