cells-hamlit2 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b36ce2958e1d643066ca1afd006812ca44b07cd5643ac790549f2216e18dd7fe
4
- data.tar.gz: 8baeaa3ec13f760c3c3d3b1a1ddd447114f896c6490a7f13dc0c88577bf5ac37
3
+ metadata.gz: 07404bf091e84e30f38162a22a53eb332f8a231af1e75d1a784d43834d5ba42f
4
+ data.tar.gz: 4eee65966f4cdfb1f94379c63781db2ab7c84a3e7c99448aa4d38f8c1ce43cd9
5
5
  SHA512:
6
- metadata.gz: 050da4421b37a809c9d3f293ed860cd058748a413006b181ac1ddbdf903f51d29654e18c5d37c2b42dcf2de3eeabe7fe81ad808d983743127754715f7ec6a61a
7
- data.tar.gz: 3433dd16695d0028a1700b4351bbaadd55797c47457c605ae5c12080f8f60b51a8c8db00a49e41eefd8ee225cadcac2fd1d98c53953a4204f707b82372ce837e
6
+ metadata.gz: e40971e2eba5c61cc6597eb2a254f65cea075de577bbaa6aba4519576c2912e6ee77222e37371ceded70b755a409091569270d2d765ef2f0296da908afac46a0
7
+ data.tar.gz: d4d0cebf20419cd532ccc6d49e9f92610f80434a1a5d3ba3eef892bfe7a5f17a993bbd5d296b61441d4115391d5fcc6a50770c8bae6c8b0de9355421c388e26a
@@ -1,8 +1,13 @@
1
+ language: ruby
1
2
  cache: bundler
3
+ branches:
4
+ only:
5
+ - master
2
6
  rvm:
3
- - 2.0
4
- - 2.1
5
- - 2.2
7
+ - 2.1.10
8
+ - 2.2.9
9
+ - 2.3.6
10
+ - 2.4.3
6
11
  gemfile:
7
12
  - gemfiles/rails_4.2-tilt-1.4.gemfile
8
13
  - gemfiles/rails_4.2-tilt-2.0.gemfile
data/CHANGES.md CHANGED
@@ -1,6 +1,10 @@
1
+ # 0.2.0
2
+
3
+ * Fix `surround` helper
4
+
1
5
  # 0.1.1
2
6
 
3
- * Now using `hamlit-block` for capturing.
7
+ * Make initial cells-hamlit2 release
4
8
 
5
9
  # 0.1.0
6
10
 
data/Gemfile CHANGED
@@ -3,9 +3,9 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in cells-haml.gemspec
4
4
  gemspec
5
5
 
6
- gem 'cells', github: 'apotonick/cells'
7
6
  gem 'railties'
8
7
  gem 'actionpack'
9
8
  gem 'actionview'
10
9
 
11
- gem "minitest-line"
10
+ gem 'minitest-line'
11
+ gem 'pry'
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # cells-hamlit2
1
+ # cells-hamlit2 [![Build Status](https://travis-ci.org/hamlit/cells-hamlit2.svg?branch=master)](https://travis-ci.org/hamlit/cells-hamlit2)
2
2
 
3
3
  Temporary workaround version of [cells-hamlit](https://github.com/trailblazer/cells-hamlit) until https://github.com/trailblazer/cells-hamlit/issues/6 is closed.
4
4
 
@@ -17,7 +17,8 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "cells", "~> 4.0"
20
+ spec.add_dependency "cells", ">= 4.0.1", "< 6.0.0"
21
+ spec.add_dependency "cells-rails"
21
22
  spec.add_dependency "hamlit"
22
23
  spec.add_development_dependency "bundler"
23
24
  spec.add_development_dependency "rake"
@@ -2,13 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- # gem "cells", :github => "apotonick/cells"
6
- #gem "cells", path: "../../cells"
7
- gem "railties", "~> 4.2.0"
5
+ gem "railties", "~> 4.2"
8
6
  gem "activemodel"
9
7
  gem "minitest", "~> 5.2"
10
8
  gem "tilt", "~> 1.4"
11
9
 
12
10
  gemspec :path => "../"
13
11
 
14
- gem "hamlit"
12
+ gem "hamlit"
@@ -2,14 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- # gem "cells", :github => "apotonick/cells"
6
- # gem "cells", path: "../../cells"
7
- gem "cells", github: "apotonick/cells"
8
- gem "railties", "~> 4.2.0"
5
+ gem "railties", "~> 4.2"
9
6
  gem "activemodel"
10
7
  gem "minitest", "~> 5.2"
11
8
  gem "tilt", "~> 2.0"
12
9
 
13
10
  gemspec :path => "../"
14
11
 
15
- gem "hamlit"
12
+ gem "hamlit"
@@ -2,6 +2,15 @@ require "hamlit"
2
2
 
3
3
  module Cell
4
4
  module Hamlit
5
+ def self.included(base)
6
+ begin
7
+ require "hamlit/rails_helpers"
8
+ rescue LoadError
9
+ else
10
+ base.include ::Hamlit::RailsHelpers
11
+ end
12
+ end
13
+
5
14
  def template_options_for(options)
6
15
  {
7
16
  escape_html: false,
@@ -34,11 +43,15 @@ module Cell
34
43
  def capture(*args)
35
44
  value = nil
36
45
  buffer = with_output_buffer { value = yield(*args) }
37
- buffer.to_s if buffer.size > 0
38
- value
46
+ if buffer.size > 0
47
+ buffer.to_s
48
+ else
49
+ value
50
+ end
39
51
  end
40
52
 
41
53
  def render_template(*)
54
+ @output_buffer ||= nil # suppress uninitialized instance variable warning
42
55
  old_output_buffer = @output_buffer
43
56
  super
44
57
  ensure
@@ -1,5 +1,5 @@
1
1
  module Cell
2
2
  module Hamlit
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -0,0 +1 @@
1
+ /log/*.log
@@ -1,6 +1,6 @@
1
1
  Hallo
2
2
 
3
- - bla = 1
3
+ - _ = 1
4
4
 
5
5
  - hidden = capture do
6
6
  Hidden!
@@ -0,0 +1,9 @@
1
+ Hallo
2
+
3
+ - _ = 1
4
+
5
+ %p
6
+ More
7
+
8
+ = surround "(", ")" do
9
+ Hidden!
@@ -1,8 +1,7 @@
1
1
  class SongCell < Cell::ViewModel
2
2
  self.view_paths = ["test/dummy/app/cells"]
3
3
 
4
-
5
- include Cell::Hamlit
4
+ include ::Cell::Hamlit
6
5
 
7
6
  def protect_against_forgery?
8
7
  false
@@ -24,10 +23,6 @@ class SongCell < Cell::ViewModel
24
23
  render
25
24
  end
26
25
 
27
- def with_capture
28
- render
29
- end
30
-
31
26
  def with_form_tag
32
27
  form_tag("/songs") + content_tag(:span) + "</form>"
33
28
  end
@@ -52,6 +47,10 @@ class SongCell < Cell::ViewModel
52
47
  render
53
48
  end
54
49
 
50
+ def with_surround
51
+ render
52
+ end
53
+
55
54
  private
56
55
  def cap
57
56
  "yay, #{with_output_buffer { yield } }"
@@ -14,8 +14,8 @@ module Dummy
14
14
  config.secret_key_base = SecureRandom.uuid
15
15
 
16
16
  # enable asset pipeline as in development.
17
- config.assets.enabled = true
18
- config.assets.compile = true
17
+ # config.assets.enabled = true
18
+ # config.assets.compile = true
19
19
  config.cache_classes = true
20
20
 
21
21
  # Show full error reports and disable caching
@@ -11,7 +11,7 @@ class HamlitTest < MiniTest::Spec
11
11
  it { song_cell.(:render_inside_block).must_equal "0\n1\n2\n" }
12
12
 
13
13
  # URL helpers work in cell instance.
14
- it { song_cell.songs_path.must_equal "/songs" }
14
+ it { skip; song_cell.songs_path.must_equal "/songs" }
15
15
 
16
16
  # content_tag { }
17
17
  it { song_cell.(:with_content_tag).must_equal "<div>Beachparty</div>\n" }
@@ -68,6 +68,17 @@ More
68
68
  </p>
69
69
  Hidden!
70
70
 
71
+ }
72
+ end
73
+ end
74
+
75
+ describe "block surround" do
76
+ it do
77
+ song_cell.(:with_surround).must_equal %{Hallo
78
+ <p>
79
+ More
80
+ </p>
81
+ (Hidden!)
71
82
  }
72
83
  end
73
84
  end
@@ -7,4 +7,4 @@ ENV['RAILS_ENV'] = 'test'
7
7
  require "cells"
8
8
  require_relative 'dummy/config/environment'
9
9
 
10
- require "cells-hamlit"
10
+ require "cells-hamlit2"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cells-hamlit2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
@@ -9,22 +9,42 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-22 00:00:00.000000000 Z
12
+ date: 2017-12-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cells
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: 4.0.1
21
+ - - "<"
19
22
  - !ruby/object:Gem::Version
20
- version: '4.0'
23
+ version: 6.0.0
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - "~>"
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ version: 4.0.1
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: 6.0.0
34
+ - !ruby/object:Gem::Dependency
35
+ name: cells-rails
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
26
39
  - !ruby/object:Gem::Version
27
- version: '4.0'
40
+ version: '0'
41
+ type: :runtime
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
28
48
  - !ruby/object:Gem::Dependency
29
49
  name: hamlit
30
50
  requirement: !ruby/object:Gem::Requirement
@@ -83,15 +103,13 @@ files:
83
103
  - README.md
84
104
  - Rakefile
85
105
  - cells-hamlit.gemspec
86
- - gemfiles/rails_3.2-tilt-1.4.gemfile
87
- - gemfiles/rails_4.0-tilt-1.4.gemfile
88
106
  - gemfiles/rails_4.2-tilt-1.4.gemfile
89
107
  - gemfiles/rails_4.2-tilt-2.0.gemfile
90
- - gemfiles/rails_4.2-tilt-3.0.gemfile
91
108
  - lib/cell/hamlit.rb
92
109
  - lib/cell/hamlit/version.rb
93
110
  - lib/cells-hamlit2.rb
94
111
  - test/cell_generator_test.rb
112
+ - test/dummy/.gitignore
95
113
  - test/dummy/Rakefile
96
114
  - test/dummy/app/cells/song/render_in_render.haml
97
115
  - test/dummy/app/cells/song/render_in_render_2.haml
@@ -100,6 +118,7 @@ files:
100
118
  - test/dummy/app/cells/song/with_content_tag.haml
101
119
  - test/dummy/app/cells/song/with_content_tag_and_content_tag.haml
102
120
  - test/dummy/app/cells/song/with_form_tag_and_content_tag.haml
121
+ - test/dummy/app/cells/song/with_surround.haml
103
122
  - test/dummy/app/cells/song_cell.rb
104
123
  - test/dummy/app/controllers/application_controller.rb
105
124
  - test/dummy/config.ru
@@ -132,12 +151,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
151
  version: '0'
133
152
  requirements: []
134
153
  rubyforge_project:
135
- rubygems_version: 2.7.2
154
+ rubygems_version: 2.7.3
136
155
  signing_key:
137
156
  specification_version: 4
138
157
  summary: Temporary Hamlit integration for Cells
139
158
  test_files:
140
159
  - test/cell_generator_test.rb
160
+ - test/dummy/.gitignore
141
161
  - test/dummy/Rakefile
142
162
  - test/dummy/app/cells/song/render_in_render.haml
143
163
  - test/dummy/app/cells/song/render_in_render_2.haml
@@ -146,6 +166,7 @@ test_files:
146
166
  - test/dummy/app/cells/song/with_content_tag.haml
147
167
  - test/dummy/app/cells/song/with_content_tag_and_content_tag.haml
148
168
  - test/dummy/app/cells/song/with_form_tag_and_content_tag.haml
169
+ - test/dummy/app/cells/song/with_surround.haml
149
170
  - test/dummy/app/cells/song_cell.rb
150
171
  - test/dummy/app/controllers/application_controller.rb
151
172
  - test/dummy/config.ru
@@ -1,15 +0,0 @@
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 "railties", "~> 3.2.0"
8
- gem "activemodel"
9
- gem "minitest", "~> 4.0"
10
- gem "tilt", "~> 1.4"
11
- gem "tzinfo"
12
-
13
- gemspec :path => "../"
14
-
15
- gem "hamlit"
@@ -1,14 +0,0 @@
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 "railties", "~> 4.0.0"
8
- gem "activemodel"
9
- gem "minitest", "~> 4.0"
10
- gem "tilt", "~> 1.4"
11
-
12
- gemspec :path => "../"
13
-
14
- gem "hamlit"
@@ -1,14 +0,0 @@
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 "railties", "~> 4.2.0"
8
- gem "activemodel"
9
- gem "minitest", "~> 5.2"
10
- gem "tilt", "~> 3.0"
11
-
12
- gemspec :path => "../"
13
-
14
- gem "hamlit"