code_clone_detector 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/exe/code_clone_detector +1 -1
- data/lib/code_clone_detector/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ab65aded7bc8d3835f3364910908bc2842b7adbcdbf724a2d6835535f082c83
|
4
|
+
data.tar.gz: 2791990994d331c73067c441d4568bb4844d4586eef86d477d84a27e1900b104
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e4770d27eec4474c97be3be51df16d1d522bf1c2704c5e4e574d40fb1c3c97c8967bf9e0091d8decbc9e7276cb5e7b4155079a63270a4ad73b0d227a162d029
|
7
|
+
data.tar.gz: 57ffa8eff124dcf4f44f04d8a362bad528032632399c997ca0863e6dcc998537b6761ddf822f4e465d76f53c27b99f6814bb380b41b1170f1fa0badb0a620b11
|
data/README.md
CHANGED
@@ -27,6 +27,11 @@ Execute as:
|
|
27
27
|
$ bundle exec code_clone_detector
|
28
28
|
|
29
29
|
You can detect the largest code clone.
|
30
|
+
|
31
|
+
if you want to execute it only for a specific folder, execute following:
|
32
|
+
|
33
|
+
$ bundle exec code_clone_detector app/
|
34
|
+
|
30
35
|
## Development
|
31
36
|
|
32
37
|
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.
|
data/exe/code_clone_detector
CHANGED
@@ -8,7 +8,7 @@ require "ripper"
|
|
8
8
|
code = []
|
9
9
|
|
10
10
|
Dir.glob("**/*") do |file_name|
|
11
|
-
if file_name.include?(".rb")
|
11
|
+
if file_name.include?(".rb") && file_name.include?((ARGV[0]).to_s)
|
12
12
|
File.open(file_name, "r") do |file|
|
13
13
|
file_content = file.read
|
14
14
|
code.push([file_name.to_s, Ripper.lex(file_content)])
|