From d464818d8229da7fdf653d65b2f9ee4060d4873a Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Mon, 16 May 2011 03:58:51 -0700 Subject: [PATCH 1/6] There is no clear description of it is the MIT license, leading many companies do not feel at ease with it. --- LICENSE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LICENSE b/LICENSE index e9f38ab..395e263 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,5 @@ +The MIT License + Copyright (c) 2009 Chris Wanstrath (Ruby) Copyright (c) 2010 Jan Lehnardt (JavaScript) From a2724bcd834d6beb5891681937f0acb89d3a4096 Mon Sep 17 00:00:00 2001 From: Pandark Date: Sat, 28 May 2011 13:19:09 +0200 Subject: [PATCH 2/6] Rackefile updated for rspec 2 & help file for tests added --- TESTS_HELP.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 TESTS_HELP.md diff --git a/TESTS_HELP.md b/TESTS_HELP.md new file mode 100644 index 0000000..82a03e5 --- /dev/null +++ b/TESTS_HELP.md @@ -0,0 +1,54 @@ +## How to run the tests + +To run the test, you need ruby and the following gems installed : rake, rspec (>=2), json + +### How to install ruby and the required gems from source + +Make sure you have the required tools to compile it + + # apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev + +Download ruby source and extract the source + + $ cd ~/ + $ wget ftp://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz + $ tar xvzf stable-snapshot.tar.gz + +Install it + + $ ./configure && make + # make install + +download the last version of RubyGems from here +http://rubyforge.org/frs/?group_id=126 + +Extract the source + + $ tar xzvf rubygems-1.8.4.tgz + +Install it + + $ cd rubygems-1.8.4 + # ruby setup.rb + +If you want to update RubyGems + + # gem update --system + +Install the required gems + + # gem install rake rspec json + +That's it! + +### How to run the tests + + $ rake + +### How to create a test + +- Create a template file `somename.html` +- Create a javascript file with data and functions `somename.js` +- Create a file the expected result `somename.txt` + +Done! From 656bea3d8d682282beddfd35b99befed3e24378b Mon Sep 17 00:00:00 2001 From: Pandark Date: Sun, 29 May 2011 15:30:53 +0200 Subject: [PATCH 3/6] Rackefile updated for rspec 2 --- Rakefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 6b9f442..75686cd 100644 --- a/Rakefile +++ b/Rakefile @@ -1,11 +1,11 @@ require 'rake' -require 'spec/rake/spectask' +require 'rspec/core/rake_task' task :default => :spec -Spec::Rake::SpecTask.new(:spec) do |t| +RSpec::Core::RakeTask.new(:spec) do |t| #t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] - t.spec_files = FileList['test/*_spec.rb'] + t.pattern = 'test/*_spec.rb' end desc "Run all specs" From 45955f5dc1ffbba68ee335c9313b55c84ef699be Mon Sep 17 00:00:00 2001 From: Sahab Yazdani Date: Tue, 5 Jul 2011 12:07:43 -0400 Subject: [PATCH 4/6] Fixes issue 105 --- mustache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mustache.js b/mustache.js index 35a8976..25d6639 100644 --- a/mustache.js +++ b/mustache.js @@ -63,7 +63,7 @@ var Mustache = function() { var that = this; var regex = new RegExp(this.otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" + - this.ctag); + this.ctag, "g"); return template.replace(regex, function(match, pragma, options) { if(!that.pragmas_implemented[pragma]) { throw({message: From 1dabeabfd6042edf3a055be5c8abc0ac805c0628 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Fri, 8 Jul 2011 13:24:24 +0200 Subject: [PATCH 5/6] add example for section names with question marks --- examples/keys_with_questionmarks.html | 3 +++ examples/keys_with_questionmarks.js | 5 +++++ examples/keys_with_questionmarks.txt | 1 + 3 files changed, 9 insertions(+) create mode 100644 examples/keys_with_questionmarks.html create mode 100644 examples/keys_with_questionmarks.js create mode 100644 examples/keys_with_questionmarks.txt diff --git a/examples/keys_with_questionmarks.html b/examples/keys_with_questionmarks.html new file mode 100644 index 0000000..417f17f --- /dev/null +++ b/examples/keys_with_questionmarks.html @@ -0,0 +1,3 @@ +{{#person?}} + Hi {{name}}! +{{/person?}} diff --git a/examples/keys_with_questionmarks.js b/examples/keys_with_questionmarks.js new file mode 100644 index 0000000..55a220d --- /dev/null +++ b/examples/keys_with_questionmarks.js @@ -0,0 +1,5 @@ +var keys_with_questionmarks = { + "person?": { + name: "Jon" + } +} diff --git a/examples/keys_with_questionmarks.txt b/examples/keys_with_questionmarks.txt new file mode 100644 index 0000000..0f69b94 --- /dev/null +++ b/examples/keys_with_questionmarks.txt @@ -0,0 +1 @@ + Hi Jon! From 783f61450d4dc6a92554279e6d1d2e610e3c37a4 Mon Sep 17 00:00:00 2001 From: Tomas Eriksson Date: Wed, 13 Jul 2011 23:54:17 -0700 Subject: [PATCH 6/6] Fixed if statement. !== --- mustache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mustache.js b/mustache.js index 25d6639..e7c22c7 100644 --- a/mustache.js +++ b/mustache.js @@ -47,7 +47,7 @@ var Mustache = function() { Sends parsed lines */ send: function(line) { - if(line != "") { + if(line !== "") { this.buffer.push(line); } },