smeargle 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/README.md +9 -2
- data/lib/smeargle/image.rb +8 -4
- data/lib/smeargle/sketch.rb +6 -0
- data/lib/smeargle/version.rb +1 -1
- data/smeargle.gemspec +1 -1
- data/spec/smeargle/sketch_spec.rb +7 -0
- metadata +7 -7
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
# Smeargle [![
|
2
|
-
Status](https://secure.travis-ci.org/mockra/smeargle.png)](http://travis-ci.org/mockra/smeargle)
|
1
|
+
# Smeargle [![BuildStatus](https://secure.travis-ci.org/mockra/smeargle.png)](http://travis-ci.org/mockra/smeargle)
|
3
2
|
|
4
3
|
Smeargle is an image collection tool that will return an object
|
5
4
|
containing images from a given URL. Smeargle was designed to be
|
@@ -82,3 +81,11 @@ urls, and is faster than the images method.
|
|
82
81
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
83
82
|
4. Push to the branch (`git push origin my-new-feature`)
|
84
83
|
5. Create new Pull Request
|
84
|
+
|
85
|
+
## Contact
|
86
|
+
|
87
|
+
[david@mockra.com](mailto:david@mockra.com)
|
88
|
+
|
89
|
+
[@Mockra_](http://twitter.com/#!/mockra_)
|
90
|
+
|
91
|
+
[mockra.com](http://mockra.com)
|
data/lib/smeargle/image.rb
CHANGED
@@ -31,16 +31,20 @@ module Smeargle
|
|
31
31
|
|
32
32
|
def image_format img
|
33
33
|
if URI(img).relative?
|
34
|
-
self.
|
34
|
+
self.clean_url + img
|
35
35
|
else
|
36
36
|
img
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
def image_details img
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
begin
|
42
|
+
remote_image = open img
|
43
|
+
image = Magick::Image::from_blob(remote_image.read).first
|
44
|
+
{ url: img, height: image.columns, width: image.rows }
|
45
|
+
rescue
|
46
|
+
nil
|
47
|
+
end
|
44
48
|
end
|
45
49
|
|
46
50
|
def filtered_images
|
data/lib/smeargle/sketch.rb
CHANGED
data/lib/smeargle/version.rb
CHANGED
data/smeargle.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
|
20
20
|
gem.add_development_dependency 'rake'
|
21
21
|
gem.add_development_dependency 'rspec'
|
22
|
+
gem.add_development_dependency 'fakeweb'
|
22
23
|
gem.add_dependency 'nokogiri'
|
23
|
-
gem.add_dependency 'fakeweb'
|
24
24
|
gem.add_dependency 'rmagick'
|
25
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smeargle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.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: 2012-09-
|
12
|
+
date: 2012-09-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
47
|
+
name: fakeweb
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
51
51
|
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
|
-
type: :
|
54
|
+
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
@@ -60,7 +60,7 @@ dependencies:
|
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
63
|
+
name: nokogiri
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
@@ -128,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
128
128
|
version: '0'
|
129
129
|
segments:
|
130
130
|
- 0
|
131
|
-
hash:
|
131
|
+
hash: -3610093232473006616
|
132
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
133
|
none: false
|
134
134
|
requirements:
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
segments:
|
139
139
|
- 0
|
140
|
-
hash:
|
140
|
+
hash: -3610093232473006616
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
143
|
rubygems_version: 1.8.23
|