rails-sass-images 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,2 +1,5 @@
1
- == 0.1 (Leonardo da Vinci)
1
+ == 0.2 (Raffaello Sanzio da Urbino)
2
+ * Rename retina-image and retina-inline mixins to hidpi-image and hidpi-inline.
3
+
4
+ == 0.1 (Leonardo di ser Piero da Vinci)
2
5
  * Initial release.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails-sass-images (0.1)
4
+ rails-sass-images (0.2)
5
5
  dimensions (> 0)
6
6
  rails (>= 3.1)
7
7
  sass-rails (> 0)
@@ -38,7 +38,7 @@ GEM
38
38
  multi_json (~> 1.0)
39
39
  arel (3.0.2)
40
40
  builder (3.0.4)
41
- diff-lcs (1.2.3)
41
+ diff-lcs (1.2.4)
42
42
  dimensions (1.2.0)
43
43
  erubis (2.7.0)
44
44
  hike (1.2.2)
@@ -49,7 +49,7 @@ GEM
49
49
  i18n (>= 0.4.0)
50
50
  mime-types (~> 1.16)
51
51
  treetop (~> 1.4.8)
52
- mime-types (1.22)
52
+ mime-types (1.23)
53
53
  multi_json (1.7.2)
54
54
  polyglot (0.3.3)
55
55
  rack (1.4.5)
@@ -81,14 +81,14 @@ GEM
81
81
  rspec-expectations (2.13.0)
82
82
  diff-lcs (>= 1.1.3, < 2.0)
83
83
  rspec-mocks (2.13.1)
84
- rspec-rails (2.13.0)
84
+ rspec-rails (2.13.1)
85
85
  actionpack (>= 3.0)
86
86
  activesupport (>= 3.0)
87
87
  railties (>= 3.0)
88
88
  rspec-core (~> 2.13.0)
89
89
  rspec-expectations (~> 2.13.0)
90
90
  rspec-mocks (~> 2.13.0)
91
- sass (3.2.7)
91
+ sass (3.2.8)
92
92
  sass-rails (3.2.6)
93
93
  railties (~> 3.2.0)
94
94
  sass (>= 3.1.10)
data/README.md CHANGED
@@ -16,10 +16,10 @@ with HiDPI (Retina) support:
16
16
 
17
17
  ```sass
18
18
  .icon
19
- +retina-inline("icon.png")
19
+ +hidpi-inline("icon.png")
20
20
 
21
21
  .background
22
- +retina-image("big-image.jpg")
22
+ +hidpi-image("big-image.jpg")
23
23
  ```
24
24
 
25
25
  and fonts support:
@@ -36,7 +36,7 @@ Sponsored by [Evil Martians](http://evilmartians.com/).
36
36
 
37
37
  Instead of Compass, Rails Sass Images has:
38
38
 
39
- * Retina support.
39
+ * HiDPI (Retina) support.
40
40
  * Full Assets Pipeline support.
41
41
  * Useful shortcuts.
42
42
  * More file types support.
@@ -1,3 +1,3 @@
1
1
  @import "rails-sass-images/image-size"
2
- @import "rails-sass-images/retina-image"
3
- @import "rails-sass-images/retina-inline"
2
+ @import "rails-sass-images/hidpi-image"
3
+ @import "rails-sass-images/hidpi-inline"
@@ -0,0 +1,9 @@
1
+ // Deprecated mixins
2
+
3
+ @mixin retina-image($path)
4
+ @warn "Mixin retina-inline is deprecated. Use hidpi-inline instead."
5
+ +hidpi-image($path)
6
+
7
+ @mixin retina-inline($path)
8
+ @warn "Mixin retina-inline is deprecated. Use hidpi-inline instead."
9
+ +hidpi-inline($path)
@@ -0,0 +1,8 @@
1
+ // Set HiDPI (Retina) image sizes and background.
2
+ //
3
+ // .button
4
+ // +hidpi-image("nice/button.png")
5
+ @mixin hidpi-image($path)
6
+ +image-size($path, 2)
7
+ background: image-url($path) no-repeat
8
+ background-size: (image-width($path) / 2) (image-height($path) / 2)
@@ -1,9 +1,9 @@
1
1
  // Set image sizes and background and inline file as base64 data:uri.
2
- // It will use retina image, that has twice size to be clean on Retina screens.
2
+ // It will use `background-size` to set HiDPI (Retina) image.
3
3
  //
4
4
  // .button
5
- // +retina-inline("nice/button.png")
6
- @mixin retina-inline($path)
5
+ // +hidpi-inline("nice/button.png")
6
+ @mixin hidpi-inline($path)
7
7
  +image-size($path, 2)
8
8
  background: inline($path) no-repeat
9
9
  background-size: (image-width($path) / 2) (image-height($path) / 2)
@@ -1,6 +1,6 @@
1
1
  // Add `width` and `height` properties with image size.
2
- // For retina images you can set scale `factor` and width and height
3
- // will be divited by this factor.
2
+ // For HiDPI images you can set scale `factor` and width and height
3
+ // will be divided by this factor.
4
4
  //
5
5
  // .button
6
6
  // +image-size("button/nice.png")
@@ -1,3 +1,3 @@
1
1
  module RailsSassImages
2
- VERSION = '0.1'.freeze unless defined? RailsSassImages::VERSION
2
+ VERSION = '0.2'.freeze unless defined? RailsSassImages::VERSION
3
3
  end
@@ -1,4 +1,4 @@
1
1
  @import "rails-sass-images"
2
2
 
3
3
  .icon
4
- +retina-image("monolith.png")
4
+ +hidpi-image("monolith.png")
@@ -1,4 +1,4 @@
1
1
  @import "rails-sass-images"
2
2
 
3
3
  .icon
4
- +retina-inline("monolith.png")
4
+ +hidpi-inline("monolith.png")
data/spec/sass_spec.rb CHANGED
@@ -14,7 +14,7 @@ describe CssController, :type => :controller do
14
14
 
15
15
  it "should raise error on unknown file" do
16
16
  proc {
17
- get :test, :file => 'wrong_inline'
17
+ get :test, :file => 'wrong-inline'
18
18
  }.should raise_error(/Can't find asset no\.png/)
19
19
  end
20
20
 
@@ -30,16 +30,16 @@ describe CssController, :type => :controller do
30
30
  response.body.should == ".icon{width:4px;height:6px}\n"
31
31
  end
32
32
 
33
- it "should has retina-image mixin" do
34
- get :test, :file => 'retina-image'
33
+ it "should has hidpi-image mixin" do
34
+ get :test, :file => 'hidpi-image'
35
35
  response.should be_success
36
36
  response.body.should == ".icon{width:2px;height:3px;" +
37
37
  "background:url(/assets/monolith.png) no-repeat;" +
38
38
  "background-size:2px 3px}\n"
39
39
  end
40
40
 
41
- it "should has retina-inline mixin" do
42
- get :test, :file => 'retina-inline'
41
+ it "should has hidpi-inline mixin" do
42
+ get :test, :file => 'hidpi-inline'
43
43
  response.should be_success
44
44
  response.body.should == ".icon{width:2px;height:3px;" +
45
45
  "background:#{INLINE} no-repeat;" +
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-sass-images
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
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: 2013-04-14 00:00:00.000000000 Z
12
+ date: 2013-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sass-rails
@@ -78,9 +78,10 @@ files:
78
78
  - README.md
79
79
  - Rakefile
80
80
  - lib/assets/stylesheets/rails-sass-images.sass
81
+ - lib/assets/stylesheets/rails-sass-images/deprecated.sass
82
+ - lib/assets/stylesheets/rails-sass-images/hidpi-image.sass
83
+ - lib/assets/stylesheets/rails-sass-images/hidpi-inline.sass
81
84
  - lib/assets/stylesheets/rails-sass-images/image-size.sass
82
- - lib/assets/stylesheets/rails-sass-images/retina-image.sass
83
- - lib/assets/stylesheets/rails-sass-images/retina-inline.sass
84
85
  - lib/rails-sass-images.rb
85
86
  - lib/rails-sass-images/sass.rb
86
87
  - lib/rails-sass-images/sass/inline.rb
@@ -89,12 +90,12 @@ files:
89
90
  - rails-sass-images.gemspec
90
91
  - spec/app/.gitignore
91
92
  - spec/app/app/assets/images/monolith.png
93
+ - spec/app/app/assets/stylesheets/hidpi-image.sass
94
+ - spec/app/app/assets/stylesheets/hidpi-inline.sass
92
95
  - spec/app/app/assets/stylesheets/image-size.sass
93
96
  - spec/app/app/assets/stylesheets/inline.sass
94
- - spec/app/app/assets/stylesheets/retina-image.sass
95
- - spec/app/app/assets/stylesheets/retina-inline.sass
96
97
  - spec/app/app/assets/stylesheets/size.sass
97
- - spec/app/app/assets/stylesheets/wrong_inline.sass
98
+ - spec/app/app/assets/stylesheets/wrong-inline.sass
98
99
  - spec/app/app/controllers/application_controller.rb
99
100
  - spec/app/app/controllers/css_controller.rb
100
101
  - spec/app/config.ru
@@ -119,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
120
  version: '0'
120
121
  segments:
121
122
  - 0
122
- hash: 973236283843385968
123
+ hash: -2995797738750552235
123
124
  required_rubygems_version: !ruby/object:Gem::Requirement
124
125
  none: false
125
126
  requirements:
@@ -128,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
129
  version: '0'
129
130
  segments:
130
131
  - 0
131
- hash: 973236283843385968
132
+ hash: -2995797738750552235
132
133
  requirements: []
133
134
  rubyforge_project:
134
135
  rubygems_version: 1.8.23
@@ -1,9 +0,0 @@
1
- // Set image sizes and background. It will use retina image, that has twice
2
- // size to be clean on Retina screens.
3
- //
4
- // .button
5
- // +retina-image("nice/button.png")
6
- @mixin retina-image($path)
7
- +image-size($path, 2)
8
- background: image-url($path) no-repeat
9
- background-size: (image-width($path) / 2) (image-height($path) / 2)