hisrc-rails 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ rvm:
2
+ - 1.9.2
3
+ - 1.9.3
4
+ - ruby-head
data/hisrc-rails.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'hisrc-rails'
3
- gem.version = '0.1.0'
3
+ gem.version = '0.2.0'
4
4
  gem.authors = 'Mario Uher'
5
5
  gem.email = 'uher.mario@gmail.com'
6
6
  gem.description = 'Make owners of the MacBook Pro with Retina Display happy and provide high-res images within your Rails app.'
@@ -11,7 +11,7 @@ module HisrcRails
11
11
  # and two additional options as well:
12
12
  #
13
13
  # * <tt>:'1x'</tt> - If no 1x option is provided, the +src+ is used.
14
- # * <tt>:'2x'</tt> - If no 2x options is provided, "@2x" is added to
14
+ # * <tt>:'2x'</tt> - If no 2x option is provided, "@2x" is inserted into
15
15
  # the +src+. So "rails.png" becomes "rails@2x.png".
16
16
  #
17
17
  # ==== Examples
@@ -22,7 +22,7 @@ module HisrcRails
22
22
  def responsive_image_tag(src, options = {})
23
23
  options[:data] ||= {}
24
24
  options[:data][:'1x'] ||= path_to_image(options.delete(:'1x').presence || options.delete('1x').presence || src)
25
- options[:data][:'2x'] ||= path_to_image(options.delete(:'2x').presence || options.delete('2x').presence || src.gsub(/([\w\/]+).(\w+)/, '\1@2x.\2'))
25
+ options[:data][:'2x'] ||= path_to_image(options.delete(:'2x').presence || options.delete('2x').presence || src.gsub(/([\w\/]+)\.(\w+)$/, '\1@2x.\2'))
26
26
 
27
27
  image_tag(src, options)
28
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hisrc-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-16 00:00:00.000000000 Z
12
+ date: 2012-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -83,6 +83,7 @@ extensions: []
83
83
  extra_rdoc_files: []
84
84
  files:
85
85
  - .gitignore
86
+ - .travis.yml
86
87
  - CHANGELOG.md
87
88
  - Gemfile
88
89
  - README.md