mote 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/lib/mote.rb +2 -2
  2. data/mote.gemspec +1 -1
  3. data/test/mote_test.rb +5 -0
  4. metadata +3 -3
@@ -18,7 +18,7 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
  class Mote
21
- VERSION = "0.0.1"
21
+ VERSION = "0.0.2"
22
22
 
23
23
  def self.parse(template, context = self)
24
24
  terms = template.split(/(<%[=#]?)\s*(.*?)\s*%>/)
@@ -30,7 +30,7 @@ class Mote
30
30
  when "<%#" then terms.shift # skip
31
31
  when "<%" then parts << "#{terms.shift}\n"
32
32
  when "<%=" then parts << "__o << (#{terms.shift}).to_s\n"
33
- else parts << "__o << '#{term}'\n"
33
+ else parts << "__o << #{term.inspect}\n"
34
34
  end
35
35
  end
36
36
 
@@ -16,5 +16,5 @@ Gem::Specification.new do |s|
16
16
  "*.gemspec",
17
17
  "test/**/*.rb"
18
18
  ]
19
- s.add_development_dependency "cutest", "~> 0.1"
19
+ s.add_development_dependency "cutest"
20
20
  end
@@ -31,6 +31,11 @@ scope do
31
31
  example = Mote.parse("The\nMan\nAnd\n<%=\n\"The\"\n%>\nSea")
32
32
  assert_equal "The\nMan\nAnd\nThe\nSea", example[:n => 3]
33
33
  end
34
+
35
+ test "quotes" do
36
+ example = Mote.parse("'foo' 'bar' 'baz'")
37
+ assert_equal "'foo' 'bar' 'baz'", example.call
38
+ end
34
39
  end
35
40
 
36
41
  include Mote::Helpers
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mote
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Michel Martens
@@ -18,9 +18,9 @@ dependencies:
18
18
  requirement: &id001 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
- - - ~>
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: "0.1"
23
+ version: "0"
24
24
  type: :development
25
25
  version_requirements: *id001
26
26
  description: Mote is the little brother of ERB. It only provides a subset of ERB's features, but praises itself of being simple--both internally and externally--and super fast.