right_publish 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,56 @@
1
+ require 'right_publish/stores/local'
2
+ require 'spec_helper'
3
+
4
+ describe RightPublish::LocalStorage do
5
+
6
+ before(:each) do
7
+ flexmock(RightPublish::Profile) do |obj|
8
+ obj.should_receive(:log).and_return { |str,dbg|
9
+ }
10
+
11
+ obj.should_receive(:config).and_return {
12
+ { :verbose=>false,
13
+ :remote_storage=>{:provider=>'s3',:remote_path=>'foo/'},
14
+ :local_storage=>{:provider=>'mocklocal',:cache_dir=>'bar/'}
15
+ }
16
+ }
17
+ end
18
+
19
+ fog = flexmock(Fog::Storage)
20
+ fog.should_receive(:new).and_return do
21
+ conn = flexmock('Connection')
22
+ conn.should_receive(:directories).and_return do
23
+ buckets = flexmock('Buckets')
24
+ buckets.should_receive(:get).and_return do
25
+ dir = flexmock('Directory')
26
+ dir.should_receive(:key).and_return('/')
27
+ dir.should_receive(:service).and_return do
28
+ path = flexmock('Path')
29
+ path.should_receive(:path_to).and_return {|k|k}
30
+ path
31
+ end
32
+ dir
33
+ end
34
+ buckets.should_receive(:create)
35
+ buckets
36
+ end
37
+ conn
38
+ end
39
+ end
40
+
41
+ context ".compute_md5" do
42
+ it "uses Digest::MD5 to compute the MD5 sum" do
43
+ file = flexmock('File') do |obj|
44
+ obj.should_receive(:key).once.and_return("filename")
45
+ end
46
+
47
+ digest = flexmock(Digest::MD5)
48
+ digest.should_receive(:file).once.and_return(digest)
49
+ digest.should_receive(:hexdigest).once
50
+
51
+ dir = RightPublish::LocalStorage.get_directories
52
+ dir.compute_md5(file)
53
+ end
54
+ end
55
+ end
56
+
@@ -0,0 +1,44 @@
1
+ require 'right_publish/stores/s3'
2
+ require 'spec_helper'
3
+
4
+ describe RightPublish::S3Storage do
5
+
6
+ before(:each) do
7
+ flexmock(RightPublish::Profile) do |obj|
8
+ obj.should_receive(:log).and_return { |str,dbg|
9
+ }
10
+
11
+ obj.should_receive(:config).and_return {
12
+ { :verbose=>false,
13
+ :remote_storage=>{:provider=>'s3',:remote_path=>'foo/'},
14
+ :local_storage=>{:provider=>'mocklocal'}
15
+ }
16
+ }
17
+ end
18
+
19
+ fog = flexmock(Fog::Storage)
20
+ fog.should_receive(:new).and_return do
21
+ conn = flexmock('Connection')
22
+ conn.should_receive(:directories).and_return do
23
+ buckets = flexmock('Buckets')
24
+ buckets.should_receive(:get).and_return do
25
+ dir = flexmock('Directory')
26
+ dir
27
+ end
28
+ buckets
29
+ end
30
+ conn
31
+ end
32
+ end
33
+
34
+ context ".compute_md5" do
35
+ it "uses the etag field to compute the MD5 sum" do
36
+ file = flexmock('File') do |obj|
37
+ obj.should_receive(:etag).once.and_return("MD5")
38
+ end
39
+
40
+ dir = RightPublish::S3Storage.get_directories
41
+ dir.compute_md5(file).should be_eql("MD5")
42
+ end
43
+ end
44
+ end
metadata ADDED
@@ -0,0 +1,274 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: right_publish
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
+ platform: ruby
12
+ authors:
13
+ - Brian Szmyd
14
+ - Tony Spataro
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2013-07-03 00:00:00 -07:00
20
+ default_executable: right_publish
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ requirement: *id001
33
+ type: :runtime
34
+ name: builder
35
+ prerelease: false
36
+ - !ruby/object:Gem::Dependency
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ hash: 29
43
+ segments:
44
+ - 1
45
+ - 9
46
+ version: "1.9"
47
+ requirement: *id002
48
+ type: :runtime
49
+ name: fog
50
+ prerelease: false
51
+ - !ruby/object:Gem::Dependency
52
+ version_requirements: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 2
60
+ - 0
61
+ version: "2.0"
62
+ requirement: *id003
63
+ type: :runtime
64
+ name: trollop
65
+ prerelease: false
66
+ - !ruby/object:Gem::Dependency
67
+ version_requirements: &id004 !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ~>
71
+ - !ruby/object:Gem::Version
72
+ hash: 25
73
+ segments:
74
+ - 0
75
+ - 9
76
+ version: "0.9"
77
+ requirement: *id004
78
+ type: :development
79
+ name: rake
80
+ prerelease: false
81
+ - !ruby/object:Gem::Dependency
82
+ version_requirements: &id005 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ~>
86
+ - !ruby/object:Gem::Version
87
+ hash: 49
88
+ segments:
89
+ - 1
90
+ - 8
91
+ - 3
92
+ version: 1.8.3
93
+ requirement: *id005
94
+ type: :development
95
+ name: jeweler
96
+ prerelease: false
97
+ - !ruby/object:Gem::Dependency
98
+ version_requirements: &id006 !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ hash: 15
104
+ segments:
105
+ - 1
106
+ - 0
107
+ version: "1.0"
108
+ requirement: *id006
109
+ type: :development
110
+ name: right_develop
111
+ prerelease: false
112
+ - !ruby/object:Gem::Dependency
113
+ version_requirements: &id007 !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ hash: 27
119
+ segments:
120
+ - 2
121
+ - 4
122
+ - 2
123
+ version: 2.4.2
124
+ requirement: *id007
125
+ type: :development
126
+ name: rdoc
127
+ prerelease: false
128
+ - !ruby/object:Gem::Dependency
129
+ version_requirements: &id008 !ruby/object:Gem::Requirement
130
+ none: false
131
+ requirements:
132
+ - - ~>
133
+ - !ruby/object:Gem::Version
134
+ hash: 3
135
+ segments:
136
+ - 2
137
+ - 0
138
+ version: "2.0"
139
+ requirement: *id008
140
+ type: :development
141
+ name: rspec
142
+ prerelease: false
143
+ - !ruby/object:Gem::Dependency
144
+ version_requirements: &id009 !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ~>
148
+ - !ruby/object:Gem::Version
149
+ hash: 25
150
+ segments:
151
+ - 0
152
+ - 9
153
+ version: "0.9"
154
+ requirement: *id009
155
+ type: :development
156
+ name: flexmock
157
+ prerelease: false
158
+ - !ruby/object:Gem::Dependency
159
+ version_requirements: &id010 !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ hash: 3
165
+ segments:
166
+ - 0
167
+ version: "0"
168
+ requirement: *id010
169
+ type: :development
170
+ name: simplecov
171
+ prerelease: false
172
+ - !ruby/object:Gem::Dependency
173
+ version_requirements: &id011 !ruby/object:Gem::Requirement
174
+ none: false
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ hash: 31
179
+ segments:
180
+ - 0
181
+ - 10
182
+ version: "0.10"
183
+ requirement: *id011
184
+ type: :development
185
+ name: ruby-debug
186
+ prerelease: false
187
+ - !ruby/object:Gem::Dependency
188
+ version_requirements: &id012 !ruby/object:Gem::Requirement
189
+ none: false
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ hash: 63
194
+ segments:
195
+ - 0
196
+ - 11
197
+ - 6
198
+ version: 0.11.6
199
+ requirement: *id012
200
+ type: :development
201
+ name: ruby-debug19
202
+ prerelease: false
203
+ description: A tool for maintaining S3-based DEB, GEM and RPM packages.
204
+ email: support@rightscale.com
205
+ executables:
206
+ - right_publish
207
+ extensions: []
208
+
209
+ extra_rdoc_files:
210
+ - README.rdoc
211
+ files:
212
+ - .rspec
213
+ - Gemfile
214
+ - Gemfile.lock
215
+ - README.rdoc
216
+ - Rakefile
217
+ - VERSION
218
+ - bin/right_publish
219
+ - lib/right_publish.rb
220
+ - lib/right_publish/profile.rb
221
+ - lib/right_publish/repo.rb
222
+ - lib/right_publish/repos/apt.rb
223
+ - lib/right_publish/repos/gem.rb
224
+ - lib/right_publish/repos/yum.rb
225
+ - lib/right_publish/storage.rb
226
+ - lib/right_publish/stores/local.rb
227
+ - lib/right_publish/stores/s3.rb
228
+ - right_publish.gemspec
229
+ - spec/repo_manager_spec.rb
230
+ - spec/repo_spec.rb
231
+ - spec/repos/apt_spec.rb
232
+ - spec/repos/gem_spec.rb
233
+ - spec/repos/yum_spec.rb
234
+ - spec/spec_helper.rb
235
+ - spec/storage_manager_spec.rb
236
+ - spec/storage_spec.rb
237
+ - spec/stores/local_spec.rb
238
+ - spec/stores/s3_spec.rb
239
+ has_rdoc: true
240
+ homepage: https://github.com/rightscale/right_publish
241
+ licenses:
242
+ - Proprietary
243
+ post_install_message:
244
+ rdoc_options: []
245
+
246
+ require_paths:
247
+ - lib
248
+ required_ruby_version: !ruby/object:Gem::Requirement
249
+ none: false
250
+ requirements:
251
+ - - ">="
252
+ - !ruby/object:Gem::Version
253
+ hash: 3
254
+ segments:
255
+ - 0
256
+ version: "0"
257
+ required_rubygems_version: !ruby/object:Gem::Requirement
258
+ none: false
259
+ requirements:
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ hash: 3
263
+ segments:
264
+ - 0
265
+ version: "0"
266
+ requirements: []
267
+
268
+ rubyforge_project:
269
+ rubygems_version: 1.3.7
270
+ signing_key:
271
+ specification_version: 3
272
+ summary: Package publishing and indexing tool
273
+ test_files: []
274
+