benoit 0.2.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitignore +1 -2
- data/.rspec +1 -1
- data/Assetfile +19 -4
- data/Gemfile.lock +29 -5
- data/Guardfile +28 -0
- data/Rakefile +2 -0
- data/benoit.gemspec +5 -0
- data/bin/benoit +25 -7
- data/lib/benoit/cadenza.rb +2 -0
- data/lib/benoit/cadenza/blocks.rb +18 -0
- data/lib/benoit/compiler_error.rb +5 -1
- data/lib/benoit/filters/base_filter.rb +4 -5
- data/lib/benoit/filters/cadenza_filter.rb +19 -16
- data/lib/benoit/filters/markdown_filter.rb +36 -4
- data/lib/benoit/logger.rb +2 -2
- data/lib/benoit/pipeline_project.rb +23 -23
- data/lib/benoit/server.rb +47 -0
- data/lib/benoit/server/remote.rb +29 -0
- data/lib/benoit/utils/finds_layouts_for_template.rb +28 -30
- data/lib/benoit/version.rb +1 -1
- data/spec/features/build_command.feature +1 -1
- data/spec/features/frontmatter_metadata.feature +3 -21
- data/spec/features/javascript_files.feature +1 -0
- data/spec/features/markdown_files.feature +41 -0
- data/spec/features/output_filters.feature +2 -7
- data/spec/features/page_layouts.feature +4 -28
- data/spec/features/pagination.feature +1 -0
- data/spec/lib/filters/base_filter_spec.rb +4 -33
- data/spec/lib/filters/markdown_filter_spec.rb +31 -8
- data/spec/lib/filters/sass_filter_spec.rb +2 -2
- data/spec/lib/site_context_spec.rb +2 -2
- data/spec/steps/staticly_steps.rb +1 -1
- data/spec/support/spec_helpers/memory_file_wrapper.rb +2 -6
- data/vendor/rake-pipeline/GETTING_STARTED.md +11 -11
- data/vendor/rake-pipeline/bin/rakep +1 -1
- data/vendor/rake-pipeline/lib/rake-pipeline.rb +2 -49
- data/vendor/rake-pipeline/lib/rake-pipeline/cli.rb +0 -1
- data/vendor/rake-pipeline/lib/rake-pipeline/file_wrapper.rb +2 -9
- data/vendor/rake-pipeline/lib/rake-pipeline/filter.rb +1 -19
- data/vendor/rake-pipeline/lib/rake-pipeline/manifest.rb +4 -0
- data/vendor/rake-pipeline/lib/rake-pipeline/middleware.rb +1 -2
- data/vendor/rake-pipeline/lib/rake-pipeline/project.rb +3 -2
- data/vendor/rake-pipeline/rake-pipeline.gemspec +1 -1
- data/vendor/rake-pipeline/spec/cli_spec.rb +0 -2
- data/vendor/rake-pipeline/spec/concat_filter_spec.rb +4 -4
- data/vendor/rake-pipeline/spec/filter_spec.rb +0 -35
- data/vendor/rake-pipeline/spec/gsub_filter_spec.rb +5 -5
- data/vendor/rake-pipeline/spec/ordering_concat_filter_spec.rb +4 -4
- data/vendor/rake-pipeline/spec/rake_acceptance_spec.rb +18 -0
- data/vendor/rake-pipeline/spec/support/spec_helpers/filters.rb +1 -1
- data/vendor/rake-pipeline/spec/support/spec_helpers/memory_file_wrapper.rb +2 -6
- metadata +77 -2
@@ -115,41 +115,6 @@ describe "Rake::Pipeline::Filter" do
|
|
115
115
|
|
116
116
|
filter.output_files.should == [output_file("jquery.js"), output_file("ember.js")]
|
117
117
|
end
|
118
|
-
|
119
|
-
describe "tracking original inputs" do
|
120
|
-
|
121
|
-
before do
|
122
|
-
output_name_generator = proc { |input| "application.js" }
|
123
|
-
filter.output_name_generator = output_name_generator
|
124
|
-
pipeline.add_filter(filter)
|
125
|
-
end
|
126
|
-
|
127
|
-
let(:original_inputs) {
|
128
|
-
input_files.map do |input|
|
129
|
-
new_path_name = input.path.gsub(/\.js/, "") + "-dev.js"
|
130
|
-
input.original_inputs = [input_file(new_path_name)]
|
131
|
-
end.flatten
|
132
|
-
}
|
133
|
-
|
134
|
-
it "keeps inputs' original file names" do
|
135
|
-
expected = filter.output_files.map{ |o| o.original_inputs.to_a }.flatten
|
136
|
-
expected.should == input_files.to_a
|
137
|
-
end
|
138
|
-
|
139
|
-
it "takes original inputs from inputs if available" do
|
140
|
-
filter.input_files = original_inputs
|
141
|
-
expected = filter.output_files.map{ |o| o.original_inputs.to_a }.flatten
|
142
|
-
expected.should == original_inputs.to_a
|
143
|
-
end
|
144
|
-
|
145
|
-
it "doesn't repeat inputs if called more than once" do
|
146
|
-
filter.input_files = original_inputs
|
147
|
-
filter.output_files
|
148
|
-
filter.output_files.map{|o| o.original_inputs.to_a }.flatten.should == original_inputs.to_a
|
149
|
-
end
|
150
|
-
|
151
|
-
end
|
152
|
-
|
153
118
|
end
|
154
119
|
|
155
120
|
describe "generates rake tasks" do
|
@@ -4,7 +4,7 @@ describe "GsubFilter" do
|
|
4
4
|
|
5
5
|
let(:input_files) {
|
6
6
|
[
|
7
|
-
MemoryFileWrapper.new("/path/to/input", "ember.js", "UTF-8",
|
7
|
+
MemoryFileWrapper.new("/path/to/input", "ember.js", "UTF-8", "Ember.assert"),
|
8
8
|
]
|
9
9
|
}
|
10
10
|
|
@@ -21,7 +21,7 @@ describe "GsubFilter" do
|
|
21
21
|
filter.output_root = "/path/to/output"
|
22
22
|
filter.input_files = input_files
|
23
23
|
|
24
|
-
filter.output_files.should == [MemoryFileWrapper.new("/path/to/output", "ember.js", "UTF-8"
|
24
|
+
filter.output_files.should == [MemoryFileWrapper.new("/path/to/output", "ember.js", "UTF-8")]
|
25
25
|
|
26
26
|
|
27
27
|
tasks = filter.generate_rake_tasks
|
@@ -44,7 +44,7 @@ describe "GsubFilter" do
|
|
44
44
|
filter.output_root = "/path/to/output"
|
45
45
|
filter.input_files = input_files
|
46
46
|
|
47
|
-
filter.output_files.should == [MemoryFileWrapper.new("/path/to/output", "ember.js", "UTF-8"
|
47
|
+
filter.output_files.should == [MemoryFileWrapper.new("/path/to/output", "ember.js", "UTF-8")]
|
48
48
|
|
49
49
|
tasks = filter.generate_rake_tasks
|
50
50
|
tasks.each(&:invoke)
|
@@ -67,7 +67,7 @@ describe "GsubFilter" do
|
|
67
67
|
filter.output_root = "/path/to/output"
|
68
68
|
filter.input_files = input_files
|
69
69
|
|
70
|
-
filter.output_files.should == [MemoryFileWrapper.new("/path/to/output", "ember.js", "UTF-8"
|
70
|
+
filter.output_files.should == [MemoryFileWrapper.new("/path/to/output", "ember.js", "UTF-8")]
|
71
71
|
|
72
72
|
tasks = filter.generate_rake_tasks
|
73
73
|
tasks.each(&:invoke)
|
@@ -82,6 +82,6 @@ describe "GsubFilter" do
|
|
82
82
|
filter.file_wrapper_class = MemoryFileWrapper
|
83
83
|
filter.output_root = "/path/to/output"
|
84
84
|
filter.input_files = input_files
|
85
|
-
filter.output_files.should == [MemoryFileWrapper.new("/path/to/output", "ember.js", "UTF-8"
|
85
|
+
filter.output_files.should == [MemoryFileWrapper.new("/path/to/output", "ember.js", "UTF-8")]
|
86
86
|
end
|
87
87
|
end
|
@@ -4,15 +4,15 @@ describe "OrderingConcatFilter" do
|
|
4
4
|
|
5
5
|
let(:input_files) {
|
6
6
|
[
|
7
|
-
MemoryFileWrapper.new("/path/to/input", "first.txt", "UTF-8",
|
8
|
-
MemoryFileWrapper.new("/path/to/input", "second.txt", "UTF-8",
|
9
|
-
MemoryFileWrapper.new("/path/to/input", "last.txt", "UTF-8",
|
7
|
+
MemoryFileWrapper.new("/path/to/input", "first.txt", "UTF-8", "FIRST"),
|
8
|
+
MemoryFileWrapper.new("/path/to/input", "second.txt", "UTF-8", "SECOND"),
|
9
|
+
MemoryFileWrapper.new("/path/to/input", "last.txt", "UTF-8", "LAST")
|
10
10
|
]
|
11
11
|
}
|
12
12
|
|
13
13
|
let(:output_files) {
|
14
14
|
[
|
15
|
-
MemoryFileWrapper.new("/path/to/output", "all.txt", "BINARY"
|
15
|
+
MemoryFileWrapper.new("/path/to/output", "all.txt", "BINARY")
|
16
16
|
]
|
17
17
|
}
|
18
18
|
|
@@ -586,6 +586,24 @@ HERE
|
|
586
586
|
content.should == "true to trance"
|
587
587
|
end
|
588
588
|
|
589
|
+
it "should handle dynamic dependencies being deleted" do
|
590
|
+
project.invoke
|
591
|
+
|
592
|
+
content = File.read output_file
|
593
|
+
|
594
|
+
content.should == EXPECTED_DYNAMIC_OUTPUT
|
595
|
+
|
596
|
+
sleep 1
|
597
|
+
|
598
|
+
imported_file = File.join tmp, "variables.import"
|
599
|
+
|
600
|
+
File.exists?(imported_file).should be_true
|
601
|
+
|
602
|
+
FileUtils.rm_rf imported_file
|
603
|
+
|
604
|
+
project.invoke
|
605
|
+
end
|
606
|
+
|
589
607
|
it "should not regenerate files when nothing changes" do
|
590
608
|
project.invoke
|
591
609
|
previous_mtime = File.mtime output_file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class Rake::Pipeline
|
2
2
|
module SpecHelpers
|
3
|
-
class MemoryFileWrapper < Struct.new(:root, :path, :encoding, :
|
3
|
+
class MemoryFileWrapper < Struct.new(:root, :path, :encoding, :body)
|
4
4
|
@@files = {}
|
5
5
|
|
6
6
|
def self.files
|
@@ -8,7 +8,7 @@ class Rake::Pipeline
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def with_encoding(new_encoding)
|
11
|
-
self.class.new(root, path, new_encoding,
|
11
|
+
self.class.new(root, path, new_encoding, body)
|
12
12
|
end
|
13
13
|
|
14
14
|
def fullpath
|
@@ -21,10 +21,6 @@ class Rake::Pipeline
|
|
21
21
|
yield
|
22
22
|
end
|
23
23
|
|
24
|
-
def original_inputs
|
25
|
-
[]
|
26
|
-
end
|
27
|
-
|
28
24
|
alias read body
|
29
25
|
|
30
26
|
def write(contents)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benoit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Fiorini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 2.2.2
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: kramdown
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.1.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.1.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: compass
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,6 +178,20 @@ dependencies:
|
|
164
178
|
- - ~>
|
165
179
|
- !ruby/object:Gem::Version
|
166
180
|
version: 0.5.0
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: thin
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ~>
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: 1.5.1
|
188
|
+
type: :runtime
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ~>
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 1.5.1
|
167
195
|
- !ruby/object:Gem::Dependency
|
168
196
|
name: rspec
|
169
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,6 +290,48 @@ dependencies:
|
|
262
290
|
- - ! '>='
|
263
291
|
- !ruby/object:Gem::Version
|
264
292
|
version: '0'
|
293
|
+
- !ruby/object:Gem::Dependency
|
294
|
+
name: guard
|
295
|
+
requirement: !ruby/object:Gem::Requirement
|
296
|
+
requirements:
|
297
|
+
- - ! '>='
|
298
|
+
- !ruby/object:Gem::Version
|
299
|
+
version: '0'
|
300
|
+
type: :development
|
301
|
+
prerelease: false
|
302
|
+
version_requirements: !ruby/object:Gem::Requirement
|
303
|
+
requirements:
|
304
|
+
- - ! '>='
|
305
|
+
- !ruby/object:Gem::Version
|
306
|
+
version: '0'
|
307
|
+
- !ruby/object:Gem::Dependency
|
308
|
+
name: guard-rspec
|
309
|
+
requirement: !ruby/object:Gem::Requirement
|
310
|
+
requirements:
|
311
|
+
- - ! '>='
|
312
|
+
- !ruby/object:Gem::Version
|
313
|
+
version: '0'
|
314
|
+
type: :development
|
315
|
+
prerelease: false
|
316
|
+
version_requirements: !ruby/object:Gem::Requirement
|
317
|
+
requirements:
|
318
|
+
- - ! '>='
|
319
|
+
- !ruby/object:Gem::Version
|
320
|
+
version: '0'
|
321
|
+
- !ruby/object:Gem::Dependency
|
322
|
+
name: rb-fsevent
|
323
|
+
requirement: !ruby/object:Gem::Requirement
|
324
|
+
requirements:
|
325
|
+
- - ~>
|
326
|
+
- !ruby/object:Gem::Version
|
327
|
+
version: '0.9'
|
328
|
+
type: :development
|
329
|
+
prerelease: false
|
330
|
+
version_requirements: !ruby/object:Gem::Requirement
|
331
|
+
requirements:
|
332
|
+
- - ~>
|
333
|
+
- !ruby/object:Gem::Version
|
334
|
+
version: '0.9'
|
265
335
|
description:
|
266
336
|
email: joe@joefiorini.com
|
267
337
|
executables:
|
@@ -277,6 +347,7 @@ files:
|
|
277
347
|
- Assetfile
|
278
348
|
- Gemfile
|
279
349
|
- Gemfile.lock
|
350
|
+
- Guardfile
|
280
351
|
- README.md
|
281
352
|
- Rakefile
|
282
353
|
- benoit-0.2.0.gem
|
@@ -286,6 +357,7 @@ files:
|
|
286
357
|
- bin/bundle-sandbox
|
287
358
|
- lib/benoit.rb
|
288
359
|
- lib/benoit/cadenza.rb
|
360
|
+
- lib/benoit/cadenza/blocks.rb
|
289
361
|
- lib/benoit/cadenza/output_filters.rb
|
290
362
|
- lib/benoit/cleaner.rb
|
291
363
|
- lib/benoit/compiler_error.rb
|
@@ -315,6 +387,8 @@ files:
|
|
315
387
|
- lib/benoit/pipeline/dsl_extensions.rb
|
316
388
|
- lib/benoit/pipeline/pagination_matcher.rb
|
317
389
|
- lib/benoit/pipeline_project.rb
|
390
|
+
- lib/benoit/server.rb
|
391
|
+
- lib/benoit/server/remote.rb
|
318
392
|
- lib/benoit/site_context.rb
|
319
393
|
- lib/benoit/utils/finds_layouts_for_template.rb
|
320
394
|
- lib/benoit/utils/normalizes_path_to_template.rb
|
@@ -334,6 +408,7 @@ files:
|
|
334
408
|
- spec/features/build_command.feature
|
335
409
|
- spec/features/frontmatter_metadata.feature
|
336
410
|
- spec/features/javascript_files.feature
|
411
|
+
- spec/features/markdown_files.feature
|
337
412
|
- spec/features/output_filters.feature
|
338
413
|
- spec/features/page_layouts.feature
|
339
414
|
- spec/features/pagination.feature
|