aws_imageshack 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ end
17
17
 
18
18
  spec = Gem::Specification.new do |s|
19
19
  s.name = "aws_imageshack"
20
- s.version = "0.3.0"
20
+ s.version = "0.4.0"
21
21
  s.author = "Denis FABIEN"
22
22
  s.email = "denis@miseajour.net"
23
23
  s.add_dependency('multipart-post')
Binary file
@@ -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
- responds_to_parent do
41
- render :update do |page|
42
- page.replace 'aws_upload_form', :inline => aws_image_shack_form(image_link)
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
- return '' if params[:aws][:fileupload] == ''
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: 19
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.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