apralib 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +3 -0
- data/.travis.yml +4 -3
- data/apralib.gemspec +5 -4
- data/lib/apralib/apra_service.rb +4 -2
- data/lib/apralib/grantee.rb +2 -2
- data/lib/apralib/version.rb +1 -1
- data/spec/lib/apra_service_spec.rb +4 -3
- metadata +11 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3b3256db49c369085a45a47586f7d225d6914a951f55baddb18b19d5385bf928
|
4
|
+
data.tar.gz: 9270c0ba4a7d6a228397f1d5439704808042e26f9dca5ce55c37686ce03f16b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b05c78f9fed17951c19d6bffa5ad660a8f6f9ef693c87888e5c6767a1a47779b0a9ec87fd0ee2acb032441149ca553075e0356993ed8dd9ed418a864f718f084
|
7
|
+
data.tar.gz: b0c1081c67f7d9446b04f209fb5b0914470e7a36f7688f6e9d1d0e98e7f01bef640cd2c4299864d18599b8b49b716b9bca52ea389a4566c15f93f68d4d2e97b2
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
data/apralib.gemspec
CHANGED
@@ -17,11 +17,12 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
|
+
spec.required_ruby_version = '>= 2.4.0'
|
20
21
|
|
21
|
-
spec.add_development_dependency 'bundler', '~> 1
|
22
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
22
23
|
spec.add_development_dependency 'rake', '< 11.0'
|
23
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
24
|
+
spec.add_development_dependency 'rspec', '~> 3.10.0'
|
24
25
|
spec.add_development_dependency 'yard'
|
25
|
-
spec.add_dependency 'savon', '~> 2.
|
26
|
-
|
26
|
+
spec.add_dependency 'savon', '~> 2.12.0'
|
27
|
+
|
27
28
|
end
|
data/lib/apralib/apra_service.rb
CHANGED
@@ -6,10 +6,12 @@ module ApraService
|
|
6
6
|
|
7
7
|
class Client
|
8
8
|
|
9
|
-
def initialize(username, password)
|
9
|
+
def initialize(username, password, proxy = nil)
|
10
|
+
|
10
11
|
@client = Savon.client(wsdl: 'https://palvelu.mela.fi/Apurahailmoitukset/ws/apurahanSyottoWS?wsdl',
|
11
12
|
wsse_auth: [username, password],
|
12
|
-
endpoint: 'https://palvelu.mela.fi/Apurahailmoitukset/ws/apurahanSyottoWS'
|
13
|
+
endpoint: 'https://palvelu.mela.fi/Apurahailmoitukset/ws/apurahanSyottoWS',
|
14
|
+
proxy: proxy)
|
13
15
|
end
|
14
16
|
|
15
17
|
def send_notifications(notifications)
|
data/lib/apralib/grantee.rb
CHANGED
@@ -2,8 +2,8 @@ module ApraService
|
|
2
2
|
|
3
3
|
class Grantee
|
4
4
|
|
5
|
-
SSN_REGEX = /(\d{6})([-+A])(\d{3})([0-9ABCDEFHJKLMNPRSTUVWXY])
|
6
|
-
CHECK_DIGITS = %w
|
5
|
+
SSN_REGEX = /(\d{6})([-+A])(\d{3})([0-9ABCDEFHJKLMNPRSTUVWXY])/.freeze
|
6
|
+
CHECK_DIGITS = %w[0 1 2 3 4 5 6 7 8 9 A B C D E F H J K L M N P R S T U V W X Y].freeze
|
7
7
|
|
8
8
|
attr_accessor :first_names, :last_name, :ssn, :address, :zip
|
9
9
|
|
data/lib/apralib/version.rb
CHANGED
@@ -10,10 +10,11 @@ module ApraService
|
|
10
10
|
def get_client
|
11
11
|
credentials = {}
|
12
12
|
credentials_file = File.join(File.dirname(__FILE__), 'apra_credentials.yml')
|
13
|
-
credentials = YAML.load(File.read(credentials_file)) if File.
|
13
|
+
credentials = YAML.load(File.read(credentials_file)) if File.exist?(credentials_file)
|
14
14
|
user = credentials['user'] || ENV['APRA_USER']
|
15
15
|
password = credentials['password'] || ENV['APRA_PASSWORD']
|
16
|
-
|
16
|
+
proxy = credentials['proxy'] || ENV['PROXY_URL']
|
17
|
+
Client.new(user, password, proxy)
|
17
18
|
end
|
18
19
|
|
19
20
|
|
@@ -21,7 +22,7 @@ module ApraService
|
|
21
22
|
|
22
23
|
it 'should create a valid object' do
|
23
24
|
|
24
|
-
service = Client.new('user','password')
|
25
|
+
service = Client.new('user', 'password')
|
25
26
|
expect(service).not_to be_nil
|
26
27
|
|
27
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apralib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Sandrini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1
|
19
|
+
version: '2.1'
|
20
20
|
type: :development
|
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: '1
|
26
|
+
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 3.
|
47
|
+
version: 3.10.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: 3.
|
54
|
+
version: 3.10.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: yard
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,28 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.
|
75
|
+
version: 2.12.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 2.
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rack
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "<"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '2'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "<"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '2'
|
82
|
+
version: 2.12.0
|
97
83
|
description: A Ruby client for the Apra Service
|
98
84
|
email:
|
99
85
|
- nessche@gmail.com
|
@@ -102,6 +88,7 @@ extensions: []
|
|
102
88
|
extra_rdoc_files: []
|
103
89
|
files:
|
104
90
|
- ".gitignore"
|
91
|
+
- ".rubocop.yml"
|
105
92
|
- ".travis.yml"
|
106
93
|
- Gemfile
|
107
94
|
- LICENSE.txt
|
@@ -130,15 +117,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
130
117
|
requirements:
|
131
118
|
- - ">="
|
132
119
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
120
|
+
version: 2.4.0
|
134
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
122
|
requirements:
|
136
123
|
- - ">="
|
137
124
|
- !ruby/object:Gem::Version
|
138
125
|
version: '0'
|
139
126
|
requirements: []
|
140
|
-
|
141
|
-
rubygems_version: 2.6.10
|
127
|
+
rubygems_version: 3.0.8
|
142
128
|
signing_key:
|
143
129
|
specification_version: 4
|
144
130
|
summary: A Ruby library to submit documents to the Apra Service run by Maatalousyrittäjien
|
@@ -147,4 +133,3 @@ test_files:
|
|
147
133
|
- spec/lib/apra_service_spec.rb
|
148
134
|
- spec/lib/grantee_spec.rb
|
149
135
|
- spec/spec_helper.rb
|
150
|
-
has_rdoc:
|