Compare commits

..

1 commit

Author SHA1 Message Date
Jerome Gravel-Niquet
772ad9eb47
v0.4.1 w/ support for crystal 1.0.0 2021-03-24 08:31:49 -04:00
13 changed files with 3 additions and 96 deletions

View file

@ -1,3 +1 @@
language: crystal language: crystal
crystal:
- latest

View file

@ -1,4 +1,4 @@
# Kilt [![Build Status](https://travis-ci.org/jeromegn/kilt.svg?branch=master)](https://travis-ci.org/jeromegn/kilt) # Kilt [![Build Status](https://travis-ci.org/jeromegn/kilt.svg?branch=master)](https://travis-ci.org/jeromegn/kilt) [![Dependency Status](https://shards.rocks/badge/github/jeromegn/kilt/status.svg)](https://shards.rocks/github/jeromegn/kilt) [![devDependency Status](https://shards.rocks/badge/github/jeromegn/kilt/dev_status.svg)](https://shards.rocks/github/jeromegn/kilt)
Generic templating interface for Crystal. Generic templating interface for Crystal.
@ -15,9 +15,6 @@ Simplify developers' lives by abstracting template rendering for multiple templa
| Slang | .slang | [slang](https://github.com/jeromegn/slang) | [@jeromegn](https://github.com/jeromegn) | | Slang | .slang | [slang](https://github.com/jeromegn/slang) | [@jeromegn](https://github.com/jeromegn) |
| Temel | .temel | [temel](https://github.com/f/temel) | [@f](https://github.com/f) | | Temel | .temel | [temel](https://github.com/f/temel) | [@f](https://github.com/f) |
| Crikey | .crikey | [crikey](https://github.com/domgetter/crikey) | [@domgetter](https://github.com/domgetter) | | Crikey | .crikey | [crikey](https://github.com/domgetter/crikey) | [@domgetter](https://github.com/domgetter) |
| Liquid | .liquid | [liquid](https://github.com/TechMagister/liquid.cr) | [@docelic](https://github.com/docelic) |
| Jbuilder | .jbuilder | [jbuilder](https://github.com/shootingfly/jbuilder) | [@shootingfly](https://github.com/shootingfly) |
| Water | .water | [water](https://github.com/shootingfly/water) | [@shootingfly](https://github.com/shootingfly) |
See also: See also:
[Registering your own template engine](#registering-your-own-template-engine). [Registering your own template engine](#registering-your-own-template-engine).

View file

@ -1,5 +1,5 @@
name: kilt name: kilt
version: 0.6.1 version: 0.4.1
crystal: '< 2.0.0' crystal: '< 2.0.0'
authors: authors:
@ -14,9 +14,3 @@ development_dependencies:
github: MakeNowJust/crustache github: MakeNowJust/crustache
temel: temel:
github: f/temel github: f/temel
liquid:
github: TechMagister/liquid.cr
jbuilder:
github: shootingfly/jbuilder
water:
github: shootingfly/water

View file

@ -1 +0,0 @@
json.span Process.pid

View file

@ -1 +0,0 @@
<span>{{ process.pid }}</span>

View file

@ -1 +0,0 @@
span Process.pid

View file

@ -1,18 +0,0 @@
require "../spec_helper"
require "../../src/jbuilder"
class JbuilderView
Kilt.file "spec/fixtures/test.jbuilder"
end
describe "kilt/jbuilder" do
it "renders jbuilder" do
Kilt.render("spec/fixtures/test.jbuilder").should eq("{\"span\":#{Process.pid}}")
end
it "works with class" do
JbuilderView.new.to_s.should eq("{\"span\":#{Process.pid}}")
end
end

View file

@ -1,31 +0,0 @@
require "../spec_helper"
require "../../src/liquid"
class LiquidView
@process = { "pid" => Process.pid }
Kilt.file "spec/fixtures/test.liquid"
end
class LiquidViewWithCustomContext
# Use of instance variable is not required in user code. It is used here to
# avoid name clash with 'context' variable existing within spec.
def initialize
@context = Liquid::Context.new
@context.set "process", { "pid" => Process.pid }
end
Kilt.file "spec/fixtures/test.liquid", "__kilt_io__", "@context"
end
it "renders liquid" do
ctx = Liquid::Context.new
ctx.set "process", { "pid" => Process.pid }
Kilt.render("spec/fixtures/test.liquid", ctx).should eq("<span>#{Process.pid}</span>\n")
end
it "works with classes" do
LiquidView.new.to_s.should eq("<span>#{Process.pid}</span>\n")
end
it "works with classes and custom context" do
LiquidViewWithCustomContext.new.to_s.should eq("<span>#{Process.pid}</span>\n")
end

View file

@ -1,18 +0,0 @@
require "../spec_helper"
require "../../src/water"
class WaterView
Kilt.file "spec/fixtures/test.water"
end
describe "kilt/water" do
it "renders water" do
Kilt.render("spec/fixtures/test.water").should eq("<span>#{Process.pid}</span>")
end
it "works with class" do
WaterView.new.to_s.should eq("<span>#{Process.pid}</span>")
end
end

View file

@ -1,4 +0,0 @@
require "./kilt"
require "jbuilder"
Kilt.register_engine "jbuilder", Jbuilder.embed

View file

@ -1,3 +1,3 @@
module Kilt module Kilt
VERSION = "0.6.1" VERSION = "0.4.1"
end end

View file

@ -1,4 +0,0 @@
require "./kilt"
require "liquid"
Kilt.register_engine "liquid", Liquid.embed

View file

@ -1,4 +0,0 @@
require "./kilt"
require "water"
Kilt.register_engine "water", Water.embed