rails-sass-images 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +2 -2
- data/ChangeLog.md +13 -0
- data/Gemfile +6 -3
- data/LICENSE +20 -165
- data/lib/rails-sass-images.rb +10 -19
- data/lib/rails-sass-images/railtie.rb +1 -21
- data/lib/rails-sass-images/sass.rb +0 -18
- data/lib/rails-sass-images/sass/inline.rb +0 -18
- data/lib/rails-sass-images/sass/size.rb +0 -18
- data/lib/rails-sass-images/version.rb +1 -1
- data/rails-sass-images.gemspec +2 -1
- data/spec/plain_spec.rb +19 -9
- data/spec/rails_spec.rb +6 -6
- metadata +22 -39
- data/ChangeLog +0 -9
- data/Gemfile.lock +0 -114
- data/lib/assets/stylesheets/rails-sass-images/deprecated.sass +0 -9
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9806128e2e822ebd8108ca48e2b066a9f7ffa5fa
|
4
|
+
data.tar.gz: fbe35722a0d6dc11de4668e286acb1e5b0211c2f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ec1f223607e5e7afa37bfbf065bdc52463a77ff98de4448c241fe84712c8bf75642f6e2c2a7fed2553573163480ef022e714568f6f28128ee3c9fbb5cde18fba
|
7
|
+
data.tar.gz: 56a66de671a3cbe7722ef50c5ff4516f35d16b4dea61b1f73aded30cd8803943ccbcc394999d497dc21b59f75e0852f997a6b766a2b2beadb07a3e77e8a56eef
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/ChangeLog.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
### 0.4 “Alessandro di Mariano di Vanni Filipepi”
|
2
|
+
* Allow to work in Rails with disabled `initialize_on_precompile`.
|
3
|
+
|
4
|
+
### 0.3 “Michelangelo di Lodovico Buonarroti Simoni”
|
5
|
+
* Allow to use with Sprockets in plain Ruby application.
|
6
|
+
* Clean up code by removing Ruby 1.8 support.
|
7
|
+
|
8
|
+
### 0.2 “Raffaello Sanzio da Urbino”
|
9
|
+
* Rename `retina-image` and `retina-inline` mixins to `hidpi-image`
|
10
|
+
and `hidpi-inline`.
|
11
|
+
|
12
|
+
### 0.1 “Leonardo di ser Piero da Vinci”
|
13
|
+
* Initial release.
|
data/Gemfile
CHANGED
@@ -4,6 +4,9 @@ gemspec
|
|
4
4
|
gem 'rake'
|
5
5
|
gem 'rspec-rails'
|
6
6
|
|
7
|
-
gem 'rails',
|
8
|
-
gem 'sass-rails',
|
9
|
-
|
7
|
+
gem 'rails', '>= 4'
|
8
|
+
gem 'sass-rails', '>= 4'
|
9
|
+
|
10
|
+
gem 'racc', platforms: 'rbx'
|
11
|
+
gem 'rubysl', platforms: 'rbx'
|
12
|
+
gem 'rubysl-test-unit', platforms: 'rbx'
|
data/LICENSE
CHANGED
@@ -1,165 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
An "Application" is any work that makes use of an interface provided
|
23
|
-
by the Library, but which is not otherwise based on the Library.
|
24
|
-
Defining a subclass of a class defined by the Library is deemed a mode
|
25
|
-
of using an interface provided by the Library.
|
26
|
-
|
27
|
-
A "Combined Work" is a work produced by combining or linking an
|
28
|
-
Application with the Library. The particular version of the Library
|
29
|
-
with which the Combined Work was made is also called the "Linked
|
30
|
-
Version".
|
31
|
-
|
32
|
-
The "Minimal Corresponding Source" for a Combined Work means the
|
33
|
-
Corresponding Source for the Combined Work, excluding any source code
|
34
|
-
for portions of the Combined Work that, considered in isolation, are
|
35
|
-
based on the Application, and not on the Linked Version.
|
36
|
-
|
37
|
-
The "Corresponding Application Code" for a Combined Work means the
|
38
|
-
object code and/or source code for the Application, including any data
|
39
|
-
and utility programs needed for reproducing the Combined Work from the
|
40
|
-
Application, but excluding the System Libraries of the Combined Work.
|
41
|
-
|
42
|
-
1. Exception to Section 3 of the GNU GPL.
|
43
|
-
|
44
|
-
You may convey a covered work under sections 3 and 4 of this License
|
45
|
-
without being bound by section 3 of the GNU GPL.
|
46
|
-
|
47
|
-
2. Conveying Modified Versions.
|
48
|
-
|
49
|
-
If you modify a copy of the Library, and, in your modifications, a
|
50
|
-
facility refers to a function or data to be supplied by an Application
|
51
|
-
that uses the facility (other than as an argument passed when the
|
52
|
-
facility is invoked), then you may convey a copy of the modified
|
53
|
-
version:
|
54
|
-
|
55
|
-
a) under this License, provided that you make a good faith effort to
|
56
|
-
ensure that, in the event an Application does not supply the
|
57
|
-
function or data, the facility still operates, and performs
|
58
|
-
whatever part of its purpose remains meaningful, or
|
59
|
-
|
60
|
-
b) under the GNU GPL, with none of the additional permissions of
|
61
|
-
this License applicable to that copy.
|
62
|
-
|
63
|
-
3. Object Code Incorporating Material from Library Header Files.
|
64
|
-
|
65
|
-
The object code form of an Application may incorporate material from
|
66
|
-
a header file that is part of the Library. You may convey such object
|
67
|
-
code under terms of your choice, provided that, if the incorporated
|
68
|
-
material is not limited to numerical parameters, data structure
|
69
|
-
layouts and accessors, or small macros, inline functions and templates
|
70
|
-
(ten or fewer lines in length), you do both of the following:
|
71
|
-
|
72
|
-
a) Give prominent notice with each copy of the object code that the
|
73
|
-
Library is used in it and that the Library and its use are
|
74
|
-
covered by this License.
|
75
|
-
|
76
|
-
b) Accompany the object code with a copy of the GNU GPL and this license
|
77
|
-
document.
|
78
|
-
|
79
|
-
4. Combined Works.
|
80
|
-
|
81
|
-
You may convey a Combined Work under terms of your choice that,
|
82
|
-
taken together, effectively do not restrict modification of the
|
83
|
-
portions of the Library contained in the Combined Work and reverse
|
84
|
-
engineering for debugging such modifications, if you also do each of
|
85
|
-
the following:
|
86
|
-
|
87
|
-
a) Give prominent notice with each copy of the Combined Work that
|
88
|
-
the Library is used in it and that the Library and its use are
|
89
|
-
covered by this License.
|
90
|
-
|
91
|
-
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
92
|
-
document.
|
93
|
-
|
94
|
-
c) For a Combined Work that displays copyright notices during
|
95
|
-
execution, include the copyright notice for the Library among
|
96
|
-
these notices, as well as a reference directing the user to the
|
97
|
-
copies of the GNU GPL and this license document.
|
98
|
-
|
99
|
-
d) Do one of the following:
|
100
|
-
|
101
|
-
0) Convey the Minimal Corresponding Source under the terms of this
|
102
|
-
License, and the Corresponding Application Code in a form
|
103
|
-
suitable for, and under terms that permit, the user to
|
104
|
-
recombine or relink the Application with a modified version of
|
105
|
-
the Linked Version to produce a modified Combined Work, in the
|
106
|
-
manner specified by section 6 of the GNU GPL for conveying
|
107
|
-
Corresponding Source.
|
108
|
-
|
109
|
-
1) Use a suitable shared library mechanism for linking with the
|
110
|
-
Library. A suitable mechanism is one that (a) uses at run time
|
111
|
-
a copy of the Library already present on the user's computer
|
112
|
-
system, and (b) will operate properly with a modified version
|
113
|
-
of the Library that is interface-compatible with the Linked
|
114
|
-
Version.
|
115
|
-
|
116
|
-
e) Provide Installation Information, but only if you would otherwise
|
117
|
-
be required to provide such information under section 6 of the
|
118
|
-
GNU GPL, and only to the extent that such information is
|
119
|
-
necessary to install and execute a modified version of the
|
120
|
-
Combined Work produced by recombining or relinking the
|
121
|
-
Application with a modified version of the Linked Version. (If
|
122
|
-
you use option 4d0, the Installation Information must accompany
|
123
|
-
the Minimal Corresponding Source and Corresponding Application
|
124
|
-
Code. If you use option 4d1, you must provide the Installation
|
125
|
-
Information in the manner specified by section 6 of the GNU GPL
|
126
|
-
for conveying Corresponding Source.)
|
127
|
-
|
128
|
-
5. Combined Libraries.
|
129
|
-
|
130
|
-
You may place library facilities that are a work based on the
|
131
|
-
Library side by side in a single library together with other library
|
132
|
-
facilities that are not Applications and are not covered by this
|
133
|
-
License, and convey such a combined library under terms of your
|
134
|
-
choice, if you do both of the following:
|
135
|
-
|
136
|
-
a) Accompany the combined library with a copy of the same work based
|
137
|
-
on the Library, uncombined with any other library facilities,
|
138
|
-
conveyed under the terms of this License.
|
139
|
-
|
140
|
-
b) Give prominent notice with the combined library that part of it
|
141
|
-
is a work based on the Library, and explaining where to find the
|
142
|
-
accompanying uncombined form of the same work.
|
143
|
-
|
144
|
-
6. Revised Versions of the GNU Lesser General Public License.
|
145
|
-
|
146
|
-
The Free Software Foundation may publish revised and/or new versions
|
147
|
-
of the GNU Lesser General Public License from time to time. Such new
|
148
|
-
versions will be similar in spirit to the present version, but may
|
149
|
-
differ in detail to address new problems or concerns.
|
150
|
-
|
151
|
-
Each version is given a distinguishing version number. If the
|
152
|
-
Library as you received it specifies that a certain numbered version
|
153
|
-
of the GNU Lesser General Public License "or any later version"
|
154
|
-
applies to it, you have the option of following the terms and
|
155
|
-
conditions either of that published version or of any later version
|
156
|
-
published by the Free Software Foundation. If the Library as you
|
157
|
-
received it does not specify a version number of the GNU Lesser
|
158
|
-
General Public License, you may choose any version of the GNU Lesser
|
159
|
-
General Public License ever published by the Free Software Foundation.
|
160
|
-
|
161
|
-
If the Library as you received it specifies that a proxy can decide
|
162
|
-
whether future versions of the GNU Lesser General Public License shall
|
163
|
-
apply, that proxy's public statement of acceptance of any version is
|
164
|
-
permanent authorization for you to choose that version for the
|
165
|
-
Library.
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright 2013 Andrey Sitnik <andrey@sitnik.ru>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/rails-sass-images.rb
CHANGED
@@ -1,21 +1,3 @@
|
|
1
|
-
=begin
|
2
|
-
Copyright 2013 Andrey “A.I.” Sitnik <andrey@sitnik.ru>,
|
3
|
-
sponsored by Evil Martians.
|
4
|
-
|
5
|
-
This program is free software: you can redistribute it and/or modify
|
6
|
-
it under the terms of the GNU Lesser General Public License as published by
|
7
|
-
the Free Software Foundation, either version 3 of the License, or
|
8
|
-
(at your option) any later version.
|
9
|
-
|
10
|
-
This program is distributed in the hope that it will be useful,
|
11
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
GNU Lesser General Public License for more details.
|
14
|
-
|
15
|
-
You should have received a copy of the GNU Lesser General Public License
|
16
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
=end
|
18
|
-
|
19
1
|
require 'pathname'
|
20
2
|
|
21
3
|
module RailsSassImages
|
@@ -40,7 +22,16 @@ module RailsSassImages
|
|
40
22
|
|
41
23
|
# Get Sprockets environment
|
42
24
|
def self.assets
|
43
|
-
@assets
|
25
|
+
if @assets
|
26
|
+
@assets
|
27
|
+
elsif @assets_loader
|
28
|
+
@assets = @assets_loader.call()
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Set lazy loader for assets
|
33
|
+
def self.assets_loader=(loader)
|
34
|
+
@assets_loader = loader
|
44
35
|
end
|
45
36
|
end
|
46
37
|
|
@@ -1,21 +1,3 @@
|
|
1
|
-
=begin
|
2
|
-
Copyright 2013 Andrey “A.I.” Sitnik <andrey@sitnik.ru>,
|
3
|
-
sponsored by Evil Martians.
|
4
|
-
|
5
|
-
This program is free software: you can redistribute it and/or modify
|
6
|
-
it under the terms of the GNU Lesser General Public License as published by
|
7
|
-
the Free Software Foundation, either version 3 of the License, or
|
8
|
-
(at your option) any later version.
|
9
|
-
|
10
|
-
This program is distributed in the hope that it will be useful,
|
11
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
GNU Lesser General Public License for more details.
|
14
|
-
|
15
|
-
You should have received a copy of the GNU Lesser General Public License
|
16
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
=end
|
18
|
-
|
19
1
|
module RailsSassImages
|
20
2
|
# Enable `lib/assets/`
|
21
3
|
class Engine < ::Rails::Engine
|
@@ -23,8 +5,6 @@ module RailsSassImages
|
|
23
5
|
|
24
6
|
# Rails integration
|
25
7
|
class Railtie < Rails::Railtie
|
26
|
-
|
27
|
-
RailsSassImages.assets = Rails.application.assets
|
28
|
-
end
|
8
|
+
RailsSassImages.assets_loader = proc { Rails.application.assets }
|
29
9
|
end
|
30
10
|
end
|
@@ -1,21 +1,3 @@
|
|
1
|
-
=begin
|
2
|
-
Copyright 2013 Andrey “A.I.” Sitnik <andrey@sitnik.ru>,
|
3
|
-
sponsored by Evil Martians.
|
4
|
-
|
5
|
-
This program is free software: you can redistribute it and/or modify
|
6
|
-
it under the terms of the GNU Lesser General Public License as published by
|
7
|
-
the Free Software Foundation, either version 3 of the License, or
|
8
|
-
(at your option) any later version.
|
9
|
-
|
10
|
-
This program is distributed in the hope that it will be useful,
|
11
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
GNU Lesser General Public License for more details.
|
14
|
-
|
15
|
-
You should have received a copy of the GNU Lesser General Public License
|
16
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
=end
|
18
|
-
|
19
1
|
require 'sass'
|
20
2
|
|
21
3
|
dir = Pathname(__FILE__).dirname.join('sass')
|
@@ -1,21 +1,3 @@
|
|
1
|
-
=begin
|
2
|
-
Copyright 2013 Andrey “A.I.” Sitnik <andrey@sitnik.ru>,
|
3
|
-
sponsored by Evil Martians.
|
4
|
-
|
5
|
-
This program is free software: you can redistribute it and/or modify
|
6
|
-
it under the terms of the GNU Lesser General Public License as published by
|
7
|
-
the Free Software Foundation, either version 3 of the License, or
|
8
|
-
(at your option) any later version.
|
9
|
-
|
10
|
-
This program is distributed in the hope that it will be useful,
|
11
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
GNU Lesser General Public License for more details.
|
14
|
-
|
15
|
-
You should have received a copy of the GNU Lesser General Public License
|
16
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
=end
|
18
|
-
|
19
1
|
require 'mime-types'
|
20
2
|
|
21
3
|
module RailsSassImages::Sass
|
@@ -1,21 +1,3 @@
|
|
1
|
-
=begin
|
2
|
-
Copyright 2013 Andrey “A.I.” Sitnik <andrey@sitnik.ru>,
|
3
|
-
sponsored by Evil Martians.
|
4
|
-
|
5
|
-
This program is free software: you can redistribute it and/or modify
|
6
|
-
it under the terms of the GNU Lesser General Public License as published by
|
7
|
-
the Free Software Foundation, either version 3 of the License, or
|
8
|
-
(at your option) any later version.
|
9
|
-
|
10
|
-
This program is distributed in the hope that it will be useful,
|
11
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
GNU Lesser General Public License for more details.
|
14
|
-
|
15
|
-
You should have received a copy of the GNU Lesser General Public License
|
16
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
-
=end
|
18
|
-
|
19
1
|
require 'dimensions'
|
20
2
|
|
21
3
|
module RailsSassImages::Sass
|
data/rails-sass-images.gemspec
CHANGED
@@ -10,12 +10,13 @@ Gem::Specification.new do |s|
|
|
10
10
|
|
11
11
|
s.files = `git ls-files`.split("\n")
|
12
12
|
s.test_files = `git ls-files -- {spec}/*`.split("\n")
|
13
|
-
s.extra_rdoc_files = ['README.md', 'LICENSE', 'ChangeLog']
|
13
|
+
s.extra_rdoc_files = ['README.md', 'LICENSE', 'ChangeLog.md']
|
14
14
|
s.require_path = 'lib'
|
15
15
|
|
16
16
|
s.author = 'Andrey "A.I." Sitnik'
|
17
17
|
s.email = 'andrey@sitnik.ru'
|
18
18
|
s.homepage = 'https://github.com/ai/rails-sass-images'
|
19
|
+
s.license = 'MIT'
|
19
20
|
|
20
21
|
s.add_dependency 'sass', ['> 0']
|
21
22
|
s.add_dependency 'sprockets', ['> 0']
|
data/spec/plain_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('../spec_helper', __FILE__)
|
|
3
3
|
require 'sprockets'
|
4
4
|
|
5
5
|
describe RailsSassImages do
|
6
|
-
before
|
6
|
+
before do
|
7
7
|
@original = RailsSassImages.assets
|
8
8
|
|
9
9
|
@assets = Sprockets::Environment.new
|
@@ -20,35 +20,45 @@ describe RailsSassImages do
|
|
20
20
|
RailsSassImages.install(@assets)
|
21
21
|
end
|
22
22
|
|
23
|
-
after
|
24
|
-
RailsSassImages.assets
|
23
|
+
after do
|
24
|
+
RailsSassImages.assets = @original
|
25
|
+
RailsSassImages.assets_loader = nil
|
25
26
|
end
|
26
27
|
|
27
|
-
it "
|
28
|
+
it "loads assets lazy" do
|
29
|
+
RailsSassImages.assets = nil
|
30
|
+
another = Sprockets::Environment.new
|
31
|
+
|
32
|
+
RailsSassImages.assets_loader = proc { another }
|
33
|
+
|
34
|
+
RailsSassImages.assets.should == another
|
35
|
+
end
|
36
|
+
|
37
|
+
it "inlines assets" do
|
28
38
|
@assets['inline.css'].to_s.should == ".icon{background:#{INLINE}}\n"
|
29
39
|
end
|
30
40
|
|
31
|
-
it "
|
41
|
+
it "raises error on unknown file" do
|
32
42
|
proc {
|
33
43
|
@assets['wrong-inline.css']
|
34
44
|
}.should raise_error(/Can't find asset no\.png/)
|
35
45
|
end
|
36
46
|
|
37
|
-
it "
|
47
|
+
it "gets image size" do
|
38
48
|
@assets['size.css'].to_s.should == ".icon{width:4px;height:6px}\n"
|
39
49
|
end
|
40
50
|
|
41
|
-
it "
|
51
|
+
it "gets image size by mixin" do
|
42
52
|
@assets['image-size.css'].to_s.should == ".icon{width:4px;height:6px}\n"
|
43
53
|
end
|
44
54
|
|
45
|
-
it "
|
55
|
+
it "has hidpi-image mixin" do
|
46
56
|
@assets['hidpi-image.css'].to_s == ".icon{width:2px;height:3px;" +
|
47
57
|
"background:url(/assets/monolith.png) no-repeat;" +
|
48
58
|
"background-size:2px 3px}\n"
|
49
59
|
end
|
50
60
|
|
51
|
-
it "
|
61
|
+
it "has hidpi-inline mixin" do
|
52
62
|
@assets['hidpi-inline.css'].to_s.should == ".icon{width:2px;height:3px;" +
|
53
63
|
"background:#{INLINE} no-repeat;" +
|
54
64
|
"background-size:2px 3px}\n"
|
data/spec/rails_spec.rb
CHANGED
@@ -6,31 +6,31 @@ describe CssController, type: :controller do
|
|
6
6
|
Rails.root.join('log').rmtree
|
7
7
|
end
|
8
8
|
|
9
|
-
it "
|
9
|
+
it "inlines assets" do
|
10
10
|
get :test, file: 'inline'
|
11
11
|
response.should be_success
|
12
12
|
response.body.should == ".icon{background:#{INLINE}}\n"
|
13
13
|
end
|
14
14
|
|
15
|
-
it "
|
15
|
+
it "raises error on unknown file" do
|
16
16
|
proc {
|
17
17
|
get :test, file: 'wrong-inline'
|
18
18
|
}.should raise_error(/Can't find asset no\.png/)
|
19
19
|
end
|
20
20
|
|
21
|
-
it "
|
21
|
+
it "gets image size" do
|
22
22
|
get :test, file: 'size'
|
23
23
|
response.should be_success
|
24
24
|
response.body.should == ".icon{width:4px;height:6px}\n"
|
25
25
|
end
|
26
26
|
|
27
|
-
it "
|
27
|
+
it "gets image size by mixin" do
|
28
28
|
get :test, file: 'image-size'
|
29
29
|
response.should be_success
|
30
30
|
response.body.should == ".icon{width:4px;height:6px}\n"
|
31
31
|
end
|
32
32
|
|
33
|
-
it "
|
33
|
+
it "has hidpi-image mixin" do
|
34
34
|
get :test, file: 'hidpi-image'
|
35
35
|
response.should be_success
|
36
36
|
response.body.should == ".icon{width:2px;height:3px;" +
|
@@ -38,7 +38,7 @@ describe CssController, type: :controller do
|
|
38
38
|
"background-size:2px 3px}\n"
|
39
39
|
end
|
40
40
|
|
41
|
-
it "
|
41
|
+
it "has hidpi-inline mixin" do
|
42
42
|
get :test, file: 'hidpi-inline'
|
43
43
|
response.should be_success
|
44
44
|
response.body.should == ".icon{width:2px;height:3px;" +
|
metadata
CHANGED
@@ -1,78 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-sass-images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
5
|
-
prerelease:
|
4
|
+
version: '0.4'
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Andrey "A.I." Sitnik
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-01-21 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: sass
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: sprockets
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">"
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">"
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: dimensions
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: mime-types
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">"
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">"
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
description:
|
@@ -82,19 +73,17 @@ extensions: []
|
|
82
73
|
extra_rdoc_files:
|
83
74
|
- README.md
|
84
75
|
- LICENSE
|
85
|
-
- ChangeLog
|
76
|
+
- ChangeLog.md
|
86
77
|
files:
|
87
|
-
- .gitignore
|
88
|
-
- .rspec
|
89
|
-
- .travis.yml
|
90
|
-
- ChangeLog
|
78
|
+
- ".gitignore"
|
79
|
+
- ".rspec"
|
80
|
+
- ".travis.yml"
|
81
|
+
- ChangeLog.md
|
91
82
|
- Gemfile
|
92
|
-
- Gemfile.lock
|
93
83
|
- LICENSE
|
94
84
|
- README.md
|
95
85
|
- Rakefile
|
96
86
|
- lib/assets/stylesheets/rails-sass-images.sass
|
97
|
-
- lib/assets/stylesheets/rails-sass-images/deprecated.sass
|
98
87
|
- lib/assets/stylesheets/rails-sass-images/hidpi-image.sass
|
99
88
|
- lib/assets/stylesheets/rails-sass-images/hidpi-inline.sass
|
100
89
|
- lib/assets/stylesheets/rails-sass-images/image-size.sass
|
@@ -125,33 +114,27 @@ files:
|
|
125
114
|
- spec/rails_spec.rb
|
126
115
|
- spec/spec_helper.rb
|
127
116
|
homepage: https://github.com/ai/rails-sass-images
|
128
|
-
licenses:
|
117
|
+
licenses:
|
118
|
+
- MIT
|
119
|
+
metadata: {}
|
129
120
|
post_install_message:
|
130
121
|
rdoc_options: []
|
131
122
|
require_paths:
|
132
123
|
- lib
|
133
124
|
required_ruby_version: !ruby/object:Gem::Requirement
|
134
|
-
none: false
|
135
125
|
requirements:
|
136
|
-
- -
|
126
|
+
- - ">="
|
137
127
|
- !ruby/object:Gem::Version
|
138
128
|
version: '0'
|
139
|
-
segments:
|
140
|
-
- 0
|
141
|
-
hash: 3926307620625692974
|
142
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
|
-
none: false
|
144
130
|
requirements:
|
145
|
-
- -
|
131
|
+
- - ">="
|
146
132
|
- !ruby/object:Gem::Version
|
147
133
|
version: '0'
|
148
|
-
segments:
|
149
|
-
- 0
|
150
|
-
hash: 3926307620625692974
|
151
134
|
requirements: []
|
152
135
|
rubyforge_project:
|
153
|
-
rubygems_version:
|
136
|
+
rubygems_version: 2.2.0
|
154
137
|
signing_key:
|
155
|
-
specification_version:
|
138
|
+
specification_version: 4
|
156
139
|
summary: Sass functions and mixins to inline images and get images size
|
157
140
|
test_files: []
|
data/ChangeLog
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
== 0.3 (Michelangelo di Lodovico Buonarroti Simoni)
|
2
|
-
* Allow to use with Sprockets in plain Ruby application.
|
3
|
-
* Clean up code by removing Ruby 1.8 support.
|
4
|
-
|
5
|
-
== 0.2 (Raffaello Sanzio da Urbino)
|
6
|
-
* Rename retina-image and retina-inline mixins to hidpi-image and hidpi-inline.
|
7
|
-
|
8
|
-
== 0.1 (Leonardo di ser Piero da Vinci)
|
9
|
-
* Initial release.
|
data/Gemfile.lock
DELETED
@@ -1,114 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
rails-sass-images (0.3)
|
5
|
-
dimensions (> 0)
|
6
|
-
mime-types (> 0)
|
7
|
-
sass (> 0)
|
8
|
-
sprockets (> 0)
|
9
|
-
|
10
|
-
GEM
|
11
|
-
remote: https://rubygems.org/
|
12
|
-
specs:
|
13
|
-
actionmailer (4.0.0.rc1)
|
14
|
-
actionpack (= 4.0.0.rc1)
|
15
|
-
mail (~> 2.5.3)
|
16
|
-
actionpack (4.0.0.rc1)
|
17
|
-
activesupport (= 4.0.0.rc1)
|
18
|
-
builder (~> 3.1.0)
|
19
|
-
erubis (~> 2.7.0)
|
20
|
-
rack (~> 1.5.2)
|
21
|
-
rack-test (~> 0.6.2)
|
22
|
-
activemodel (4.0.0.rc1)
|
23
|
-
activesupport (= 4.0.0.rc1)
|
24
|
-
builder (~> 3.1.0)
|
25
|
-
activerecord (4.0.0.rc1)
|
26
|
-
activemodel (= 4.0.0.rc1)
|
27
|
-
activerecord-deprecated_finders (~> 1.0.2)
|
28
|
-
activesupport (= 4.0.0.rc1)
|
29
|
-
arel (~> 4.0.0)
|
30
|
-
activerecord-deprecated_finders (1.0.2)
|
31
|
-
activesupport (4.0.0.rc1)
|
32
|
-
i18n (~> 0.6, >= 0.6.4)
|
33
|
-
minitest (~> 4.2)
|
34
|
-
multi_json (~> 1.3)
|
35
|
-
thread_safe (~> 0.1)
|
36
|
-
tzinfo (~> 0.3.37)
|
37
|
-
arel (4.0.0)
|
38
|
-
atomic (1.1.9)
|
39
|
-
builder (3.1.4)
|
40
|
-
diff-lcs (1.2.4)
|
41
|
-
dimensions (1.2.0)
|
42
|
-
erubis (2.7.0)
|
43
|
-
hike (1.2.2)
|
44
|
-
i18n (0.6.4)
|
45
|
-
mail (2.5.3)
|
46
|
-
i18n (>= 0.4.0)
|
47
|
-
mime-types (~> 1.16)
|
48
|
-
treetop (~> 1.4.8)
|
49
|
-
mime-types (1.23)
|
50
|
-
minitest (4.7.4)
|
51
|
-
multi_json (1.7.3)
|
52
|
-
polyglot (0.3.3)
|
53
|
-
rack (1.5.2)
|
54
|
-
rack-test (0.6.2)
|
55
|
-
rack (>= 1.0)
|
56
|
-
rails (4.0.0.rc1)
|
57
|
-
actionmailer (= 4.0.0.rc1)
|
58
|
-
actionpack (= 4.0.0.rc1)
|
59
|
-
activerecord (= 4.0.0.rc1)
|
60
|
-
activesupport (= 4.0.0.rc1)
|
61
|
-
bundler (>= 1.3.0, < 2.0)
|
62
|
-
railties (= 4.0.0.rc1)
|
63
|
-
sprockets-rails (~> 2.0.0.rc4)
|
64
|
-
railties (4.0.0.rc1)
|
65
|
-
actionpack (= 4.0.0.rc1)
|
66
|
-
activesupport (= 4.0.0.rc1)
|
67
|
-
rake (>= 0.8.7)
|
68
|
-
thor (>= 0.18.1, < 2.0)
|
69
|
-
rake (10.0.4)
|
70
|
-
rspec-core (2.13.1)
|
71
|
-
rspec-expectations (2.13.0)
|
72
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
73
|
-
rspec-mocks (2.13.1)
|
74
|
-
rspec-rails (2.13.1)
|
75
|
-
actionpack (>= 3.0)
|
76
|
-
activesupport (>= 3.0)
|
77
|
-
railties (>= 3.0)
|
78
|
-
rspec-core (~> 2.13.0)
|
79
|
-
rspec-expectations (~> 2.13.0)
|
80
|
-
rspec-mocks (~> 2.13.0)
|
81
|
-
sass (3.2.8)
|
82
|
-
sass-rails (4.0.0.rc1)
|
83
|
-
railties (>= 4.0.0.beta, < 5.0)
|
84
|
-
sass (>= 3.1.10)
|
85
|
-
sprockets-rails (~> 2.0.0.rc0)
|
86
|
-
tilt (~> 1.3)
|
87
|
-
sprockets (2.9.3)
|
88
|
-
hike (~> 1.2)
|
89
|
-
multi_json (~> 1.0)
|
90
|
-
rack (~> 1.0)
|
91
|
-
tilt (~> 1.1, != 1.3.0)
|
92
|
-
sprockets-rails (2.0.0.rc4)
|
93
|
-
actionpack (>= 3.0)
|
94
|
-
activesupport (>= 3.0)
|
95
|
-
sprockets (~> 2.8)
|
96
|
-
thor (0.18.1)
|
97
|
-
thread_safe (0.1.0)
|
98
|
-
atomic
|
99
|
-
tilt (1.4.0)
|
100
|
-
treetop (1.4.12)
|
101
|
-
polyglot
|
102
|
-
polyglot (>= 0.3.1)
|
103
|
-
tzinfo (0.3.37)
|
104
|
-
|
105
|
-
PLATFORMS
|
106
|
-
ruby
|
107
|
-
|
108
|
-
DEPENDENCIES
|
109
|
-
rails (>= 4.0.0.rc1)
|
110
|
-
rails-sass-images!
|
111
|
-
rake
|
112
|
-
rspec-rails
|
113
|
-
sass-rails (>= 4.0.0.rc1)
|
114
|
-
sprockets-rails (>= 2.0.0.rc4)
|
@@ -1,9 +0,0 @@
|
|
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)
|