benoit 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmE3NTA3MDk1ZDQxYTdjYjg3MGY3YjQ0NmQwYmU1M2ExOTlhZDU4Ng==
4
+ YWFhYmM1NDcwMDAyMjM3Nzg3M2UxYjU0YjYwZDAwN2E4ZmFmNTBmNw==
5
5
  data.tar.gz: !binary |-
6
- YmUxY2JlZjJlMmQxM2M3YTMxZjEwMjBjZGEyMjQ4ZTU5NmZjNGFiYw==
6
+ NzQ3NmMyZTA4M2Q3ZmIyOGE5ODdmYmQ4OTZjMzQ3OTkwYjBjZmY0Yg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NTU3M2NhYTdhMzMwOTZjZjIwNTAwMDdkZjMwYjQ2NGZhMWRiMTBkNWE5NzEx
10
- ODBkOTFmNTVlOTAwNDMwZTI1MTRiOGMyOTFmY2QwY2ViNGMyYTYyYWJjNWY2
11
- YTZkOWY0ZTAzZWQ4ZjI2NzljMmQxODUwODMyYjYzMDM3OTNkMzg=
9
+ OTZhZWNjZWI4ZTVmMmRmMDg5YzdkZWU2OTkyYzMwYzdiYzYwM2QwMTg3YmYy
10
+ ZjkyZGZhMDMzNDkwNWI1ZDU5MmJlY2RjMjExNzU3MGRhMDY0OWZjYTVkOGQz
11
+ YzllZjJjZmMzYTVhYzIxN2VmNWRiNDU3NzZiMmQ0MGUyN2VlZmM=
12
12
  data.tar.gz: !binary |-
13
- MWUwNmE0ZWI5ODhiNTI5ZTIwYjVjMWU5MmRhOWNjODg4ODEzZGRhMDMyYmI1
14
- MDBiZjdkYTQ3YTI3NmY3ZTJlNDc4OTFmOGFhMDlhNWE2ZWI2M2Q4MDIxNjFi
15
- NzY2YWIzZGRkOWYzZWFkNmUzZmE4MGQwYTM0MmM3NjExNzQ0OTg=
13
+ NmYzZDQ2NjYwNzY3ZTQzMGZmNTE2YmM4ZjAzZjRmNDljMzZlNTZmZmUyYzMx
14
+ MThlZmZjMmMxYTM4ODkyZGIxY2I5YmIwM2IwZjQ1MTZiYTIzMGYwM2I0YTgy
15
+ M2I0YjM5MDI0YTRjYTlmMWE1MDEzZmJlZWQwZDcyYjIyNDYxNDg=
data/Assetfile CHANGED
@@ -5,8 +5,20 @@ before_filter Benoit::Filters::MetadataCleaner
5
5
  input Dir.pwd do
6
6
 
7
7
  reject "_*"
8
- reject ".git"
9
- reject ".gitignore"
8
+ reject "_build/**/*"
9
+
10
+ default_ignores = %w(.git .gitignore Gemfile Gemfile.lock .bundle)
11
+
12
+ ignores =
13
+ if File.exist?(Benoit.config.ignorefile)
14
+ ignores = File.read(Benoit.config.ignorefile).split("\n")
15
+ else
16
+ []
17
+ end
18
+
19
+ ignores.concat(default_ignores).each do |ignored|
20
+ reject ignored
21
+ end
10
22
 
11
23
  match "**/*{.markdown,.md,.mkdown,.mdown}" do
12
24
  filter Benoit::Filters::MarkdownFilter
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- benoit (0.1.2)
4
+ benoit (0.2.0)
5
5
  cadenza (~> 0.8.0)
6
6
  chunky_png (~> 1.2.0)
7
7
  compass (~> 0.13.alpha)
data/bin/benoit CHANGED
@@ -36,6 +36,10 @@ command :build do |c|
36
36
  c.desc 'Clean up (delete) any existing build files for this site before building'
37
37
  c.switch :clean
38
38
 
39
+ c.desc 'Name of file containing files that should not be copied or processed to output directory'
40
+ c.default_value '.benoitignore'
41
+ c.flag [:g, :"ignorefile"]
42
+
39
43
  c.desc 'Describe a flag to build'
40
44
  c.default_value 'default'
41
45
  c.flag :f
@@ -49,6 +53,7 @@ command :build do |c|
49
53
  Dir.chdir(site_path) do
50
54
  Benoit.configure do |config|
51
55
  config.clean_before_build = options[:clean]
56
+ config.ignorefile = options[:"ignorefile"]
52
57
  end
53
58
  project = Benoit::PipelineProject.new(assetfile_path, Benoit.config.output_path, Benoit.config.cache_path)
54
59
  project.invoke
@@ -7,9 +7,15 @@
7
7
  #
8
8
 
9
9
  class StandardError
10
- def to_json
11
- { message: "Benoit has encountered an internal error. Please contact @benoitapp on Twitter to resolve this problem.", type: "error" }.to_json
10
+
11
+ def message
12
+ @message || "Staticly has encountered an internal error. Please contact @staticlyapp on Twitter to resolve this problem."
13
+ end
14
+
15
+ def type
16
+ "error"
12
17
  end
18
+
13
19
  end
14
20
 
15
21
  module Benoit
@@ -3,7 +3,7 @@ module Benoit
3
3
 
4
4
  class Config
5
5
 
6
- attr_accessor :output_mode, :cache_path, :output_path, :site_path
6
+ attr_accessor :output_mode, :cache_path, :output_path, :site_path, :ignorefile
7
7
  attr_writer :clean_before_build
8
8
 
9
9
  def clean_before_build?
@@ -58,7 +58,9 @@ module Benoit
58
58
  elsif valid_page
59
59
  return resource_collection(name)
60
60
  else
61
- super
61
+ # The key we are looking for has no content,
62
+ # therefore we can return an empty array
63
+ []
62
64
  end
63
65
 
64
66
  end
@@ -1,3 +1,3 @@
1
1
  module Benoit
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -24,6 +24,36 @@ Feature: benoit build
24
24
  And I build the site with the flag "--clean"
25
25
  Then that file should not exist in the output site
26
26
 
27
+ Scenario: Builds without any content pages
28
+ Given a file with an extension of ".html" with content:
29
+ """
30
+ before
31
+ {% for post in site.posts %}
32
+ blah
33
+ {% endfor %}
34
+ after
35
+ """
36
+ When I build the site
37
+ Then the output file should only have content:
38
+ """
39
+ before
40
+
41
+ after
42
+ """
43
+
44
+ Scenario: Does not copy any files in .benoitignore
45
+ Given a file named ".benoitignore" with content:
46
+ """
47
+ a.sh
48
+ """
49
+ And a file named "a.sh" with content:
50
+ """
51
+ testing
52
+ """
53
+ When I build the site
54
+ Then the file "a.sh" should not exist in the output site
55
+ And the file ".benoitignore" should not exist in the output site
56
+
27
57
  @backlog
28
58
  Scenario: Override default output path
29
59
  When I run `benoit build --output-path _compiled`
@@ -79,7 +79,7 @@ Feature: Site Context
79
79
 
80
80
  Scenario: Metadata contains rendered Markdown
81
81
  Given a site
82
- And a file wih an extension of ".markdown" with content:
82
+ And a file with an extension of ".markdown" with content:
83
83
  """
84
84
  ---
85
85
  type: post
@@ -145,7 +145,7 @@ module BenoitSteps
145
145
  create_file_for_page @page
146
146
  end
147
147
 
148
- step "a file wih an extension of :extname with content:" do |extname, content|
148
+ step "a file with an extension of :extname with content:" do |extname, content|
149
149
  @page = Page.new
150
150
  @page.generate_name(extname)
151
151
  @site.add_page @page
@@ -177,6 +177,11 @@ module BenoitSteps
177
177
  write_file("img.png", img_content)
178
178
  end
179
179
 
180
+ step "the file :named should not exist in the output site" do |filename|
181
+ path = File.join("_build", filename)
182
+ step 'a file named "%s" should not exist' % path
183
+ end
184
+
180
185
  step "that file should not exist in the output site" do
181
186
  path = File.join("_build", @page.name)
182
187
  step 'a file named "%s" should not exist' % path
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.1.3
4
+ version: 0.2.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-04-27 00:00:00.000000000 Z
11
+ date: 2013-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli