anaconda 1.0.3 → 1.0.4
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.
- checksums.yaml +4 -4
- data/README.markdown +3 -0
- data/lib/anaconda.rb +1 -1
- data/lib/anaconda/anaconda_for.rb +23 -0
- data/lib/anaconda/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7212d183f2965554be4f43394ea2dc65b396500b
|
4
|
+
data.tar.gz: bb52c4c5f4c1dd7ded8004f825a43de5eb460c1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80631dfd8a009772117b8fcd33aaa89b20fa0fe2f8ec82be36ec8378222f6f7baa723cddeaca084e22c87627f674937ef78400cfb6749e68d44a74701fd50dc2
|
7
|
+
data.tar.gz: 5ea78f6fbc7867a8722780bdc76c5143865de7430f30b3e651917e8fa68fb476de0d34fe71ac451ce976252c65260662299c4b0018ca68b1f96411eb502b15b7
|
data/README.markdown
CHANGED
@@ -202,6 +202,9 @@ If you return false to the following events it will prevent the default behavior
|
|
202
202
|
From version 1.0.0 on we have used [Semantic Versioning](http://semver.org/).
|
203
203
|
|
204
204
|
## Changelog
|
205
|
+
* 1.0.4
|
206
|
+
* Add `anaconda_form_data_for()` and `anaconda_form_data_for_all_columns` instance methods that return the raw data needed to upload to AWS
|
207
|
+
|
205
208
|
* 1.0.3
|
206
209
|
* Properly define dependencies so they are included
|
207
210
|
* Add support for non US Standard region buckets. See new `aws_endpoint` option in the config
|
data/lib/anaconda.rb
CHANGED
@@ -33,7 +33,7 @@ module Anaconda
|
|
33
33
|
yield self
|
34
34
|
|
35
35
|
@@aws[:aws_endpoint] = "s3.amazonaws.com/#{@@aws[:aws_bucket]}" unless @@aws[:aws_endpoint].present?
|
36
|
-
@@aws[:path_style] = !@@aws[:aws_endpoint].starts_with?(@@aws[:aws_bucket])
|
36
|
+
@@aws[:path_style] = !@@aws[:aws_endpoint].starts_with?(@@aws[:aws_bucket])
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.js_file_types
|
@@ -86,6 +86,29 @@ module Anaconda
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
+
def anaconda_form_data_for_all_columns
|
90
|
+
form_data = {}
|
91
|
+
self.anaconda_columns.each do |column|
|
92
|
+
form_data[column.to_sym] = anaconda_form_data_for column
|
93
|
+
end
|
94
|
+
form_data
|
95
|
+
end
|
96
|
+
|
97
|
+
def anaconda_form_data_for( anaconda_column )
|
98
|
+
if self.anaconda_columns.include? anaconda_column.to_sym
|
99
|
+
|
100
|
+
options = self.class.anaconda_options[anaconda_column.to_sym].dup
|
101
|
+
|
102
|
+
options[:base_key] = self.send(options[:base_key].to_s) if options[:base_key].kind_of? Symbol
|
103
|
+
uploader = Anaconda::S3Uploader.new(options)
|
104
|
+
fields = uploader.fields
|
105
|
+
fields[:post_url] = uploader.url
|
106
|
+
fields
|
107
|
+
else
|
108
|
+
raise "#{anaconda_column} not configured for anaconda. Misspelling or did you forget to add the anaconda_for call for this field?"
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
89
112
|
private
|
90
113
|
def anaconda_url(column_name, *args)
|
91
114
|
return nil unless send("#{column_name}_file_path").present?
|
data/lib/anaconda/version.rb
CHANGED