• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gernest / bearcub
83%
master: 83%

Build:
Build:
LAST BUILD BRANCH: rewrite
DEFAULT BRANCH: master
Repo Added 08 Aug 2017 12:08PM UTC
Files 1
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH rewrite
branch: rewrite
CHANGE BRANCH
x
Reset
  • rewrite
  • master

pending completion
8

push

travis-ci

gernest
Use text/template to render variable replacement

This is a new implementation of ReplaceString which uses text/template for heavy lifting.

What it does is first the input is rewritten to tags that are going to be identified by text/emplate, then the rewritten template is passed to text/template for rendering.

The special tags are `<<` and `>>` so,  `{host}` becomes `<< replace "host">>` where replace is the template function with signature `func(string)string`

This will work well with json, the fact here is we can later change special tags to be unique to any particular text format that way the function can be used on xml etc.

The replaced variables are handled by the end user meaning not only can json objects be adressed but aslo arbitrary logic can be handled since templating is separaed from replacement

72 of 72 new or added lines in 1 file covered. (100.0%)

99 of 120 relevant lines covered (82.5%)

12.87 hits per line

Relevant lines Covered
Build:
Build:
120 RELEVANT LINES 99 COVERED LINES
12.87 HITS PER LINE
Source Files on rewrite
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
8 rewrite Use text/template to render variable replacement This is a new implementation of ReplaceString which uses text/template for heavy lifting. What it does is first the input is rewritten to tags that are going to be identified by text/emplate, then... push 19 Aug 2017 03:46PM UTC gernest travis-ci pending completion  
See All Builds (10)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc