hogan_assets 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hogan_assets (1.0.2)
4
+ hogan_assets (1.0.3)
5
5
  execjs (>= 1.2.9)
6
6
  sprockets (>= 2.0.3)
7
7
  tilt (>= 1.3.3)
data/README.md CHANGED
@@ -57,7 +57,8 @@ I made this because I <3 **mustache** and want to use it in Rails. Follow me on
57
57
 
58
58
  # Contributors
59
59
 
60
- * Matthew Nelson (@mdavidn) : Remove unnecessary template source
60
+ * Matthew Nelson (@mdavidn) : Remove unnecessary template source
61
+ * Jack Lawson (@ajacksified) : Configurable file extension
61
62
 
62
63
  ## Contributing
63
64
 
data/lib/hogan_assets.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  require 'hogan_assets/version'
2
+ require 'hogan_assets/config'
2
3
 
3
4
  module HoganAssets
5
+ extend Config
6
+
4
7
  autoload(:Hogan, 'hogan_assets/hogan')
5
8
  autoload(:Tilt, 'hogan_assets/tilt')
6
9
 
@@ -8,6 +11,6 @@ module HoganAssets
8
11
  require 'hogan_assets/engine'
9
12
  else
10
13
  require 'sprockets'
11
- Sprockets.register_engine '.mustache', Tilt
14
+ Sprockets.register_engine ".#{HoganAssets.template_extension}", Tilt
12
15
  end
13
16
  end
@@ -0,0 +1,24 @@
1
+ module HoganAssets
2
+ # Change config options in an initializer:
3
+ #
4
+ # HoganAssets.template_extension = 'mustache'
5
+ #
6
+ # Or in a block:
7
+ #
8
+ # HoganAssets.configure do |config|
9
+ # config.template_extension = 'mustache'
10
+ # end
11
+
12
+ module Config
13
+ attr_accessor :template_base_path, :template_extension
14
+
15
+ def configure
16
+ yield self
17
+ end
18
+
19
+ def template_extension
20
+ @template_extension ||= 'mustache'
21
+ end
22
+ end
23
+ end
24
+
@@ -2,7 +2,7 @@ module HoganAssets
2
2
  class Engine < ::Rails::Engine
3
3
  initializer "sprockets.hogan", :after => "sprockets.environment", :group => :all do |app|
4
4
  next unless app.assets
5
- app.assets.register_engine('.mustache', Tilt)
5
+ app.assets.register_engine(".#{HoganAssets.template_extension}", Tilt)
6
6
  end
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module HoganAssets
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hogan_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-15 00:00:00.000000000Z
12
+ date: 2012-03-09 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: execjs
16
- requirement: &70197692099300 !ruby/object:Gem::Requirement
16
+ requirement: &70347106413740 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.2.9
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70197692099300
24
+ version_requirements: *70347106413740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: tilt
27
- requirement: &70197692098520 !ruby/object:Gem::Requirement
27
+ requirement: &70347106413260 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.3.3
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70197692098520
35
+ version_requirements: *70347106413260
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sprockets
38
- requirement: &70197692097800 !ruby/object:Gem::Requirement
38
+ requirement: &70347106412800 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 2.0.3
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70197692097800
46
+ version_requirements: *70347106412800
47
47
  description: Use compiled hogan.js (mustache) JavaScript templates with sprockets
48
48
  and the Rails asset pipeline.
49
49
  email:
@@ -61,6 +61,7 @@ files:
61
61
  - Rakefile
62
62
  - hogan_assets.gemspec
63
63
  - lib/hogan_assets.rb
64
+ - lib/hogan_assets/config.rb
64
65
  - lib/hogan_assets/engine.rb
65
66
  - lib/hogan_assets/hogan.rb
66
67
  - lib/hogan_assets/tilt.rb
@@ -88,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
89
  version: '0'
89
90
  requirements: []
90
91
  rubyforge_project:
91
- rubygems_version: 1.8.10
92
+ rubygems_version: 1.8.17
92
93
  signing_key:
93
94
  specification_version: 3
94
95
  summary: Use compiled hogan.js (mustache) JavaScript templates with sprockets and