zorglub 0.1.1 → 0.1.3

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: 3e7dee8a5205c1f0f2b8be300b2bb68251dbef0f762020332bcf47850bba7323
4
- data.tar.gz: 169f7bd5d713d86544d83307fba364876ea6c2326bc2d31c551843854ec340f5
3
+ metadata.gz: 15b48bc08713bc37d2166bd5b25f38a96f3dad82b0bc44f0bc557138b899ce2a
4
+ data.tar.gz: 876256741f2d5f0772ebd9563d120216c4297b1deff02825e8e14e8f1feda79a
5
5
  SHA512:
6
- metadata.gz: '09cd0d8cbcdacf01223de522e97d64d3bbb50606f3f50006edcd50150724e0c4cf55d1bc7e65e3fd02ba93d56c4d002470453f64ba39d256081e8936ec59b8b9'
7
- data.tar.gz: cfe3dbb427f4a3a488d5c6a0f111bd9723b244fe18925944eced6fa0c9774206e5987f4d19c0ad24db41ee304760aec0e7bf3825642da98c7aa0e38f6e23d76f
6
+ metadata.gz: 1268e3cd8632e30dd62ccc24d5232dd65ac0600ada80285b5f350612eab7b6ac873853218a218e3b55f2070cc828ea1f7a7fc82af0e663108fceef42f3da6ef6
7
+ data.tar.gz: 21f9083de79c46d2c41129efdbeade803874e6c99f0684050c856cf03a11ba699f00366d1e46ab590a54d3d11f59dbb758ba32675f6de90976352306d8e05f2d
data/Changelog CHANGED
@@ -1,3 +1,32 @@
1
+ 2024-08-13 Jérémy Zurcher <jeremy@asynk.ch>
2
+ * release 0.1.3
3
+ * fix specs
4
+ * remove Haml __encoding__ option
5
+
6
+ 2024-08-12 Jérémy Zurcher <jeremy@asynk.ch>
7
+ * release 0.1.2
8
+ * fix haml && sass caching
9
+
10
+ 2024-08-12 Jérémy Zurcher <jeremy@asynk.ch>
11
+ * release 0.1.1
12
+ * support ruby 3.x
13
+ * major update && code formatting
14
+
15
+ 2019-01-01 Jérémy Zurcher <jeremy@asynk.ch>
16
+ * release 0.1.0
17
+ * spec and coverage improvement
18
+ * remove Haml __ugly__ option
19
+
20
+ 2014-02-12 Jérémy Zurcher <jeremy@asynk.ch>
21
+ * release 0.0.9
22
+ * accept Content-Type change via rack response
23
+ * improve error_404 log msg
24
+ * implement Node#no_view!
25
+
26
+ 2013-09-04 Jérémy Zurcher <jeremy@asynk.ch>
27
+ * release 0.0.8
28
+ * implement Node#mime!
29
+
1
30
  2013-02-01 Jérémy Zurcher <jeremy@asynk.ch>
2
31
  * release 0.0.7
3
32
  * zorglub.rb swallows version.rb
data/lib/zorglub/app.rb CHANGED
@@ -18,7 +18,7 @@ module Zorglub
18
18
  engines: {},
19
19
  haml_options: {
20
20
  format: :html5,
21
- encoding: 'utf-8'
21
+ escape_html: false
22
22
  },
23
23
  sass_options: {
24
24
  syntax: :scss,
@@ -5,12 +5,13 @@ module Zorglub
5
5
  module Engines
6
6
  module Haml
7
7
  def self.proc(path, obj)
8
- haml = ::Haml::Template.new(path)
9
8
  if obj.app.opt(:engines_cache_enabled)
10
9
  key = path.sub obj.app.opt(:root), ''
11
- obj.app.engines_cache[key] ||= haml
10
+ haml = obj.app.engines_cache[key] || ::Haml::Template.new(obj.app.opt(:haml_options)) { ::File.read(path) }
11
+ else
12
+ haml = ::Haml::Template.new(obj.app.opt(:haml_options)) { ::File.read(path) }
12
13
  end
13
- html = haml.render(obj, obj.app.opt(:haml_options))
14
+ html = haml.render(obj)
14
15
  [html, 'text/html']
15
16
  end
16
17
  end
@@ -4,10 +4,11 @@ module Zorglub
4
4
  module Engines
5
5
  module Sass
6
6
  def self.proc(path, obj)
7
- sass = ::Sass::Engine.new(::File.read(path), obj.app.opt(:sass_options))
8
7
  if obj.app.opt(:engines_cache_enabled)
9
8
  key = path.sub obj.app.opt(:root), ''
10
- obj.app.engines_cache[key] ||= sass
9
+ sass = obj.app.engines_cache[key] || ::Sass::Engine.new(::File.read(path), obj.app.opt(:sass_options))
10
+ else
11
+ sass = ::Sass::Engine.new(::File.read(path), obj.app.opt(:sass_options))
11
12
  end
12
13
  css = sass.render
13
14
  [css, 'text/css']
data/lib/zorglub.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
3
  module Zorglub
4
- VERSION = '0.1.1'.freeze
4
+ VERSION = '0.1.3'.freeze
5
5
  end
6
6
 
7
7
  require 'zorglub/node'
@@ -1 +1 @@
1
- %h1="Hello world"
1
+ %h1="Hello #{@name}"
data/spec/node_spec.rb CHANGED
@@ -73,7 +73,7 @@ describe Zorglub do
73
73
  end
74
74
 
75
75
  it 'should raise error when too much arguments' do
76
- expect(-> { Node0.my_call '/with_2args/1/2/3' }).to raise_error ArgumentError
76
+ expect { Node0.my_call '/with_2args/1/2/3' }.to raise_error ArgumentError
77
77
  end
78
78
 
79
79
  it 'layout proc, method level layout and engine definitions should work' do
@@ -266,10 +266,10 @@ describe Zorglub do
266
266
  it 'haml engine should work' do
267
267
  Node0.app.opt! :engines_cache_enabled, false
268
268
  r = Node0.my_call '/engines/haml'
269
- expect(r.body[0]).to eq "<h1>Hello world</h1>\n"
269
+ expect(r.body[0]).to eq "<h1>Hello <i>world</i></h1>\n"
270
270
  Node0.app.opt! :engines_cache_enabled, true
271
271
  r = Node0.my_call '/engines/haml'
272
- expect(r.body[0]).to eq "<h1>Hello world</h1>\n"
272
+ expect(r.body[0]).to eq "<h1>Hello <i>world</i></h1>\n"
273
273
  end
274
274
 
275
275
  it 'sass engine should work' do
data/spec/spec_helper.rb CHANGED
@@ -112,6 +112,7 @@ class Node0 < Zorglub::Node
112
112
  no_layout!
113
113
  case name
114
114
  when 'haml'
115
+ @name = '<i>world</i>'
115
116
  engine! :haml
116
117
  when 'sass'
117
118
  engine! :sass
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zorglub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérémy Zurcher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-12 00:00:00.000000000 Z
11
+ date: 2024-08-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a very stripped down version of innate.
14
14
  email: