fuel_surcharge 1.0.0 → 1.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
2
  SHA256:
3
- metadata.gz: 9e056196172ceee98f1d33ec86ca82157aef2d308c93ee365f84fee89b3cc53b
4
- data.tar.gz: b5499c4e3122359aa92c777c46abab4911ba9fa3249e6166395fe153f2bc7371
3
+ metadata.gz: ee98beb9f5967adb56ef8f17730f3ddf7818c3662520a9643ee517e8499e103f
4
+ data.tar.gz: 445dea66100f192bc3aba33aeafdb5b64bc64272f511f78ca525f932e6fc7010
5
5
  SHA512:
6
- metadata.gz: 9c6fa22b6577e30a04b234f7d2f9c2fb8f71850c91bf23a3bfa3050319e76a8382b61b199cfa8c308813c3f1d2c71b9025d5746fb754882656d2939b894d34d9
7
- data.tar.gz: e89e7f5337efb2efba9a16b0e2755c2db4f74631225526dd8aa221e8ea9c10f4adab5ea780633edd621079ba8a7b4cc55696b8f2ce4c18585f34939b9693437e
6
+ metadata.gz: 9b57c20d6ed3c8e0761a5066a4296bb499fad337f5c770e7fbedbdca7dfc8f97429936835a774dc0fef85ff1acc03e34444b460cf8433b56a40047f1062afe08
7
+ data.tar.gz: caf6ad219c79f0caa8e6f6d7d24f905b97f8d54371dd05f289890b3d914dacf74e065783464f75ff84a8d3b898d0211004aac93faf5e4c78eee9097d3f159816
data/CHANGELOG.md CHANGED
@@ -1,10 +1,37 @@
1
1
  # Change Log
2
2
 
3
+ ## [v1.1.0](https://github.com/levups/fuel_surcharge/tree/v1.1.0) (2019-02-08)
4
+ [Full Changelog](https://github.com/levups/fuel_surcharge/compare/v1.0.0...v1.1.0)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - Auto-publish new gem versions using Github Actions [\#25](https://github.com/levups/fuel_surcharge/issues/25)
9
+
10
+ **Fixed bugs:**
11
+
12
+ - Error extracting time\_period for Chronopost [\#26](https://github.com/levups/fuel_surcharge/issues/26)
13
+
14
+ **Merged pull requests:**
15
+
16
+ - Remove gem signature on publish [\#30](https://github.com/levups/fuel_surcharge/pull/30) ([bobmaerten](https://github.com/bobmaerten))
17
+ - Check workflow agains git ref before running other actions [\#29](https://github.com/levups/fuel_surcharge/pull/29) ([bobmaerten](https://github.com/bobmaerten))
18
+ - Github action auto publish [\#28](https://github.com/levups/fuel_surcharge/pull/28) ([bobmaerten](https://github.com/bobmaerten))
19
+ - Fix chronopost time period extract [\#27](https://github.com/levups/fuel_surcharge/pull/27) ([bobmaerten](https://github.com/bobmaerten))
20
+ - Bump rubocop from 0.63.0 to 0.63.1 [\#24](https://github.com/levups/fuel_surcharge/pull/24) ([dependabot[bot]](https://github.com/apps/dependabot))
21
+ - Bump http from 4.0.2 to 4.0.3 [\#23](https://github.com/levups/fuel_surcharge/pull/23) ([dependabot[bot]](https://github.com/apps/dependabot))
22
+ - Bump rubocop from 0.62.0 to 0.63.0 [\#22](https://github.com/levups/fuel_surcharge/pull/22) ([dependabot[bot]](https://github.com/apps/dependabot))
23
+ - Bump http from 4.0.1 to 4.0.2 [\#21](https://github.com/levups/fuel_surcharge/pull/21) ([dependabot[bot]](https://github.com/apps/dependabot))
24
+ - Bump http from 4.0.0 to 4.0.1 [\#20](https://github.com/levups/fuel_surcharge/pull/20) ([dependabot[bot]](https://github.com/apps/dependabot))
25
+
3
26
  ## [v1.0.0](https://github.com/levups/fuel_surcharge/tree/v1.0.0) (2019-01-04)
4
27
  [Full Changelog](https://github.com/levups/fuel_surcharge/compare/v0.2.0...v1.0.0)
5
28
 
6
29
  **Merged pull requests:**
7
30
 
31
+ - Add travis ci build badge [\#19](https://github.com/levups/fuel_surcharge/pull/19) ([bobmaerten](https://github.com/bobmaerten))
32
+ - Replace cert name with more generic one [\#18](https://github.com/levups/fuel_surcharge/pull/18) ([bobmaerten](https://github.com/bobmaerten))
33
+ - Simplify Travis CI configuration file [\#17](https://github.com/levups/fuel_surcharge/pull/17) ([czj](https://github.com/czj))
34
+ - Bump to v1.0.0 [\#16](https://github.com/levups/fuel_surcharge/pull/16) ([czj](https://github.com/czj))
8
35
  - Include and comply to relaxed Rubocop style [\#15](https://github.com/levups/fuel_surcharge/pull/15) ([czj](https://github.com/czj))
9
36
  - Add BigDecimal compatibility for ruby 2.6 [\#13](https://github.com/levups/fuel_surcharge/pull/13) ([bobmaerten](https://github.com/bobmaerten))
10
37
  - Bump rake from 12.3.1 to 12.3.2 [\#12](https://github.com/levups/fuel_surcharge/pull/12) ([dependabot[bot]](https://github.com/apps/dependabot))
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fuel_surcharge (1.0.0)
4
+ fuel_surcharge (1.1.0)
5
5
  http (~> 4.0)
6
6
 
7
7
  GEM
@@ -30,7 +30,7 @@ GEM
30
30
  rainbow (>= 2.1)
31
31
  rake (>= 10.0)
32
32
  retriable (~> 2.1)
33
- http (4.0.0)
33
+ http (4.0.3)
34
34
  addressable (~> 2.3)
35
35
  http-cookie (~> 1.0)
36
36
  http-form_data (~> 2.0)
@@ -41,15 +41,15 @@ GEM
41
41
  http_parser.rb (0.6.0)
42
42
  i18n (1.1.1)
43
43
  concurrent-ruby (~> 1.0)
44
- jaro_winkler (1.5.1)
44
+ jaro_winkler (1.5.2)
45
45
  minitest (5.11.3)
46
46
  minitest-stub_any_instance (1.0.2)
47
47
  multi_json (1.13.1)
48
48
  multipart-post (2.0.0)
49
49
  octokit (4.13.0)
50
50
  sawyer (~> 0.8.0, >= 0.5.3)
51
- parallel (1.12.1)
52
- parser (2.5.3.0)
51
+ parallel (1.13.0)
52
+ parser (2.6.0.0)
53
53
  ast (~> 2.4.0)
54
54
  powerpack (0.1.2)
55
55
  public_suffix (3.0.3)
@@ -57,7 +57,7 @@ GEM
57
57
  rake (12.3.2)
58
58
  relaxed-rubocop (2.3.1)
59
59
  retriable (2.1.0)
60
- rubocop (0.62.0)
60
+ rubocop (0.63.1)
61
61
  jaro_winkler (~> 1.5.1)
62
62
  parallel (~> 1.10)
63
63
  parser (>= 2.5, != 2.5.1.1)
data/Rakefile CHANGED
@@ -3,6 +3,8 @@
3
3
  require "bundler/gem_tasks"
4
4
  require "github_changelog_generator/task"
5
5
  require "rake/testtask"
6
+ require "http"
7
+ require "json"
6
8
 
7
9
  Rake::TestTask.new(:test) do |t|
8
10
  t.libs << "test"
@@ -10,6 +12,24 @@ Rake::TestTask.new(:test) do |t|
10
12
  t.test_files = FileList["test/**/*_test.rb"]
11
13
  end
12
14
 
15
+ desc "Check if a gem release is required"
16
+ task :should_we_release_a_new_version do
17
+ response = HTTP.get("https://rubygems.org/api/v1/gems/fuel_surcharge.json")
18
+ unless response.code == 200
19
+ puts "Unable to fetch rubygems version"
20
+ puts response.inspect
21
+ exit 1
22
+ end
23
+ gem_release = JSON.parse(response.to_s).dig("version")
24
+
25
+ if FuelSurcharge::VERSION == gem_release
26
+ puts "No release required"
27
+ exit 78
28
+ else
29
+ puts "Let's release the v#{FuelSurcharge::VERSION}!"
30
+ end
31
+ end
32
+
13
33
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
14
34
  latest_release = `git tag --sort=taggerdate | tail -n 1`.strip
15
35
  next_release = "v#{FuelSurcharge::VERSION}"
@@ -18,6 +38,7 @@ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
18
38
  config.project = "fuel_surcharge"
19
39
  config.future_release = next_release if next_release > latest_release
20
40
  config.add_issues_wo_labels = false
41
+ config.exclude_labels = "release"
21
42
  end
22
43
 
23
44
  task default: :test
@@ -29,16 +29,12 @@ Gem::Specification.new do |spec|
29
29
  # Specify which files should be added to the gem when it is released.
30
30
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
31
31
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
32
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|.github)/}) }
33
33
  end
34
34
  spec.bindir = "exe"
35
35
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
36
  spec.require_paths = ["lib"]
37
37
 
38
- # Signature config
39
- spec.cert_chain = ["certs/levups.pem"]
40
- spec.signing_key = File.expand_path("~/.ssh/levups-gem-private_key.pem") if $PROGRAM_NAME.end_with?("gem")
41
-
42
38
  spec.add_dependency "http", "~> 4.0"
43
39
 
44
40
  spec.add_development_dependency "bundler", ">= 1.17"
@@ -28,11 +28,11 @@ module FuelSurcharge
28
28
  private
29
29
 
30
30
  def source_html
31
- HTTPRequest.new(url)
32
- .response
33
- .to_s
34
- .delete("\n")
35
- .gsub(/\s+/, " ")
31
+ @source_html ||= HTTPRequest.new(url)
32
+ .response
33
+ .to_s
34
+ .delete("\n")
35
+ .gsub(/\s+/, " ")
36
36
  end
37
37
 
38
38
  def tables
@@ -56,7 +56,8 @@ module FuelSurcharge
56
56
  def period
57
57
  return unless head
58
58
 
59
- head.match(%r{<p>(?<content>.*)</p>})
59
+ text = head.split(%r{</th>\s*<th}).last
60
+ text.match(%r{<p>(?<content>.*)</p>})
60
61
  end
61
62
 
62
63
  def body
@@ -69,8 +70,8 @@ module FuelSurcharge
69
70
  return unless period
70
71
  return unless body
71
72
 
72
- @time_period = period[:content].sub("<br />", "")
73
- @road_percentage, @air_percentage = body.split("</tr><tr>").map do |line|
73
+ @time_period = period[:content].sub(%r{<br\s*/>}, "")
74
+ @road_percentage, @air_percentage = body.split(%r{</tr>\s*<tr}).map do |line|
74
75
  line.to_s.rpartition("</td>").first.rpartition(">").last
75
76
  end
76
77
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FuelSurcharge
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
metadata CHANGED
@@ -1,41 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuel_surcharge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Maerten
8
8
  - Clément Joubert
9
9
  autorequire:
10
10
  bindir: exe
11
- cert_chain:
12
- - |
13
- -----BEGIN CERTIFICATE-----
14
- MIIEKDCCApCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRib2Iv
15
- REM9bGV2dXBzL0RDPWNvbTAeFw0xODExMTYwODU2MjNaFw0xOTExMTYwODU2MjNa
16
- MB8xHTAbBgNVBAMMFGJvYi9EQz1sZXZ1cHMvREM9Y29tMIIBojANBgkqhkiG9w0B
17
- AQEFAAOCAY8AMIIBigKCAYEA7XI0+NhEI2y0RnOR6b1sTMXGldA57XhzTorPtk7l
18
- CkOeiMBZzzK+femZhA4Y81TyUFSlg3TO/ggqEv2M0poXkz0xAXlzEqPF2P24UBs8
19
- yYWzO5RxrVHlm2Y6qS/tT8BtD0onXQQEsRH3q0dMHqGLVXTgLDeZ66Rx6+M8GZ1H
20
- PvwqINOgFEhdnWQPhFPZILBRrGo/BrToZFYBRGy4LO4+M1wFxlh4CbVNGK2tnwIM
21
- XkmVCzxTq+e+UoWgUrJYTSAvOxXqe8DlwDTeexaBdCVRG6aRIW1EAgctJDunRCTD
22
- r/mYiPuZcfkjKZwGpw6oz5+68FpgHzY7G41778A1yClN/5cLN/lNFsMoOu6LEiDV
23
- 8IKiSdZ3D9p8mjesqT/vOe7kUrWohQDSi3QJ60+cLiFD+Ft9DBuAO0TDRN6/tGL9
24
- VjvGbuJF+4FTrfiqljfWWk9bWu9OXxzg227SEygsjxVl7sYFF51qMRUAO9wvRy2O
25
- K2jiGEWzepWwuQH2sgD1mFQPAgMBAAGjbzBtMAkGA1UdEwQCMAAwCwYDVR0PBAQD
26
- AgSwMB0GA1UdDgQWBBSZs9qHyqcihqhWFJ59uiPXX3V+zTAZBgNVHREEEjAQgQ5i
27
- b2JAbGV2dXBzLmNvbTAZBgNVHRIEEjAQgQ5ib2JAbGV2dXBzLmNvbTANBgkqhkiG
28
- 9w0BAQsFAAOCAYEAp/4YIwioG2eVCJ/rGuQXhkK4Q1m7yQK3wmm8SzHbn4hRl0TG
29
- Bt3Q9/UB/N5w8HLOeYPR0wmfJ7ngrazqAnWPd/2tPFJ5ovy+zy5777ff2KNadCnI
30
- PnNYEldJQinX2PFQrLQu6+ia9TFCS+xSGBLNuF6tdxLNj6wwXV4GbmpKCn+roEbw
31
- x2KtEWqghlLMLa/NLl80bF4QOiT4hB5bCv3nP5NEJcyaaFPFtXQL5TConaMTZg3S
32
- lGv70G/cGpn1QQjBeIJfxi1pSuJ1wKsQ3/kEJZ+qg8wuD1xHAQ03Rjteavbv/isW
33
- 2Ds/y1oZIwGFXS0eSJGGRAl6RDjg5ODbw1l1qp2EY0rMJjr6khCmfemTj1CHfaPr
34
- 1r0R3b6fBvWXGHOWc+LYj2Myd3ISW3d3d1GkcvdT6eka4r+3RrQzlC9zxTwcCuJw
35
- jT8ozif/0OTSDY7+8Js1LxoE1c1miwLixh66/avBqoFcnMzfSkTmEv2xVoYiCk0M
36
- CrJThrTFQhqQDaVx
37
- -----END CERTIFICATE-----
38
- date: 2019-01-04 00:00:00.000000000 Z
11
+ cert_chain: []
12
+ date: 2019-02-10 00:00:00.000000000 Z
39
13
  dependencies:
40
14
  - !ruby/object:Gem::Dependency
41
15
  name: http
@@ -170,7 +144,6 @@ files:
170
144
  - Rakefile
171
145
  - bin/console
172
146
  - bin/setup
173
- - certs/levups.pem
174
147
  - exe/fuel_surcharge
175
148
  - fuel_surcharge.gemspec
176
149
  - lib/fuel_surcharge.rb
@@ -203,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
176
  - !ruby/object:Gem::Version
204
177
  version: '0'
205
178
  requirements: []
206
- rubygems_version: 3.0.2
179
+ rubygems_version: 3.0.1
207
180
  signing_key:
208
181
  specification_version: 4
209
182
  summary: Retrieve current month's Transporters' fuel surcharge
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
@@ -1,3 +0,0 @@
1
- RQ>��C�M*_���~qt}{Z�}�s���3��H+�Qtr���;���5MU̳����2���w�Ϝ`v��` ���Z��ݺj�D;�BF#�9�U�g� ';�"��s���R�H:���(�Ã���Ġg�f��zO!��T�>,]�GJp����D����RB�L�PWtv6��6���:�: � } �wg��M�n�w�b�q�͔��N����Rq��L��:1.��[A���j�!u���
2
- ��F1GOy+g�u��
3
- \���_a�op���Э�lR�>��bg�7�[��3̑�b+�h��|�,�́���F�抸]��j�����������n�_r�^ ��YA,�f�0p���ZO��������0V��fT�^�i
data/certs/levups.pem DELETED
@@ -1,25 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIEKDCCApCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQDDBRib2Iv
3
- REM9bGV2dXBzL0RDPWNvbTAeFw0xODExMTYwODU2MjNaFw0xOTExMTYwODU2MjNa
4
- MB8xHTAbBgNVBAMMFGJvYi9EQz1sZXZ1cHMvREM9Y29tMIIBojANBgkqhkiG9w0B
5
- AQEFAAOCAY8AMIIBigKCAYEA7XI0+NhEI2y0RnOR6b1sTMXGldA57XhzTorPtk7l
6
- CkOeiMBZzzK+femZhA4Y81TyUFSlg3TO/ggqEv2M0poXkz0xAXlzEqPF2P24UBs8
7
- yYWzO5RxrVHlm2Y6qS/tT8BtD0onXQQEsRH3q0dMHqGLVXTgLDeZ66Rx6+M8GZ1H
8
- PvwqINOgFEhdnWQPhFPZILBRrGo/BrToZFYBRGy4LO4+M1wFxlh4CbVNGK2tnwIM
9
- XkmVCzxTq+e+UoWgUrJYTSAvOxXqe8DlwDTeexaBdCVRG6aRIW1EAgctJDunRCTD
10
- r/mYiPuZcfkjKZwGpw6oz5+68FpgHzY7G41778A1yClN/5cLN/lNFsMoOu6LEiDV
11
- 8IKiSdZ3D9p8mjesqT/vOe7kUrWohQDSi3QJ60+cLiFD+Ft9DBuAO0TDRN6/tGL9
12
- VjvGbuJF+4FTrfiqljfWWk9bWu9OXxzg227SEygsjxVl7sYFF51qMRUAO9wvRy2O
13
- K2jiGEWzepWwuQH2sgD1mFQPAgMBAAGjbzBtMAkGA1UdEwQCMAAwCwYDVR0PBAQD
14
- AgSwMB0GA1UdDgQWBBSZs9qHyqcihqhWFJ59uiPXX3V+zTAZBgNVHREEEjAQgQ5i
15
- b2JAbGV2dXBzLmNvbTAZBgNVHRIEEjAQgQ5ib2JAbGV2dXBzLmNvbTANBgkqhkiG
16
- 9w0BAQsFAAOCAYEAp/4YIwioG2eVCJ/rGuQXhkK4Q1m7yQK3wmm8SzHbn4hRl0TG
17
- Bt3Q9/UB/N5w8HLOeYPR0wmfJ7ngrazqAnWPd/2tPFJ5ovy+zy5777ff2KNadCnI
18
- PnNYEldJQinX2PFQrLQu6+ia9TFCS+xSGBLNuF6tdxLNj6wwXV4GbmpKCn+roEbw
19
- x2KtEWqghlLMLa/NLl80bF4QOiT4hB5bCv3nP5NEJcyaaFPFtXQL5TConaMTZg3S
20
- lGv70G/cGpn1QQjBeIJfxi1pSuJ1wKsQ3/kEJZ+qg8wuD1xHAQ03Rjteavbv/isW
21
- 2Ds/y1oZIwGFXS0eSJGGRAl6RDjg5ODbw1l1qp2EY0rMJjr6khCmfemTj1CHfaPr
22
- 1r0R3b6fBvWXGHOWc+LYj2Myd3ISW3d3d1GkcvdT6eka4r+3RrQzlC9zxTwcCuJw
23
- jT8ozif/0OTSDY7+8Js1LxoE1c1miwLixh66/avBqoFcnMzfSkTmEv2xVoYiCk0M
24
- CrJThrTFQhqQDaVx
25
- -----END CERTIFICATE-----
metadata.gz.sig DELETED
@@ -1,5 +0,0 @@
1
- ��n�.ந��xΜ�J�3�T
2
- ��T�A4*/��H<�&8�!�+zdh�QJkW�f�Dq�y���f��L\�3v#-�p���R�wt��CXE� O���v[p����K2d���ZQ� 5�����
3
- '臠�����@a6��i
4
- Q419�ȸWW��"�E�!X3�\Nڍ���wӅ��pwy��3{��#�`��Ɔ5i���ݚ]�.��l3
5
- �9��+����c���%p:���%��e#�J�5�� ���ݞ>n�#\YgM�bp���"�%aR�Z���/�=ʆ๝nV)$��H0�E��ڲ�-�