code_lister 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/code_lister.gemspec +1 -0
- data/lib/code_lister/code_lister.rb +7 -5
- data/lib/code_lister/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8e7e0850ac1c629bb18a504492d663bb2a8f898
|
4
|
+
data.tar.gz: ff1c57d1ad759d9e3672119a890ec06cc790460b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc7d65ff2a50bd2e33dadf8a26b9a2b114a586264015efd274acb86e058b5b4e27049ce145891ae2f319047402938d566801cebfdf95d20a6297e062d4c819be
|
7
|
+
data.tar.gz: 9aee7c7be3b9c210e326230ad4b2ec28da45c0329382bca0385c63eceb42ecf241e752de654323ab95ac1ca878e052bc7b8773cf308ad362590b758ef3cc215a
|
data/CHANGELOG.md
CHANGED
data/code_lister.gemspec
CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.description = "List/filter files similar to 'find then grep' command in Linux/Unix based system"
|
12
12
|
spec.homepage = "https://github.com/agilecreativity/code_lister"
|
13
13
|
spec.license = "MIT"
|
14
|
+
spec.required_ruby_version = ">= 2.1.0"
|
14
15
|
spec.files = Dir.glob("{bin,lib}/**/*") + %w[Gemfile
|
15
16
|
Rakefile
|
16
17
|
code_lister.gemspec
|
@@ -101,10 +101,12 @@ module CodeLister
|
|
101
101
|
files
|
102
102
|
end
|
103
103
|
|
104
|
+
private
|
105
|
+
|
104
106
|
# List files that do not have the extension
|
105
107
|
#
|
106
108
|
# @return list of files that does not have any extension
|
107
|
-
|
109
|
+
def no_extension_files(base_dir, wildcard, non_exts = [])
|
108
110
|
list = []
|
109
111
|
unless non_exts.empty?
|
110
112
|
list = Dir.glob(File.join(base_dir, wildcard, "{#{non_exts.join(",")}}"))
|
@@ -112,7 +114,7 @@ module CodeLister
|
|
112
114
|
list
|
113
115
|
end
|
114
116
|
|
115
|
-
|
117
|
+
def take_any!(file_list, args = {})
|
116
118
|
words = args[:inc_words]
|
117
119
|
ignore_case = args[:ignore_case]
|
118
120
|
unless words.empty?
|
@@ -123,7 +125,7 @@ module CodeLister
|
|
123
125
|
file_list
|
124
126
|
end
|
125
127
|
|
126
|
-
|
128
|
+
def drop_any!(file_list, args = {})
|
127
129
|
words = args[:exc_words]
|
128
130
|
ignore_case = args[:ignore_case]
|
129
131
|
unless words.empty?
|
@@ -134,11 +136,11 @@ module CodeLister
|
|
134
136
|
file_list
|
135
137
|
end
|
136
138
|
|
137
|
-
|
139
|
+
def matched_any?(words, file, ignore_case)
|
138
140
|
words.any? { |word| matched?(ignore_case, word, file) }
|
139
141
|
end
|
140
142
|
|
141
|
-
|
143
|
+
def matched?(ignore_case, word, file)
|
142
144
|
if ignore_case
|
143
145
|
/#{word}/i =~ File.basename(file)
|
144
146
|
else
|
data/lib/code_lister/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code_lister
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burin Choomnuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -186,7 +186,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
186
186
|
requirements:
|
187
187
|
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version:
|
189
|
+
version: 2.1.0
|
190
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - ">="
|