bard-static 3.1.3 → 3.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cd92415549a953d04f87fc2e400e591c8a0fe19ea8803023d4831982ae13626
4
- data.tar.gz: a28a988522d3b177ad5fee3de67c3401f3e79d5e44976abfb8e12f5093da98dd
3
+ metadata.gz: 4a3b9f9931685d93b3d6bb8f125f3db67fbf163d079a6613ad1e0e85b91e3a8e
4
+ data.tar.gz: eedf16b063d490fa8056bff8334010cc1dce0d0f63e51a1b449f5599eac176b3
5
5
  SHA512:
6
- metadata.gz: 7cabc9f7ec86fc61b5b3ae4a924690159b0c0a4b07a108cc4e823a7fa995c7391f5f7f4f26a0011d73519894886d3f20dbe83e22a1a4d6cd03691d61477d9ca5
7
- data.tar.gz: dbdf25a251c891f86d9494221b1e8e1d499122a830931278f684dda382fc78f75bb07acb3d09e8e449252278bfcef1eae1dd02125d755dfa237843fcd40d0970
6
+ metadata.gz: 6986e4cc858f7bf32b0b3acc530d0274830fafb11e68907619bbae29cfe017efcd95eb617dcb3da0e269321430d950c18e444cab12b7614acf6228fcdd70213d
7
+ data.tar.gz: ff6c0fc341655efa41d26da5c9a196f59baa34fe5a65ed80b79c33b285737996341277b8bc17b4a0583964fbe2a195322bfb2818bca9c7abe473e3c9e64498b3
@@ -17,7 +17,7 @@ module Bard
17
17
  begin
18
18
  yield
19
19
  rescue ActionView::MissingTemplate
20
- render text: "Not Found", status: 404
20
+ render plain: "Not Found", status: 404
21
21
  end
22
22
  end
23
23
 
@@ -73,7 +73,7 @@ module Bard
73
73
 
74
74
  def add_class class_name
75
75
  html_options[:class] ||= ""
76
- html_options[:class] << " #{class_name}"
76
+ html_options[:class] += " #{class_name}"
77
77
  html_options[:class].strip!
78
78
  end
79
79
 
@@ -0,0 +1,25 @@
1
+ module Bard
2
+ module Static
3
+ class MockupInProductionError < StandardError
4
+ def initialize(path)
5
+ super("Mockup pages are not available in production: #{path}")
6
+ end
7
+ end
8
+
9
+ class BlockMockupsInProductionMiddleware
10
+ def initialize(app)
11
+ @app = app
12
+ end
13
+
14
+ def call(env)
15
+ request = Rack::Request.new(env)
16
+
17
+ if Rails.env.production? && request.path.start_with?("/mockups")
18
+ raise MockupInProductionError.new(request.path)
19
+ end
20
+
21
+ @app.call(env)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  module Bard
2
2
  module Static
3
- VERSION = "3.1.3"
3
+ VERSION = "3.2.0"
4
4
  end
5
5
  end
data/lib/bard/static.rb CHANGED
@@ -1,10 +1,12 @@
1
1
  require "bard/static/no_robots_middleware"
2
+ require "bard/static/block_mockups_in_production_middleware"
2
3
  require_relative "../../app/helpers/bard/static/mockup_helper"
3
4
 
4
5
  module Bard
5
6
  module Static
6
7
  class Engine < ::Rails::Engine
7
8
  config.app_middleware.use NoRobotsMiddleware
9
+ config.app_middleware.use BlockMockupsInProductionMiddleware
8
10
 
9
11
  initializer "nacelle integration" do
10
12
  Cell::Base.class_eval do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard-static
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
@@ -9,11 +9,25 @@ authors:
9
9
  - Vesa Vänskä
10
10
  - Matias Korhonen
11
11
  - Antti Salonen
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2023-12-04 00:00:00.000000000 Z
16
- dependencies: []
15
+ date: 2025-11-24 00:00:00.000000000 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: ostruct
19
+ requirement: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: '0'
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
17
31
  description: Handcrafted prototypes for Rails.
18
32
  email:
19
33
  - micah@botandrose.com
@@ -32,12 +46,13 @@ files:
32
46
  - config/routes.rb
33
47
  - lib/bard-static.rb
34
48
  - lib/bard/static.rb
49
+ - lib/bard/static/block_mockups_in_production_middleware.rb
35
50
  - lib/bard/static/no_robots_middleware.rb
36
51
  - lib/bard/static/version.rb
37
52
  homepage: https://github.com/botandrose/bard-static
38
53
  licenses: []
39
54
  metadata: {}
40
- post_install_message:
55
+ post_install_message:
41
56
  rdoc_options: []
42
57
  require_paths:
43
58
  - lib
@@ -52,8 +67,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
67
  - !ruby/object:Gem::Version
53
68
  version: '0'
54
69
  requirements: []
55
- rubygems_version: 3.2.32
56
- signing_key:
70
+ rubygems_version: 3.5.11
71
+ signing_key:
57
72
  specification_version: 4
58
73
  summary: Protoyping engine for Rails.
59
74
  test_files: []