rubisc 0.3.4 → 0.3.5
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/lib/fileutil.rb +19 -23
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a28e2fc56bd3f3b1f3d5faa0964ac5e1e60cd9fa
|
|
4
|
+
data.tar.gz: a9148538776d68e43a47d8f2fa179201c91871d3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4fae636635cf9b52d5b56eb3ee22b75219b1930695fe4e7a4f5353bfa5d2242bf1cfe9335f709d22e93c6444d0e0402cbbc5007717526a5231b932aa5891916c
|
|
7
|
+
data.tar.gz: 07e48686af50c4766868c227624e6975d7b2fb58857bdcfaa8291623b808f28a8f998c1b14b8e0cf1f8e4e93c5c5e28e1670a8e3f33f7b657e28bbd633ea1379
|
data/lib/fileutil.rb
CHANGED
|
@@ -30,16 +30,8 @@ module Rubisc
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def self.substitute path,old_content,new_content
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Dir.entries(path).each do |sub|
|
|
36
|
-
if sub!="." and sub!=".."
|
|
37
|
-
substitute "#{path}/#{sub}",old_content,new_content
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
else
|
|
41
|
-
file_substitute path,old_content,new_content
|
|
42
|
-
end
|
|
33
|
+
iterate_files path do |file|
|
|
34
|
+
file_substitute path,old_content,new_content
|
|
43
35
|
end
|
|
44
36
|
end
|
|
45
37
|
|
|
@@ -50,19 +42,11 @@ module Rubisc
|
|
|
50
42
|
end
|
|
51
43
|
|
|
52
44
|
def self.contains_pattern? path,pattern
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
contains=contains_pattern? "#{path}/#{sub}",pattern
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
else
|
|
62
|
-
contains=file_contains_pattern? path,pattern
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
contains
|
|
45
|
+
iterate_files path do |file|
|
|
46
|
+
contains=file_contains_pattern file,pattern
|
|
47
|
+
return true if contains
|
|
48
|
+
end
|
|
49
|
+
false
|
|
66
50
|
end
|
|
67
51
|
|
|
68
52
|
def self.file_contains_pattern? path,pattern
|
|
@@ -72,5 +56,17 @@ module Rubisc
|
|
|
72
56
|
end
|
|
73
57
|
matches!=nil
|
|
74
58
|
end
|
|
59
|
+
|
|
60
|
+
def self.iterate_files path
|
|
61
|
+
if File.directory?(path)
|
|
62
|
+
Dir.entries(path).each do |sub|
|
|
63
|
+
if sub!="." and sub!=".."
|
|
64
|
+
iterate_files "#{path}/#{sub}"
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
else
|
|
68
|
+
yield path
|
|
69
|
+
end
|
|
70
|
+
end
|
|
75
71
|
end
|
|
76
72
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubisc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- luqyluqe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-05-
|
|
11
|
+
date: 2018-05-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Wicked cool ruby scripts
|
|
14
14
|
email: luqy.luqe@gmail.com
|