haml_coffee_assets 1.16.1 → 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +11 -11
- data/lib/haml_coffee_assets.rb +2 -3
- data/lib/haml_coffee_assets/action_view/patches.rb +3 -1
- data/lib/haml_coffee_assets/action_view/resolver.rb +5 -1
- data/lib/haml_coffee_assets/action_view/template_handler.rb +3 -2
- data/lib/haml_coffee_assets/configuration.rb +1 -1
- data/lib/haml_coffee_assets/rails/engine.rb +9 -45
- data/lib/haml_coffee_assets/transformer.rb +33 -0
- data/lib/haml_coffee_assets/version.rb +1 -1
- data/vendor/assets/javascripts/hamlcoffee_amd.js.coffee.erb +1 -1
- metadata +204 -14
- data/lib/haml_coffee_assets/tilt/template_handler.rb +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 68c32a5b411d1824da4a40464e7e3773529cf9bf85bce568f16c32e79d5c77bf
|
4
|
+
data.tar.gz: 3cd98534f88665eff482c8b1236004a600de377928128491ab9fffdc879cc404
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d261f7279539e796fa3cc3848ba5a37ed9df444b31ee77aec5b76aa03a8f495db743190c38f243822571cf06da44cd4effb69886e33715b1359f0c838ef3429
|
7
|
+
data.tar.gz: 826f493ad75f8d6e7f563b3ab7eea7f2231999104d4433affa3d16299d759e378c04c063ceb5ed5a3a70598e26b41c94b6a391abc795732010fba3139888d721
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Haml Coffee Assets [![Build Status](https://secure.travis-ci.org/
|
1
|
+
# Haml Coffee Assets [![Build Status](https://secure.travis-ci.org/emilioforrer/haml_coffee_assets.png)](http://travis-ci.org/emilioforrer/haml_coffee_assets)
|
2
2
|
|
3
3
|
Haml Coffee Assets compiles [Haml Coffee](https://github.com/netzpirat/haml-coffee) templates in the Rails 3.1 asset
|
4
4
|
pipeline, so you can use them as JavaScript templates in your JavaScript heavy Rails application. Server-side rendering
|
@@ -59,7 +59,7 @@ If you're using AMD support then you do not need to include the above helper, si
|
|
59
59
|
This provides the default escaping and the global context functions. Read more about it in the configuration section
|
60
60
|
below.
|
61
61
|
|
62
|
-
Please have a look at the [CHANGELOG](https://github.com/
|
62
|
+
Please have a look at the [CHANGELOG](https://github.com/emilioforrer/haml_coffee_assets/blob/master/CHANGELOG.md) when
|
63
63
|
upgrading to a newer Haml Coffee Assets version.
|
64
64
|
|
65
65
|
If you want to use Haml Coffee with Sinatra, please have a look at the
|
@@ -94,7 +94,7 @@ removed.
|
|
94
94
|
|
95
95
|
When you give your templates the extension `.jst.hamlc`, Haml Coffee Assets will only generate the template function,
|
96
96
|
which then in turn will be further processed by the
|
97
|
-
[Sprocket JST processor](https://github.com/
|
97
|
+
[Sprocket JST processor](https://github.com/rails/sprockets/blob/master/lib/sprockets/jst_processor.rb). Because
|
98
98
|
Haml Coffee Assets will not generate the template, you can't use the AMD support, template name filter and the JST
|
99
99
|
namespace definition is more cumbersome compared to the Haml Coffee template generation.
|
100
100
|
|
@@ -408,7 +408,7 @@ App.globalTemplateContext = (locals) -> HAML.extend({}, {
|
|
408
408
|
}, locals)
|
409
409
|
```
|
410
410
|
|
411
|
-
Please have a look at the wiki for [further examples](https://github.com/
|
411
|
+
Please have a look at the wiki for [further examples](https://github.com/emilioforrer/haml_coffee_assets/wiki) on how to
|
412
412
|
use the global context.
|
413
413
|
|
414
414
|
### Customize the tag lists
|
@@ -456,7 +456,7 @@ to, you can set custom functions for:
|
|
456
456
|
* config.hamlcoffee.customSucceed
|
457
457
|
* config.hamlcoffee.customPrecede
|
458
458
|
|
459
|
-
You can see the [default implementation](https://github.com/
|
459
|
+
You can see the [default implementation](https://github.com/emilioforrer/haml_coffee_assets/blob/master/vendor/assets/javascripts/hamlcoffee.js.coffee.erb)
|
460
460
|
and the [Haml Coffee documentation](https://github.com/netzpirat/haml-coffee#custom-helper-function-options)
|
461
461
|
for more information about each helper function.
|
462
462
|
|
@@ -516,14 +516,14 @@ example.
|
|
516
516
|
|
517
517
|
Developed by Michael Kessler, [FlinkFinger](http://www.flinkfinger.com).
|
518
518
|
|
519
|
-
If you like Haml Coffee Assets, you can watch the repository at [GitHub](https://github.com/
|
519
|
+
If you like Haml Coffee Assets, you can watch the repository at [GitHub](https://github.com/emilioforrer/haml_coffee_assets)
|
520
520
|
and follow [@netzpirat](https://twitter.com/#!/netzpirat) on Twitter for project updates.
|
521
521
|
|
522
522
|
## Development
|
523
523
|
|
524
|
-
* Issues and feature request hosted at [GitHub Issues](https://github.com/
|
525
|
-
* Documentation hosted at [RubyDoc](http://rubydoc.info/github/
|
526
|
-
* Source hosted at [GitHub](https://github.com/
|
524
|
+
* Issues and feature request hosted at [GitHub Issues](https://github.com/emilioforrer/haml_coffee_assets/issues).
|
525
|
+
* Documentation hosted at [RubyDoc](http://rubydoc.info/github/emilioforrer/haml_coffee_assets/master/frames).
|
526
|
+
* Source hosted at [GitHub](https://github.com/emilioforrer/haml_coffee_assets).
|
527
527
|
|
528
528
|
Pull requests are very welcome! Please try to follow these simple rules if applicable:
|
529
529
|
|
@@ -548,8 +548,8 @@ Please try to follow these simple rules:
|
|
548
548
|
|
549
549
|
## Contributors
|
550
550
|
|
551
|
-
See the [CHANGELOG](https://github.com/
|
552
|
-
[contributors](https://github.com/
|
551
|
+
See the [CHANGELOG](https://github.com/emilioforrer/haml_coffee_assets/blob/master/CHANGELOG.md) and the GitHub list of
|
552
|
+
[contributors](https://github.com/emilioforrer/haml_coffee_assets/contributors).
|
553
553
|
|
554
554
|
## Acknowledgement
|
555
555
|
|
data/lib/haml_coffee_assets.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'pathname'
|
4
4
|
|
5
|
-
require 'tilt'
|
6
5
|
require 'sprockets'
|
7
6
|
require 'execjs'
|
8
7
|
|
@@ -11,7 +10,7 @@ require 'haml_coffee_assets/configuration'
|
|
11
10
|
require 'haml_coffee_assets/compiler'
|
12
11
|
require 'haml_coffee_assets/version'
|
13
12
|
|
14
|
-
require 'haml_coffee_assets/
|
13
|
+
require 'haml_coffee_assets/transformer'
|
15
14
|
|
16
15
|
if defined?(Rails) && Rails.version >= '3.0.0'
|
17
16
|
require 'rails'
|
@@ -19,7 +18,7 @@ if defined?(Rails) && Rails.version >= '3.0.0'
|
|
19
18
|
require 'haml_coffee_assets/action_view/patches'
|
20
19
|
else
|
21
20
|
require 'sprockets/engines'
|
22
|
-
Sprockets.register_engine '.hamlc', ::HamlCoffeeAssets::
|
21
|
+
Sprockets.register_engine '.hamlc', ::HamlCoffeeAssets::Transformer
|
23
22
|
end
|
24
23
|
|
25
24
|
# Main Haml Coffee Assets module with
|
@@ -29,8 +29,10 @@ module HamlCoffeeAssets::ActionView
|
|
29
29
|
|
30
30
|
if ::Rails::VERSION::STRING < "4"
|
31
31
|
raise ::ActionView::Template::Error.new(template, assigns, e)
|
32
|
-
|
32
|
+
elsif ::Rails::VERSION::STRING < "5.1"
|
33
33
|
raise ::ActionView::Template::Error.new(template, e)
|
34
|
+
else
|
35
|
+
raise ::ActionView::Template::Error.new(template)
|
34
36
|
end
|
35
37
|
end
|
36
38
|
end
|
@@ -11,7 +11,11 @@ module HamlCoffeeAssets
|
|
11
11
|
def find_templates(name, prefix, partial, details, outside_app_allowed = false)
|
12
12
|
if details[:formats].include?(:html)
|
13
13
|
clear_cache if ::Rails.env == "development"
|
14
|
-
|
14
|
+
if ::Rails::VERSION::STRING < "4.2.5.1"
|
15
|
+
super(name, prefix, partial, details)
|
16
|
+
else
|
17
|
+
super(name, prefix, partial, details, outside_app_allowed)
|
18
|
+
end
|
15
19
|
else
|
16
20
|
[]
|
17
21
|
end
|
@@ -3,7 +3,7 @@ module HamlCoffeeAssets
|
|
3
3
|
class TemplateHandler
|
4
4
|
DEPENDENCY_PATTERN = /(?:window\.)?JST(?:\[["']([\w\/]+)["']\]|\.(\w+))/
|
5
5
|
|
6
|
-
def self.call(template)
|
6
|
+
def self.call(template, _body = nil)
|
7
7
|
new(template).render
|
8
8
|
end
|
9
9
|
|
@@ -80,7 +80,8 @@ module HamlCoffeeAssets
|
|
80
80
|
partial_source(path),
|
81
81
|
path,
|
82
82
|
self.class,
|
83
|
-
virtual_path: partial_path(path)
|
83
|
+
virtual_path: partial_path(path),
|
84
|
+
locals: []
|
84
85
|
)
|
85
86
|
|
86
87
|
compiled << self.class.new(
|
@@ -38,7 +38,7 @@ module HamlCoffeeAssets
|
|
38
38
|
self.selfCloseTags = 'meta,img,link,br,hr,input,area,param,col,base'
|
39
39
|
self.context = 'window.HAML.context'
|
40
40
|
self.templates_path = 'app/assets/javascripts/templates'
|
41
|
-
self.global_context_asset = 'templates/context'
|
41
|
+
self.global_context_asset = 'templates/context.js'
|
42
42
|
self.name_filter = lambda { |n|
|
43
43
|
parts = n.sub(/^templates\//, '').split('/')
|
44
44
|
parts.last.sub!(/^_/, '')
|
@@ -33,54 +33,18 @@ module HamlCoffeeAssets
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
# touch it. This is problematic because when the global_context_asset
|
42
|
-
# changes we need to manually touch every template that uses the congtext
|
43
|
-
# in some way.
|
44
|
-
#
|
45
|
-
# To ease development, make rails 'touch' and recompile hamlc templates
|
46
|
-
# when the global context has changed.
|
47
|
-
#
|
48
|
-
# Do this ONLY in development.
|
49
|
-
#
|
50
|
-
# TODO: Don't monkey patch rails.
|
51
|
-
module ::ActionView
|
52
|
-
class Template
|
53
|
-
def stale?
|
54
|
-
return false unless ::Rails.env == "development"
|
55
|
-
return false unless handler.respond_to?(:stale?)
|
56
|
-
handler.stale?(updated_at)
|
57
|
-
end
|
58
|
-
|
59
|
-
alias_method :old_render, :render
|
60
|
-
|
61
|
-
# by default, rails will only compile a template once
|
62
|
-
# path render so it recompiles the template if 'stale'
|
63
|
-
def render(view, locals, buffer=nil, &block)
|
64
|
-
if @compiled and stale?
|
65
|
-
now = Time.now
|
66
|
-
File.utime(now, now, identifier) # touch file
|
67
|
-
::Rails.logger.info "Busted cache for #{identifier} by touching it"
|
68
|
-
|
69
|
-
view = refresh(view)
|
70
|
-
@source = view.source
|
71
|
-
@compiled = false
|
72
|
-
end
|
73
|
-
old_render(view, locals, buffer, &block)
|
74
|
-
end
|
36
|
+
config.assets.configure do |env|
|
37
|
+
if env.respond_to?(:register_transformer)
|
38
|
+
env.register_mime_type 'text/hamlc', extensions: ['.hamlc']
|
39
|
+
env.register_transformer 'text/hamlc', 'application/javascript', ::HamlCoffeeAssets::Transformer
|
40
|
+
end
|
75
41
|
|
76
|
-
|
42
|
+
if env.respond_to?(:register_engine)
|
43
|
+
args = ['.hamlc', ::HamlCoffeeAssets::Transformer]
|
44
|
+
args << { mime_type: 'text/hamlc', silence_deprecation: true } if Sprockets::VERSION.start_with?('3')
|
45
|
+
env.register_engine(*args)
|
77
46
|
end
|
78
47
|
end
|
79
|
-
|
80
|
-
next unless app.assets
|
81
|
-
|
82
|
-
# Register Tilt template (for Sprockets)
|
83
|
-
app.assets.register_engine '.hamlc', ::HamlCoffeeAssets::Tilt::TemplateHandler
|
84
48
|
end
|
85
49
|
|
86
50
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: UTF-8
|
2
|
+
|
3
|
+
module HamlCoffeeAssets
|
4
|
+
# Haml Coffee Sprockets processor
|
5
|
+
#
|
6
|
+
class Transformer
|
7
|
+
def initialize(filename, &block)
|
8
|
+
@filename = filename
|
9
|
+
@source = block.call
|
10
|
+
end
|
11
|
+
|
12
|
+
def render(context, empty_hash_wtf)
|
13
|
+
self.class.run(@filename, @filename, @source, context)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.run(filename, name, source, context)
|
17
|
+
jst = !!(filename =~ /\.jst\.hamlc(?:\.|$)/)
|
18
|
+
name = HamlCoffeeAssets.config.name_filter.call(name) if HamlCoffeeAssets.config.name_filter && !jst
|
19
|
+
|
20
|
+
HamlCoffeeAssets::Compiler.compile(name, source, !jst)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.call(input)
|
24
|
+
filename = input[:filename]
|
25
|
+
name = input[:name]
|
26
|
+
source = input[:data]
|
27
|
+
context = input[:environment].context_class.new(input)
|
28
|
+
|
29
|
+
result = run(filename, name, source, context)
|
30
|
+
context.metadata.merge(data: result)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -48,7 +48,7 @@ define ->
|
|
48
48
|
#
|
49
49
|
findAndPreserve: (text) ->
|
50
50
|
tags = '<%= ::HamlCoffeeAssets.config.preserveTags %>'.split(',').join('|')
|
51
|
-
text = text.replace(/\r/g, '').replace ///<(#{ tags })>([\s\S]*?)<\/\1>///
|
51
|
+
text = text.replace(/\r/g, '').replace ///<(#{ tags })>([\s\S]*?)<\/\1>///g, (str, tag, content) ->
|
52
52
|
"<#{ tag }>#{ <%= ::HamlCoffeeAssets.config.customPreserve %>(content) }</#{ tag }>"
|
53
53
|
|
54
54
|
# The surround helper surrounds the function output
|
metadata
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml_coffee_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Kessler
|
8
|
+
- Emilio Forrer
|
9
|
+
- Christopher Ostrowski
|
8
10
|
autorequire:
|
9
11
|
bindir: bin
|
10
12
|
cert_chain: []
|
11
|
-
date:
|
13
|
+
date: 2021-04-29 00:00:00.000000000 Z
|
12
14
|
dependencies:
|
13
15
|
- !ruby/object:Gem::Dependency
|
14
16
|
name: coffee-script
|
@@ -25,33 +27,39 @@ dependencies:
|
|
25
27
|
- !ruby/object:Gem::Version
|
26
28
|
version: '2'
|
27
29
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
30
|
+
name: railties
|
29
31
|
requirement: !ruby/object:Gem::Requirement
|
30
32
|
requirements:
|
31
33
|
- - ">="
|
32
34
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
35
|
+
version: '4.2'
|
36
|
+
- - "<"
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '6.2'
|
34
39
|
type: :runtime
|
35
40
|
prerelease: false
|
36
41
|
version_requirements: !ruby/object:Gem::Requirement
|
37
42
|
requirements:
|
38
43
|
- - ">="
|
39
44
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
45
|
+
version: '4.2'
|
46
|
+
- - "<"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '6.2'
|
41
49
|
- !ruby/object:Gem::Dependency
|
42
50
|
name: sprockets
|
43
51
|
requirement: !ruby/object:Gem::Requirement
|
44
52
|
requirements:
|
45
53
|
- - ">="
|
46
54
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
55
|
+
version: '3.7'
|
48
56
|
type: :runtime
|
49
57
|
prerelease: false
|
50
58
|
version_requirements: !ruby/object:Gem::Requirement
|
51
59
|
requirements:
|
52
60
|
- - ">="
|
53
61
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
62
|
+
version: '3.7'
|
55
63
|
- !ruby/object:Gem::Dependency
|
56
64
|
name: bundler
|
57
65
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,9 +74,193 @@ dependencies:
|
|
66
74
|
- - ">="
|
67
75
|
- !ruby/object:Gem::Version
|
68
76
|
version: '0'
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: rspec
|
79
|
+
requirement: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
type: :development
|
85
|
+
prerelease: false
|
86
|
+
version_requirements: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: jquery-rails
|
93
|
+
requirement: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
type: :development
|
99
|
+
prerelease: false
|
100
|
+
version_requirements: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
- !ruby/object:Gem::Dependency
|
106
|
+
name: coffee-rails
|
107
|
+
requirement: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
type: :development
|
113
|
+
prerelease: false
|
114
|
+
version_requirements: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
- !ruby/object:Gem::Dependency
|
120
|
+
name: jasmine
|
121
|
+
requirement: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
type: :development
|
127
|
+
prerelease: false
|
128
|
+
version_requirements: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
- !ruby/object:Gem::Dependency
|
134
|
+
name: jasmine-rails
|
135
|
+
requirement: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
type: :development
|
141
|
+
prerelease: false
|
142
|
+
version_requirements: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
- !ruby/object:Gem::Dependency
|
148
|
+
name: guard
|
149
|
+
requirement: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
type: :development
|
155
|
+
prerelease: false
|
156
|
+
version_requirements: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
- !ruby/object:Gem::Dependency
|
162
|
+
name: guard-jasmine
|
163
|
+
requirement: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
168
|
+
type: :development
|
169
|
+
prerelease: false
|
170
|
+
version_requirements: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
175
|
+
- !ruby/object:Gem::Dependency
|
176
|
+
name: guard-rspec
|
177
|
+
requirement: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
type: :development
|
183
|
+
prerelease: false
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
requirements:
|
186
|
+
- - ">="
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: '0'
|
189
|
+
- !ruby/object:Gem::Dependency
|
190
|
+
name: rake
|
191
|
+
requirement: !ruby/object:Gem::Requirement
|
192
|
+
requirements:
|
193
|
+
- - ">="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
version: '0'
|
196
|
+
type: :development
|
197
|
+
prerelease: false
|
198
|
+
version_requirements: !ruby/object:Gem::Requirement
|
199
|
+
requirements:
|
200
|
+
- - ">="
|
201
|
+
- !ruby/object:Gem::Version
|
202
|
+
version: '0'
|
203
|
+
- !ruby/object:Gem::Dependency
|
204
|
+
name: yard
|
205
|
+
requirement: !ruby/object:Gem::Requirement
|
206
|
+
requirements:
|
207
|
+
- - ">="
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
version: '0'
|
210
|
+
type: :development
|
211
|
+
prerelease: false
|
212
|
+
version_requirements: !ruby/object:Gem::Requirement
|
213
|
+
requirements:
|
214
|
+
- - ">="
|
215
|
+
- !ruby/object:Gem::Version
|
216
|
+
version: '0'
|
217
|
+
- !ruby/object:Gem::Dependency
|
218
|
+
name: pry
|
219
|
+
requirement: !ruby/object:Gem::Requirement
|
220
|
+
requirements:
|
221
|
+
- - ">="
|
222
|
+
- !ruby/object:Gem::Version
|
223
|
+
version: '0'
|
224
|
+
type: :development
|
225
|
+
prerelease: false
|
226
|
+
version_requirements: !ruby/object:Gem::Requirement
|
227
|
+
requirements:
|
228
|
+
- - ">="
|
229
|
+
- !ruby/object:Gem::Version
|
230
|
+
version: '0'
|
231
|
+
- !ruby/object:Gem::Dependency
|
232
|
+
name: rb-readline
|
233
|
+
requirement: !ruby/object:Gem::Requirement
|
234
|
+
requirements:
|
235
|
+
- - ">="
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
version: '0'
|
238
|
+
type: :development
|
239
|
+
prerelease: false
|
240
|
+
version_requirements: !ruby/object:Gem::Requirement
|
241
|
+
requirements:
|
242
|
+
- - ">="
|
243
|
+
- !ruby/object:Gem::Version
|
244
|
+
version: '0'
|
245
|
+
- !ruby/object:Gem::Dependency
|
246
|
+
name: puma
|
247
|
+
requirement: !ruby/object:Gem::Requirement
|
248
|
+
requirements:
|
249
|
+
- - ">="
|
250
|
+
- !ruby/object:Gem::Version
|
251
|
+
version: '0'
|
252
|
+
type: :development
|
253
|
+
prerelease: false
|
254
|
+
version_requirements: !ruby/object:Gem::Requirement
|
255
|
+
requirements:
|
256
|
+
- - ">="
|
257
|
+
- !ruby/object:Gem::Version
|
258
|
+
version: '0'
|
69
259
|
description: Compile Haml CoffeeScript templates in the Rails asset pipeline.
|
70
260
|
email:
|
71
261
|
- michi@flinkfinger.com
|
262
|
+
- emilio.forrer@gmail.com
|
263
|
+
- chris.ostrowski@gmail.com
|
72
264
|
executables: []
|
73
265
|
extensions: []
|
74
266
|
extra_rdoc_files: []
|
@@ -83,13 +275,13 @@ files:
|
|
83
275
|
- lib/haml_coffee_assets/configuration.rb
|
84
276
|
- lib/haml_coffee_assets/global_context.rb
|
85
277
|
- lib/haml_coffee_assets/rails/engine.rb
|
86
|
-
- lib/haml_coffee_assets/
|
278
|
+
- lib/haml_coffee_assets/transformer.rb
|
87
279
|
- lib/haml_coffee_assets/version.rb
|
88
280
|
- lib/js/haml_coffee_assets.js
|
89
281
|
- lib/js/hamlcoffee.js
|
90
282
|
- vendor/assets/javascripts/hamlcoffee.js.coffee.erb
|
91
283
|
- vendor/assets/javascripts/hamlcoffee_amd.js.coffee.erb
|
92
|
-
homepage: https://github.com/
|
284
|
+
homepage: https://github.com/emilioforrer/haml_coffee_assets
|
93
285
|
licenses:
|
94
286
|
- MIT
|
95
287
|
metadata: {}
|
@@ -101,17 +293,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
293
|
requirements:
|
102
294
|
- - ">="
|
103
295
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
296
|
+
version: '2.5'
|
105
297
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
298
|
requirements:
|
107
299
|
- - ">="
|
108
300
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
301
|
+
version: 2.5.2
|
110
302
|
requirements: []
|
111
|
-
|
112
|
-
rubygems_version: 2.4.8
|
303
|
+
rubygems_version: 3.0.9
|
113
304
|
signing_key:
|
114
305
|
specification_version: 4
|
115
306
|
summary: Haml CoffeeScript templates
|
116
307
|
test_files: []
|
117
|
-
has_rdoc:
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# coding: UTF-8
|
2
|
-
|
3
|
-
require 'tilt'
|
4
|
-
|
5
|
-
module HamlCoffeeAssets
|
6
|
-
module Tilt
|
7
|
-
|
8
|
-
# Haml Coffee template handler implementation for Tilt.
|
9
|
-
#
|
10
|
-
class TemplateHandler < ::Tilt::Template
|
11
|
-
|
12
|
-
self.default_mime_type = 'application/javascript'
|
13
|
-
|
14
|
-
# Test if the compiler is initialized.
|
15
|
-
#
|
16
|
-
# @return [Boolean] the initialization status
|
17
|
-
#
|
18
|
-
def self.engine_initialized?
|
19
|
-
defined? HamlCoffeeAssets::Compiler
|
20
|
-
end
|
21
|
-
|
22
|
-
# Initialize the template engine.
|
23
|
-
#
|
24
|
-
def initialize_engine
|
25
|
-
require_template_library 'haml_coffee_assets/compiler'
|
26
|
-
end
|
27
|
-
|
28
|
-
# Prepare the template
|
29
|
-
#
|
30
|
-
def prepare
|
31
|
-
end
|
32
|
-
|
33
|
-
# Compile the template.
|
34
|
-
#
|
35
|
-
def evaluate(scope, locals = { }, &block)
|
36
|
-
jst = !!(scope.pathname.to_s =~ /\.jst\.hamlc(?:\.|$)/)
|
37
|
-
name = scope.logical_path
|
38
|
-
name = HamlCoffeeAssets.config.name_filter.call(name) if HamlCoffeeAssets.config.name_filter && !jst
|
39
|
-
|
40
|
-
@output ||= HamlCoffeeAssets::Compiler.compile(name, data, !jst)
|
41
|
-
end
|
42
|
-
|
43
|
-
private
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
end
|