-
Notifications
You must be signed in to change notification settings - Fork 315
Add configs of rubocop gem and fix some rubocop warnings #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
715f064
7c4fed2
fc8e042
7a8a8b6
f507a01
b7cda26
c677730
6fac8c7
7dcba79
c45a639
5d47830
d928aee
6d19df4
52623a4
67838e1
bfc8b3c
eae8112
d3e911f
4ee6d6b
7ef15bd
bb08213
f401fff
98e6b5d
a2afbaf
0c6a10e
d2d8590
a0da550
6c46c21
0aa70b8
d0c8e8d
eba5fa1
b1c0dc2
b9a757e
2ac8086
f67cf18
f0dc815
70dd0d0
b93ef12
3efd167
da863e4
b730387
e0d5617
7624740
06e5a93
225a4f7
abf9cbe
105c2c7
735a055
707bd44
d2b4a52
73e5f70
77ef05c
cb143f0
b311998
2c7a990
b13fafb
d92d8d6
987dbf1
5ea5710
8d6f23b
7eb06a1
edf3126
d5f7982
b6f9176
47b72f5
930b5ae
04f6902
6a7a22f
f291e1f
31fb9d7
77b7d6c
1ba81ff
8533708
abb8c02
d6cc880
b1bfb1a
23cfcc7
2c8f6f8
b9aefaf
63b3ee3
b920a1e
112a77d
68b5fcf
068a3e7
f6693af
94c1df1
4b60095
784e70b
ce7e01a
96f3997
1759f71
aa83776
fd864bd
2007be0
e211434
63d388c
c0177a4
53fba8a
47aa16f
68181da
f7eec2d
37ede3c
13658b0
4c81b11
753eab1
8c13dfc
1e99ff6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,13 +23,13 @@ def <<(entry) | |
@entry_set[to_key(entry)] = entry | ||
end | ||
|
||
alias :push :<< | ||
alias_method :push, :<< | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no sense to use alias_method because we don't need chains. So better use alias instead of alias_method |
||
|
||
def size | ||
@entry_set.size | ||
end | ||
|
||
alias :length :size | ||
alias_method :length, :size | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no sense to use alias_method because we don't need chains. So better use alias instead of alias_method |
||
|
||
def delete(entry) | ||
if @entry_set.delete(to_key(entry)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ def to_local_bin | |
ordered_values.map! { |v| v.to_local_bin.force_encoding('BINARY') }.join | ||
end | ||
|
||
alias :to_s :to_local_bin | ||
alias_method :to_s, :to_local_bin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no sense to use alias_method because we don't need chains. So better use alias instead of alias_method |
||
|
||
def to_c_dir_bin | ||
ordered_values.map! { |v| v.to_c_dir_bin.force_encoding('BINARY') }.join | ||
|
@@ -83,8 +83,8 @@ def local_size | |
to_local_bin.bytesize | ||
end | ||
|
||
alias :length :local_size | ||
alias :size :local_size | ||
alias_method :length, :local_size | ||
alias_method :size, :local_size | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no sense to use alias_method because we don't need chains. So better use alias instead of alias_method |
||
end | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ def eof | |
true | ||
end | ||
|
||
alias :eof? :eof | ||
alias_method :eof?, :eof | ||
end | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what reason you did it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no sense to use alias_method because we don't need chains. So better use alias instead of alias_method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, agree with you based on https://github.com/bbatsov/ruby-style-guide#alias-method-lexically, I redone it soon in all cases