file_column_with_s3 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/file_column.rb +1 -0
- data/test/abstract_unit.rb +1 -1
- data/test/file_column_helper_test.rb +11 -1
- data/test/file_column_test.rb +1 -1
- metadata +80 -93
data/lib/file_column.rb
CHANGED
@@ -718,6 +718,7 @@ module FileColumn # :nodoc:
|
|
718
718
|
define_method "#{attr}_download_url" do |context_path, *args|
|
719
719
|
subpath, store_url_for_option = args
|
720
720
|
state = send(state_method)
|
721
|
+
store_url_for_option ||= {}
|
721
722
|
relative_path = state.relative_path(subpath)
|
722
723
|
|
723
724
|
return nil unless relative_path
|
data/test/abstract_unit.rb
CHANGED
@@ -14,11 +14,21 @@ class UrlForFileColumnTest < Test::Unit::TestCase
|
|
14
14
|
FileColumn.config_store(:in_memory_with_url)
|
15
15
|
@e = Entry.new(:image => upload(f("skanthak.png")))
|
16
16
|
assert @e.save
|
17
|
-
assert_equal "store generated url for #{@e.image_relative_path}", url_for_file_column("e", "image")
|
17
|
+
assert_equal "store generated url for #{@e.image_relative_path} with options {}", url_for_file_column("e", "image")
|
18
18
|
ensure
|
19
19
|
FileColumn.config_store(:filesystem)
|
20
20
|
end
|
21
21
|
|
22
|
+
def test_should_should_pass_through_store_url_for_options
|
23
|
+
FileColumn.config_store(:in_memory_with_url)
|
24
|
+
@e = Entry.new(:image => upload(f("skanthak.png")))
|
25
|
+
assert @e.save
|
26
|
+
assert_equal "store generated url for #{@e.image_relative_path} with options {:expires_in=>200}", url_for_file_column("e", "image", nil, {:expires_in => 200 })
|
27
|
+
ensure
|
28
|
+
FileColumn.config_store(:filesystem)
|
29
|
+
end
|
30
|
+
|
31
|
+
|
22
32
|
def test_url_for_file_column_with_temp_entry
|
23
33
|
@e = Entry.new(:image => upload(f("skanthak.png")))
|
24
34
|
url = url_for_file_column("e", "image")
|
data/test/file_column_test.rb
CHANGED
@@ -695,7 +695,7 @@ class FileColumnDownloadUrlTest < Test::Unit::TestCase
|
|
695
695
|
FileColumn.config_store(:in_memory_with_url)
|
696
696
|
e = Entry.new(:image => upload(f("skanthak.png")))
|
697
697
|
assert e.save
|
698
|
-
assert_equal "store generated url for #{e.image_relative_path}", e.image_download_url(nil)
|
698
|
+
assert_equal "store generated url for #{e.image_relative_path} with options {}", e.image_download_url(nil)
|
699
699
|
ensure
|
700
700
|
FileColumn.config_store(:filesystem)
|
701
701
|
end
|
metadata
CHANGED
@@ -1,105 +1,102 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_column_with_s3
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.6
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 5
|
10
|
-
version: 0.1.5
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Mingle SaaS team
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2014-03-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: mingle-storage
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 15
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 0
|
32
|
-
- 8
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 0.0.8
|
34
22
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: rails
|
38
23
|
prerelease: false
|
39
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.0.8
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rails
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
40
33
|
none: false
|
41
|
-
requirements:
|
34
|
+
requirements:
|
42
35
|
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
hash: 19
|
45
|
-
segments:
|
46
|
-
- 2
|
47
|
-
- 3
|
48
|
-
- 8
|
36
|
+
- !ruby/object:Gem::Version
|
49
37
|
version: 2.3.8
|
50
38
|
type: :runtime
|
51
|
-
version_requirements: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: sqlite3
|
54
39
|
prerelease: false
|
55
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
56
41
|
none: false
|
57
|
-
requirements:
|
58
|
-
- -
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.3.8
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: sqlite3
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
64
54
|
type: :development
|
65
|
-
version_requirements: *id003
|
66
|
-
- !ruby/object:Gem::Dependency
|
67
|
-
name: rmagick
|
68
55
|
prerelease: false
|
69
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
70
57
|
none: false
|
71
|
-
requirements:
|
72
|
-
- -
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rmagick
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
78
70
|
type: :development
|
79
|
-
version_requirements: *id004
|
80
|
-
- !ruby/object:Gem::Dependency
|
81
|
-
name: aws-sdk
|
82
71
|
prerelease: false
|
83
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
84
73
|
none: false
|
85
|
-
requirements:
|
86
|
-
- -
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: aws-sdk
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
92
86
|
type: :development
|
93
|
-
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
94
|
description:
|
95
95
|
email: mingle.saas@thoughtworks.com
|
96
96
|
executables: []
|
97
|
-
|
98
97
|
extensions: []
|
99
|
-
|
100
98
|
extra_rdoc_files: []
|
101
|
-
|
102
|
-
files:
|
99
|
+
files:
|
103
100
|
- Rakefile
|
104
101
|
- lib/file_column/validations.rb
|
105
102
|
- lib/file_column.rb
|
@@ -125,36 +122,26 @@ files:
|
|
125
122
|
- s3_env.example
|
126
123
|
homepage: https://github.com/ThoughtWorksStudios/file_column
|
127
124
|
licenses: []
|
128
|
-
|
129
125
|
post_install_message:
|
130
126
|
rdoc_options: []
|
131
|
-
|
132
|
-
require_paths:
|
127
|
+
require_paths:
|
133
128
|
- lib
|
134
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
129
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
135
130
|
none: false
|
136
|
-
requirements:
|
137
|
-
- -
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
|
140
|
-
|
141
|
-
- 0
|
142
|
-
version: "0"
|
143
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - ! '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
136
|
none: false
|
145
|
-
requirements:
|
146
|
-
- -
|
147
|
-
- !ruby/object:Gem::Version
|
148
|
-
|
149
|
-
segments:
|
150
|
-
- 0
|
151
|
-
version: "0"
|
137
|
+
requirements:
|
138
|
+
- - ! '>='
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
152
141
|
requirements: []
|
153
|
-
|
154
142
|
rubyforge_project:
|
155
|
-
rubygems_version: 1.8.
|
143
|
+
rubygems_version: 1.8.29
|
156
144
|
signing_key:
|
157
145
|
specification_version: 3
|
158
146
|
summary: File attachment library for ruby
|
159
147
|
test_files: []
|
160
|
-
|