bunch 0.0.10 → 0.0.11
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.
- data/example/js/.bunchignore +1 -0
- data/example/js/test2/foo.js +1 -0
- data/lib/bunch.rb +15 -0
- data/lib/bunch/cli.rb +1 -0
- data/lib/bunch/null_node.rb +11 -0
- data/lib/bunch/rack.rb +2 -0
- data/lib/bunch/version.rb +1 -1
- metadata +5 -2
@@ -0,0 +1 @@
|
|
1
|
+
foo
|
@@ -0,0 +1 @@
|
|
1
|
+
foo;
|
data/lib/bunch.rb
CHANGED
@@ -21,6 +21,7 @@ require 'bunch/directory_node'
|
|
21
21
|
require 'bunch/file_node'
|
22
22
|
require 'bunch/coffee_node'
|
23
23
|
require 'bunch/sass_node'
|
24
|
+
require 'bunch/null_node'
|
24
25
|
|
25
26
|
module Bunch
|
26
27
|
class CompileError < StandardError
|
@@ -36,12 +37,24 @@ module Bunch
|
|
36
37
|
end
|
37
38
|
|
38
39
|
class << Bunch
|
40
|
+
IGNORED_PATTERNS = []
|
41
|
+
|
42
|
+
def load_ignores(path='.')
|
43
|
+
fn = File.join(path, '.bunchignore')
|
44
|
+
if File.exist?(fn)
|
45
|
+
IGNORED_PATTERNS.concat File.readlines(fn).map { |f| Regexp.new(f.chomp) }
|
46
|
+
IGNORED_PATTERNS.uniq!
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
39
50
|
def content_for(path)
|
40
51
|
tree_for(normalized_path(path)).content
|
41
52
|
end
|
42
53
|
|
43
54
|
def tree_for(path)
|
44
55
|
case
|
56
|
+
when IGNORED_PATTERNS.any? { |p| File.basename(path) =~ p }
|
57
|
+
Bunch::NullNode.new(path)
|
45
58
|
when File.directory?(path)
|
46
59
|
Bunch::DirectoryNode.new(path)
|
47
60
|
when path =~ /\.coffee$/
|
@@ -69,3 +82,5 @@ class << Bunch
|
|
69
82
|
end
|
70
83
|
end
|
71
84
|
end
|
85
|
+
|
86
|
+
Bunch.load_ignores
|
data/lib/bunch/cli.rb
CHANGED
data/lib/bunch/rack.rb
CHANGED
data/lib/bunch/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: bunch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.11
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ryan Fitzgerald
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-01-
|
13
|
+
date: 2012-01-31 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mime-types
|
@@ -89,8 +89,10 @@ files:
|
|
89
89
|
- example/css/test1.css
|
90
90
|
- example/css/test2/test2a.scss
|
91
91
|
- example/css/test2/test2b.css
|
92
|
+
- example/js/.bunchignore
|
92
93
|
- example/js/test1.js
|
93
94
|
- example/js/test2/_.yml
|
95
|
+
- example/js/test2/foo.js
|
94
96
|
- example/js/test2/test2a.js
|
95
97
|
- example/js/test2/test2b.js
|
96
98
|
- example/js/test2/test2c.js
|
@@ -110,6 +112,7 @@ files:
|
|
110
112
|
- lib/bunch/directory_node.rb
|
111
113
|
- lib/bunch/file_node.rb
|
112
114
|
- lib/bunch/middleware.rb
|
115
|
+
- lib/bunch/null_node.rb
|
113
116
|
- lib/bunch/rack.rb
|
114
117
|
- lib/bunch/sass_node.rb
|
115
118
|
- lib/bunch/version.rb
|