cells-haml 0.0.2 → 0.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afb505222abec10007aa42aba06dc1471e13bd35
|
4
|
+
data.tar.gz: d6cf9966745815f0831df6b914757f42c91791d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfdf392451a738e1de7266b25c36f0707463cbc412d61f574da61258d3e89d1b33c2d25ff919796d9dff08ad043f6f51e0f5c4661fd26c1e673cef013aa28ddb
|
7
|
+
data.tar.gz: 4b2c625bd551d555979a71b632cf0f522343d4c4ebb7c200dc6c644ae9fd8736247451b8c09e4f70e161f386337709de508df655657609bec94f94aac34a2302
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
#gem "cells", :github => "apotonick/cells"
|
6
|
+
gem "cells", path: "../../cells"
|
7
|
+
gem "appraisal"
|
8
|
+
gem "railties", "~> 3.2.0"
|
9
|
+
gem "activemodel"
|
10
|
+
gem "minitest", "~> 4.0"
|
11
|
+
gem "tilt", "~> 1.4"
|
12
|
+
gem "tzinfo"
|
13
|
+
|
14
|
+
gemspec :path => "../"
|
15
|
+
|
16
|
+
# gem "erbse", path: "../../erbse"
|
data/lib/cell/haml.rb
CHANGED
@@ -2,87 +2,87 @@ require 'tilt/haml'
|
|
2
2
|
|
3
3
|
module Cell
|
4
4
|
module Haml
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
5
|
+
# def output_buffer_with_haml
|
6
|
+
# return haml_buffer.buffer if is_haml?
|
7
|
+
# output_buffer_without_haml
|
8
|
+
# end
|
9
|
+
|
10
|
+
# def set_output_buffer_with_haml(new_buffer)
|
11
|
+
# if is_haml?
|
12
|
+
# if ::Haml::Util.rails_xss_safe? && new_buffer.is_a?(ActiveSupport::SafeBuffer)
|
13
|
+
# new_buffer = String.new(new_buffer)
|
14
|
+
# end
|
15
|
+
# haml_buffer.buffer = new_buffer
|
16
|
+
# else
|
17
|
+
# set_output_buffer_without_haml new_buffer
|
18
|
+
# end
|
19
|
+
# end
|
20
|
+
|
21
|
+
|
22
|
+
# def self.included(base)
|
23
|
+
# base.class_eval do
|
24
|
+
# alias_method :output_buffer_without_haml, :output_buffer
|
25
|
+
# alias_method :output_buffer, :output_buffer_with_haml
|
26
|
+
|
27
|
+
# alias_method :set_output_buffer_without_haml, :output_buffer=
|
28
|
+
# alias_method :output_buffer=, :set_output_buffer_with_haml
|
29
|
+
# end
|
30
|
+
# end
|
31
|
+
|
32
|
+
# # TODO: remove the concept of output buffers and just return block's result!
|
33
|
+
# class OutputBuffer < String
|
34
|
+
# end
|
35
|
+
|
36
|
+
|
37
|
+
# def with_output_buffer(buf = nil)
|
38
|
+
# unless buf
|
39
|
+
# buf = OutputBuffer.new
|
40
|
+
# end
|
41
|
+
# self.output_buffer, old_buffer = buf, output_buffer
|
42
|
+
# yield
|
43
|
+
# output_buffer
|
44
|
+
# ensure
|
45
|
+
# self.output_buffer = old_buffer
|
46
|
+
# end
|
47
|
+
|
48
|
+
|
49
|
+
# # generic ERB HAML HELPERS>>>>>>
|
50
|
+
# def capture(*args,&block)
|
51
|
+
# value = nil
|
52
|
+
# buffer = with_output_buffer() { value = yield(*args) }
|
53
|
+
# if string = buffer.presence || value and string.is_a?(String)
|
54
|
+
# return string
|
55
|
+
# end
|
56
|
+
# end
|
57
|
+
|
58
|
+
# # From FormTagHelper. why do they escape every possible string? why?
|
59
|
+
# def form_tag_in_block(html_options, &block)
|
60
|
+
# content = capture(&block)
|
61
|
+
# form_tag_with_body(html_options, content)
|
62
|
+
# end
|
63
|
+
|
64
|
+
# def form_tag_with_body(html_options, content)
|
65
|
+
# "#{form_tag_html(html_options)}" << content.to_s << "</form>"
|
66
|
+
# end
|
67
|
+
|
68
|
+
# def form_tag_html(html_options)
|
69
|
+
# extra_tags = extra_tags_for_form(html_options)
|
70
|
+
# "#{tag(:form, html_options, true) + extra_tags}"
|
71
|
+
# end
|
72
|
+
|
73
|
+
# # Rails 4.0, TagHelper.
|
74
|
+
# def tag_option(key, value, escape)
|
75
|
+
# super(key, value, false)
|
76
|
+
# end
|
77
|
+
|
78
|
+
# def content_tag_string(name, content, options, escape=true)
|
79
|
+
# super(name, content, options, false)
|
80
|
+
# end
|
81
81
|
end
|
82
82
|
|
83
|
-
ViewModel.class_eval do
|
84
|
-
|
85
|
-
end
|
83
|
+
# ViewModel.class_eval do
|
84
|
+
# include Haml
|
85
|
+
# end
|
86
86
|
|
87
87
|
ViewModel.template_engine = :haml
|
88
88
|
end
|
data/lib/cell/haml/version.rb
CHANGED
data/test/haml_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cells-haml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- README.md
|
83
83
|
- Rakefile
|
84
84
|
- cells-haml.gemspec
|
85
|
+
- gemfiles/rails_3.2-tilt-1.4.gemfile
|
85
86
|
- gemfiles/rails_4.2-tilt-1.4.gemfile
|
86
87
|
- gemfiles/rails_4.2-tilt-2.0.gemfile
|
87
88
|
- gemfiles/rails_4.2-tilt-3.0.gemfile
|