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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c9e5c1eb961ee644b6175c64097f346ed23ff2a8
4
- data.tar.gz: cdcd99886d2b11f12459353034ab2139c4a5e596
2
+ SHA256:
3
+ metadata.gz: 3b3256db49c369085a45a47586f7d225d6914a951f55baddb18b19d5385bf928
4
+ data.tar.gz: 9270c0ba4a7d6a228397f1d5439704808042e26f9dca5ce55c37686ce03f16b2
5
5
  SHA512:
6
- metadata.gz: 55f6d230ba9d69dc7801b80ee061b9bc401a188db573674d48d0439a766dfd281541aeabd5fc5804db254bd5b8940f9b411872b7b77daa287d0f11eed7d82207
7
- data.tar.gz: 5a400a5b273fb12a0891bfa46130f6205272e73f0156547ecd22770cbd7b15b9b15344a279985a61011a2a4a37395238f811b418baf76fc98f46777890d1b020
6
+ metadata.gz: b05c78f9fed17951c19d6bffa5ad660a8f6f9ef693c87888e5c6767a1a47779b0a9ec87fd0ee2acb032441149ca553075e0356993ed8dd9ed418a864f718f084
7
+ data.tar.gz: b0c1081c67f7d9446b04f209fb5b0914470e7a36f7688f6e9d1d0e98e7f01bef640cd2c4299864d18599b8b49b716b9bca52ea389a4566c15f93f68d4d2e97b2
@@ -0,0 +1,3 @@
1
+ Metrics/BlockLength:
2
+ Exclude:
3
+ - spec/**/*.rb
@@ -1,7 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.7.2
3
4
  - 2.4.0
4
- - 2.2.2
5
- - 2.1.3
6
- - 1.9.3
5
+ deploy:
6
+ provider: rubygems
7
+ edge: true
7
8
 
@@ -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.3'
22
+ spec.add_development_dependency 'bundler', '~> 2.1'
22
23
  spec.add_development_dependency 'rake', '< 11.0'
23
- spec.add_development_dependency 'rspec', '~> 3.1.0'
24
+ spec.add_development_dependency 'rspec', '~> 3.10.0'
24
25
  spec.add_development_dependency 'yard'
25
- spec.add_dependency 'savon', '~> 2.3.0'
26
- spec.add_dependency 'rack', '< 2'
26
+ spec.add_dependency 'savon', '~> 2.12.0'
27
+
27
28
  end
@@ -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)
@@ -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(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)
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
 
@@ -1,3 +1,3 @@
1
1
  module Apralib
2
- VERSION = '0.0.5'
2
+ VERSION = '0.1.0'.freeze
3
3
  end
@@ -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.exists?(credentials_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
- Client.new(user, password)
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.5
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: 2018-04-30 00:00:00.000000000 Z
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.3'
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.3'
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.1.0
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.1.0
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.3.0
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.3.0
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: '0'
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
- rubyforge_project:
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: