un_used_methods 0.1.0 → 0.1.1

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: 875c2f106cf4fc02e3f6fab4b7e57b39b6207bb87db110e221d6f42d54270dbe
4
- data.tar.gz: 37a2ac5c9ba5b8378643777db4b59b4d8baef57a1fa9b457414cd11e2b822fa9
3
+ metadata.gz: eb16037d95822bc46032688ce2f4946b51bdcb036f6d10ac3e99bad7e55e841f
4
+ data.tar.gz: f09b4e02a470acc103637647c5518a36ec60df67afa3a7a5a08bc191b4fc24e5
5
5
  SHA512:
6
- metadata.gz: d4ca47e9f5170e9ace7853ea9b5639fcdd6050e685058a49c232879c349ca30a1a709bcbbadc19a4c6cd62b4abf9dab38ea2b74cea7591d231989faaeba9dd52
7
- data.tar.gz: 9321d49fe19e0452612c9dd13e95293eadfffc0cf316c4d4ce5e2eeceea3661e0dddb98dfa90cd46058dff82dac63a07cc94bbb0f244004f7699cfb907709e26
6
+ metadata.gz: 010c199699355f6eb81141e82377a193a409c98156ead13417867a71a9384622da243d74eee859d12539e8c8fe12f5cfcbe03261326a73c3ab3e316ff64f0510
7
+ data.tar.gz: 9120c81b4cebcadaa300622c6d7c7fe372bb8776f84a7ab8fee16eed814810250a4f0f1468b6be11bf69be591afdc3efee4f079804e759bbcb41daa63d4431ee
data/.idea/misc.xml CHANGED
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="ruby-3.1.6-p260" project-jdk-type="RUBY_SDK" />
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="ruby-3.1.6-p260" project-jdk-type="RUBY_SDK" />
4
4
  </project>
@@ -11,50 +11,14 @@
11
11
  </content>
12
12
  <orderEntry type="jdk" jdkName="ruby-3.1.6-p260 (2)" jdkType="RUBY_SDK" />
13
13
  <orderEntry type="sourceFolder" forTests="false" />
14
- <orderEntry type="library" scope="PROVIDED" name="actioncable (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
15
- <orderEntry type="library" scope="PROVIDED" name="actionmailbox (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
16
- <orderEntry type="library" scope="PROVIDED" name="actionmailer (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="actionpack (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
18
- <orderEntry type="library" scope="PROVIDED" name="actiontext (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
19
- <orderEntry type="library" scope="PROVIDED" name="actionview (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
20
- <orderEntry type="library" scope="PROVIDED" name="activejob (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
21
- <orderEntry type="library" scope="PROVIDED" name="activemodel (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
22
- <orderEntry type="library" scope="PROVIDED" name="activerecord (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
23
- <orderEntry type="library" scope="PROVIDED" name="activestorage (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
24
- <orderEntry type="library" scope="PROVIDED" name="activesupport (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
25
14
  <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, ruby-3.1.6-p260 (2)) [gem]" level="application" />
26
- <orderEntry type="library" scope="PROVIDED" name="builder (v3.3.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
27
15
  <orderEntry type="library" scope="PROVIDED" name="bundler (v2.5.17, ruby-3.1.6-p260 (2)) [gem]" level="application" />
28
- <orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.3.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
29
- <orderEntry type="library" scope="PROVIDED" name="crass (v1.0.6, ruby-3.1.6-p260 (2)) [gem]" level="application" />
30
- <orderEntry type="library" scope="PROVIDED" name="date (v3.3.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
31
16
  <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.1, ruby-3.1.6-p260 (2)) [gem]" level="application" />
32
- <orderEntry type="library" scope="PROVIDED" name="erubi (v1.13.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
33
- <orderEntry type="library" scope="PROVIDED" name="globalid (v1.2.1, ruby-3.1.6-p260 (2)) [gem]" level="application" />
34
- <orderEntry type="library" scope="PROVIDED" name="i18n (v1.14.5, ruby-3.1.6-p260 (2)) [gem]" level="application" />
35
17
  <orderEntry type="library" scope="PROVIDED" name="json (v2.7.2, ruby-3.1.6-p260 (2)) [gem]" level="application" />
36
18
  <orderEntry type="library" scope="PROVIDED" name="language_server-protocol (v3.17.0.3, ruby-3.1.6-p260 (2)) [gem]" level="application" />
37
- <orderEntry type="library" scope="PROVIDED" name="loofah (v2.22.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
38
- <orderEntry type="library" scope="PROVIDED" name="mail (v2.8.1, ruby-3.1.6-p260 (2)) [gem]" level="application" />
39
- <orderEntry type="library" scope="PROVIDED" name="marcel (v1.0.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
40
- <orderEntry type="library" scope="PROVIDED" name="method_source (v1.1.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
41
- <orderEntry type="library" scope="PROVIDED" name="mini_mime (v1.1.5, ruby-3.1.6-p260 (2)) [gem]" level="application" />
42
- <orderEntry type="library" scope="PROVIDED" name="minitest (v5.25.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
43
- <orderEntry type="library" scope="PROVIDED" name="net-imap (v0.4.14, ruby-3.1.6-p260 (2)) [gem]" level="application" />
44
- <orderEntry type="library" scope="PROVIDED" name="net-pop (v0.1.2, ruby-3.1.6-p260 (2)) [gem]" level="application" />
45
- <orderEntry type="library" scope="PROVIDED" name="net-protocol (v0.2.2, ruby-3.1.6-p260 (2)) [gem]" level="application" />
46
- <orderEntry type="library" scope="PROVIDED" name="net-smtp (v0.5.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
47
- <orderEntry type="library" scope="PROVIDED" name="nio4r (v2.7.3, ruby-3.1.6-p260 (2)) [gem]" level="application" />
48
- <orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.16.7, ruby-3.1.6-p260 (2)) [gem]" level="application" />
49
19
  <orderEntry type="library" scope="PROVIDED" name="parallel (v1.26.2, ruby-3.1.6-p260 (2)) [gem]" level="application" />
50
20
  <orderEntry type="library" scope="PROVIDED" name="parser (v3.3.4.2, ruby-3.1.6-p260 (2)) [gem]" level="application" />
51
21
  <orderEntry type="library" scope="PROVIDED" name="racc (v1.8.1, ruby-3.1.6-p260 (2)) [gem]" level="application" />
52
- <orderEntry type="library" scope="PROVIDED" name="rack (v2.2.9, ruby-3.1.6-p260 (2)) [gem]" level="application" />
53
- <orderEntry type="library" scope="PROVIDED" name="rack-test (v2.1.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
54
- <orderEntry type="library" scope="PROVIDED" name="rails (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
55
- <orderEntry type="library" scope="PROVIDED" name="rails-dom-testing (v2.2.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
56
- <orderEntry type="library" scope="PROVIDED" name="rails-html-sanitizer (v1.6.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
57
- <orderEntry type="library" scope="PROVIDED" name="railties (v7.0.8.4, ruby-3.1.6-p260 (2)) [gem]" level="application" />
58
22
  <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, ruby-3.1.6-p260 (2)) [gem]" level="application" />
59
23
  <orderEntry type="library" scope="PROVIDED" name="rake (v13.2.1, ruby-3.1.6-p260 (2)) [gem]" level="application" />
60
24
  <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.9.2, ruby-3.1.6-p260 (2)) [gem]" level="application" />
@@ -69,11 +33,6 @@
69
33
  <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.13.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
70
34
  <orderEntry type="library" scope="PROVIDED" name="strscan (v3.1.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
71
35
  <orderEntry type="library" scope="PROVIDED" name="thor (v1.3.1, ruby-3.1.6-p260 (2)) [gem]" level="application" />
72
- <orderEntry type="library" scope="PROVIDED" name="timeout (v0.4.1, ruby-3.1.6-p260 (2)) [gem]" level="application" />
73
- <orderEntry type="library" scope="PROVIDED" name="tzinfo (v2.0.6, ruby-3.1.6-p260 (2)) [gem]" level="application" />
74
36
  <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.5.0, ruby-3.1.6-p260 (2)) [gem]" level="application" />
75
- <orderEntry type="library" scope="PROVIDED" name="websocket-driver (v0.7.6, ruby-3.1.6-p260 (2)) [gem]" level="application" />
76
- <orderEntry type="library" scope="PROVIDED" name="websocket-extensions (v0.1.5, ruby-3.1.6-p260 (2)) [gem]" level="application" />
77
- <orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.6.17, ruby-3.1.6-p260 (2)) [gem]" level="application" />
78
37
  </component>
79
38
  </module>
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml CHANGED
@@ -9,3 +9,6 @@ Style/StringLiteralsInInterpolation:
9
9
 
10
10
  Lint/ScriptPermission:
11
11
  Enabled: false
12
+
13
+ Metrics/MethodLength:
14
+ Max: 20
data/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
- ## [Unreleased]
2
-
3
- ## [0.1.0] - 2024-08-16
4
-
5
- - Initial release
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-08-16
4
+
5
+ - Initial release
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,132 +1,132 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our
6
- community a harassment-free experience for everyone, regardless of age, body
7
- size, visible or invisible disability, ethnicity, sex characteristics, gender
8
- identity and expression, level of experience, education, socio-economic status,
9
- nationality, personal appearance, race, caste, color, religion, or sexual
10
- identity and orientation.
11
-
12
- We pledge to act and interact in ways that contribute to an open, welcoming,
13
- diverse, inclusive, and healthy community.
14
-
15
- ## Our Standards
16
-
17
- Examples of behavior that contributes to a positive environment for our
18
- community include:
19
-
20
- * Demonstrating empathy and kindness toward other people
21
- * Being respectful of differing opinions, viewpoints, and experiences
22
- * Giving and gracefully accepting constructive feedback
23
- * Accepting responsibility and apologizing to those affected by our mistakes,
24
- and learning from the experience
25
- * Focusing on what is best not just for us as individuals, but for the overall
26
- community
27
-
28
- Examples of unacceptable behavior include:
29
-
30
- * The use of sexualized language or imagery, and sexual attention or advances of
31
- any kind
32
- * Trolling, insulting or derogatory comments, and personal or political attacks
33
- * Public or private harassment
34
- * Publishing others' private information, such as a physical or email address,
35
- without their explicit permission
36
- * Other conduct which could reasonably be considered inappropriate in a
37
- professional setting
38
-
39
- ## Enforcement Responsibilities
40
-
41
- Community leaders are responsible for clarifying and enforcing our standards of
42
- acceptable behavior and will take appropriate and fair corrective action in
43
- response to any behavior that they deem inappropriate, threatening, offensive,
44
- or harmful.
45
-
46
- Community leaders have the right and responsibility to remove, edit, or reject
47
- comments, commits, code, wiki edits, issues, and other contributions that are
48
- not aligned to this Code of Conduct, and will communicate reasons for moderation
49
- decisions when appropriate.
50
-
51
- ## Scope
52
-
53
- This Code of Conduct applies within all community spaces, and also applies when
54
- an individual is officially representing the community in public spaces.
55
- Examples of representing our community include using an official email address,
56
- posting via an official social media account, or acting as an appointed
57
- representative at an online or offline event.
58
-
59
- ## Enforcement
60
-
61
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
- reported to the community leaders responsible for enforcement at
63
- [INSERT CONTACT METHOD].
64
- All complaints will be reviewed and investigated promptly and fairly.
65
-
66
- All community leaders are obligated to respect the privacy and security of the
67
- reporter of any incident.
68
-
69
- ## Enforcement Guidelines
70
-
71
- Community leaders will follow these Community Impact Guidelines in determining
72
- the consequences for any action they deem in violation of this Code of Conduct:
73
-
74
- ### 1. Correction
75
-
76
- **Community Impact**: Use of inappropriate language or other behavior deemed
77
- unprofessional or unwelcome in the community.
78
-
79
- **Consequence**: A private, written warning from community leaders, providing
80
- clarity around the nature of the violation and an explanation of why the
81
- behavior was inappropriate. A public apology may be requested.
82
-
83
- ### 2. Warning
84
-
85
- **Community Impact**: A violation through a single incident or series of
86
- actions.
87
-
88
- **Consequence**: A warning with consequences for continued behavior. No
89
- interaction with the people involved, including unsolicited interaction with
90
- those enforcing the Code of Conduct, for a specified period of time. This
91
- includes avoiding interactions in community spaces as well as external channels
92
- like social media. Violating these terms may lead to a temporary or permanent
93
- ban.
94
-
95
- ### 3. Temporary Ban
96
-
97
- **Community Impact**: A serious violation of community standards, including
98
- sustained inappropriate behavior.
99
-
100
- **Consequence**: A temporary ban from any sort of interaction or public
101
- communication with the community for a specified period of time. No public or
102
- private interaction with the people involved, including unsolicited interaction
103
- with those enforcing the Code of Conduct, is allowed during this period.
104
- Violating these terms may lead to a permanent ban.
105
-
106
- ### 4. Permanent Ban
107
-
108
- **Community Impact**: Demonstrating a pattern of violation of community
109
- standards, including sustained inappropriate behavior, harassment of an
110
- individual, or aggression toward or disparagement of classes of individuals.
111
-
112
- **Consequence**: A permanent ban from any sort of public interaction within the
113
- community.
114
-
115
- ## Attribution
116
-
117
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
- version 2.1, available at
119
- [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
-
121
- Community Impact Guidelines were inspired by
122
- [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
-
124
- For answers to common questions about this code of conduct, see the FAQ at
125
- [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
- [https://www.contributor-covenant.org/translations][translations].
127
-
128
- [homepage]: https://www.contributor-covenant.org
129
- [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
- [Mozilla CoC]: https://github.com/mozilla/diversity
131
- [FAQ]: https://www.contributor-covenant.org/faq
132
- [translations]: https://www.contributor-covenant.org/translations
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 Dhamo1107
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Dhamo1107
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,39 +1,39 @@
1
- # UnUsedMethods
2
-
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/un_used_methods`. To experiment with that code, run `bin/console` for an interactive prompt.
6
-
7
- ## Installation
8
-
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
12
-
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
14
-
15
- If bundler is not being used to manage dependencies, install the gem by executing:
16
-
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
18
-
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
22
-
23
- ## Development
24
-
25
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
-
27
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
-
29
- ## Contributing
30
-
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/un_used_methods. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/un_used_methods/blob/master/CODE_OF_CONDUCT.md).
32
-
33
- ## License
34
-
35
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
36
-
37
- ## Code of Conduct
38
-
39
- Everyone interacting in the UnUsedMethods project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/un_used_methods/blob/master/CODE_OF_CONDUCT.md).
1
+ # UnUsedMethods
2
+
3
+ TODO: Delete this and the text below, and describe your gem
4
+
5
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/un_used_methods`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ ## Installation
8
+
9
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
+
11
+ Install the gem and add to the application's Gemfile by executing:
12
+
13
+ $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
14
+
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
16
+
17
+ $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/un_used_methods. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/un_used_methods/blob/master/CODE_OF_CONDUCT.md).
32
+
33
+ ## License
34
+
35
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
36
+
37
+ ## Code of Conduct
38
+
39
+ Everyone interacting in the UnUsedMethods project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/un_used_methods/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,12 +1,12 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "rubocop/rake_task"
9
-
10
- RuboCop::RakeTask.new
11
-
12
- task default: %i[spec rubocop]
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -37,7 +37,7 @@ module UnUsedMethods
37
37
  Dir.glob("#{directory}/**/*.rb").each do |file|
38
38
  methods = extract_methods(file)
39
39
  methods.each do |method|
40
- un_used_methods << "#{file}: #{method}" unless method_used?(method)
40
+ un_used_methods << "#{file}: #{method}" if method_used?(method, file)
41
41
  end
42
42
  end
43
43
 
@@ -49,21 +49,33 @@ module UnUsedMethods
49
49
  content.scan(/def (\w+)/).flatten
50
50
  end
51
51
 
52
- def method_used?(method)
53
- method_pattern = /#{method}/
54
- files = Dir.glob("app/**/*.{rb}")
55
-
56
- files.any? do |file|
52
+ def method_used?(method, definition_file)
53
+ # Patterns to detect method calls with and without parentheses
54
+ method_call_pattern = /(\.|^|\s)#{method}\s*(\(|$)/
55
+ # Search directories for relevant file types
56
+ files = Dir.glob("app/**/*.{rb,html,erb,haml,slim,js,jsx,ts,tsx}") + Dir.glob("lib/**/*.{rb}")
57
+ method_used = false
58
+ files.each do |file|
57
59
  content = File.read(file)
58
- content.match?(method_pattern)
60
+ # Check for method usage (skip the method's own definition line)
61
+ if content =~ method_call_pattern && file != definition_file
62
+ method_used = true
63
+ p "Method '#{method}' called in file: #{file}"
64
+ break
65
+ elsif content.scan(method_call_pattern).count > 1 && file == definition_file
66
+ method_used = true
67
+ p "Method '#{method}' called in its own file: #{file}"
68
+ break
69
+ end
59
70
  end
71
+ !method_used
60
72
  end
61
73
 
62
74
  def report_un_used_methods(unused_methods)
63
75
  if unused_methods.empty?
64
- puts "No un used methods found!"
76
+ p "No un used methods found!"
65
77
  else
66
- puts "Un used Methods found in your model, controller, and helper directories:"
78
+ p "Un used Methods found in your model, controller, and helper directories:"
67
79
  unused_methods.each { |method| puts method }
68
80
  end
69
81
  end
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- module UnUsedMethods
4
- VERSION = "0.1.0"
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ module UnUsedMethods
4
+ VERSION = "0.1.1"
5
+ end
@@ -1,4 +1,4 @@
1
- module UnUsedMethods
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end
1
+ module UnUsedMethods
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: un_used_methods
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dhamo1107
@@ -95,6 +95,7 @@ files:
95
95
  - lib/un_used_methods/cli.rb
96
96
  - lib/un_used_methods/version.rb
97
97
  - sig/un_used_methods.rbs
98
+ - un_used_methods-0.1.0.gem
98
99
  homepage: https://github.com/Dhamo1107/un_used_methods
99
100
  licenses:
100
101
  - MIT
@@ -118,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
119
  - !ruby/object:Gem::Version
119
120
  version: '0'
120
121
  requirements: []
121
- rubygems_version: 3.3.26
122
+ rubygems_version: 3.3.27
122
123
  signing_key:
123
124
  specification_version: 4
124
125
  summary: A gem to identify and list unused methods in your Rails application.