smt_rails 0.2.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3a8fb1a89a16e6b97deeaa6b480e3a4a91bb016
4
- data.tar.gz: 00225de382b21435a2b45ce15b7e6d772c8fec2e
3
+ metadata.gz: 1d890287cb5c00f5e578f630d59b96c898d6f219
4
+ data.tar.gz: 7a385c39cb00db68cc19ad6d08afb96d77d58837
5
5
  SHA512:
6
- metadata.gz: b7743f0f37bd4e831582cf14d065c79c5bce02291fdd98c7a1c199fbab6b91a7efdee88541660132629e192b7600312d384cc88705e926418398d1a6c6d0c388
7
- data.tar.gz: 3d18bd870bbce15e5795127e37d7f1b2e2cad1e40d27f078cf88eb5d119763f02c7a692d5546647d795b6f4f7dc433201fc0ef200002c73cd7714bf1b3f4d46c
6
+ metadata.gz: 19124d99e48b714ebd5d30d4b3aac0b8c92caf11df43de8126a2973cdd5589643a4460ae764711646f4e78e44342344a93a1deb68c404b1559630deeef144e37
7
+ data.tar.gz: e235d6c7f5d59ab727aa1ea323f339fdf157043e8352b744e02f3b432b1e74f033367c1d7b358ecfc12a13670ed60667e9cae255b614ea0090be8f3dbf0567a7
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.3.3
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SmtRails
2
2
 
3
- Shared mustache templates for rails 3.
3
+ Shared mustache templates for Rails 3 and 4 and Sprockets 2 and 3.
4
4
 
5
5
  ## Installation
6
6
 
@@ -11,15 +11,15 @@ Add this line to your application's Gemfile:
11
11
  And then execute:
12
12
 
13
13
  $ bundle
14
-
14
+
15
15
  Or install it yourself as:
16
-
16
+
17
17
  $ gem install smt_rails
18
18
 
19
19
  ## Usage
20
20
 
21
21
  $ rails g smt_rails:install
22
-
22
+
23
23
  Generator add into "application.js" requirements for mustache and "templates" folder in "app". Next you can create mustache templates in this folder or subfolders.
24
24
 
25
25
  For example:
@@ -27,11 +27,11 @@ For example:
27
27
  File: "app/templates/tests/_test.mustache"
28
28
 
29
29
  Hello {{msg}}!!!
30
-
30
+
31
31
  In view you can render this template by this way:
32
32
 
33
- <%= render "tests/test", :mustache => {msg: "Test"} %>
34
-
33
+ <%= render "tests/test", :mustache => {msg: "Test"} %>
34
+
35
35
  The same template you can render in JavaScript:
36
36
 
37
37
  var content = SMT['tests/test']({msg: "Test"});
@@ -6,7 +6,12 @@ module SmtRails
6
6
 
7
7
  initializer "sprockets.smt_rails", :group => :all do |app|
8
8
  app.config.assets.configure do |env|
9
- env.register_engine(".#{SmtRails.template_extension}", Tilt)
9
+ if env.respond_to?(:register_transformer)
10
+ env.register_mime_type 'text/html', extensions: ['.mustache'], charset: :html
11
+ env.register_preprocessor 'text/html', Tilt
12
+ else
13
+ env.register_engine(".#{SmtRails.template_extension}", Tilt)
14
+ end
10
15
  end
11
16
  app.config.assets.paths << SmtRails.template_base_path
12
17
  end
@@ -1,3 +1,3 @@
1
1
  module SmtRails
2
- VERSION = "0.2.9"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smt_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Vasiliev
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-22 00:00:00.000000000 Z
12
+ date: 2017-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.2.2
115
+ rubygems_version: 2.5.2
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: Shared mustache templates for rails 3