Skip to content

Commit cdda848

Browse files
committed
Fix typos and improve code quality
- Fix typo: '3th' → '3rd' in comment - Fix typo: 'extentions' → 'extensions' (directory renamed) - Fix method name: 'copy_interface_file' → 'copy_type_file' in TypeGenerator - Update .rubocop.yml to reference correct directory name - Update README.md with modern Ruby syntax (Array[] → [])
1 parent 410519c commit cdda848

6 files changed

Lines changed: 11 additions & 9 deletions

File tree

.rubocop.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ AllCops:
22
TargetRubyVersion: 3.2
33
NewCops: enable
44
SuggestExtensions: false
5+
Exclude:
6+
- "README.md"
57

68
Style/StringLiterals:
79
Enabled: true
@@ -21,7 +23,7 @@ Metrics/BlockLength:
2123
Metrics/MethodLength:
2224
Exclude:
2325
- "lib/rspec/json_api/compare_hash.rb"
24-
- "lib/extentions/hash.rb"
26+
- "lib/extensions/hash.rb"
2527

2628
Metrics/AbcSize:
2729
Exclude:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Generate new type:
5151
RSpec.describe UsersController, type: :controller do
5252
describe '#index' do
5353
let(:expected_schema) do
54-
Array[{
54+
[{
5555
id: RSpec::JsonApi::Types::UUID,
5656
name: String,
5757
age: Integer,
@@ -204,7 +204,7 @@ let(:expected_schema) do
204204
id: Integer,
205205
name: String,
206206
age: Integer,
207-
notes: Array[String]
207+
notes: [String]
208208
}
209209
end
210210
```
@@ -231,7 +231,7 @@ end
231231
### Interface match
232232
```ruby
233233
let(:expected_schema) do
234-
Array[RSpec::JsonApi::Interfaces::PERSON]
234+
[RSpec::JsonApi::Interfaces::PERSON]
235235
end
236236
```
237237

lib/generators/rspec/json_api/type/type_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Generators
66
class TypeGenerator < Rails::Generators::NamedBase
77
source_root File.expand_path("templates", __dir__)
88

9-
def copy_interface_file
9+
def copy_type_file
1010
create_file "spec/rspec/json_api/types/#{file_name}.rb", <<~FILE
1111
module RSpec
1212
module JsonApi

lib/rspec/json_api.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
# Load 3th party libraries
3+
# Load 3rd party libraries
44
require "json"
55
require "diffy"
66
require "active_support/core_ext/object/blank"
@@ -10,9 +10,9 @@
1010
require "rspec/json_api/compare_hash"
1111
require "rspec/json_api/compare_array"
1212

13-
# Load extentions
14-
require "extentions/hash"
15-
require "extentions/array"
13+
# Load extensions
14+
require "extensions/hash"
15+
require "extensions/array"
1616

1717
# Load matchers
1818
require "rspec/json_api/matchers"

0 commit comments

Comments
 (0)