Skip to content

Commit 90f6e80

Browse files
committed
Clean up a bunch of stuff
1 parent e4b4bff commit 90f6e80

6 files changed

Lines changed: 13 additions & 62 deletions

File tree

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ Style/BracesAroundHashParameters:
1919

2020
Layout/AccessModifierIndentation:
2121
EnforcedStyle: outdent
22+
23+
Metrics/LineLength:
24+
Enabled: false

.rubocop_todo.yml

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,12 @@
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 1
10-
# Cop supports --auto-correct.
11-
# Configuration parameters: EnforcedStyle, IndentationWidth.
12-
# SupportedStyles: aligned, indented, indented_relative_to_receiver
13-
Layout/MultilineMethodCallIndentation:
14-
Exclude:
15-
- 'lib/drip/collection.rb'
16-
17-
# Offense count: 6
18-
# Cop supports --auto-correct.
19-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
20-
# SupportedStyles: space, no_space, compact
21-
# SupportedStylesForEmptyBraces: space, no_space
22-
Layout/SpaceInsideHashLiteralBraces:
23-
Exclude:
24-
- 'test/drip/client_test.rb'
25-
26-
# Offense count: 3
27-
# Cop supports --auto-correct.
28-
# Configuration parameters: IndentationWidth.
29-
Layout/Tab:
30-
Exclude:
31-
- 'lib/drip/client/orders.rb'
32-
33-
# Offense count: 1
34-
# Cop supports --auto-correct.
35-
# Configuration parameters: AllowInHeredoc.
36-
Layout/TrailingWhitespace:
37-
Exclude:
38-
- 'lib/drip/client/orders.rb'
39-
409
# Offense count: 1
4110
# Cop supports --auto-correct.
4211
Lint/ScriptPermission:
4312
Exclude:
4413
- 'Rakefile'
4514

46-
# Offense count: 1
47-
# Cop supports --auto-correct.
48-
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
49-
Lint/UnusedBlockArgument:
50-
Exclude:
51-
- 'lib/drip/response.rb'
52-
5315
# Offense count: 2
5416
# Cop supports --auto-correct.
5517
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
@@ -142,17 +104,3 @@ Style/NumericLiterals:
142104
# SupportedStyles: single_quotes, double_quotes
143105
Style/StringLiterals:
144106
Enabled: false
145-
146-
# Offense count: 1
147-
# Cop supports --auto-correct.
148-
# Configuration parameters: EnforcedStyle.
149-
# SupportedStyles: single_quotes, double_quotes
150-
Style/StringLiteralsInInterpolation:
151-
Exclude:
152-
- 'test/drip/client_test.rb'
153-
154-
# Offense count: 102
155-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
156-
# URISchemes: http, https
157-
Metrics/LineLength:
158-
Max: 126

lib/drip/client/orders.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ def create_or_update_orders(orders)
2727
# Public: Create or update a refund.
2828
#
2929
# options - Required. A Hash of refund properties
30-
# amount - Required. The amount of the refund.
30+
# amount - Required. The amount of the refund.
3131
# provider - Required. The provider for the Order being refunded.
3232
# order_upstream_id - Required. The upstream_id for the Order being refunded.
33-
# upstream_id - The unique id of refund in the order management system.
34-
# note - A note about the refund.
35-
# processed_at - The String time at which the refund was processed in
33+
# upstream_id - The unique id of refund in the order management system.
34+
# note - A note about the refund.
35+
# processed_at - The String time at which the refund was processed in
3636
# ISO-8601 format.
3737
#
3838
# Returns a Drip::Response.

lib/drip/collection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def self.resource_name
1919

2020
def item_class
2121
@item_class ||= Drip::Resources.
22-
find_class(self.class.resource_name)
22+
find_class(self.class.resource_name)
2323
end
2424

2525
def parse_items

lib/drip/response.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def parse_members
6565

6666
def member_map
6767
@member_map ||= {}.tap do |map|
68-
members.each { |key, value| map[key.to_sym] = key }
68+
members.each { |key, _value| map[key.to_sym] = key }
6969
end
7070
end
7171
end

test/drip/client_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Drip::ClientTest < Drip::TestCase
7979

8080
@client.get("testpath")
8181

82-
header = "Basic #{Base64.encode64(@key + ":")}".strip
82+
header = "Basic #{Base64.encode64(@key + ':')}".strip
8383
assert_requested :get, "https://api.getdrip.com/v2/testpath", headers: { 'Authorization' => header }
8484
end
8585
end
@@ -127,7 +127,7 @@ class Drip::ClientTest < Drip::TestCase
127127

128128
should "follow redirect" do
129129
stub_request(:get, "https://api.getdrip.com/v2/testpath").
130-
to_return(status: 301, body: "", headers: {"Location" => "https://api.example.com/mytestpath"})
130+
to_return(status: 301, body: "", headers: { "Location" => "https://api.example.com/mytestpath" })
131131
stub_request(:get, "https://api.example.com/mytestpath").
132132
to_return(status: 200, body: "mybody")
133133
response = @client.get("testpath")
@@ -138,9 +138,9 @@ class Drip::ClientTest < Drip::TestCase
138138

139139
should "not follow too many redirects" do
140140
stub_request(:get, "https://api.getdrip.com/v2/testpath").
141-
to_return(status: 301, body: "", headers: {"Location" => "https://api.example.com/mytestpath"})
141+
to_return(status: 301, body: "", headers: { "Location" => "https://api.example.com/mytestpath" })
142142
stub_request(:get, "https://api.example.com/mytestpath").
143-
to_return(status: 302, body: "", headers: {"Location" => "https://api.getdrip.com/v2/testpath"})
143+
to_return(status: 302, body: "", headers: { "Location" => "https://api.getdrip.com/v2/testpath" })
144144
assert_raises(Drip::TooManyRedirectsError) { @client.get("testpath") }
145145
assert_requested :get, "https://api.getdrip.com/v2/testpath", times: 5
146146
assert_requested :get, "https://api.example.com/mytestpath", times: 5

0 commit comments

Comments
 (0)