pictate 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -4
- data/Gemfile.lock +12 -13
- data/VERSION +1 -1
- data/bin/pictate +8 -0
- data/lib/pictate.rb +17 -4
- data/pictate.gemspec +11 -15
- metadata +11 -28
- data/ext/.gitignore +0 -0
data/Gemfile
CHANGED
@@ -6,13 +6,12 @@ source "http://rubygems.org"
|
|
6
6
|
# Add dependencies to develop your gem here.
|
7
7
|
# Include everything needed to run rake, tests, features, etc.
|
8
8
|
group :development do
|
9
|
-
gem "shoulda", "
|
9
|
+
gem "shoulda", "~> 3.0.0"
|
10
10
|
gem "rdoc", "~> 3.12"
|
11
11
|
gem "bundler", "~> 1.1.0"
|
12
12
|
gem "jeweler", "~> 1.8.3"
|
13
|
-
gem "simplecov", ">= 0"
|
14
13
|
end
|
15
14
|
|
16
|
-
gem "selenium-webdriver", "~> 2.
|
15
|
+
gem "selenium-webdriver", "~> 2.21.2"
|
17
16
|
gem "choice", "~> 0.1.6"
|
18
|
-
gem "spinning_cursor", "~> 0.1.
|
17
|
+
gem "spinning_cursor", "~> 0.1.2"
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
4
|
+
addressable (2.2.7)
|
5
|
+
childprocess (0.3.2)
|
5
6
|
ffi (~> 1.0.6)
|
6
7
|
choice (0.1.6)
|
7
8
|
ffi (1.0.11)
|
@@ -12,14 +13,17 @@ GEM
|
|
12
13
|
rake
|
13
14
|
rdoc
|
14
15
|
json (1.6.6)
|
15
|
-
|
16
|
+
libwebsocket (0.1.3)
|
17
|
+
addressable
|
18
|
+
multi_json (1.3.2)
|
16
19
|
rake (0.9.2.2)
|
17
20
|
rdoc (3.12)
|
18
21
|
json (~> 1.4)
|
19
|
-
rubyzip (0.9.
|
20
|
-
selenium-webdriver (2.
|
22
|
+
rubyzip (0.9.8)
|
23
|
+
selenium-webdriver (2.21.2)
|
21
24
|
childprocess (>= 0.2.5)
|
22
25
|
ffi (~> 1.0)
|
26
|
+
libwebsocket (~> 0.1.3)
|
23
27
|
multi_json (~> 1.0)
|
24
28
|
rubyzip
|
25
29
|
shoulda (3.0.1)
|
@@ -27,11 +31,7 @@ GEM
|
|
27
31
|
shoulda-matchers (~> 1.0.0)
|
28
32
|
shoulda-context (1.0.0)
|
29
33
|
shoulda-matchers (1.0.0)
|
30
|
-
|
31
|
-
multi_json (~> 1.0)
|
32
|
-
simplecov-html (~> 0.5.3)
|
33
|
-
simplecov-html (0.5.3)
|
34
|
-
spinning_cursor (0.1.0.rc1)
|
34
|
+
spinning_cursor (0.1.2)
|
35
35
|
|
36
36
|
PLATFORMS
|
37
37
|
ruby
|
@@ -41,7 +41,6 @@ DEPENDENCIES
|
|
41
41
|
choice (~> 0.1.6)
|
42
42
|
jeweler (~> 1.8.3)
|
43
43
|
rdoc (~> 3.12)
|
44
|
-
selenium-webdriver (~> 2.
|
45
|
-
shoulda
|
46
|
-
|
47
|
-
spinning_cursor (~> 0.1.0.rc1)
|
44
|
+
selenium-webdriver (~> 2.21.2)
|
45
|
+
shoulda (~> 3.0.0)
|
46
|
+
spinning_cursor (~> 0.1.2)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/bin/pictate
CHANGED
@@ -29,6 +29,14 @@ def show_error str="There was an error with the parsing..."
|
|
29
29
|
exit
|
30
30
|
end
|
31
31
|
|
32
|
+
#
|
33
|
+
# Check if java exists (needed for selenium)
|
34
|
+
#
|
35
|
+
`which java`
|
36
|
+
if not $?.success?
|
37
|
+
show_error "Java is not installed. Pictate uses Selenium and HTMLUnit java applications."
|
38
|
+
end
|
39
|
+
|
32
40
|
#
|
33
41
|
# Check image extension
|
34
42
|
#
|
data/lib/pictate.rb
CHANGED
@@ -33,17 +33,23 @@ module Pictate
|
|
33
33
|
selenium_path = server_path
|
34
34
|
else
|
35
35
|
previous_wd = FileUtils.pwd
|
36
|
-
|
36
|
+
begin
|
37
|
+
FileUtils.cd(File.join ENV['HOME'], '.selenium')
|
38
|
+
rescue
|
39
|
+
FileUtils.mkdir(File.join ENV['HOME'], '.selenium')
|
40
|
+
FileUtils.cd(File.join ENV['HOME'], '.selenium')
|
41
|
+
end
|
37
42
|
selenium_latest = Selenium::Server.latest
|
38
43
|
if not File.exists? "selenium-server-standalone-#{selenium_latest}.jar"
|
44
|
+
@download = true
|
39
45
|
SpinningCursor.set_banner "Downloading latest version of selenium " +
|
40
46
|
"server standalone"
|
41
47
|
end
|
42
|
-
selenium_path = Selenium::Server.download(selenium_latest)
|
48
|
+
@selenium_path = Selenium::Server.download(selenium_latest)
|
43
49
|
end
|
44
50
|
|
45
51
|
SpinningCursor.set_banner "Starting selenium standalone server"
|
46
|
-
@server = Selenium::Server.new(selenium_path, :background => true)
|
52
|
+
@server = Selenium::Server.new(@selenium_path, :background => true)
|
47
53
|
@server.start
|
48
54
|
caps = Selenium::WebDriver::Remote::Capabilities.htmlunit(
|
49
55
|
:javascript_enabled => true)
|
@@ -57,6 +63,14 @@ module Pictate
|
|
57
63
|
def stop_server
|
58
64
|
@driver.quit
|
59
65
|
@server.stop
|
66
|
+
if @download
|
67
|
+
SpinningCursor.set_message <<-EOF
|
68
|
+
#{SpinningCursor.set_message nil}
|
69
|
+
|
70
|
+
Selenium was downloaded to #{@selenium_path}.
|
71
|
+
You can remove it if you need, but note that pictate will download it again if you don't specify another path.
|
72
|
+
EOF
|
73
|
+
end
|
60
74
|
end
|
61
75
|
|
62
76
|
#
|
@@ -82,6 +96,5 @@ module Pictate
|
|
82
96
|
best.gsub!("Best guess for this image:", "")
|
83
97
|
result = "I believe this is a picture of: #{best}."
|
84
98
|
end
|
85
|
-
result
|
86
99
|
end
|
87
100
|
end
|
data/pictate.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "pictate"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Adnan Abdulhussein"]
|
12
|
-
s.date = "2012-04-
|
12
|
+
s.date = "2012-04-28"
|
13
13
|
s.description = "Pointless command line tool that attempts to describe the image you give it by automating a google search by image."
|
14
14
|
s.email = "adnan@prydoni.us"
|
15
15
|
s.executables = ["pictate"]
|
@@ -26,7 +26,6 @@ Gem::Specification.new do |s|
|
|
26
26
|
"Rakefile",
|
27
27
|
"VERSION",
|
28
28
|
"bin/pictate",
|
29
|
-
"ext/.gitignore",
|
30
29
|
"lib/pictate.rb",
|
31
30
|
"pictate.gemspec",
|
32
31
|
"test/helper.rb",
|
@@ -42,33 +41,30 @@ Gem::Specification.new do |s|
|
|
42
41
|
s.specification_version = 3
|
43
42
|
|
44
43
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
45
|
-
s.add_runtime_dependency(%q<selenium-webdriver>, ["~> 2.
|
44
|
+
s.add_runtime_dependency(%q<selenium-webdriver>, ["~> 2.21.2"])
|
46
45
|
s.add_runtime_dependency(%q<choice>, ["~> 0.1.6"])
|
47
|
-
s.add_runtime_dependency(%q<spinning_cursor>, ["~> 0.1.
|
48
|
-
s.add_development_dependency(%q<shoulda>, ["
|
46
|
+
s.add_runtime_dependency(%q<spinning_cursor>, ["~> 0.1.2"])
|
47
|
+
s.add_development_dependency(%q<shoulda>, ["~> 3.0.0"])
|
49
48
|
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
50
49
|
s.add_development_dependency(%q<bundler>, ["~> 1.1.0"])
|
51
50
|
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
52
|
-
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
53
51
|
else
|
54
|
-
s.add_dependency(%q<selenium-webdriver>, ["~> 2.
|
52
|
+
s.add_dependency(%q<selenium-webdriver>, ["~> 2.21.2"])
|
55
53
|
s.add_dependency(%q<choice>, ["~> 0.1.6"])
|
56
|
-
s.add_dependency(%q<spinning_cursor>, ["~> 0.1.
|
57
|
-
s.add_dependency(%q<shoulda>, ["
|
54
|
+
s.add_dependency(%q<spinning_cursor>, ["~> 0.1.2"])
|
55
|
+
s.add_dependency(%q<shoulda>, ["~> 3.0.0"])
|
58
56
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
59
57
|
s.add_dependency(%q<bundler>, ["~> 1.1.0"])
|
60
58
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
61
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
62
59
|
end
|
63
60
|
else
|
64
|
-
s.add_dependency(%q<selenium-webdriver>, ["~> 2.
|
61
|
+
s.add_dependency(%q<selenium-webdriver>, ["~> 2.21.2"])
|
65
62
|
s.add_dependency(%q<choice>, ["~> 0.1.6"])
|
66
|
-
s.add_dependency(%q<spinning_cursor>, ["~> 0.1.
|
67
|
-
s.add_dependency(%q<shoulda>, ["
|
63
|
+
s.add_dependency(%q<spinning_cursor>, ["~> 0.1.2"])
|
64
|
+
s.add_dependency(%q<shoulda>, ["~> 3.0.0"])
|
68
65
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
69
66
|
s.add_dependency(%q<bundler>, ["~> 1.1.0"])
|
70
67
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
71
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
72
68
|
end
|
73
69
|
end
|
74
70
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pictate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
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-04-
|
12
|
+
date: 2012-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: selenium-webdriver
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 2.21.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 2.21.2
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: choice
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.1.
|
53
|
+
version: 0.1.2
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,23 +58,23 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.1.
|
61
|
+
version: 0.1.2
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: shoulda
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 3.0.0
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: 3.0.0
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: rdoc
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,22 +123,6 @@ dependencies:
|
|
123
123
|
- - ~>
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: 1.8.3
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: simplecov
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
|
-
requirements:
|
131
|
-
- - ! '>='
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version: '0'
|
134
|
-
type: :development
|
135
|
-
prerelease: false
|
136
|
-
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
|
-
requirements:
|
139
|
-
- - ! '>='
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
version: '0'
|
142
126
|
description: Pointless command line tool that attempts to describe the image you give
|
143
127
|
it by automating a google search by image.
|
144
128
|
email: adnan@prydoni.us
|
@@ -157,7 +141,6 @@ files:
|
|
157
141
|
- Rakefile
|
158
142
|
- VERSION
|
159
143
|
- bin/pictate
|
160
|
-
- ext/.gitignore
|
161
144
|
- lib/pictate.rb
|
162
145
|
- pictate.gemspec
|
163
146
|
- test/helper.rb
|
@@ -177,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
177
160
|
version: '0'
|
178
161
|
segments:
|
179
162
|
- 0
|
180
|
-
hash: -
|
163
|
+
hash: -1159349662437453405
|
181
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
165
|
none: false
|
183
166
|
requirements:
|
data/ext/.gitignore
DELETED
File without changes
|