Skip to content

Commit 597633b

Browse files
committed
Rename Hbs -> HandlebarsModule
1 parent 6b49050 commit 597633b

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

docs/asciidoc/modules/handlebars.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ https://github.com/jknack/handlebars.java[Handlebars templates] for Jooby.
2222
.Java
2323
[source, java, role="primary"]
2424
----
25-
import io.jooby.handlebars.Hbs;
25+
import io.jooby.handlebars.HandlebarsModule;
2626
2727
{
28-
install(new Hbs());
28+
install(new HandlebarsModule());
2929
3030
get("/", ctx -> {
3131
return new ModelAndView("index.hbs")
@@ -37,10 +37,10 @@ import io.jooby.handlebars.Hbs;
3737
.Kotlin
3838
[source, kt, role="secondary"]
3939
----
40-
import io.jooby.handlebars.Hbs
40+
import io.jooby.handlebars.HandlebarsModule
4141
4242
{
43-
install(Hbs())
43+
install(HandlebarsModule())
4444
4545
get("/") {
4646
ModelAndView("index.hbs")
@@ -69,27 +69,27 @@ Custom Handlebars object can be provided it programmatically:
6969
.Java
7070
[source, java, role="primary"]
7171
----
72-
import io.jooby.handlebars.Hbs;
72+
import io.jooby.handlebars.HandlebarsModule;
7373
7474
{
7575
Handlebars handlebars = new Handlebars();
7676
7777
// Apply custom configuration
7878
79-
install(new Hbs(handlebars));
79+
install(new HandlebarsModule(handlebars));
8080
}
8181
----
8282

8383
.Kotlin
8484
[source, kt, role="secondary"]
8585
----
86-
import io.jooby.handlebars.Hbs
86+
import io.jooby.handlebars.HandlebarsModule
8787
8888
{
8989
val handlebars = Handlebars()
9090
9191
// Apply custom configuration
9292
93-
install(Hbs(handlebars))
93+
install(HandlebarsModule(handlebars))
9494
}
9595
----

modules/jooby-handlebars/src/main/java/io/jooby/handlebars/Hbs.java renamed to modules/jooby-handlebars/src/main/java/io/jooby/handlebars/HandlebarsModule.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import static io.jooby.TemplateEngine.TEMPLATE_PATH;
3737
import static io.jooby.TemplateEngine.normalizePath;
3838

39-
public class Hbs implements Extension {
39+
public class HandlebarsModule implements Extension {
4040

4141
public static class Builder {
4242

@@ -158,15 +158,15 @@ private static TemplateLoader defaultTemplateLoader(Environment env, String temp
158158

159159
private String templatesPath;
160160

161-
public Hbs(@Nonnull Handlebars handlebars) {
161+
public HandlebarsModule(@Nonnull Handlebars handlebars) {
162162
this.handlebars = handlebars;
163163
}
164164

165-
public Hbs(@Nonnull String templatesPath) {
165+
public HandlebarsModule(@Nonnull String templatesPath) {
166166
this.templatesPath = templatesPath;
167167
}
168168

169-
public Hbs() {
169+
public HandlebarsModule() {
170170
this(TemplateEngine.PATH);
171171
}
172172

@@ -180,7 +180,7 @@ public Hbs() {
180180
services.put(Handlebars.class, handlebars);
181181
}
182182

183-
public static Hbs.Builder create() {
184-
return new Hbs.Builder();
183+
public static HandlebarsModule.Builder create() {
184+
return new HandlebarsModule.Builder();
185185
}
186186
}

modules/jooby-handlebars/src/test/java/io/jooby/handlebars/HbsTest.java renamed to modules/jooby-handlebars/src/test/java/io/jooby/handlebars/HandlebarsModuleTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import static org.junit.jupiter.api.Assertions.assertEquals;
1313

14-
public class HbsTest {
14+
public class HandlebarsModuleTest {
1515
public static class User {
1616
private String firstname;
1717

@@ -33,7 +33,7 @@ public String getLastname() {
3333

3434
@Test
3535
public void render() throws Exception {
36-
Handlebars handlebars = Hbs.create()
36+
Handlebars handlebars = HandlebarsModule.create()
3737
.build(new Environment(getClass().getClassLoader(), ConfigFactory.empty()));
3838
HbsTemplateEngine engine = new HbsTemplateEngine(handlebars);
3939
MockContext ctx = new MockContext();
@@ -47,7 +47,7 @@ public void render() throws Exception {
4747

4848
@Test
4949
public void renderFileSystem() throws Exception {
50-
Handlebars handlebars = Hbs.create()
50+
Handlebars handlebars = HandlebarsModule.create()
5151
.setTemplatesPath(Paths.get("src", "test", "resources", "views").toString())
5252
.build(new Environment(getClass().getClassLoader(), ConfigFactory.empty()));
5353
HbsTemplateEngine engine = new HbsTemplateEngine(handlebars);

0 commit comments

Comments
 (0)