Skip to content

Commit

Permalink
Rename Mustache_Mustache to Mustache_Engine.
Browse files Browse the repository at this point in the history
Because the former was just too absurd to keep typing.
  • Loading branch information
bobthecow committed May 2, 2012
1 parent 1ffd7c1 commit be5cfb3
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions README.markdown
Expand Up @@ -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!"
```

Expand Down Expand Up @@ -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);
```
Expand Down
20 changes: 10 additions & 10 deletions src/Mustache/Mustache.php → src/Mustache/Engine.php
Expand Up @@ -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';

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand All @@ -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
Expand All @@ -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
*
Expand All @@ -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
*
Expand All @@ -295,7 +295,7 @@ public function hasHelper($name) {
/**
* Remove a helper by name.
*
* @see Mustache_Mustache::setHelpers
* @see Mustache_Engine::setHelpers
*
* @param string $name
*/
Expand Down Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/Mustache/Loader/ArrayLoader.php
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/Mustache/Template.php
Expand Up @@ -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!"
*
Expand Down
Expand Up @@ -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;

Expand All @@ -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,
Expand Down Expand Up @@ -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);
Expand All @@ -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,
));
Expand All @@ -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() {
Expand All @@ -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',
Expand All @@ -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,
)));
Expand Down Expand Up @@ -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');
}

Expand All @@ -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) {
Expand Down
Expand Up @@ -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() {
Expand Down
Expand Up @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/Mustache/Test/Functional/CallTest.php
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion test/Mustache/Test/Functional/ExamplesTest.php
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion test/Mustache/Test/Functional/HigherOrderSectionsTest.php
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion test/Mustache/Test/Functional/MustacheInjectionTest.php
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/Mustache/Test/Functional/MustacheSpecTest.php
Expand Up @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/Mustache/Test/Functional/ObjectSectionTest.php
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions test/Mustache/Test/TemplateTest.php
Expand Up @@ -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;
Expand Down

0 comments on commit be5cfb3

Please sign in to comment.