picturefill 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +11 -0
- data/lib/picturefill/context.rb +2 -2
- data/lib/picturefill/version.rb +1 -1
- data/picturefill.gemspec +1 -0
- data/spec/picturefill/view_helper_spec.rb +18 -0
- data/spec/spec_helper.rb +6 -0
- metadata +16 -3
- data/spec/dummy/db/test.sqlite3 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b026ad5b538c54def5367f3154eb0052c99b80a2
|
4
|
+
data.tar.gz: 6709f7b2f4c94d56197ecb1d97c10f4d7632c97b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 397cf74eee66231364fcbe455d9d3163d68c169bfe12be0b55e4cd27e57bee189d8e3dc49f39642654565a2fe124bbedf56120911b8870e097d05290b0559599
|
7
|
+
data.tar.gz: 236e5cf88571f01a7248fa7ca3106acc1d11a9f3475e38f4780b3436e49b5c3ee7c211828e45f06f6e8bd247e3d4432b1267a61e832b669f6254db2cb75881c9
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- "1.8.7"
|
4
|
+
- "1.9.2"
|
5
|
+
- "1.9.3"
|
6
|
+
- jruby-18mode # JRuby in 1.8 mode
|
7
|
+
- jruby-19mode # JRuby in 1.9 mode
|
8
|
+
- rbx-18mode
|
9
|
+
- rbx-19mode
|
10
|
+
# uncomment this line if your project needs to run something other than `rake`:
|
11
|
+
# script: bundle exec rspec spec
|
data/lib/picturefill/context.rb
CHANGED
@@ -43,13 +43,13 @@ module Picturefill
|
|
43
43
|
"(min-device-pixel-ratio: %.1f)" % ratio
|
44
44
|
when nil
|
45
45
|
else
|
46
|
-
ArgumentError
|
46
|
+
raise ArgumentError.new("Only Float && Integer allowed")
|
47
47
|
end
|
48
48
|
media = "(#{media})" if media
|
49
49
|
|
50
50
|
[min, ratio, media].select { |e| !e.nil? }.join(" and ")
|
51
51
|
else
|
52
|
-
ArgumentError("Only hash && string allowed")
|
52
|
+
raise ArgumentError.new("Only hash && string allowed")
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
data/lib/picturefill/version.rb
CHANGED
data/picturefill.gemspec
CHANGED
@@ -115,6 +115,24 @@ describe Picturefill::Rails::ViewHelper do
|
|
115
115
|
end
|
116
116
|
|
117
117
|
|
118
|
+
context "when given invalid :ratio" do
|
119
|
+
it "raises an ArgumentError" do
|
120
|
+
expect {
|
121
|
+
setup_image("small.jpg", :ratio => ["evil"])
|
122
|
+
}.to raise_error(ArgumentError)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
|
127
|
+
context "when given invalid params" do
|
128
|
+
it "raises an ArgumentError" do
|
129
|
+
expect {
|
130
|
+
setup_image("small.jpg", ["evil"])
|
131
|
+
}.to raise_error(ArgumentError)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
|
118
136
|
private
|
119
137
|
|
120
138
|
def setup_image(*args)
|
data/spec/spec_helper.rb
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
# Configure Rails Environment
|
2
2
|
ENV["RAILS_ENV"] = "test"
|
3
3
|
|
4
|
+
require 'simplecov'
|
5
|
+
SimpleCov.start do
|
6
|
+
add_filter "spec/dummy"
|
7
|
+
end
|
8
|
+
|
4
9
|
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
10
|
require 'rspec/rails'
|
11
|
+
|
6
12
|
require 'picturefill'
|
7
13
|
# require 'capybara/rspec'
|
8
14
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picturefill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Helm
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: simplecov
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: Rails-Wrapper for picturefill.js
|
56
70
|
email:
|
57
71
|
- deradon87@gmail.com
|
@@ -61,6 +75,7 @@ extra_rdoc_files: []
|
|
61
75
|
files:
|
62
76
|
- .gitignore
|
63
77
|
- .rspec
|
78
|
+
- .travis.yml
|
64
79
|
- CHANGELOG.md
|
65
80
|
- Gemfile
|
66
81
|
- LICENSE.txt
|
@@ -117,7 +132,6 @@ files:
|
|
117
132
|
- spec/dummy/db/migrate/20120819164528_add_association_with_class_name.rb
|
118
133
|
- spec/dummy/db/migrate/20130203095901_create_company.rb
|
119
134
|
- spec/dummy/db/schema.rb
|
120
|
-
- spec/dummy/db/test.sqlite3
|
121
135
|
- spec/dummy/public/404.html
|
122
136
|
- spec/dummy/public/422.html
|
123
137
|
- spec/dummy/public/500.html
|
@@ -199,7 +213,6 @@ test_files:
|
|
199
213
|
- spec/dummy/db/migrate/20120819164528_add_association_with_class_name.rb
|
200
214
|
- spec/dummy/db/migrate/20130203095901_create_company.rb
|
201
215
|
- spec/dummy/db/schema.rb
|
202
|
-
- spec/dummy/db/test.sqlite3
|
203
216
|
- spec/dummy/public/404.html
|
204
217
|
- spec/dummy/public/422.html
|
205
218
|
- spec/dummy/public/500.html
|
data/spec/dummy/db/test.sqlite3
DELETED
File without changes
|