aws_imageshack 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/aws_imageshack-0.3.0.gem +0 -0
- data/lib/aws_imageshack.rb +9 -6
- metadata +4 -3
data/Rakefile
CHANGED
Binary file
|
data/lib/aws_imageshack.rb
CHANGED
@@ -37,9 +37,11 @@ with(window.parent) { setTimeout(function() { window.eval('#{self.class.helpers.
|
|
37
37
|
@aws_options = options[:options]
|
38
38
|
if @aws_params[:aws] and @aws_params[:aws][:fileupload]
|
39
39
|
image_link = aws_imageshack_save(@aws_params, @aws_api_key)
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
if image_link
|
41
|
+
responds_to_parent do
|
42
|
+
render :update do |page|
|
43
|
+
page.replace 'aws_upload_form', :inline => aws_image_shack_form(image_link)
|
44
|
+
end
|
43
45
|
end
|
44
46
|
end
|
45
47
|
return image_link
|
@@ -48,9 +50,10 @@ with(window.parent) { setTimeout(function() { window.eval('#{self.class.helpers.
|
|
48
50
|
|
49
51
|
def aws_imageshack_save(params, api_key)
|
50
52
|
require "net/http"
|
51
|
-
require "net/http/post/multipart"
|
52
|
-
|
53
|
-
|
53
|
+
require "net/http/post/multipart"
|
54
|
+
if params[:aws][:fileupload] == ''
|
55
|
+
return nil
|
56
|
+
end
|
54
57
|
name = params[:aws][:fileupload].original_filename
|
55
58
|
directory = 'tmp/uploads'
|
56
59
|
`mkdir "#{directory}"` if !File.exists?(directory)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws_imageshack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 4
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Denis FABIEN
|
@@ -43,6 +43,7 @@ extra_rdoc_files:
|
|
43
43
|
files:
|
44
44
|
- aws_imageshack-0.1.0.gem
|
45
45
|
- aws_imageshack-0.2.0.gem
|
46
|
+
- aws_imageshack-0.3.0.gem
|
46
47
|
- init.rb
|
47
48
|
- install.rb
|
48
49
|
- MIT-LICENSE
|