jgm-cloudlib 0.1 → 0.2
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/bin/cloudlib +0 -6
- data/bin/cloudlib-web +3 -6
- data/cloudlib.gemspec +2 -2
- metadata +2 -2
data/bin/cloudlib
CHANGED
@@ -8,13 +8,11 @@ require 'optparse'
|
|
8
8
|
require 'highline/import' # highline gem
|
9
9
|
|
10
10
|
PROGNAME = "cloudlib"
|
11
|
-
CLOUDLIB_VERSION = "0.1"
|
12
11
|
NUMITEMS = 10
|
13
12
|
|
14
13
|
options = {}
|
15
14
|
opts = OptionParser.new do |opts|
|
16
15
|
opts.program_name = "#{PROGNAME} (c) 2008 John MacFarlane"
|
17
|
-
opts.version = "version #{CLOUDLIB_VERSION}"
|
18
16
|
opts.banner = "cloudlib -- a library of books and articles in the AWS `cloud'\n" +
|
19
17
|
"Usage: #{PROGNAME} - start interactive menu\n" +
|
20
18
|
" #{PROGNAME} add FILE - upload FILE to library, prompting for metadata\n" +
|
@@ -24,10 +22,6 @@ opts = OptionParser.new do |opts|
|
|
24
22
|
" #{PROGNAME} restore [PATH] - restore library from local backup in PATH\n" +
|
25
23
|
"Options:"
|
26
24
|
end
|
27
|
-
opts.on("-v", "--version", "Show version") do
|
28
|
-
puts opts.ver
|
29
|
-
exit 0
|
30
|
-
end
|
31
25
|
opts.on("-h", "--help", "Show usage message") do
|
32
26
|
puts opts.help
|
33
27
|
exit 0
|
data/bin/cloudlib-web
CHANGED
@@ -6,14 +6,11 @@ require 'tempfile'
|
|
6
6
|
require 'cloudlib'
|
7
7
|
require 'highline/import' # highline gem
|
8
8
|
|
9
|
-
# Number of items to display per page after query
|
10
|
-
NUMITEMS = 10
|
11
|
-
|
12
9
|
# check that required environment variables are set
|
13
10
|
envvars = ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "CLOUDLIB_LIBRARY_NAME", "CLOUDLIB_WEB_USERNAME", "CLOUDLIB_WEB_PASSWORD"]
|
14
11
|
envvars.each do |var|
|
15
12
|
unless ENV[var]
|
16
|
-
ENV[var] = ask("#{var}: ", String) { |q| q.echo = if var == "AWS_SECRET_ACCESS_KEY" then "*" else true end }
|
13
|
+
ENV[var] = ask("#{var}: ", String) { |q| q.echo = if var == "AWS_SECRET_ACCESS_KEY" || var == "CLOUDLIB_WEB_PASSWORD" then "*" else true end }
|
17
14
|
end
|
18
15
|
end
|
19
16
|
Cloudlib::Entry.connect(ENV['CLOUDLIB_LIBRARY_NAME'], ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'])
|
@@ -37,7 +34,7 @@ end
|
|
37
34
|
post '/' do
|
38
35
|
if params[:query]
|
39
36
|
@query = params[:query]
|
40
|
-
@token, @entries = Cloudlib::Entry.query(@query,
|
37
|
+
@token, @entries = Cloudlib::Entry.query(@query, 10, params[:token])
|
41
38
|
else
|
42
39
|
@token, @entries = "", []
|
43
40
|
@query = ""
|
@@ -124,7 +121,7 @@ __END__
|
|
124
121
|
= yield
|
125
122
|
%div#footer
|
126
123
|
powered by
|
127
|
-
%a{:href => ''}cloudlib
|
124
|
+
%a{:href => 'http://github.com/jgm/cloudlib/tree/master'}cloudlib
|
128
125
|
|
129
126
|
@@ index
|
130
127
|
%div.queryform
|
data/cloudlib.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cloudlib"
|
3
|
-
s.version = "0.
|
4
|
-
s.date = "2008-12-
|
3
|
+
s.version = "0.2"
|
4
|
+
s.date = "2008-12-26"
|
5
5
|
s.summary = "Tools for maintaining a library of books and articles in Amazon S3 and SimpleDB"
|
6
6
|
s.email = "jgm@berkeley.edu"
|
7
7
|
s.homepage = "http://github.com/jgm/cloudlib"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jgm-cloudlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "0.
|
4
|
+
version: "0.2"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John MacFarlane
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-12-
|
12
|
+
date: 2008-12-26 00:00:00 -08:00
|
13
13
|
default_executable: cloudlib
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|