haml_coffee_assets 1.16.0 → 1.16.1

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: c69a78d37958a5eb8100e64f3ce99aa845534740
4
- data.tar.gz: 064a19166880278d3cc92fc1794d7c260310ead7
3
+ metadata.gz: 6edc5db2638eb51d27678e76b30a85cd536954e3
4
+ data.tar.gz: 864656538126891ff583377194315e3d87315e59
5
5
  SHA512:
6
- metadata.gz: 70e76fc9f0b9e573cf51763b1a266ece1fefab977a7efdccb8c92a90ba310931d693683ea6b8a47266b91e7c13324596140485e39565d71f1d775e206332896d
7
- data.tar.gz: 5a4249bcd796aea65aba75a2b40983f412e23b850ee86416f986e278704ccd4522313203987c83f4e1578970b031e3414c1bfda84deb8f898bb499776960508f
6
+ metadata.gz: 08168a2692a32dc5b4f1ba2320a9a0b815ec6ee687a6086a93804ed4f12e0833bc6e6baba361b3a0fcb04aedd4b18451a52f843fdcc4f07c8cccc1a1ebde501a
7
+ data.tar.gz: cb15534a4c761687f801965326b8a3496675280fcec4f9c73987a9b5c2d3033c875237c24b835dffa72266271edadd953c5385d9f873cf544f3071583e0b0b8c
data/README.md CHANGED
@@ -48,8 +48,7 @@ group :assets do
48
48
  gem 'execjs'
49
49
  end
50
50
  ```
51
-
52
- And require the `hamlcoffee.js` in your `app/assets/javascripts/templates/context.js.coffee`:
51
+ (note that Rails 4.0 [removed the assets group](https://github.com/rails/rails/commit/49c4af43ec5819d8f5c1a91f9b84296c927ce6e7) from Gemfile and so you don't need that line) and require the `hamlcoffee.js` in your `app/assets/javascripts/templates/context.js.coffee`:
53
52
 
54
53
  ```coffeescript
55
54
  #= require hamlcoffee
@@ -515,7 +514,7 @@ example.
515
514
 
516
515
  ## Author
517
516
 
518
- Developed by Michael Kessler, [mksoft.ch](https://mksoft.ch).
517
+ Developed by Michael Kessler, [FlinkFinger](http://www.flinkfinger.com).
519
518
 
520
519
  If you like Haml Coffee Assets, you can watch the repository at [GitHub](https://github.com/netzpirat/haml_coffee_assets)
521
520
  and follow [@netzpirat](https://twitter.com/#!/netzpirat) on Twitter for project updates.
@@ -1,36 +1,42 @@
1
- # Monkey patches for rails to support our template engine.
2
- # Hopefully these fixes will make it into rails or we find a
3
- # better way to avoid this.
4
- #
5
- # TODO: Don't monkey patch rails
6
-
7
1
  # See patch notes inline
8
- class ::ActionView::Template
2
+ module HamlCoffeeAssets::ActionView
3
+ module Patches
4
+ def self.included(base)
5
+ base.send :include, InstanceMethods
6
+ base.send :alias_method, :handle_render_error_without_patch, :handle_render_error
7
+ base.send :alias_method, :handle_render_error, :handle_render_error_with_patch
8
+ end
9
9
 
10
- # Patch, it's almost exaclty the same with a small tweak
11
- def handle_render_error(view, e) #:nodoc:
12
- if e.is_a?(::ActionView::Template::Error)
13
- e.sub_template_of(self)
14
- raise e
15
- else
16
- assigns = view.respond_to?(:assigns) ? view.assigns : {}
17
- template = self
10
+ module InstanceMethods
11
+ # Patch, it's almost exaclty the same with a small tweak
12
+ def handle_render_error_with_patch(view, e) #:nodoc:
13
+ if e.is_a?(::ActionView::Template::Error)
14
+ e.sub_template_of(self)
15
+ raise e
16
+ else
17
+ assigns = view.respond_to?(:assigns) ? view.assigns : {}
18
+ template = self
18
19
 
19
- # Here's the patch: if the javascript runtime throws an error
20
- # during compilation, we get to this handler but our view
21
- # doesn't have a lookup_context - thus throwing a very hard
22
- # to debug error in Template#refresh. To circumvent, ensure the
23
- # view responds to lookup_context before refreshing.
24
- if view.respond_to?(:lookup_context) and template.source.nil?
25
- template = refresh(view)
26
- template.encode!
27
- end
20
+ # Here's the patch: if the javascript runtime throws an error
21
+ # during compilation, we get to this handler but our view
22
+ # doesn't have a lookup_context - thus throwing a very hard
23
+ # to debug error in Template#refresh. To circumvent, ensure the
24
+ # view responds to lookup_context before refreshing.
25
+ if view.respond_to?(:lookup_context) and template.source.nil?
26
+ template = refresh(view)
27
+ template.encode! if template.respond_to?(:encode!)
28
+ end
28
29
 
29
- if Rails::VERSION::STRING < "4"
30
- raise ::ActionView::Template::Error.new(template, assigns, e)
31
- else
32
- raise ::ActionView::Template::Error.new(template, e)
30
+ if ::Rails::VERSION::STRING < "4"
31
+ raise ::ActionView::Template::Error.new(template, assigns, e)
32
+ else
33
+ raise ::ActionView::Template::Error.new(template, e)
34
+ end
35
+ end
33
36
  end
34
37
  end
38
+
35
39
  end
36
40
  end
41
+
42
+ ::ActionView::Template.send :include, HamlCoffeeAssets::ActionView::Patches if defined? ::ActionView::Template
@@ -1,4 +1,5 @@
1
1
  require "action_view"
2
+ require 'action_view/template/resolver'
2
3
 
3
4
  module HamlCoffeeAssets
4
5
  module ActionView
@@ -7,7 +8,7 @@ module HamlCoffeeAssets
7
8
  # in it would normally be a fallback for all formats.
8
9
  #
9
10
  class Resolver < ::ActionView::FileSystemResolver
10
- def find_templates(name, prefix, partial, details)
11
+ def find_templates(name, prefix, partial, details, outside_app_allowed = false)
11
12
  if details[:formats].include?(:html)
12
13
  clear_cache if ::Rails.env == "development"
13
14
  super
@@ -1,5 +1,5 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module HamlCoffeeAssets
4
- VERSION = '1.16.0' unless defined?(HamlCoffeeAssets::VERSION)
4
+ VERSION = '1.16.1' unless defined?(HamlCoffeeAssets::VERSION)
5
5
  end
@@ -454,7 +454,7 @@ require.define("/haml-coffee.coffee",function(require,module,exports,__dirname,_
454
454
  indent = require('./util/text').indent;
455
455
 
456
456
  module.exports = HamlCoffee = (function() {
457
- HamlCoffee.VERSION = '1.13.5';
457
+ HamlCoffee.VERSION = '1.13.6';
458
458
 
459
459
  function HamlCoffee(options) {
460
460
  var segment, segments, _base, _base1, _base10, _base11, _base12, _base13, _base2, _base3, _base4, _base5, _base6, _base7, _base8, _base9, _i, _len;
@@ -671,6 +671,7 @@ require.define("/haml-coffee.coffee",function(require,module,exports,__dirname,_
671
671
  result = line.match(/^(\s*)(.*)/);
672
672
  ws = result[1];
673
673
  expression = result[2];
674
+ this.currentIndent = ws.length;
674
675
  if (/^\s*$/.test(line)) {
675
676
  continue;
676
677
  }
@@ -680,7 +681,7 @@ require.define("/haml-coffee.coffee",function(require,module,exports,__dirname,_
680
681
  expression += ' ' + attributes.match(/^\s*(.*?)(\s+\|\s*)?$/)[1];
681
682
  this.lineNumber++;
682
683
  }
683
- while (/^-#/.test(expression) && RegExp("^\\s{" + (this.previousIndent + (this.tabSize || 2)) + "}").test(lines[0]) && lines.length > 0) {
684
+ while (/^-#/.test(expression) && RegExp("^\\s{" + (this.currentIndent + (this.tabSize || 2)) + "}").test(lines[0]) && lines.length > 0) {
684
685
  lines.shift();
685
686
  this.lineNumber++;
686
687
  }
@@ -691,7 +692,6 @@ require.define("/haml-coffee.coffee",function(require,module,exports,__dirname,_
691
692
  this.lineNumber++;
692
693
  }
693
694
  }
694
- this.currentIndent = ws.length;
695
695
  if (this.indentChanged()) {
696
696
  this.updateTabSize();
697
697
  this.updateBlockLevel();
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml_coffee_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.0
4
+ version: 1.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Kessler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-03 00:00:00.000000000 Z
11
+ date: 2016-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-script
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tilt
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.1'
33
+ version: '1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.1'
40
+ version: '1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sprockets
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: '2'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: '2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -68,11 +68,14 @@ dependencies:
68
68
  version: '0'
69
69
  description: Compile Haml CoffeeScript templates in the Rails asset pipeline.
70
70
  email:
71
- - michi@netzpiraten.ch
71
+ - michi@flinkfinger.com
72
72
  executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
+ - LICENSE
77
+ - README.md
78
+ - lib/haml_coffee_assets.rb
76
79
  - lib/haml_coffee_assets/action_view/patches.rb
77
80
  - lib/haml_coffee_assets/action_view/resolver.rb
78
81
  - lib/haml_coffee_assets/action_view/template_handler.rb
@@ -82,14 +85,10 @@ files:
82
85
  - lib/haml_coffee_assets/rails/engine.rb
83
86
  - lib/haml_coffee_assets/tilt/template_handler.rb
84
87
  - lib/haml_coffee_assets/version.rb
85
- - lib/haml_coffee_assets/version.rbc
86
- - lib/haml_coffee_assets.rb
87
88
  - lib/js/haml_coffee_assets.js
88
89
  - lib/js/hamlcoffee.js
89
90
  - vendor/assets/javascripts/hamlcoffee.js.coffee.erb
90
91
  - vendor/assets/javascripts/hamlcoffee_amd.js.coffee.erb
91
- - LICENSE
92
- - README.md
93
92
  homepage: https://github.com/netzpirat/haml_coffee_assets
94
93
  licenses:
95
94
  - MIT
@@ -102,7 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
101
  requirements:
103
102
  - - ">="
104
103
  - !ruby/object:Gem::Version
105
- version: '0'
104
+ version: 1.9.3
106
105
  required_rubygems_version: !ruby/object:Gem::Requirement
107
106
  requirements:
108
107
  - - ">="
@@ -110,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
109
  version: 1.3.6
111
110
  requirements: []
112
111
  rubyforge_project: haml_coffee_assets
113
- rubygems_version: 2.1.11
112
+ rubygems_version: 2.4.8
114
113
  signing_key:
115
114
  specification_version: 4
116
115
  summary: Haml CoffeeScript templates
@@ -1,180 +0,0 @@
1
- !RBIX
2
- 9595534255132031488
3
- x
4
- M
5
- 1
6
- n
7
- n
8
- x
9
- 10
10
- __script__
11
- i
12
- 28
13
- 99
14
- 7
15
- 0
16
- 65
17
- 49
18
- 1
19
- 2
20
- 13
21
- 99
22
- 12
23
- 7
24
- 2
25
- 12
26
- 7
27
- 3
28
- 12
29
- 65
30
- 12
31
- 49
32
- 4
33
- 4
34
- 15
35
- 49
36
- 2
37
- 0
38
- 15
39
- 2
40
- 11
41
- I
42
- 6
43
- I
44
- 0
45
- I
46
- 0
47
- I
48
- 0
49
- n
50
- p
51
- 5
52
- x
53
- 16
54
- HamlCoffeeAssets
55
- x
56
- 11
57
- open_module
58
- x
59
- 15
60
- __module_init__
61
- M
62
- 1
63
- n
64
- n
65
- x
66
- 16
67
- HamlCoffeeAssets
68
- i
69
- 48
70
- 5
71
- 66
72
- 26
73
- 93
74
- 0
75
- 15
76
- 29
77
- 21
78
- 0
79
- 45
80
- 0
81
- 1
82
- 7
83
- 2
84
- 3
85
- 98
86
- 3
87
- 3
88
- 30
89
- 8
90
- 27
91
- 25
92
- 92
93
- 0
94
- 27
95
- 8
96
- 32
97
- 15
98
- 7
99
- 4
100
- 8
101
- 33
102
- 1
103
- 9
104
- 38
105
- 1
106
- 8
107
- 47
108
- 65
109
- 7
110
- 2
111
- 7
112
- 5
113
- 64
114
- 49
115
- 6
116
- 2
117
- 11
118
- I
119
- 4
120
- I
121
- 0
122
- I
123
- 0
124
- I
125
- 0
126
- n
127
- p
128
- 7
129
- x
130
- 16
131
- HamlCoffeeAssets
132
- n
133
- x
134
- 7
135
- VERSION
136
- x
137
- 22
138
- vm_const_defined_under
139
- s
140
- 8
141
- constant
142
- s
143
- 5
144
- 0.8.2
145
- x
146
- 9
147
- const_set
148
- p
149
- 5
150
- I
151
- 2
152
- I
153
- 4
154
- I
155
- 2f
156
- I
157
- 0
158
- I
159
- 30
160
- x
161
- 78
162
- /Users/michi/Repositories/haml_coffee_assets/lib/haml_coffee_assets/version.rb
163
- p
164
- 0
165
- x
166
- 13
167
- attach_method
168
- p
169
- 3
170
- I
171
- 0
172
- I
173
- 3
174
- I
175
- 1c
176
- x
177
- 78
178
- /Users/michi/Repositories/haml_coffee_assets/lib/haml_coffee_assets/version.rb
179
- p
180
- 0