templebars 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -40,8 +40,8 @@ in your JavaScript manifest (`application.js`):
40
40
  //= require_tree ../templates
41
41
  ```
42
42
 
43
- Your template file names must be suffixed with the ".handlebars" or
44
- ".hbs" extensions in order for Templebars to handle them.
43
+ Your template file names must be suffixed with the ".js.handlebars" or
44
+ ".js.hbs" extensions in order for Templebars to handle them.
45
45
 
46
46
  ## Using templates
47
47
 
@@ -59,6 +59,15 @@ And a template at `app/assets/templates/users/detail.handlebars` with:
59
59
  Templates['users/detail'](context);
60
60
  ```
61
61
 
62
+ ## Using a different global Templates object
63
+
64
+ To use Templebars with, for example, Ember.js, add the following to your
65
+ `config/application.rb`:
66
+
67
+ ```ruby
68
+ config.templebars_template_global = "Ember.TEMPLATES"
69
+ ```
70
+
62
71
  *This gem is maintained by [Stovepipe Studios][stovepipe].*
63
72
 
64
73
  [stovepipe]: http://www.stovepipestudios.com
@@ -21,7 +21,7 @@ module Templebars
21
21
  protected
22
22
 
23
23
  def register_template_js( name, precompiled_js )
24
- global = Templebars::Rails::GLOBAL
24
+ global = Rails.application.config.templebars_template_global || "Templates"
25
25
  <<-JS
26
26
  this.#{global} || (this.#{global} = {});
27
27
  this.#{global}["#{name}"] = Handlebars.template(#{precompiled_js});
@@ -1,6 +1,6 @@
1
1
  module Templebars
2
2
  module Rails
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  HANDLEBARSJS_VERSION = "1.0.beta.6"
5
5
  end
6
6
  end
@@ -1,7 +1,5 @@
1
1
  module Templebars
2
2
  module Rails
3
- GLOBAL = "Templates"
4
-
5
3
  require 'templebars/rails/engine'
6
4
  require 'templebars/rails/templates'
7
5
  require 'templebars/rails/version'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: templebars
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sprockets
16
- requirement: &70132810909720 !ruby/object:Gem::Requirement
16
+ requirement: &70271647410700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.0.3
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70132810909720
24
+ version_requirements: *70271647410700
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: execjs
27
- requirement: &70132810909320 !ruby/object:Gem::Requirement
27
+ requirement: &70271647408340 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70132810909320
35
+ version_requirements: *70271647408340
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: tilt
38
- requirement: &70132810908660 !ruby/object:Gem::Requirement
38
+ requirement: &70271647407720 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70132810908660
46
+ version_requirements: *70271647407720
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &70132810908020 !ruby/object:Gem::Requirement
49
+ requirement: &70271647407300 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70132810908020
57
+ version_requirements: *70271647407300
58
58
  description: This gem provides Handlebars magic for your Rails 3 application.
59
59
  email:
60
60
  - tyson@stovepipestudios.com