remove unused badges from readme and format code

This commit is contained in:
Anton Maminov 2018-11-05 22:40:15 +02:00
parent 0339265b3d
commit c680398930
9 changed files with 10 additions and 15 deletions

View file

@ -1,4 +1,4 @@
# 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) # Kilt [![Build Status](https://travis-ci.org/jeromegn/kilt.svg?branch=master)](https://travis-ci.org/jeromegn/kilt)
Generic templating interface for Crystal. Generic templating interface for Crystal.

View file

@ -14,13 +14,11 @@ class MustacheView
end end
describe "kilt/crustache" do describe "kilt/crustache" do
it "renders crustache" do it "renders crustache" do
Kilt.render("spec/fixtures/test.mustache", { "pid" => Process.pid }).should eq("<span>#{Process.pid}</span>") Kilt.render("spec/fixtures/test.mustache", {"pid" => Process.pid}).should eq("<span>#{Process.pid}</span>")
end end
it "works with classes" do it "works with classes" do
MustacheView.new.to_s.should eq("<span>#{Process.pid}</span>") MustacheView.new.to_s.should eq("<span>#{Process.pid}</span>")
end end
end end

View file

@ -2,7 +2,7 @@ require "../spec_helper"
require "../../src/liquid" require "../../src/liquid"
class LiquidView class LiquidView
@process = { "pid" => Process.pid } @process = {"pid" => Process.pid}
Kilt.file "spec/fixtures/test.liquid" Kilt.file "spec/fixtures/test.liquid"
end end
@ -11,14 +11,15 @@ class LiquidViewWithCustomContext
# avoid name clash with 'context' variable existing within spec. # avoid name clash with 'context' variable existing within spec.
def initialize def initialize
@context = Liquid::Context.new @context = Liquid::Context.new
@context.set "process", { "pid" => Process.pid } @context.set "process", {"pid" => Process.pid}
end end
Kilt.file "spec/fixtures/test.liquid", "__kilt_io__", "@context" Kilt.file "spec/fixtures/test.liquid", "__kilt_io__", "@context"
end end
it "renders liquid" do it "renders liquid" do
ctx = Liquid::Context.new ctx = Liquid::Context.new
ctx.set "process", { "pid" => Process.pid } ctx.set "process", {"pid" => Process.pid}
Kilt.render("spec/fixtures/test.liquid", ctx).should eq("<span>#{Process.pid}</span>\n") Kilt.render("spec/fixtures/test.liquid", ctx).should eq("<span>#{Process.pid}</span>\n")
end end

View file

@ -6,7 +6,6 @@ class SlangView
end end
describe "kilt/slang" do describe "kilt/slang" do
it "renders slang" do it "renders slang" do
Kilt.render("spec/fixtures/test.slang").should eq("<span>#{Process.pid}</span>") Kilt.render("spec/fixtures/test.slang").should eq("<span>#{Process.pid}</span>")
end end
@ -14,5 +13,4 @@ describe "kilt/slang" do
it "works with classes" do it "works with classes" do
SlangView.new.to_s.should eq("<span>#{Process.pid}</span>") SlangView.new.to_s.should eq("<span>#{Process.pid}</span>")
end end
end end

View file

@ -5,7 +5,6 @@ class View
end end
describe Kilt do describe Kilt do
it "renders ecr" do it "renders ecr" do
Kilt.render("spec/fixtures/test.ecr").should eq("<span>#{Process.pid}</span>") Kilt.render("spec/fixtures/test.ecr").should eq("<span>#{Process.pid}</span>")
end end
@ -24,5 +23,4 @@ describe Kilt do
Kilt.register_engine "raw", Raw.embed Kilt.register_engine "raw", Raw.embed
Kilt.render("spec/fixtures/test.raw").should eq("Hello World!") Kilt.render("spec/fixtures/test.raw").should eq("Hello World!")
end end
end end

View file

@ -1,3 +1,3 @@
require "spec" require "spec"
require "../src/kilt" require "../src/kilt"
require "./support/raw_engine" require "./support/raw_engine"

View file

@ -2,4 +2,4 @@ module Raw
macro embed(filename, io) macro embed(filename, io)
{{ io.id }} << {{`cat #{filename}`.stringify}} {{ io.id }} << {{`cat #{filename}`.stringify}}
end end
end end

View file

@ -1,4 +1,4 @@
require "./kilt" require "./kilt"
require "crustache" require "crustache"
Kilt.register_engine "mustache", Mustache.embed Kilt.register_engine "mustache", Mustache.embed

View file

@ -2,4 +2,4 @@ module Kilt
class Exception < ::Exception class Exception < ::Exception
# Nothing special # Nothing special
end end
end end