picgarage 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/pgupload +15 -7
- data/lib/picgarage/version.rb +1 -1
- data/lib/picgarage.rb +3 -3
- metadata +1 -1
data/bin/pgupload
CHANGED
@@ -11,18 +11,26 @@ end
|
|
11
11
|
|
12
12
|
image = ARGV[0]
|
13
13
|
|
14
|
-
|
14
|
+
begin
|
15
15
|
|
16
|
-
|
16
|
+
picgarage = PicGarage::PicGarage.new
|
17
17
|
|
18
|
-
|
18
|
+
short_url = picgarage.upload_image(image)
|
19
19
|
|
20
|
-
|
20
|
+
if RUBY_PLATFORM.downcase.include?("darwin")
|
21
21
|
|
22
|
-
|
22
|
+
IO.popen('pbcopy', 'r+') do |clipboard|
|
23
|
+
|
24
|
+
clipboard.puts short_url
|
25
|
+
|
26
|
+
end
|
23
27
|
|
24
28
|
end
|
25
29
|
|
26
|
-
|
30
|
+
puts short_url
|
27
31
|
|
28
|
-
|
32
|
+
rescue => error
|
33
|
+
|
34
|
+
puts error
|
35
|
+
|
36
|
+
end
|
data/lib/picgarage/version.rb
CHANGED
data/lib/picgarage.rb
CHANGED
@@ -28,19 +28,19 @@ module PicGarage
|
|
28
28
|
|
29
29
|
else
|
30
30
|
|
31
|
-
"Bad response from server, please try again."
|
31
|
+
raise "Bad response from server, please try again."
|
32
32
|
|
33
33
|
end
|
34
34
|
|
35
35
|
else
|
36
36
|
|
37
|
-
"Given image type is not accepted."
|
37
|
+
raise "Given image type is not accepted."
|
38
38
|
|
39
39
|
end
|
40
40
|
|
41
41
|
else
|
42
42
|
|
43
|
-
"Given image does not exist."
|
43
|
+
raise "Given image does not exist."
|
44
44
|
|
45
45
|
end
|
46
46
|
|