selfiegram 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +10 -0
- data/VERSION +1 -1
- data/lib/background_images/downloader.rb +1 -1
- data/lib/background_images/finder.rb +13 -9
- data/selfiegram.gemspec +10 -4
- data/writing/tmp/folks_i_love/background.jpg +0 -0
- data/writing/tmp/folks_i_love/background.png +0 -0
- data/writing/tmp/folks_i_love/final.png +0 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 646e0065c637523eecb871677971d95f0763e543
|
4
|
+
data.tar.gz: 4d14958a03b55a7040cb1fd3ace918c17daf7639
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73817902a3fae90e0e950295b77d9b61093edb77e76cc6fc35fab11e620a946ec078605811d46b7dbdfb10a92492fc229f8e395c1674b542e600ac82ef738f95
|
7
|
+
data.tar.gz: 8c350dd2dccbc06de658dfe9987ce925bf93cf655862d2e788d16448902a912613c1a6d821db51336e1ac4fd234dce239a57a6b4bd7aab81118abc58f65ef47c
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -9,9 +9,15 @@ GEM
|
|
9
9
|
tzinfo (~> 1.1)
|
10
10
|
addressable (2.3.6)
|
11
11
|
builder (3.2.2)
|
12
|
+
byebug (3.5.1)
|
13
|
+
columnize (~> 0.8)
|
14
|
+
debugger-linecache (~> 1.2)
|
15
|
+
slop (~> 3.6)
|
12
16
|
celluloid (0.16.0)
|
13
17
|
timers (~> 4.0.0)
|
14
18
|
coderay (1.1.0)
|
19
|
+
columnize (0.8.9)
|
20
|
+
debugger-linecache (1.2.0)
|
15
21
|
descendants_tracker (0.0.4)
|
16
22
|
thread_safe (~> 0.3, >= 0.3.1)
|
17
23
|
diff-lcs (1.2.5)
|
@@ -76,6 +82,9 @@ GEM
|
|
76
82
|
coderay (~> 1.1.0)
|
77
83
|
method_source (~> 0.8.1)
|
78
84
|
slop (~> 3.4)
|
85
|
+
pry-byebug (2.0.0)
|
86
|
+
byebug (~> 3.4)
|
87
|
+
pry (~> 0.10)
|
79
88
|
rack (1.5.2)
|
80
89
|
rake (10.3.2)
|
81
90
|
rb-fsevent (0.9.4)
|
@@ -122,6 +131,7 @@ DEPENDENCIES
|
|
122
131
|
bundler (~> 1.0)
|
123
132
|
guard-rspec
|
124
133
|
jeweler (~> 2.0.1)
|
134
|
+
pry-byebug
|
125
135
|
rdoc (~> 3.12)
|
126
136
|
rmagick
|
127
137
|
rspec
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module BackgroundImages
|
2
2
|
class Finder
|
3
|
-
attr_accessor :find_image_of, :max_attempts
|
3
|
+
attr_accessor :find_image_of, :max_attempts, :results
|
4
4
|
|
5
5
|
def initialize(find_image_of = "Brad Pitt's Ghost")
|
6
6
|
@find_image_of = find_image_of
|
@@ -8,15 +8,19 @@ module BackgroundImages
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def find_many(attempt=1)
|
11
|
-
|
12
|
-
raise "Unable to get response from Google Image search"
|
13
|
-
end
|
11
|
+
return results unless results.nil?
|
14
12
|
|
15
|
-
|
13
|
+
if attempt > @max_attempts
|
14
|
+
raise "Unable to get response from Google Image search"
|
15
|
+
end
|
16
16
|
|
17
|
-
|
17
|
+
response = JSON.parse(find_command)
|
18
18
|
|
19
|
-
|
19
|
+
return find_many(attempt+1) unless valid_image_search_response?(response)
|
20
|
+
|
21
|
+
results = response["responseData"]["results"]
|
22
|
+
|
23
|
+
return results
|
20
24
|
end
|
21
25
|
|
22
26
|
def find_one(method=:first)
|
@@ -25,9 +29,9 @@ module BackgroundImages
|
|
25
29
|
return result
|
26
30
|
end
|
27
31
|
|
28
|
-
|
32
|
+
private
|
29
33
|
def valid_image_search_response?(response)
|
30
|
-
response.is_a?(Hash) && response.has_key?("responseData")
|
34
|
+
response.is_a?(Hash) && response.has_key?("responseData") && response["responseData"].has_key?("results")
|
31
35
|
end
|
32
36
|
|
33
37
|
def find_command
|
data/selfiegram.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: selfiegram 0.0.
|
5
|
+
# stub: selfiegram 0.0.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "selfiegram"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.6"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Brett Shollenberger"]
|
14
|
-
s.date = "2014-
|
14
|
+
s.date = "2014-12-02"
|
15
15
|
s.description = "Take mad selfies!"
|
16
16
|
s.email = "brett.shollenberger@gmail.com"
|
17
17
|
s.executables = ["selfie"]
|
@@ -39,7 +39,10 @@ Gem::Specification.new do |s|
|
|
39
39
|
"selfiegram.gemspec",
|
40
40
|
"selfies/people/brett.png",
|
41
41
|
"selfies/people/brettcassette.png",
|
42
|
-
"spec/spec_helper.rb"
|
42
|
+
"spec/spec_helper.rb",
|
43
|
+
"writing/tmp/folks_i_love/background.jpg",
|
44
|
+
"writing/tmp/folks_i_love/background.png",
|
45
|
+
"writing/tmp/folks_i_love/final.png"
|
43
46
|
]
|
44
47
|
s.homepage = "http://github.com/brettshollenberger/selfiegram"
|
45
48
|
s.licenses = ["MIT"]
|
@@ -51,6 +54,7 @@ Gem::Specification.new do |s|
|
|
51
54
|
|
52
55
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
53
56
|
s.add_runtime_dependency(%q<rmagick>, [">= 0"])
|
57
|
+
s.add_runtime_dependency(%q<pry-byebug>, [">= 0"])
|
54
58
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
55
59
|
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
56
60
|
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
@@ -60,6 +64,7 @@ Gem::Specification.new do |s|
|
|
60
64
|
s.add_development_dependency(%q<guard-rspec>, [">= 0"])
|
61
65
|
else
|
62
66
|
s.add_dependency(%q<rmagick>, [">= 0"])
|
67
|
+
s.add_dependency(%q<pry-byebug>, [">= 0"])
|
63
68
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
64
69
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
65
70
|
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
@@ -70,6 +75,7 @@ Gem::Specification.new do |s|
|
|
70
75
|
end
|
71
76
|
else
|
72
77
|
s.add_dependency(%q<rmagick>, [">= 0"])
|
78
|
+
s.add_dependency(%q<pry-byebug>, [">= 0"])
|
73
79
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
74
80
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
75
81
|
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selfiegram
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Shollenberger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry-byebug
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: shoulda
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,6 +165,9 @@ files:
|
|
151
165
|
- selfies/people/brett.png
|
152
166
|
- selfies/people/brettcassette.png
|
153
167
|
- spec/spec_helper.rb
|
168
|
+
- writing/tmp/folks_i_love/background.jpg
|
169
|
+
- writing/tmp/folks_i_love/background.png
|
170
|
+
- writing/tmp/folks_i_love/final.png
|
154
171
|
homepage: http://github.com/brettshollenberger/selfiegram
|
155
172
|
licenses:
|
156
173
|
- MIT
|