retina_image_tag 0.0.8 → 0.0.9

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.
data/README.md CHANGED
@@ -4,6 +4,12 @@ A high-resolution image is loaded when the retina_image_tag is called from a ret
4
4
 
5
5
  more info about the problem: http://theindustry.cc/2012/03/30/2x-the-retina-dilemma/
6
6
 
7
+ exampleapp: http://retinaimagetag-demoapp.herokuapp.com/
8
+
9
+ exampleapp sourcecode: https://github.com/ffaerber/retina_image_tag_demoapp
10
+
11
+
12
+
7
13
  ## Installation
8
14
 
9
15
  Add this line to your application's Gemfile:
@@ -29,11 +35,8 @@ and a @2x Retina Images: foo@2x.jpg (800x800px)
29
35
 
30
36
  and use it like normal
31
37
 
32
- <%= retina_image_tag 'foo.jpg', :alt => 'BrainHead', :class => 'some-class' %>
33
-
34
- add :size => "@1x" so the foo@2x.jpg is the same size as foo.jpg
38
+ <%= retina_image_tag 'foo.jpg', :size => "400x400" %>
35
39
 
36
- <%= retina_image_tag 'foo.jpg', :alt => 'BrainHead', :class => 'some-class', :size => "@1x" %>
37
40
 
38
41
 
39
42
  ## Contributing
@@ -7,6 +7,6 @@ module RetinaImageTag
7
7
  initializer "retina_image_tag.view_helpers" do |app|
8
8
  ActionView::Base.send :include, ViewHelpers
9
9
  end
10
-
10
+
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module RetinaImageTag
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -0,0 +1,16 @@
1
+ require 'RMagick'
2
+
3
+ namespace :retina_image_tag do
4
+ desc 'convert @2x images to normal images'
5
+ task :convert do
6
+ retina_images = Dir['app/assets/images/**/*@2x*']
7
+
8
+ retina_images.each do |retina_image|
9
+ img = Magick::ImageList.new(retina_image)
10
+ x1 = img.resize(0.5)
11
+ x1.write retina_image.delete "@2x"
12
+ end
13
+
14
+ end
15
+
16
+ end
@@ -16,5 +16,6 @@ Gem::Specification.new do |gem|
16
16
  gem.version = RetinaImageTag::VERSION
17
17
 
18
18
  gem.add_dependency "railties", "~> 3.1"
19
+ gem.add_dependency "rmagick", "~> 2.13.1"
19
20
 
20
21
  end
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.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.1'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rmagick
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 2.13.1
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 2.13.1
30
46
  description: ! 'A high-resolution image is loaded when the retina_image_tag is called
31
47
  from a retina display '
32
48
  email:
@@ -46,6 +62,7 @@ files:
46
62
  - lib/retina_image_tag/railtie.rb
47
63
  - lib/retina_image_tag/version.rb
48
64
  - lib/retina_image_tag/view_helpers.rb
65
+ - lib/tasks/retina_image_tag.rake
49
66
  - retina_image_tag.gemspec
50
67
  - vendor/assets/javascripts/retina_image_tag.js
51
68
  homepage: https://github.com/ffaerber/retina_image_tag