bard_static 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,16 +5,24 @@ module BardStatic
5
5
 
6
6
  def mockups
7
7
  env["bard_static.prototype"] = true
8
- render_with_index "mockups/#{params[:file_path]}", :layout => false
8
+ with_404_handler { render_with_index "mockups/#{params[:file_path]}", :layout => false }
9
9
  end
10
10
 
11
11
  def static
12
12
  layout = !request.xhr? # render ajax responses with no layout
13
- render_with_index "static/#{params[:file_path]}", :layout => layout
13
+ with_404_handler { render_with_index "static/#{params[:file_path]}", :layout => layout }
14
14
  end
15
15
 
16
16
  private
17
17
 
18
+ def with_404_handler
19
+ begin
20
+ yield
21
+ rescue ActionView::MissingTemplate
22
+ render :text => "Not Found", :status => 404
23
+ end
24
+ end
25
+
18
26
  def render_with_index path, options = {}
19
27
  begin
20
28
  options = options.dup # render is destructive to the options hash!
@@ -1,3 +1,3 @@
1
1
  module BardStatic
2
- VERSION = "1.5.1"
2
+ VERSION = "1.5.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard_static
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 1
10
- version: 1.5.1
9
+ - 2
10
+ version: 1.5.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Micah Geisel
@@ -21,7 +21,7 @@ autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
23
 
24
- date: 2013-06-23 00:00:00 Z
24
+ date: 2013-06-24 00:00:00 Z
25
25
  dependencies: []
26
26
 
27
27
  description: Handcrafted prototypes for Rails.