Permalink
Browse files

Rename Mustache_Mustache to Mustache_Engine.

Because the former was just too absurd to keep typing.
  • Loading branch information...
1 parent 1ffd7c1 commit be5cfb3e9ec90c2296e883d020660c8ae629924e @bobthecow committed May 2, 2012
View
@@ -12,7 +12,7 @@ A quick example:
```php
<?php
-$m = new Mustache_Mustache;
+$m = new Mustache_Engine;
echo $m->render('Hello {{planet}}', array('planet' => 'World!')); // "Hello World!"
```
@@ -49,7 +49,7 @@ And render it:
```php
<?php
-$m = new Mustache_Mustache;
+$m = new Mustache_Engine;
$chris = new Chris;
echo $m->render($template, $chris);
```
@@ -21,7 +21,7 @@
*
* @author Justin Hileman {@link http://justinhileman.com}
*/
-class Mustache_Mustache {
+class Mustache_Engine {
const VERSION = '2.0.0-dev';
const SPEC_VERSION = '1.1.2';
@@ -120,7 +120,7 @@ public function __construct(array $options = array()) {
*
* Equivalent to calling `$mustache->loadTemplate($template)->render($data);`
*
- * @see Mustache_Mustache::loadTemplate
+ * @see Mustache_Engine::loadTemplate
* @see Mustache_Template::render
*
* @param string $template
@@ -242,7 +242,7 @@ public function setHelpers($helpers) {
/**
* Get the current set of Mustache helpers.
*
- * @see Mustache_Mustache::setHelpers
+ * @see Mustache_Engine::setHelpers
*
* @return Mustache_HelperCollection
*/
@@ -257,7 +257,7 @@ public function getHelpers() {
/**
* Add a new Mustache helper.
*
- * @see Mustache_Mustache::setHelpers
+ * @see Mustache_Engine::setHelpers
*
* @param string $name
* @param mixed $helper
@@ -269,7 +269,7 @@ public function addHelper($name, $helper) {
/**
* Get a Mustache helper by name.
*
- * @see Mustache_Mustache::setHelpers
+ * @see Mustache_Engine::setHelpers
*
* @param string $name
*
@@ -282,7 +282,7 @@ public function getHelper($name) {
/**
* Check whether this Mustache instance has a helper.
*
- * @see Mustache_Mustache::setHelpers
+ * @see Mustache_Engine::setHelpers
*
* @param string $name
*
@@ -295,7 +295,7 @@ public function hasHelper($name) {
/**
* Remove a helper by name.
*
- * @see Mustache_Mustache::setHelpers
+ * @see Mustache_Engine::setHelpers
*
* @param string $name
*/
@@ -443,9 +443,9 @@ public function loadLambda($source, $delims = null) {
/**
* Instantiate and return a Mustache Template instance by source.
*
- * @see Mustache_Mustache::loadTemplate
- * @see Mustache_Mustache::loadPartial
- * @see Mustache_Mustache::loadLambda
+ * @see Mustache_Engine::loadTemplate
+ * @see Mustache_Engine::loadPartial
+ * @see Mustache_Engine::loadLambda
*
* @param string $source
*
@@ -21,7 +21,7 @@
*
* $tpl = $loader->load('foo'); // '{{ bar }}'
*
- * The ArrayLoader is used internally as a partials loader by Mustache_Mustache instance when an array of partials
+ * The ArrayLoader is used internally as a partials loader by Mustache_Engine instance when an array of partials
* is set. It can also be used as a quick-and-dirty Template loader.
*
* @implements Loader
@@ -17,23 +17,23 @@
abstract class Mustache_Template {
/**
- * @var Mustache_Mustache
+ * @var Mustache_Engine
*/
protected $mustache;
/**
* Mustache Template constructor.
*
- * @param Mustache_Mustache $mustache
+ * @param Mustache_Engine $mustache
*/
- public function __construct(Mustache_Mustache $mustache) {
+ public function __construct(Mustache_Engine $mustache) {
$this->mustache = $mustache;
}
/**
* Mustache Template instances can be treated as a function and rendered by simply calling them:
*
- * $m = new Mustache_Mustache;
+ * $m = new Mustache_Engine;
* $tpl = $m->loadTemplate('Hello, {{ name }}!');
* echo $tpl(array('name' => 'World')); // "Hello, World!"
*
@@ -12,7 +12,7 @@
/**
* @group unit
*/
-class Mustache_Test_MustacheTest extends PHPUnit_Framework_TestCase {
+class Mustache_Test_EngineTest extends PHPUnit_Framework_TestCase {
private static $tempDir;
@@ -26,7 +26,7 @@ public static function setUpBeforeClass() {
public function testConstructor() {
$loader = new Mustache_Loader_StringLoader;
$partialsLoader = new Mustache_Loader_ArrayLoader;
- $mustache = new Mustache_Mustache(array(
+ $mustache = new Mustache_Engine(array(
'template_class_prefix' => '__whot__',
'cache' => self::$tempDir,
'loader' => $loader,
@@ -83,7 +83,7 @@ public function testSettingServices() {
$tokenizer = new Mustache_Tokenizer;
$parser = new Mustache_Parser;
$compiler = new Mustache_Compiler;
- $mustache = new Mustache_Mustache;
+ $mustache = new Mustache_Engine;
$this->assertNotSame($loader, $mustache->getLoader());
$mustache->setLoader($loader);
@@ -110,7 +110,7 @@ public function testSettingServices() {
* @group functional
*/
public function testCache() {
- $mustache = new Mustache_Mustache(array(
+ $mustache = new Mustache_Engine(array(
'template_class_prefix' => '__whot__',
'cache' => self::$tempDir,
));
@@ -129,7 +129,7 @@ public function testCache() {
* @dataProvider getBadEscapers
*/
public function testNonCallableEscapeThrowsException($escape) {
- new Mustache_Mustache(array('escape' => $escape));
+ new Mustache_Engine(array('escape' => $escape));
}
public function getBadEscapers() {
@@ -143,15 +143,15 @@ public function getBadEscapers() {
* @expectedException RuntimeException
*/
public function testImmutablePartialsLoadersThrowException() {
- $mustache = new Mustache_Mustache(array(
+ $mustache = new Mustache_Engine(array(
'partials_loader' => new Mustache_Loader_StringLoader,
));
$mustache->setPartials(array('foo' => '{{ foo }}'));
}
public function testMissingPartialsTreatedAsEmptyString() {
- $mustache = new Mustache_Mustache(array(
+ $mustache = new Mustache_Engine(array(
'partials_loader' => new Mustache_Loader_ArrayLoader(array(
'foo' => 'FOO',
'baz' => 'BAZ',
@@ -164,7 +164,7 @@ public function testMissingPartialsTreatedAsEmptyString() {
public function testHelpers() {
$foo = array($this, 'getFoo');
$bar = 'BAR';
- $mustache = new Mustache_Mustache(array('helpers' => array(
+ $mustache = new Mustache_Engine(array('helpers' => array(
'foo' => $foo,
'bar' => $bar,
)));
@@ -204,7 +204,7 @@ public static function wrapWithUnderscores($text) {
* @expectedException InvalidArgumentException
*/
public function testSetHelpersThrowsExceptions() {
- $mustache = new Mustache_Mustache;
+ $mustache = new Mustache_Engine;
$mustache->setHelpers('monkeymonkeymonkey');
}
@@ -229,7 +229,7 @@ private static function rmdir($path) {
}
}
-class MustacheStub extends Mustache_Mustache {
+class MustacheStub extends Mustache_Engine {
public $source;
public $template;
public function loadTemplate($source) {
@@ -18,7 +18,7 @@ class Mustache_Test_FiveThree_Functional_HigherOrderSectionsTest extends PHPUnit
private $mustache;
public function setUp() {
- $this->mustache = new Mustache_Mustache;
+ $this->mustache = new Mustache_Engine;
}
public function testAnonymousFunctionSectionCallback() {
@@ -20,7 +20,7 @@ class Mustache_Test_FiveThree_Functional_MustacheSpecTest extends PHPUnit_Framew
private static $mustache;
public static function setUpBeforeClass() {
- self::$mustache = new Mustache_Mustache;
+ self::$mustache = new Mustache_Engine;
}
/**
@@ -16,7 +16,7 @@
class Mustache_Test_Functional_CallTest extends PHPUnit_Framework_TestCase {
public function testCallEatsContext() {
- $m = new Mustache_Mustache;
+ $m = new Mustache_Engine;
$tpl = $m->loadTemplate('{{# foo }}{{ label }}: {{ name }}{{/ foo }}');
$foo = new Mustache_Test_Functional_ClassWithCall();
@@ -26,7 +26,7 @@ class Mustache_Test_Functional_ExamplesTest extends PHPUnit_Framework_TestCase {
* @param string $expected
*/
public function testExamples($context, $source, $partials, $expected) {
- $mustache = new Mustache_Mustache(array(
+ $mustache = new Mustache_Engine(array(
'partials' => $partials
));
$this->assertEquals($expected, $mustache->loadTemplate($source)->render($context));
@@ -18,7 +18,7 @@ class Mustache_Test_Functional_HigherOrderSectionsTest extends PHPUnit_Framework
private $mustache;
public function setUp() {
- $this->mustache = new Mustache_Mustache;
+ $this->mustache = new Mustache_Engine;
}
public function testRuntimeSectionCallback() {
@@ -18,7 +18,7 @@ class Mustache_Test_Functional_MustacheInjectionTest extends PHPUnit_Framework_T
private $mustache;
public function setUp() {
- $this->mustache = new Mustache_Mustache;
+ $this->mustache = new Mustache_Engine;
}
// interpolation
@@ -20,7 +20,7 @@ class Mustache_Test_Functional_MustacheSpecTest extends PHPUnit_Framework_TestCa
private static $mustache;
public static function setUpBeforeClass() {
- self::$mustache = new Mustache_Mustache;
+ self::$mustache = new Mustache_Engine;
}
/**
@@ -17,7 +17,7 @@ class Mustache_Test_Functional_ObjectSectionTest extends PHPUnit_Framework_TestC
private $mustache;
public function setUp() {
- $this->mustache = new Mustache_Mustache;
+ $this->mustache = new Mustache_Engine;
}
public function testBasicObject() {
@@ -14,14 +14,14 @@
*/
class Mustache_Test_TemplateTest extends PHPUnit_Framework_TestCase {
public function testConstructor() {
- $mustache = new Mustache_Mustache;
+ $mustache = new Mustache_Engine;
$template = new Mustache_Test_TemplateStub($mustache);
$this->assertSame($mustache, $template->getMustache());
}
public function testRendering() {
$rendered = '<< wheee >>';
- $mustache = new Mustache_Mustache;
+ $mustache = new Mustache_Engine;
$template = new Mustache_Test_TemplateStub($mustache);
$template->rendered = $rendered;
$context = new Mustache_Context;

0 comments on commit be5cfb3

Please sign in to comment.