Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit 8b31952

Browse files
author
Dorothee Laugwitz
authored
Update rubocop and rubocop-performance (#72)
* Change `rubocop` version specification to `~> 1.8.1` * Change `rubocop-performance` version specification to `~> 1.7.0` * Update `.rubocop.yml` to match current shipcloud style guides * Correct styling issues automatically with `rubocop -a` * Fix remaining styling issues, mostly by adding magic comment `# frozen_string_literal: true` to files [ch7626](https://app.clubhouse.io/shipcloud/story/7626)
1 parent cbe6e2c commit 8b31952

34 files changed

Lines changed: 624 additions & 570 deletions

.rubocop.yml

Lines changed: 310 additions & 313 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
- Add attr_accessor for `service` to class `Shipcloud::Shipment` to be able to access the service attribute at the shipment object.
44
- Add attr_accessor for `additional_services` to class `Shipcloud::Shipment` to be able to access the additional_services attribute at the shipment object.
55
- Add attr_reader for `label_voucher_url` to class `Shipcloud::Shipment` to be able to read the label_voucher_url (QR Code url) attribute at the shipment object.
6+
- Added missing `frozen_string_literal: true` magic comments to files
67

78
### Changed
89
- Set required ruby version to >= 2.6
910
- Replace Travis CI with CircleCI
1011
- Specify simplecov to be ~> 0.21.0
12+
- Specify `rubocop` to be `~> 1.10.0`
13+
- Specify `rubocop-performance` to be `~> 1.7.0`
1114

1215
### Deprecated
1316

@@ -16,6 +19,7 @@
1619
- Drop support for RBX
1720

1821
### Fixed
22+
- Fix rubocop styling issues
1923

2024
### Security
2125

@@ -24,16 +28,6 @@
2428
- Support shipments with pickup requests as required for [TNT](https://developers.shipcloud.io/carriers/tnt.html).
2529
- Add attr_accessor for `email` to class `Shipcloud::Address` to be able to access the email attribute at the address object.
2630

27-
### Changed
28-
29-
### Deprecated
30-
31-
### Removed
32-
33-
### Fixed
34-
35-
### Security
36-
3731
## [0.10.0] - 2019-08-07
3832
### Added
3933
- Add the possibility to specify custom affiliate_id on every request

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
source 'https://rubygems.org'
1+
# frozen_string_literal: true
2+
source "https://rubygems.org"
23

34
# Specify your gem's dependencies in shipcloud.gemspec
45
gemspec

Rakefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
# frozen_string_literal: true
12
require "bundler/gem_tasks"
2-
require 'rspec/core/rake_task'
3+
require "rspec/core/rake_task"
34

45
RSpec::Core::RakeTask.new(:spec)
56

67
task :console do
7-
require 'irb'
8-
require 'irb/completion'
9-
require 'shipcloud'
8+
require "irb"
9+
require "irb/completion"
10+
require "shipcloud"
1011
ARGV.clear
1112
IRB.start
1213
end

lib/shipcloud/address.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Shipcloud
24
class Address < Base
35
include Shipcloud::Operations::Update

lib/shipcloud/base.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Shipcloud
24
class Base
35
include Shipcloud::Operations::Create
@@ -28,17 +30,15 @@ def self.camel_to_snakecase(string)
2830
end
2931

3032
def self.class_name
31-
self.name.split("::").last
33+
name.split("::").last
3234
end
3335

3436
def self.base_url
3537
"#{class_name.downcase}s"
3638
end
3739

38-
def self.create_response_root
39-
end
40+
def self.create_response_root; end
4041

41-
def self.index_response_root
42-
end
42+
def self.index_response_root; end
4343
end
4444
end

lib/shipcloud/carrier.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Shipcloud
24
class Carrier < Base
35
include Shipcloud::Operations::All

lib/shipcloud/operations/all.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Shipcloud
24
module Operations
35
module All

lib/shipcloud/operations/create.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Shipcloud
24
module Operations
35
module Create
@@ -18,7 +20,7 @@ def create(attributes, api_key: nil, affiliate_id: nil)
1820
if create_response_root
1921
response = response.fetch(create_response_root, {})
2022
end
21-
self.new(response)
23+
new(response)
2224
end
2325
end
2426

lib/shipcloud/operations/delete.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Shipcloud
24
module Operations
35
module Delete

0 commit comments

Comments
 (0)