s3lurp 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG ADDED
@@ -0,0 +1,15 @@
1
+ v0.4.4
2
+
3
+ * add multiple_files option to add multiple=true attribute to the file input
4
+
5
+ v0.4.3
6
+
7
+ * fix backwards compatibility
8
+
9
+ v0.4.2
10
+
11
+ * change s3_* authorization options to aws_*
12
+
13
+ v0.4.1
14
+
15
+ * initial release
data/README.md CHANGED
@@ -131,6 +131,7 @@ to the helper in a hash.
131
131
  |__:minutes\_valid__ | Length of time in minutes that the generated form is valid. _Default:_ 360 |
132
132
  |__:form\_html\_options__ | Hash of additional options that is passed to the form_tag contructor. |
133
133
  |__:file\_field\_tag\_accept__ | Sets the accept parameter of the file field tag. [?](http://www.w3.org/TR/html-markup/input.file.html#input.file.attrs.accept) |
134
+ |__:multiple\_files__ | Sets multiple=true for the file field input |
134
135
  |__:submit\_tag__ | HTML string containing code for the input or button that will handle form submission. This is optional and if not included a basic submit tag will be generated for the form. |
135
136
  |__:submit\_tag\_value__ | Override the value of the standard generated submit tag. _Default:_ "Upload" |
136
137
  |__:submit\_tag\_options__ | Hash of options passed to the submit_tag generator. |
@@ -1,3 +1,3 @@
1
1
  module S3lurp
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
@@ -19,7 +19,7 @@ module S3lurp
19
19
  NON_FIELD_OPTIONS = %w( s3_bucket aws_secret_key
20
20
  max_file_size min_file_size
21
21
  amz_meta_tags minutes_valid
22
- form_html_options file_field_tag_accept
22
+ form_html_options file_field_tag_accept multiple_files
23
23
  submit_tag submit_tag_value submit_tag_options).map(&:to_sym)
24
24
 
25
25
  def s3_direct_form_tag(opt = {})
@@ -116,11 +116,10 @@ module S3lurp
116
116
  end
117
117
 
118
118
  def s3_generate_file_field_tag(opt ={})
119
- if opt[:file_field_tag_accept]
120
- file_field_tag('file', :accept => opt[:file_field_tag_accept], :class => 's3lurp_file_tag')
121
- else
122
- file_field_tag('file', :class => 's3lurp_file_tag')
123
- end
119
+ opts = {:class => 's3lurp_file_tag'}
120
+ opts.merge!({:accept => opt[:file_field_tag_accept]}) if opt[:file_field_tag_accept]
121
+ opts.merge!({:multiple => true}) if opt[:multiple_files]
122
+ file_field_tag('file', opts)
124
123
  end
125
124
 
126
125
  end
data/lib/s3lurp.rb CHANGED
@@ -10,7 +10,7 @@ module S3lurp
10
10
  :success_action_redirect, :success_action_status,
11
11
  :min_file_size, :max_file_size,
12
12
  :amz_meta_tags, :minutes_valid,
13
- :form_html_options, :file_field_tag_accept,
13
+ :form_html_options, :file_field_tag_accept, :multiple_files,
14
14
  :submit_tag, :submit_tag_value, :submit_tag_options,
15
15
  :file, :key].freeze
16
16
  class << self
data/spec/s3lurp_spec.rb CHANGED
@@ -86,6 +86,9 @@ describe S3lurp::ViewHelpers do
86
86
  view.s3_generate_file_field_tag({:file_field_tag_accept => "image/*"}).should include('accept="image/*"')
87
87
  end
88
88
 
89
+ it 'should generate file field tag with multiple true' do
90
+ view.s3_generate_file_field_tag({:multiple_files => true}).should include('multiple')
91
+ end
89
92
 
90
93
  end
91
94
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3lurp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-10 00:00:00.000000000 Z
12
+ date: 2013-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -100,6 +100,7 @@ extra_rdoc_files: []
100
100
  files:
101
101
  - .gitignore
102
102
  - .rspec
103
+ - CHANGELOG
103
104
  - Gemfile
104
105
  - LICENSE.txt
105
106
  - README.md
@@ -127,7 +128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
128
  version: '0'
128
129
  segments:
129
130
  - 0
130
- hash: -4220849144564821796
131
+ hash: 2497482005412700173
131
132
  required_rubygems_version: !ruby/object:Gem::Requirement
132
133
  none: false
133
134
  requirements:
@@ -136,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  version: '0'
137
138
  segments:
138
139
  - 0
139
- hash: -4220849144564821796
140
+ hash: 2497482005412700173
140
141
  requirements: []
141
142
  rubyforge_project:
142
143
  rubygems_version: 1.8.25