flash_cookie_session 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,4 +1,2 @@
1
1
  source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in flash_cookie_session.gemspec
4
2
  gemspec
@@ -38,6 +38,7 @@ I'm not sure who first figured everything out, so I won't bother trying to credi
38
38
  file_queue_limit : 20,
39
39
 
40
40
  file_queued_handler : fileQueued,
41
+ file_queue_error_handler : fileQueueError,
41
42
  upload_start_handler : uploadStart,
42
43
  upload_progress_handler : uploadProgress,
43
44
  upload_success_handler : uploadSuccess,
@@ -45,24 +46,32 @@ I'm not sure who first figured everything out, so I won't bother trying to credi
45
46
  });
46
47
 
47
48
  function fileQueued(file){
48
- // alert('queued');
49
49
  this.startUpload();
50
50
  }
51
51
 
52
- function uploadStart(file){
53
- // alert('start');
52
+ function fileQueueError(file, errorCode, message) {
53
+ alert(message);
54
+ }
55
+
56
+ function uploadStart(file) {
57
+ alert('uploadStart');
54
58
  }
55
59
 
56
60
  function uploadProgress(file, bytesLoaded, bytesTotal){
61
+ alert('uploadProgress');
57
62
  }
58
63
 
59
64
  function uploadSuccess(file, serverData){
60
- // alert('success');
65
+ alert('uploadSuccess');
61
66
  }
62
67
 
63
68
  function uploadComplete(file){
64
- // alert('complete');
65
- this.startUpload();
69
+ if (this.getStats().files_queued > 0) {
70
+ this.startUpload();
71
+ }
72
+ else {
73
+ alert('uploadComplete');
74
+ }
66
75
  }
67
76
 
68
77
  With SWFUpload, the post_params are sent along with the file upload, which would be in params[:Filedata] in this example.
@@ -18,6 +18,6 @@ Gem::Specification.new do |s|
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
-
21
+
22
22
  s.add_dependency("rails", ["~> 3.0"])
23
23
  end
@@ -4,19 +4,23 @@ module FlashCookieSession
4
4
  class Railtie < Rails::Railtie
5
5
  initializer "flash_cookie_session.initializer" do
6
6
 
7
- # Manually load the session_store config file
8
- # even though this shouldn't be necessary
9
- # otherwise Rails.application.config.session_options[:key] comes up nil :(
7
+ # Manually load the config file even though we shouldn't need to,
8
+ # otherwise Rails.application.config.session_options[:key] comes up nil
10
9
  session_store_config = Rails.root.join('config/initializers/session_store.rb')
11
10
 
12
11
  if session_store_config.exist?
13
12
  require session_store_config
14
13
  end
15
14
 
15
+ session_store = Rails.application.config.session_store
16
+ session_key = Rails.application.config.session_options[:key]
17
+
18
+ raise 'FlashCookieSession config missing' unless session_store && session_key
19
+
16
20
  Rails.application.middleware.insert_before(
17
- Rails.application.config.session_store,
21
+ session_store,
18
22
  "FlashCookieSession::Middleware",
19
- Rails.application.config.session_options[:key]
23
+ session_key
20
24
  )
21
25
  end
22
26
  end
@@ -1,3 +1,3 @@
1
1
  module FlashCookieSession
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flash_cookie_session
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Trevor Turk
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-12 00:00:00 +01:00
18
+ date: 2010-11-01 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency