retina_image_tag 0.0.11 → 0.0.13

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.
@@ -1,3 +1,3 @@
1
1
  module RetinaImageTag
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -1,5 +1,3 @@
1
- require 'fastimage'
2
-
3
1
  module RetinaImageTag
4
2
  module ViewHelpers
5
3
 
@@ -9,32 +7,18 @@ module RetinaImageTag
9
7
  end
10
8
 
11
9
 
12
- def full_image_path
13
- if Rails.env == 'development'
14
- Rails.root.to_s+'/app/assets/images/'+@image
15
- else
16
- request.protocol + request.host_with_port + image_path(@image)
17
- end
18
- end
19
-
20
-
21
10
  def retina_image_tag(image, options = {})
22
11
  @devicePixelRatio = cookies[:devicePixelRatio]
23
12
  @options = options
24
13
  @image = image # foo.jpg, subdir/foo.png
25
14
 
26
-
27
- if @options[:size] == nil
28
- @options[:size] = FastImage.size(full_image_path.delete '@2x').join("x")
29
- end
30
-
31
15
  case @devicePixelRatio
32
16
  when '2'
33
17
  retina_image 2
34
18
  when '1.5'
35
19
  retina_image 2
36
20
  else
37
- image_tag(@image, @options)
21
+ image_tag(@image, @options)
38
22
  end
39
23
  end
40
24
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retina_image_tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: