handlebars 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.mdown CHANGED
@@ -9,7 +9,8 @@ This uses [therubyracer][1] to bind to the _actual_ JavaScript implementation of
9
9
  Simple stuff
10
10
 
11
11
  require 'handlebars'
12
- template = Handlebars.compile("{{say}}{{what}}")
12
+ handlebars = Handlebars::Context.new
13
+ template = handlebars.compile("{{say}}{{what}}")
13
14
  template.call(:say => "Hey", :what => "Yuh!") #=> "Hey Yuh!"
14
15
 
15
16
  With functions as properties
@@ -18,10 +19,10 @@ With functions as properties
18
19
 
19
20
  Register block helpers:
20
21
 
21
- Handlebars.register_helper(:twice) do |block|
22
+ handlebars.register_helper(:twice) do |block|
22
23
  "#{block.call}#{block.call}"
23
24
  end
24
- template = Handlebars.compile({{#twice}}Hurray!{{/twice}})
25
+ template = handlebars.compile({{#twice}}Hurray!{{/twice}})
25
26
  template.call #=> Hurray!Hurray!
26
27
 
27
28
  ## Hack
data/lib/handlebars.rb CHANGED
@@ -1,6 +1,4 @@
1
1
 
2
- require 'handlebars/loader'
3
-
4
2
  module Handlebars
5
3
  autoload :Context, 'handlebars/context'
6
4
  end
@@ -1,4 +1,5 @@
1
1
  require 'commonjs'
2
+ require 'v8'
2
3
 
3
4
  module Handlebars
4
5
  class Context
@@ -1,3 +1,3 @@
1
1
  module Handlebars
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handlebars
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: therubyracer
16
- requirement: &2156214780 !ruby/object:Gem::Requirement
16
+ requirement: &2156892900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.10.0beta1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156214780
24
+ version_requirements: *2156892900
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: commonjs
27
- requirement: &2156214000 !ruby/object:Gem::Requirement
27
+ requirement: &2156891200 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.2.3
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2156214000
35
+ version_requirements: *2156891200
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &2156213220 !ruby/object:Gem::Requirement
38
+ requirement: &2156890700 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '2.0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2156213220
46
+ version_requirements: *2156890700
47
47
  description: Uses the actual JavaScript implementation of Handlebars, but supports
48
48
  using Ruby objects as template contexts and Ruby procs as view functions and named
49
49
  helpers