picture_tag 1.0.2 → 1.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: 07303344956dfbc17835db1ed6b262af3f3f8c85
4
- data.tar.gz: 928988902d49cd4e034f2c9085111396cdbc6741
3
+ metadata.gz: 4696873e437ef6264ca7b71dbc69e4ae404a73bb
4
+ data.tar.gz: 3be7abdbb509e1d577438c3e7cdbbc723d06189d
5
5
  SHA512:
6
- metadata.gz: 6c2421d15f25135c59dcfa2a89c6403aef6f7248529acbb0a0c824e5e5923550df89fc48fb04d8096a4c5d3da7f3bf7f5b25a9fe6d25041983decbee44b1c44d
7
- data.tar.gz: 855abf42b82ce6d8584ec41a8bb97661402d3d4406563f3c9a4fcab641fe33cd480e31ff39a3862f97303402426ff600e279e2b5bf747b1ed351881f731f0de0
6
+ metadata.gz: f08f6720763c18d504994b2c67af50f50a915f94a0e389b48a56ec2a95ac812bc37abe93eb66446b6c8135c69765b1e84626060d28ed95a7e71e783624e4414d
7
+ data.tar.gz: e90348674340f5525a9f15b8beeee89da2e2f5c72c8473022ac4d72b2a04b27ecf7d892a56af2deb5d18ab3118d08ebdf8689b42a4658e844f18c8690ae3c4a1
data/.travis.yml CHANGED
@@ -1,12 +1,13 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  script: 'bundle exec rake'
4
+ sudo: false
4
5
  rvm:
5
- - 1.9.3
6
+ - 2.2.2
6
7
 
7
8
  notifications:
8
9
  email:
9
10
  recipients:
10
11
  - tomas.celizna@gmail.com
11
12
  on_failure: change
12
- on_success: never
13
+ on_success: never
data/Gemfile CHANGED
@@ -1,5 +1,8 @@
1
1
  source 'https://rubygems.org'
2
- source 'https://rails-assets.org'
3
2
 
4
3
  # Specify your gem's dependencies in simple_form_epic_editor.gemspec
5
4
  gemspec
5
+
6
+ source 'https://rails-assets.org' do
7
+ gem 'rails-assets-picturefill'
8
+ end
data/README.md CHANGED
@@ -6,21 +6,32 @@ Rails helper for `<picture>` tag integrated with [Picturefill](http://scottjehl.
6
6
 
7
7
  ## Installation
8
8
 
9
- Add this line to your application's Gemfile:
9
+ Add this to your application's Gemfile:
10
10
 
11
+ ```ruby
11
12
  gem 'picture_tag'
13
+ source 'https://rails-assets.org' do
14
+ gem 'rails-assets-picturefill'
15
+ end
16
+ ```
12
17
 
13
18
  And then execute:
14
19
 
15
- $ bundle
20
+ ```sh
21
+ $ bundle
22
+ ```
16
23
 
17
24
  Or install it yourself as:
18
25
 
19
- $ gem install picture_tag
26
+ ```sh
27
+ $ gem install picture_tag
28
+ ```
20
29
 
21
30
  To make it work you need to add this to your `application.js`:
22
31
 
23
- //= require picture_tag
32
+ ```JS
33
+ //= require picture_tag
34
+ ```
24
35
 
25
36
  ## Usage
26
37
 
data/lib/picture_tag.rb CHANGED
@@ -1,5 +1,5 @@
1
- require "picture_tag/railtie" if defined?(Rails)
2
- require "picture_tag/engine"
3
- require "picture_tag/version"
1
+ require 'picture_tag/railtie' if defined?(Rails)
2
+ require 'picture_tag/engine'
3
+ require 'picture_tag/version'
4
4
 
5
- require "rails-assets-picturefill"
5
+ require 'rails-assets-picturefill'
@@ -2,7 +2,7 @@ require 'picture_tag/view_helpers'
2
2
 
3
3
  module PictureTag
4
4
  class Railtie < Rails::Railtie
5
- initializer "picture_tag.view_helpers" do
5
+ initializer 'picture_tag.view_helpers' do
6
6
  ActionView::Base.send :include, ViewHelpers
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module PictureTag
2
- VERSION = "1.0.2"
2
+ VERSION = '1.0.3'.freeze
3
3
  end
@@ -2,29 +2,27 @@ require 'action_view'
2
2
 
3
3
  module PictureTag
4
4
  module ViewHelpers
5
-
6
- def self.included klass
5
+ def self.included(klass)
7
6
  klass.class_eval do
8
7
  include ActionView::Context
9
8
  end
10
9
  end
11
10
 
12
- def picture_tag srcset, options={}, &block
11
+ def picture_tag(srcset, options = {}, &block)
13
12
  picture_options = options.except(:image)
14
13
  image_options = options.fetch(:image, {})
15
14
  image_options[:srcset] = srcset
16
15
 
17
16
  content_tag :picture, picture_options do
18
17
  "<!--[if IE 9]><video style='display: none;'><![endif]-->".html_safe +
19
- capture(&block) +
20
- "<!--[if IE 9]></video><![endif]-->".html_safe +
21
- tag("img", image_options)
18
+ capture(&block).html_safe +
19
+ '<!--[if IE 9]></video><![endif]-->'.html_safe +
20
+ tag('img', image_options)
22
21
  end
23
22
  end
24
23
 
25
- def source_tag options={}
24
+ def source_tag(options = {})
26
25
  tag :source, options
27
26
  end
28
-
29
27
  end
30
28
  end
data/picture_tag.gemspec CHANGED
@@ -4,26 +4,26 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'picture_tag/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "picture_tag"
7
+ spec.name = 'picture_tag'
8
8
  spec.version = PictureTag::VERSION
9
- spec.authors = ["Tomas Celizna"]
10
- spec.email = ["tomas.celizna@gmail.com"]
11
- spec.summary = %q{Rails helper for <picture> tag integrated with Picturefill.}
12
- spec.description = %q{Rails helper for <picture> tag integrated with Picturefill.}
13
- spec.homepage = "https://github.com/tomasc/picture_tag"
14
- spec.license = "MIT"
9
+ spec.authors = ['Tomas Celizna']
10
+ spec.email = ['tomas.celizna@gmail.com']
11
+ spec.summary = 'Rails helper for <picture> tag integrated with Picturefill.'
12
+ spec.description = 'Rails helper for <picture> tag integrated with Picturefill.'
13
+ spec.homepage = 'https://github.com/tomasc/picture_tag'
14
+ spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
19
+ spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency "rails", ">= 3.0"
22
- spec.add_dependency "rails-assets-picturefill"
21
+ spec.add_dependency 'rails', '>= 3.0'
22
+ spec.add_dependency 'rails-assets-picturefill'
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.6"
25
- spec.add_development_dependency "coveralls"
26
- spec.add_development_dependency "minitest"
27
- spec.add_development_dependency "minitest-spec"
28
- spec.add_development_dependency "rake"
24
+ spec.add_development_dependency 'bundler'
25
+ spec.add_development_dependency 'coveralls'
26
+ spec.add_development_dependency 'minitest'
27
+ spec.add_development_dependency 'minitest-spec'
28
+ spec.add_development_dependency 'rake'
29
29
  end
@@ -11,7 +11,7 @@ module PictureTag
11
11
 
12
12
  describe '#source_tag' do
13
13
  it 'returns source tag' do
14
- source_tag.must_match Regexp.new("<source.*?\/>")
14
+ source_tag.must_match Regexp.new('<source.*?/>')
15
15
  end
16
16
  end
17
17
 
@@ -24,10 +24,10 @@ module PictureTag
24
24
  let(:image_options) { { alt: alt, src: src } }
25
25
  let(:content) { 'content' }
26
26
  let(:ie9_start) { "<!--[if IE 9]><video style='display: none;'><![endif]-->" }
27
- let(:ie9_end) { "<!--[if IE 9]></video><![endif]-->" }
27
+ let(:ie9_end) { '<!--[if IE 9]></video><![endif]-->' }
28
28
 
29
29
  it 'returns picture tag' do
30
- picture_tag(srcset, image: image_options) { content }.must_match Regexp.new("\\A<picture>.*?</picture>\\z")
30
+ picture_tag(srcset, image: image_options) { content }.must_match Regexp.new('\\A<picture>.*?</picture>\\z')
31
31
  end
32
32
 
33
33
  it 'wraps content in the picture tag' do
@@ -58,6 +58,5 @@ module PictureTag
58
58
  (index_of_ie9_end_tag > index_of_content).must_equal true
59
59
  end
60
60
  end
61
-
62
61
  end
63
62
  end
data/test/test_helper.rb CHANGED
@@ -8,7 +8,7 @@ require 'minitest/spec'
8
8
  require 'picture_tag'
9
9
  require 'rubygems'
10
10
 
11
- if ENV["CI"]
12
- require "coveralls"
11
+ if ENV['CI']
12
+ require 'coveralls'
13
13
  Coveralls.wear!
14
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picture_tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-01 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.6'
47
+ version: '0'
48
48
  type: :development
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: '1.6'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: coveralls
57
57
  requirement: !ruby/object:Gem::Requirement