code_lister 0.1.6 → 0.1.7
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/CHANGELOG.md +4 -0
- data/lib/code_lister/code_lister.rb +14 -0
- data/lib/code_lister/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5802e933d268745ca6bc5c5f7f6e90cc2266b0c
|
4
|
+
data.tar.gz: c4b931df8b7538838f259c3f86df8b0163276f57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddbb984454b699da9a01c65aa88ca79bebcce6cd64f7a652e59bb5c1557439c02afeb664d87fa2cc61e8f706add4d37273f21b53afeddf5976ad0bcd5fce9389
|
7
|
+
data.tar.gz: 8e69327acbbc1278a14efafd6440fb2c167dacfa18dec1453e95ffc76aaaba40045affe6f5bc9744b6b08689ddd8d347259056f898246d3f9e253aa659ec90ff
|
data/CHANGELOG.md
CHANGED
@@ -25,6 +25,20 @@ module CodeLister
|
|
25
25
|
return []
|
26
26
|
end
|
27
27
|
|
28
|
+
# Extract list of files from a given shell command
|
29
|
+
#
|
30
|
+
# @param [String] command the input command e.g. 'find . -type f -iname .."
|
31
|
+
# @param [String] prefix the prefix directory that will be replaced by '.' (dot string)
|
32
|
+
# @return [Array<String>] empty list or file list of the form ["./Gemfile", "./lib/codelister.rb", ..]
|
33
|
+
def files_from_shell(command, prefix)
|
34
|
+
prefix = File.expand_path(prefix) if prefix
|
35
|
+
unless prefix && File.directory?(prefix)
|
36
|
+
raise "'#{prefix}' is not valid prefix directory!"
|
37
|
+
end
|
38
|
+
files = files_from_command(command)
|
39
|
+
files.map! { |file| file.gsub(File.expand_path(prefix), ".") }
|
40
|
+
end
|
41
|
+
|
28
42
|
# List files base on multiple simple criteria
|
29
43
|
#
|
30
44
|
# @param [Hash<Symbol>,<Object>] args argument hash
|
data/lib/code_lister/version.rb
CHANGED