smock 0.1.34 → 0.1.35
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.
- data/Gemfile.lock +1 -1
- data/Rakefile +0 -2
- metadata +3 -5
- data/lib/config.ru +0 -2
- data/list.html +0 -219
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.35
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -326,13 +326,11 @@ files:
|
|
326
326
|
- examples/explore_files/thumbnail_x-1379162338.jpg
|
327
327
|
- examples/explore_files/tuts-plus-bd0affcfa95d86912384b5d39e923119.jpg
|
328
328
|
- index.html
|
329
|
-
- lib/config.ru
|
330
329
|
- lib/smock.rb
|
331
330
|
- lib/smock/engine.rb
|
332
331
|
- lib/smock/generator.rb
|
333
332
|
- lib/smock/version.rb
|
334
333
|
- lib/tasks/install.rake
|
335
|
-
- list.html
|
336
334
|
- smock.gemspec
|
337
335
|
- v2/_colors.css.sass
|
338
336
|
- v2/_forms.css.sass
|
@@ -374,7 +372,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
374
372
|
version: '0'
|
375
373
|
segments:
|
376
374
|
- 0
|
377
|
-
hash: -
|
375
|
+
hash: -2184486158544104751
|
378
376
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
379
377
|
none: false
|
380
378
|
requirements:
|
@@ -383,7 +381,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
383
381
|
version: '0'
|
384
382
|
segments:
|
385
383
|
- 0
|
386
|
-
hash: -
|
384
|
+
hash: -2184486158544104751
|
387
385
|
requirements: []
|
388
386
|
rubyforge_project: smock
|
389
387
|
rubygems_version: 1.8.21
|
data/lib/config.ru
DELETED
data/list.html
DELETED
@@ -1,219 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<!--
|
4
|
-
|
5
|
-
Amazon S3 Bucket listing.
|
6
|
-
|
7
|
-
|
8
|
-
Copyright (C) 2008 Francesco Pasqualini
|
9
|
-
|
10
|
-
This program is free software: you can redistribute it and/or modify
|
11
|
-
it under the terms of the GNU General Public License as published by
|
12
|
-
the Free Software Foundation, either version 3 of the License, or
|
13
|
-
(at your option) any later version.
|
14
|
-
|
15
|
-
This program is distributed in the hope that it will be useful,
|
16
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18
|
-
GNU General Public License for more details.
|
19
|
-
|
20
|
-
You should have received a copy of the GNU General Public License
|
21
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
22
|
-
|
23
|
-
-->
|
24
|
-
|
25
|
-
<title>Bucket listing</title>
|
26
|
-
<SCRIPT>
|
27
|
-
|
28
|
-
function getSpace(s,l){
|
29
|
-
var ret = "";
|
30
|
-
while(s.length+ret.length<l){
|
31
|
-
ret = ret + " ";
|
32
|
-
}
|
33
|
-
return ret;
|
34
|
-
}
|
35
|
-
|
36
|
-
|
37
|
-
location.querystring = (function() {
|
38
|
-
// The return is a collection of key/value pairs
|
39
|
-
var result = {};
|
40
|
-
|
41
|
-
// Gets the query string with a preceeding '?'
|
42
|
-
var querystring = location.search;
|
43
|
-
|
44
|
-
// document.location.search is empty if a query string is absent
|
45
|
-
if (!querystring)
|
46
|
-
return result;
|
47
|
-
|
48
|
-
// substring(1) to remove the '?'
|
49
|
-
var pairs = querystring.substring(1).split("&");
|
50
|
-
var splitPair;
|
51
|
-
|
52
|
-
// Load the key/values of the return collection
|
53
|
-
for (var i = 0; i < pairs.length; i++) {
|
54
|
-
splitPair = pairs[i].split("=");
|
55
|
-
result[splitPair[0]] = splitPair[1];
|
56
|
-
}
|
57
|
-
|
58
|
-
return result;
|
59
|
-
})();
|
60
|
-
|
61
|
-
function createRequestObject(){
|
62
|
-
var request_o; //declare the variable to hold the object.
|
63
|
-
var browser = navigator.appName; //find the browser name
|
64
|
-
if(browser == "Microsoft Internet Explorer"){
|
65
|
-
/* Create the object using MSIE's method */
|
66
|
-
request_o = new ActiveXObject("Microsoft.XMLHTTP");
|
67
|
-
}else{
|
68
|
-
/* Create the object using other browser's method */
|
69
|
-
request_o = new XMLHttpRequest();
|
70
|
-
}
|
71
|
-
return request_o; //return the object
|
72
|
-
}
|
73
|
-
|
74
|
-
/* You can get more specific with version information by using
|
75
|
-
parseInt(navigator.appVersion)
|
76
|
-
Which will extract an integer value containing the version
|
77
|
-
of the browser being used.
|
78
|
-
*/
|
79
|
-
/* The variable http will hold our new XMLHttpRequest object. */
|
80
|
-
var http = createRequestObject();
|
81
|
-
function getList(){
|
82
|
-
http.open('get', location.protocol+'//'+location.hostname);
|
83
|
-
http.onreadystatechange = handleList;
|
84
|
-
http.send(null);
|
85
|
-
}
|
86
|
-
|
87
|
-
function handleList(){
|
88
|
-
/* Make sure that the transaction has finished. The XMLHttpRequest object
|
89
|
-
has a property called readyState with several states:
|
90
|
-
0: Uninitialized
|
91
|
-
1: Loading
|
92
|
-
2: Loaded
|
93
|
-
3: Interactive
|
94
|
-
4: Finished */
|
95
|
-
if(http.readyState == 4){ //Finished loading the response
|
96
|
-
/* We have got the response from the server-side script,
|
97
|
-
let's see just what it was. using the responseText property of
|
98
|
-
the XMLHttpRequest object. */
|
99
|
-
var response = http.responseXML;
|
100
|
-
|
101
|
-
filex = response.getElementsByTagName('Contents');
|
102
|
-
|
103
|
-
|
104
|
-
res = '';
|
105
|
-
fileList = new Array();
|
106
|
-
for(i=0; i<filex.length; i++){
|
107
|
-
fileData =new Array();
|
108
|
-
fileList[i] = fileData;
|
109
|
-
size = filex[i].getElementsByTagName('Size')[0].firstChild.data;
|
110
|
-
name = filex[i].getElementsByTagName('Key')[0].firstChild.data;
|
111
|
-
lastmod = filex[i].getElementsByTagName('LastModified')[0].firstChild.data;
|
112
|
-
link = "<A HREF=\""+name+"\">"+name+"</A>";
|
113
|
-
fileData[0] = name;
|
114
|
-
fileData[1] = size;
|
115
|
-
fileData[2] = lastmod;
|
116
|
-
fileData[3] = link;
|
117
|
-
}
|
118
|
-
fileList.sort(getSort());
|
119
|
-
for(i=0; i<fileList.length; i++){ //length is the same as count($array)
|
120
|
-
fileData = fileList[i];
|
121
|
-
name = fileData[0];
|
122
|
-
size = fileData[1];
|
123
|
-
lastmod = fileData[2];
|
124
|
-
link = fileData[3];
|
125
|
-
res = res + getSpace(size,15) +size + " B ";
|
126
|
-
res = res + " "+ getSpace(lastmod,20)+ lastmod + " ";
|
127
|
-
res = res + " "+ link+ getSpace(name,50) + " ";
|
128
|
-
res = res + "<BR>";
|
129
|
-
}
|
130
|
-
|
131
|
-
|
132
|
-
document.getElementById('bucket_list').innerHTML = "<PRE>"+getLink()+"<BR>"+res+"</PRE>" ;
|
133
|
-
}
|
134
|
-
}
|
135
|
-
|
136
|
-
|
137
|
-
function getQueryVariable(variable) {
|
138
|
-
var query = window.location.search.substring(1);
|
139
|
-
var vars = query.split("&");
|
140
|
-
for (var i=0;i<vars.length;i++) {
|
141
|
-
var pair = vars[i].split("=");
|
142
|
-
if (pair[0] == variable) {
|
143
|
-
return pair[1];
|
144
|
-
}
|
145
|
-
}
|
146
|
-
return null;
|
147
|
-
}
|
148
|
-
|
149
|
-
|
150
|
-
function sortSize(a,b) {
|
151
|
-
if(parseInt(a[1]) > parseInt(b[1])) return 1;
|
152
|
-
if(parseInt(a[1]) < parseInt(b[1])) return -1;
|
153
|
-
return 0;
|
154
|
-
}
|
155
|
-
function sortSizeDesc(a,b) { return (-sortSize(a,b)); }
|
156
|
-
function sortLastmod(a,b) {
|
157
|
-
if(a[2] > b[2]) return 1;
|
158
|
-
if(a[2] < b[2]) return -1;
|
159
|
-
return 0;
|
160
|
-
}
|
161
|
-
function sortLastmodDesc(a,b) { return (-sortLastmod(a,b)); }
|
162
|
-
|
163
|
-
function sortName(a,b) {
|
164
|
-
if(a[0] > b[0]) return 1;
|
165
|
-
if(a[0] < b[0]) return -1;
|
166
|
-
return 0;
|
167
|
-
}
|
168
|
-
function sortNameDesc(a,b) { return -sortName(a,b); }
|
169
|
-
//document.write('http://'+location.hostname);
|
170
|
-
|
171
|
-
function getSort(){
|
172
|
-
var s = getQueryVariable("sort");
|
173
|
-
var d = getQueryVariable("sortdir");
|
174
|
-
if(s=='size'){ return d == 'desc' ? sortSizeDesc : sortSize};
|
175
|
-
if(s=='name'){ return d == 'desc' ? sortNameDesc : sortName};
|
176
|
-
if(s=='lastmod'){ return d == 'desc' ? sortLastmodDesc : sortLastmod};
|
177
|
-
return sortName;
|
178
|
-
}
|
179
|
-
|
180
|
-
|
181
|
-
function getLink(){
|
182
|
-
return " "+getLinkSize() + " " + getLinkLastmod() + " " + getLinkName() + " " ;
|
183
|
-
}
|
184
|
-
|
185
|
-
function getNextSortDir(sortCol){
|
186
|
-
if (sortCol == getQueryVariable("sort"))
|
187
|
-
return getQueryVariable("sortdir") == 'desc' ? 'asc' : 'desc';
|
188
|
-
return 'asc'
|
189
|
-
}
|
190
|
-
|
191
|
-
function getLinkSize(){
|
192
|
-
return "<A HREF=\"?sort=size&sortdir=" +getNextSortDir('size') +"\">Size</A>";
|
193
|
-
}
|
194
|
-
function getLinkName(){
|
195
|
-
return "<A HREF=\"?sort=name&sortdir=" +getNextSortDir('name') +"\">Name</A>";
|
196
|
-
}
|
197
|
-
function getLinkLastmod(){
|
198
|
-
return "<A HREF=\"?sort=lastmod&sortdir=" +getNextSortDir('lastmod') +"\">Lastmodified</A>";
|
199
|
-
}
|
200
|
-
|
201
|
-
|
202
|
-
</SCRIPT>
|
203
|
-
</head>
|
204
|
-
<body onLoad="getList();">
|
205
|
-
<div id="bucket_list">
|
206
|
-
|
207
|
-
</div>
|
208
|
-
<BR>
|
209
|
-
<SMALL>
|
210
|
-
<PRE>
|
211
|
-
Smock Versions
|
212
|
-
</PRE>
|
213
|
-
</SMALL>
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
</body>
|
218
|
-
</html>
|
219
|
-
|