nodebugger 0.1.2 → 0.1.3
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 +1 -0
- data/lib/generators/nodebugger_generator.rb +1 -0
- data/lib/nodebugger/version.rb +4 -3
- data/lib/nodebugger.rb +7 -6
- 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: 4f4dc971175aa5a54cfdb1a6aaa557d75879cc09
|
4
|
+
data.tar.gz: 17827e2fb8cdd86066c01343c0b1275fa375061b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acf42a2cafa50599e9cf5175c477c5604be4124a1a525bc3e3294af7a3e0bdfecdd222f4d69203b42d0c6ad541a72425a8ae2554a08162449276bac5afd8c6b1
|
7
|
+
data.tar.gz: 87ebbb3196a302301f285e0b73bee04181f9868dc4b48295251fd040044d909cc9cd8fa94ca8c31fe76ece862a891806043a00a0bf3fa14cd12ba12002411155
|
data/README.md
CHANGED
@@ -24,6 +24,7 @@ Or install it yourself as:
|
|
24
24
|
rails generate nodebugger
|
25
25
|
#this will crearte nodebugger.rb in /config/initializers. In this file set directories to remove debugger from
|
26
26
|
#set recursive to true to remove from subdirectories
|
27
|
+
# pass extensions for particular file extention config.extensions_only = '.{rb, coffee, js}'
|
27
28
|
#run command
|
28
29
|
Nodebugger.run
|
29
30
|
|
@@ -5,6 +5,7 @@ class NodebuggerGenerator < Rails::Generators::Base
|
|
5
5
|
#pass directories to remove debugger from
|
6
6
|
#config.from_directories = %w(app/controllers app/models app/views)
|
7
7
|
#config.recursive = false
|
8
|
+
#config.extensions_only = '.{rb, coffee, js}' # leave commented for all extentions
|
8
9
|
end"
|
9
10
|
end
|
10
11
|
end
|
data/lib/nodebugger/version.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
module Nodebugger
|
2
2
|
class Configuration
|
3
|
-
attr_accessor :from_directories, :recursive
|
3
|
+
attr_accessor :from_directories, :recursive, :extensions_only
|
4
4
|
|
5
5
|
def initialize
|
6
6
|
@from_directories = %w(app/controllers app/models app/views)
|
7
|
-
@recursive = false
|
7
|
+
@recursive = false
|
8
|
+
@extensions_only = ""
|
8
9
|
end
|
9
10
|
end
|
10
|
-
VERSION = "0.1.
|
11
|
+
VERSION = "0.1.3"
|
11
12
|
end
|
data/lib/nodebugger.rb
CHANGED
@@ -19,21 +19,22 @@ module Nodebugger
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def run
|
22
|
+
extensions_only = Nodebugger.configuration.extensions_only
|
22
23
|
Nodebugger.configuration.from_directories.each do |directory|
|
23
|
-
files =[]
|
24
|
+
files =[]
|
24
25
|
if Nodebugger.configuration.recursive
|
25
|
-
files = recursion(directory, files)
|
26
|
+
files = recursion(directory, files, extensions_only)
|
26
27
|
else
|
27
|
-
files = Dir.glob("#{directory}/*").select { |f| File.file?(f) }
|
28
|
+
files = Dir.glob("#{directory}/*" << extensions_only).select { |f| File.file?(f) }
|
28
29
|
end
|
29
30
|
process_files(files)
|
30
31
|
end
|
31
32
|
end
|
32
33
|
|
33
|
-
def recursion(directory, files)
|
34
|
+
def recursion(directory, files, extensions_only)
|
34
35
|
files << Dir.glob("#{directory}/*").select { |f| File.file?(f) }
|
35
36
|
files = files.flatten!
|
36
|
-
dirs = Dir.glob("#{directory}/*").select { |f| File.directory?(f) }
|
37
|
+
dirs = Dir.glob("#{directory}/*" << extensions_only).select { |f| File.directory?(f) }
|
37
38
|
dirs.each do |dir|
|
38
39
|
recursion(dir, files)
|
39
40
|
end
|
@@ -50,5 +51,5 @@ module Nodebugger
|
|
50
51
|
end
|
51
52
|
end
|
52
53
|
end
|
53
|
-
|
54
|
+
|
54
55
|
end
|