remote_files 1.4.0 → 1.4.1

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.
@@ -67,7 +67,7 @@ module RemoteFiles
67
67
  end
68
68
 
69
69
  def lookup_store(store_identifier)
70
- @stores_map[store_identifier]
70
+ @stores_map[store_identifier.to_sym]
71
71
  end
72
72
 
73
73
  def primary_store
@@ -3,11 +3,16 @@ module RemoteFiles
3
3
  attr_reader :content, :content_type, :identifier, :stored_in, :configuration
4
4
 
5
5
  def initialize(identifier, options = {})
6
+ known_keys = [:identifier, :stored_in, :content_type, :configuration, :content]
7
+ known_keys.each do |key|
8
+ options[key] ||= options.delete(key.to_s)
9
+ end
10
+
6
11
  @identifier = identifier
7
- @stored_in = options[:stored_in] || []
12
+ @stored_in = (options[:stored_in] || []).map(&:to_sym)
8
13
  @content = options.delete(:content)
9
14
  @content_type = options[:content_type]
10
- @configuration = RemoteFiles::CONFIGURATIONS[options[:configuration] || :default]
15
+ @configuration = RemoteFiles::CONFIGURATIONS[(options[:configuration] || :default).to_sym]
11
16
  @options = options
12
17
  end
13
18
 
@@ -4,15 +4,16 @@ require 'resque'
4
4
  module RemoteFiles
5
5
  class ResqueJob
6
6
  def self.perform(options)
7
- action = options.delete(:_action)
7
+ identifier = options.delete(:identifier) || options.delete("identifier")
8
+ action = options.delete(:_action) || options.delete("_action")
8
9
 
9
- file = RemoteFiles::File.new(options.delete(:identifier), options)
10
+ file = RemoteFiles::File.new(identifier, options)
10
11
 
11
- case action
12
+ case action.to_sym
12
13
  when :synchronize
13
14
  file.synchronize!
14
15
  when :delete
15
- file.delete_now!(file)
16
+ file.delete_now!
16
17
  else
17
18
  raise "unknown action #{action.inspect}"
18
19
  end
@@ -1,3 +1,3 @@
1
1
  module RemoteFiles
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
data/lib/remote_files.rb CHANGED
@@ -21,7 +21,7 @@ module RemoteFiles
21
21
  name = :default
22
22
  end
23
23
 
24
- CONFIGURATIONS[name].from_hash(hash)
24
+ CONFIGURATIONS[name.to_sym].from_hash(hash)
25
25
  end
26
26
 
27
27
  def self.add_store(store_identifier, options = {}, &block)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_files
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -148,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  segments:
150
150
  - 0
151
- hash: -1309416763629715964
151
+ hash: -2157945958237137625
152
152
  required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  none: false
154
154
  requirements:
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  version: '0'
158
158
  segments:
159
159
  - 0
160
- hash: -1309416763629715964
160
+ hash: -2157945958237137625
161
161
  requirements: []
162
162
  rubyforge_project:
163
163
  rubygems_version: 1.8.24