twitter-bootstrap-components-rails 0.2.5 → 0.3.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
  SHA1:
3
- metadata.gz: 0085bccb28902a03e490cce44f3ea47c3bfc6a8b
4
- data.tar.gz: f4ce56c35df79ce21c828a39c26c5cdf4cac9f01
3
+ metadata.gz: e89c84677d6c6b601dece0e5f97866b3deee9f55
4
+ data.tar.gz: 762479eefa90cbd162ba34dd412a8be19ddeabd4
5
5
  SHA512:
6
- metadata.gz: f08646c4570d12c21468c35c17b7b65414b74f517eabb7f06c2fb5521eed24e6079d2fbebb7eff0934b3d70c244ec3f9f2b675746d239e1c7d4f3b6830a71501
7
- data.tar.gz: a56172889aba09b539206e4fae240f2ab239dca3073f41bb61fc52f64ca7f73643b26a218dafbbfc820ab7adb3a5da8819f2bce7b0254410353f3badfbbe2731
6
+ metadata.gz: 7e4b163ce6f3021792bd4c2db461c4c93aaa4edff8ca8fe8130a2a1d351c3c2273e0b3e730366e30810702923559d8bf5f595e6b89062007914617387aead3f6
7
+ data.tar.gz: 85a1583bbaf1c8742732fffc925f21fa5deb36a5c06f98cd034858c15220fc4fc0cc42788530618a32a0ac9444cbc81f8700dd22062b0cf59a253b2b687dd810
@@ -0,0 +1,38 @@
1
+ module Twitter
2
+ module Bootstrap
3
+ module Components
4
+ module V3
5
+ class ResponsiveEmbed < Base
6
+ ALLOWED_ASPECT_RATIOS = [:'16by9', :'4by3']
7
+
8
+ private
9
+
10
+ def view_locals
11
+ {
12
+ block_output: @block_output,
13
+ context: context,
14
+ source_url: @options[:source_url],
15
+ aspect_ratio: aspect_ratio
16
+ }
17
+ end
18
+
19
+ def context
20
+ @options[:context]
21
+ end
22
+
23
+ def aspect_ratio
24
+ @options[:aspect_ratio]
25
+ end
26
+
27
+ def aspect_ratio
28
+ @aspect_ratio = @options[:aspect_ratio] || :'16by9'
29
+ unless ALLOWED_ASPECT_RATIOS.include?(@aspect_ratio)
30
+ raise "aspect_ratio must be one of (#{ALLOWED_ASPECT_RATIOS}). #{@aspect_ratio} was given."
31
+ end
32
+ @aspect_ratio
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -32,6 +32,10 @@ module Twitter
32
32
  Twitter::Bootstrap::Components::V3::Thumbnail.new(self, options, &block).perform
33
33
  end
34
34
 
35
+ def bootstrap_responsive_embed(options = {}, &block)
36
+ Twitter::Bootstrap::Components::V3::ResponsiveEmbed.new(self, options, &block).perform
37
+ end
38
+
35
39
  # add ons
36
40
  def bootstrap_form_for(object, *args, &block)
37
41
  simple_form_for(object, *args, &block)
@@ -0,0 +1,2 @@
1
+ %div{ class: "embed-responsive embed-responsive-#{aspect_ratio}" }
2
+ %iframe.embed-responsive-item{ src: source_url }
@@ -2,7 +2,7 @@ module Twitter
2
2
  module Bootstrap
3
3
  module Components
4
4
  module Rails
5
- VERSION = '0.2.5'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-bootstrap-components-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-19 00:00:00.000000000 Z
11
+ date: 2017-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -143,6 +143,7 @@ files:
143
143
  - app/components/twitter/bootstrap/components/v3/button.rb
144
144
  - app/components/twitter/bootstrap/components/v3/button_group.rb
145
145
  - app/components/twitter/bootstrap/components/v3/media_object.rb
146
+ - app/components/twitter/bootstrap/components/v3/responsive_embed.rb
146
147
  - app/components/twitter/bootstrap/components/v3/responsive_media_object.rb
147
148
  - app/components/twitter/bootstrap/components/v3/thumbnail.rb
148
149
  - app/components/twitter/bootstrap/components/v4/alert.rb
@@ -169,6 +170,7 @@ files:
169
170
  - app/views/twitter/bootstrap/components/v3/_button.haml
170
171
  - app/views/twitter/bootstrap/components/v3/_button_group.html.haml
171
172
  - app/views/twitter/bootstrap/components/v3/_media_object.html.haml
173
+ - app/views/twitter/bootstrap/components/v3/_responsive_embed.html.haml
172
174
  - app/views/twitter/bootstrap/components/v3/_responsive_media_object.html.haml
173
175
  - app/views/twitter/bootstrap/components/v3/_thumbnail.html.haml
174
176
  - app/views/twitter/bootstrap/components/v4/_alert.html.haml
@@ -211,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
213
  version: '0'
212
214
  requirements: []
213
215
  rubyforge_project:
214
- rubygems_version: 2.5.1
216
+ rubygems_version: 2.6.11
215
217
  signing_key:
216
218
  specification_version: 4
217
219
  summary: Twitter Bootstrap Components for Rails.