handlebar 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,16 +1,6 @@
1
1
  require 'rubygems'
2
- require 'bundler'
3
-
4
- begin
5
- Bundler.setup(:default, :development)
6
- rescue Bundler::BundlerError => e
7
- $stderr.puts e.message
8
- $stderr.puts "Run `bundle install` to install missing gems"
9
- exit e.status_code
10
- end
11
2
 
12
3
  require 'rake'
13
-
14
4
  require 'jeweler'
15
5
 
16
6
  Jeweler::Tasks.new do |gem|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -4,22 +4,20 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{handlebar}
8
- s.version = "0.2.1"
7
+ s.name = "handlebar"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Scott Tadman"]
12
- s.date = %q{2011-07-04}
13
- s.description = %q{A simple text templating system}
14
- s.email = %q{github@tadman.ca}
12
+ s.date = "2011-11-28"
13
+ s.description = "A simple text templating system"
14
+ s.email = "github@tadman.ca"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- "Gemfile",
22
- "Gemfile.lock",
23
21
  "LICENSE.txt",
24
22
  "README.rdoc",
25
23
  "Rakefile",
@@ -33,30 +31,19 @@ Gem::Specification.new do |s|
33
31
  "test/test_handlebar.rb",
34
32
  "test/test_handlebar_template.rb"
35
33
  ]
36
- s.homepage = %q{http://github.com/twg/handlebar}
34
+ s.homepage = "http://github.com/twg/handlebar"
37
35
  s.licenses = ["MIT"]
38
36
  s.require_paths = ["lib"]
39
- s.rubygems_version = %q{1.5.3}
40
- s.summary = %q{Simple text tempating system}
41
- s.test_files = [
42
- "test/helper.rb",
43
- "test/test_handlebar.rb",
44
- "test/test_handlebar_template.rb"
45
- ]
37
+ s.rubygems_version = "1.8.11"
38
+ s.summary = "Simple text tempating system"
46
39
 
47
40
  if s.respond_to? :specification_version then
48
41
  s.specification_version = 3
49
42
 
50
43
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
51
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
52
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
53
44
  else
54
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
55
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
56
45
  end
57
46
  else
58
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
59
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
60
47
  end
61
48
  end
62
49
 
@@ -69,7 +69,7 @@ class Handlebar::Template
69
69
  _variables = variables
70
70
 
71
71
  Hash.new do |h, k|
72
- h[k] = (_variables[k.to_sym] || _variables[k.to_s])
72
+ h[k] = k ? (_variables[k.to_sym] || _variables[k.to_s]) : _variables[k]
73
73
  end
74
74
  else
75
75
  [ variables ]
@@ -1,13 +1,5 @@
1
1
  require 'rubygems'
2
- require 'bundler'
3
2
 
4
- begin
5
- Bundler.setup(:default, :development)
6
- rescue Bundler::BundlerError => e
7
- $stderr.puts e.message
8
- $stderr.puts "Run `bundle install` to install missing gems"
9
- exit e.status_code
10
- end
11
3
  require 'test/unit'
12
4
 
13
5
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
@@ -212,4 +212,16 @@ class TestHandlebarTemplate < Test::Unit::TestCase
212
212
 
213
213
  assert_equal '<p>&lt;strong&gt;</p>', deserialized_template.render('<strong>')
214
214
  end
215
+
216
+ def test_with_broken_input
217
+ template = Handlebar::Template.new('{{}}')
218
+
219
+ assert_equal '', template.render
220
+ assert_equal '', template.render(nil)
221
+ assert_equal '', template.render(nil => nil)
222
+
223
+ template = Handlebar::Template.new('{{test}}')
224
+
225
+ assert_equal '', template.render(nil => nil)
226
+ end
215
227
  end
metadata CHANGED
@@ -1,53 +1,25 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: handlebar
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.2
4
5
  prerelease:
5
- version: 0.2.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Scott Tadman
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-07-04 00:00:00 -04:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: bundler
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
20
- none: false
21
- requirements:
22
- - - ~>
23
- - !ruby/object:Gem::Version
24
- version: 1.0.0
25
- type: :development
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: jeweler
29
- prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
31
- none: false
32
- requirements:
33
- - - ~>
34
- - !ruby/object:Gem::Version
35
- version: 1.5.2
36
- type: :development
37
- version_requirements: *id002
12
+ date: 2011-11-28 00:00:00.000000000 Z
13
+ dependencies: []
38
14
  description: A simple text templating system
39
15
  email: github@tadman.ca
40
16
  executables: []
41
-
42
17
  extensions: []
43
-
44
- extra_rdoc_files:
18
+ extra_rdoc_files:
45
19
  - LICENSE.txt
46
20
  - README.rdoc
47
- files:
21
+ files:
48
22
  - .document
49
- - Gemfile
50
- - Gemfile.lock
51
23
  - LICENSE.txt
52
24
  - README.rdoc
53
25
  - Rakefile
@@ -60,35 +32,29 @@ files:
60
32
  - test/helper.rb
61
33
  - test/test_handlebar.rb
62
34
  - test/test_handlebar_template.rb
63
- has_rdoc: true
64
35
  homepage: http://github.com/twg/handlebar
65
- licenses:
36
+ licenses:
66
37
  - MIT
67
38
  post_install_message:
68
39
  rdoc_options: []
69
-
70
- require_paths:
40
+ require_paths:
71
41
  - lib
72
- required_ruby_version: !ruby/object:Gem::Requirement
42
+ required_ruby_version: !ruby/object:Gem::Requirement
73
43
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: "0"
78
- required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
49
  none: false
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
84
54
  requirements: []
85
-
86
55
  rubyforge_project:
87
- rubygems_version: 1.5.3
56
+ rubygems_version: 1.8.11
88
57
  signing_key:
89
58
  specification_version: 3
90
59
  summary: Simple text tempating system
91
- test_files:
92
- - test/helper.rb
93
- - test/test_handlebar.rb
94
- - test/test_handlebar_template.rb
60
+ test_files: []
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- group :development do
4
- gem "bundler", "~> 1.0.0"
5
- gem "jeweler", "~> 1.5.2"
6
- end
@@ -1,16 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- git (1.2.5)
5
- jeweler (1.5.2)
6
- bundler (~> 1.0.0)
7
- git (>= 1.2.5)
8
- rake
9
- rake (0.9.2)
10
-
11
- PLATFORMS
12
- ruby
13
-
14
- DEPENDENCIES
15
- bundler (~> 1.0.0)
16
- jeweler (~> 1.5.2)