cliaws 1.4.2 → 1.5.0
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/.gitignore +1 -0
- data/License.txt +2 -2
- data/README.txt +0 -1
- data/Rakefile +50 -4
- data/VERSION +1 -0
- data/bin/cliec2 +2 -28
- data/bin/clis3 +2 -185
- data/bin/clisdb +44 -0
- data/bin/clisqs +2 -103
- data/cliaws.gemspec +40 -20
- data/lib/cliaws/cli/ec2.rb +97 -0
- data/lib/cliaws/cli/s3.rb +172 -0
- data/lib/cliaws/cli/sqs.rb +73 -0
- data/lib/cliaws/ec2.rb +38 -0
- data/lib/cliaws/s3.rb +1 -7
- data/lib/cliaws/sqs.rb +4 -4
- data/lib/cliaws.rb +0 -2
- metadata +20 -45
- data/Manifest.txt +0 -29
- data/config/hoe.rb +0 -73
- data/config/requirements.rb +0 -15
- data/lib/cliaws/version.rb +0 -9
- data/log/.gitignore +0 -0
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/script/txt2html +0 -74
- data/setup.rb +0 -1585
- data/tasks/deployment.rake +0 -46
- data/tasks/environment.rake +0 -7
- data/test/test_cliaws.rb +0 -11
- data/test/test_helper.rb +0 -2
- data/vendor/right_http_connection-1.2.1/README.txt +0 -3
- data/vendor/right_http_connection-1.2.1/lib/right_http_connection.rb +0 -117
@@ -0,0 +1,172 @@
|
|
1
|
+
require "thor"
|
2
|
+
require "cliaws"
|
3
|
+
|
4
|
+
module Cliaws
|
5
|
+
module Cli
|
6
|
+
class S3 < Thor
|
7
|
+
map ["-h", "--help"] => :help
|
8
|
+
|
9
|
+
desc "url S3_OBJECT_PATH", <<EOD
|
10
|
+
Returns a signed, private, URL to the given S3 object that is valid for 24 hours.
|
11
|
+
EOD
|
12
|
+
def url(s3_object)
|
13
|
+
puts Cliaws.s3.url(s3_object)
|
14
|
+
rescue Cliaws::S3::UnknownBucket
|
15
|
+
abort "Could not find bucket named #{$!.bucket_name}"
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "list [S3_OBJECT_PATH_PREFIX]", <<EOD
|
19
|
+
Lists all S3 objects that start with the given string.
|
20
|
+
|
21
|
+
EXAMPLES
|
22
|
+
|
23
|
+
If the bucket named "vacation" contains the files "movies/arrival.mp4",
|
24
|
+
"movies/at_the_ball.mp4" and "photos/johnson_and_us.jpg", then:
|
25
|
+
|
26
|
+
$ clis3 list vacation/movies
|
27
|
+
movies/arrival.mp4
|
28
|
+
movies/at_the_ball.mp4
|
29
|
+
|
30
|
+
$ clis3 list vacation
|
31
|
+
movies/arrival.mp4
|
32
|
+
movies/at_the_ball.mp4
|
33
|
+
photos/johnson_and_us.jpg
|
34
|
+
|
35
|
+
$ clis3 list vacation/p
|
36
|
+
photos/johnson_and_us.jpg
|
37
|
+
EOD
|
38
|
+
def list(prefix="")
|
39
|
+
puts Cliaws.s3.list(prefix)
|
40
|
+
rescue Cliaws::S3::UnknownBucket
|
41
|
+
abort "Could not find bucket named #{$!.bucket_name}"
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "touch S3_OBJECT_PATH", <<EOD
|
45
|
+
Creates or OVERWRITES a named file at the specified path.
|
46
|
+
|
47
|
+
WARNING: If the file already exists, IT WILL BE OVERWRITTEN with no content.
|
48
|
+
EOD
|
49
|
+
def touch(s3_object)
|
50
|
+
Cliaws.s3.put("", s3_object)
|
51
|
+
rescue Cliaws::S3::UnknownBucket
|
52
|
+
abort "Could not find bucket named #{$!.bucket_name}"
|
53
|
+
end
|
54
|
+
|
55
|
+
desc "put [LOCAL_FILE [LOCAL_FILE ...]] S3_PATH", <<EOD
|
56
|
+
Puts one or more named local files, or a simple string, to a path.
|
57
|
+
|
58
|
+
This method has the same interface as cp(1).
|
59
|
+
|
60
|
+
EXAMPLES
|
61
|
+
|
62
|
+
$ clis3 put --data "123 Grand St / Old Orchard Beach" vacation/2009/where.txt
|
63
|
+
$ clis3 put photos/phil_johnson.jpg vacation/2009/phil_johnson.jpg
|
64
|
+
$ clis3 put photos/peter.jpg photos/sarah.jpg vacation/2009/photos/hosts
|
65
|
+
$ clis3 put movies vacation/2009/movies
|
66
|
+
EOD
|
67
|
+
method_options :data => :optional
|
68
|
+
def put(*args)
|
69
|
+
paths = args
|
70
|
+
s3_object = paths.pop
|
71
|
+
|
72
|
+
single_put_mapper = lambda do |source, s3_path|
|
73
|
+
raise ArgumentError, "Writing directly from STDIN is forbidden when STDIN's size is unknown. The RightAws library will write a zero-byte file to Amazon's servers." unless source.respond_to?(:lstat) || source.respond_to?(:size)
|
74
|
+
s3_path
|
75
|
+
end
|
76
|
+
|
77
|
+
multi_put_mapper = lambda do |source, s3_path|
|
78
|
+
if source.respond_to?(:path) then
|
79
|
+
File.join(s3_path, File.basename(source.path))
|
80
|
+
else
|
81
|
+
raise ArgumentError, "Cannot write to a directory when one or more sources are not files: #{source.inspect}"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
if options[:data] && !paths.empty? then
|
86
|
+
raise ArgumentError, "Cannot specify both --data and filename(s) to send."
|
87
|
+
elsif options[:data] then
|
88
|
+
sources = [StringIO.new(options[:data])]
|
89
|
+
mapper = single_put_mapper
|
90
|
+
elsif paths == ["-"] then
|
91
|
+
sources = [STDIN]
|
92
|
+
mapper = single_put_mapper
|
93
|
+
else
|
94
|
+
targets = paths.map {|filename| filename.to_s}
|
95
|
+
case targets.length
|
96
|
+
when 0
|
97
|
+
sources = [STDIN]
|
98
|
+
mapper = single_put_mapper
|
99
|
+
when 1
|
100
|
+
sources = targets.map {|target| File.open(target, "rb")}
|
101
|
+
mapper = single_put_mapper
|
102
|
+
else
|
103
|
+
sources = targets.map {|target| File.open(target, "rb")}
|
104
|
+
mapper = multi_put_mapper
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
sources.each do |source|
|
109
|
+
target = mapper.call(source, s3_object)
|
110
|
+
if source.respond_to?(:path) then
|
111
|
+
puts "#{source.path} => #{target}"
|
112
|
+
else
|
113
|
+
puts "STDIN => #{target}"
|
114
|
+
end
|
115
|
+
|
116
|
+
Cliaws.s3.put(source, target)
|
117
|
+
end
|
118
|
+
rescue Cliaws::S3::UnknownBucket
|
119
|
+
abort "Could not find bucket named #{$!.bucket_name}"
|
120
|
+
end
|
121
|
+
|
122
|
+
desc "rm S3_OBJECT [S3_OBJECT ...]", <<EOD
|
123
|
+
Deletes one or more S3 objects.
|
124
|
+
|
125
|
+
Does not accept wildcards: each path to delete must be named individually.
|
126
|
+
EOD
|
127
|
+
def rm(*paths)
|
128
|
+
paths.each do |path|
|
129
|
+
puts "rm #{path}"
|
130
|
+
Cliaws.s3.rm(path)
|
131
|
+
end
|
132
|
+
rescue Cliaws::S3::UnknownBucket
|
133
|
+
abort "Could not find bucket named #{$!.bucket_name}"
|
134
|
+
end
|
135
|
+
|
136
|
+
desc "cat S3_OBJECT", <<EOD
|
137
|
+
Prints the contents of the named object to STDOUT.
|
138
|
+
A single new line (\n) will be appended to the output.
|
139
|
+
EOD
|
140
|
+
def cat(s3_object)
|
141
|
+
print Cliaws.s3.get(s3_object, STDOUT)
|
142
|
+
puts
|
143
|
+
rescue Cliaws::S3::UnknownBucket
|
144
|
+
abort "Could not find bucket named #{$!.bucket_name}"
|
145
|
+
end
|
146
|
+
|
147
|
+
desc "get S3_OBJECT [LOCAL_FILE]", <<EOD
|
148
|
+
Returns the raw contents of the named object.
|
149
|
+
|
150
|
+
If LOCAL_FILE is unspecified, it will default to STDOUT.
|
151
|
+
EOD
|
152
|
+
def get(s3_object, local_path=nil)
|
153
|
+
out = if local_path then
|
154
|
+
File.open(local_path, "wb")
|
155
|
+
else
|
156
|
+
STDOUT
|
157
|
+
end
|
158
|
+
|
159
|
+
Cliaws.s3.get(s3_object, out)
|
160
|
+
rescue Cliaws::S3::UnknownBucket
|
161
|
+
abort "Could not find bucket named #{$!.bucket_name}"
|
162
|
+
end
|
163
|
+
|
164
|
+
desc "head S3_OBJECT", "Returns a YAML representation of meta data that Amazon keeps about the named object"
|
165
|
+
def head(s3_object)
|
166
|
+
puts Cliaws.s3.head(s3_object).to_yaml
|
167
|
+
rescue Cliaws::S3::UnknownBucket
|
168
|
+
abort "Could not find bucket named #{$!.bucket_name}"
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require "thor"
|
2
|
+
require "cliaws"
|
3
|
+
|
4
|
+
module Cliaws
|
5
|
+
module Cli
|
6
|
+
class Sqs < Thor
|
7
|
+
map %w(-h --help -H) => :help
|
8
|
+
map "peek" => :receive
|
9
|
+
|
10
|
+
desc "create QUEUE_NAME", "Creates a new queue with the specified name."
|
11
|
+
def create(queue_name)
|
12
|
+
Cliaws.sqs.create(queue_name)
|
13
|
+
puts "Created #{queue_name}"
|
14
|
+
end
|
15
|
+
|
16
|
+
desc "delete QUEUE_NAME", "Deletes the named queue."
|
17
|
+
method_options :force => :boolean
|
18
|
+
def delete(queue_name)
|
19
|
+
Cliaws.sqs.delete(queue_name, options[:force])
|
20
|
+
puts "Queue #{queue_name} deleted"
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "list [PREFIX]", "Lists your queues, only if they match PREFIX."
|
24
|
+
def list(prefix=nil)
|
25
|
+
puts Cliaws.sqs.list(prefix).map {|q| q.name}
|
26
|
+
end
|
27
|
+
|
28
|
+
desc "size QUEUE_NAME", "Prints the number of items in the queue to STDOUT."
|
29
|
+
def size(queue_name)
|
30
|
+
puts Cliaws.sqs.size(queue_name)
|
31
|
+
end
|
32
|
+
|
33
|
+
desc "receive QUEUE_NAME", "Prints a message from the queue to STDOUT. This is also known as peeking."
|
34
|
+
def receive(queue_name)
|
35
|
+
message = Cliaws.sqs.receive(queue_name)
|
36
|
+
puts message if message
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "pop QUEUE_NAME", "Prints a message from the queue to STDOUT, and removes it from the queue."
|
40
|
+
def pop(queue_name)
|
41
|
+
message = Cliaws.sqs.pop(queue_name)
|
42
|
+
puts message if message
|
43
|
+
end
|
44
|
+
|
45
|
+
desc "push QUEUE_NAME [LOCAL_FILE]", <<EOD
|
46
|
+
Pushes a new message to the named queue.
|
47
|
+
|
48
|
+
Reads STDIN if LOCAL_FILE and --data are absent.
|
49
|
+
EOD
|
50
|
+
method_options :data => :optional
|
51
|
+
def push(queue_name, local_file=nil)
|
52
|
+
raise ArgumentError, "Cannot give both --data and LOCAL_FILE" if options[:data] && local_file
|
53
|
+
data = case
|
54
|
+
when local_file
|
55
|
+
File.read(local_file)
|
56
|
+
when options[:data]
|
57
|
+
options[:data]
|
58
|
+
else
|
59
|
+
STDIN.read
|
60
|
+
end
|
61
|
+
Cliaws.sqs.push(queue_name, data)
|
62
|
+
puts "Pushed #{data.size} bytes to queue #{queue_name}"
|
63
|
+
end
|
64
|
+
|
65
|
+
desc "info QUEUE_NAME", "Returns information about the named queue, as a YAML document."
|
66
|
+
def info(queue_name)
|
67
|
+
info = Cliaws.sqs.info(queue_name)
|
68
|
+
data = {"Visibility" => info[:visibility_timeout], "Number of messages" => info[:size]}
|
69
|
+
puts data.to_yaml
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
data/lib/cliaws/ec2.rb
CHANGED
@@ -13,7 +13,45 @@ module Cliaws
|
|
13
13
|
ec2.describe_instances.map {|raw_data| Instance.new(raw_data)}
|
14
14
|
end
|
15
15
|
|
16
|
+
def run(ami, options={})
|
17
|
+
raw_data = ec2.launch_instances(ami,
|
18
|
+
:min_count => options[:count],
|
19
|
+
:max_count => options[:count],
|
20
|
+
:key_name => options[:keypair],
|
21
|
+
:instance_type => options[:type])
|
22
|
+
raw_data.map {|data| Instance.new(data)}
|
23
|
+
end
|
24
|
+
|
25
|
+
def terminate(instance_ids)
|
26
|
+
raw_data = ec2.terminate_instances(instance_ids)
|
27
|
+
raw_data.map {|data| Instance.new(data)}
|
28
|
+
end
|
29
|
+
|
30
|
+
def allocate_address
|
31
|
+
ec2.allocate_address
|
32
|
+
end
|
33
|
+
|
34
|
+
def deallocate_address(address)
|
35
|
+
ec2.release_address(address)
|
36
|
+
end
|
37
|
+
|
38
|
+
def associate_address(options)
|
39
|
+
ec2.associate_address(options[:instance], options[:address])
|
40
|
+
end
|
41
|
+
|
42
|
+
def disassociate_address(address)
|
43
|
+
ec2.disassociate_address(address)
|
44
|
+
end
|
45
|
+
|
46
|
+
def describe_addresses
|
47
|
+
ec2.describe_addresses.inject([]) do |memo, hash|
|
48
|
+
memo << {"instance_id" => hash[:instance_id], "address" => hash[:public_ip]}
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
16
52
|
class Instance
|
53
|
+
attr_reader :raw_data
|
54
|
+
|
17
55
|
def initialize(raw_data)
|
18
56
|
@raw_data = raw_data
|
19
57
|
end
|
data/lib/cliaws/s3.rb
CHANGED
@@ -1,11 +1,5 @@
|
|
1
1
|
require "right_aws"
|
2
2
|
|
3
|
-
# Load vendor code through RubyGems
|
4
|
-
require "right_http_connection"
|
5
|
-
|
6
|
-
# Then patch it here
|
7
|
-
require File.dirname(__FILE__) + "/../../vendor/right_http_connection-1.2.1/lib/right_http_connection"
|
8
|
-
|
9
3
|
module Cliaws
|
10
4
|
class S3
|
11
5
|
attr_reader :access_key_id, :secret_access_key
|
@@ -41,7 +35,7 @@ module Cliaws
|
|
41
35
|
bucket, keyname = bucket_and_key_name(s3_object)
|
42
36
|
key = bucket.key(keyname, true)
|
43
37
|
headers = key.headers
|
44
|
-
|
38
|
+
headers.merge(key.meta_headers)
|
45
39
|
end
|
46
40
|
|
47
41
|
def put(source, s3_object, create=true)
|
data/lib/cliaws/sqs.rb
CHANGED
@@ -3,12 +3,12 @@ require "right_aws"
|
|
3
3
|
module Cliaws
|
4
4
|
class Sqs
|
5
5
|
def initialize(access_key_id, secret_access_key)
|
6
|
-
@sqs = RightAws::
|
6
|
+
@sqs = RightAws::SqsGen2.new(access_key_id, secret_access_key, :logger => Logger.new("/dev/null"))
|
7
7
|
end
|
8
8
|
|
9
9
|
# Gets a message from the queue, but doesn't delete it.
|
10
10
|
def receive(qname)
|
11
|
-
q(qname).receive
|
11
|
+
q(qname).receive
|
12
12
|
end
|
13
13
|
|
14
14
|
# Adds a message in the queue.
|
@@ -18,7 +18,7 @@ module Cliaws
|
|
18
18
|
|
19
19
|
# Gets and deletes message.
|
20
20
|
def pop(qname)
|
21
|
-
q(qname).pop
|
21
|
+
q(qname).pop
|
22
22
|
end
|
23
23
|
|
24
24
|
# Fetches a number of messages.
|
@@ -33,7 +33,7 @@ module Cliaws
|
|
33
33
|
|
34
34
|
# Lists the created queues.
|
35
35
|
def list(prefix=nil)
|
36
|
-
@sqs.queues(prefix)
|
36
|
+
@sqs.queues(prefix)
|
37
37
|
end
|
38
38
|
|
39
39
|
# Creates a queue
|
data/lib/cliaws.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cliaws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Fran\xC3\xA7ois Beausoleil"
|
@@ -9,18 +9,18 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-07 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: thor
|
17
17
|
type: :runtime
|
18
18
|
version_requirement:
|
19
19
|
version_requirements: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: "
|
23
|
+
version: "0.9"
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: right_aws
|
@@ -30,69 +30,45 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: "1.
|
34
|
-
version:
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: hoe
|
37
|
-
type: :development
|
38
|
-
version_requirement:
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 1.8.0
|
33
|
+
version: "1.10"
|
44
34
|
version:
|
45
35
|
description: A command-line suite of tools to access Amazon Web Services, using the RightAws gems.
|
46
|
-
email:
|
47
|
-
- francois@teksol.info
|
36
|
+
email: francois@teksol.info
|
48
37
|
executables:
|
49
|
-
- cliec2
|
50
38
|
- clis3
|
51
39
|
- clisqs
|
40
|
+
- cliec2
|
52
41
|
extensions: []
|
53
42
|
|
54
43
|
extra_rdoc_files:
|
55
44
|
- History.txt
|
56
45
|
- License.txt
|
57
|
-
- Manifest.txt
|
58
|
-
- README.txt
|
59
|
-
- vendor/right_http_connection-1.2.1/README.txt
|
60
46
|
files:
|
61
47
|
- .gitignore
|
62
48
|
- History.txt
|
63
49
|
- License.txt
|
64
|
-
- Manifest.txt
|
65
50
|
- README.txt
|
66
51
|
- Rakefile
|
52
|
+
- VERSION
|
67
53
|
- bin/cliec2
|
68
54
|
- bin/clis3
|
55
|
+
- bin/clisdb
|
69
56
|
- bin/clisqs
|
70
57
|
- cliaws.gemspec
|
71
|
-
- config/hoe.rb
|
72
|
-
- config/requirements.rb
|
73
58
|
- lib/cliaws.rb
|
59
|
+
- lib/cliaws/cli/ec2.rb
|
60
|
+
- lib/cliaws/cli/s3.rb
|
61
|
+
- lib/cliaws/cli/sqs.rb
|
74
62
|
- lib/cliaws/ec2.rb
|
75
63
|
- lib/cliaws/s3.rb
|
76
64
|
- lib/cliaws/sqs.rb
|
77
|
-
- lib/cliaws/version.rb
|
78
|
-
- log/.gitignore
|
79
|
-
- script/console
|
80
|
-
- script/destroy
|
81
|
-
- script/generate
|
82
|
-
- script/txt2html
|
83
|
-
- setup.rb
|
84
|
-
- tasks/deployment.rake
|
85
|
-
- tasks/environment.rake
|
86
|
-
- test/test_cliaws.rb
|
87
|
-
- test/test_helper.rb
|
88
|
-
- vendor/right_http_connection-1.2.1/README.txt
|
89
|
-
- vendor/right_http_connection-1.2.1/lib/right_http_connection.rb
|
90
65
|
has_rdoc: true
|
91
|
-
homepage: http://cliaws.rubyforge.org
|
66
|
+
homepage: http://cliaws.rubyforge.org/
|
67
|
+
licenses: []
|
68
|
+
|
92
69
|
post_install_message:
|
93
70
|
rdoc_options:
|
94
|
-
- --
|
95
|
-
- README.txt
|
71
|
+
- --charset=UTF-8
|
96
72
|
require_paths:
|
97
73
|
- lib
|
98
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -110,10 +86,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
86
|
requirements: []
|
111
87
|
|
112
88
|
rubyforge_project: cliaws
|
113
|
-
rubygems_version: 1.3.
|
89
|
+
rubygems_version: 1.3.2
|
114
90
|
signing_key:
|
115
|
-
specification_version:
|
91
|
+
specification_version: 3
|
116
92
|
summary: A command-line suite of tools to access Amazon Web Services, using the RightAws gems.
|
117
|
-
test_files:
|
118
|
-
|
119
|
-
- test/test_helper.rb
|
93
|
+
test_files: []
|
94
|
+
|
data/Manifest.txt
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
.gitignore
|
2
|
-
History.txt
|
3
|
-
License.txt
|
4
|
-
Manifest.txt
|
5
|
-
README.txt
|
6
|
-
Rakefile
|
7
|
-
bin/cliec2
|
8
|
-
bin/clis3
|
9
|
-
bin/clisqs
|
10
|
-
cliaws.gemspec
|
11
|
-
config/hoe.rb
|
12
|
-
config/requirements.rb
|
13
|
-
lib/cliaws.rb
|
14
|
-
lib/cliaws/ec2.rb
|
15
|
-
lib/cliaws/s3.rb
|
16
|
-
lib/cliaws/sqs.rb
|
17
|
-
lib/cliaws/version.rb
|
18
|
-
log/.gitignore
|
19
|
-
script/console
|
20
|
-
script/destroy
|
21
|
-
script/generate
|
22
|
-
script/txt2html
|
23
|
-
setup.rb
|
24
|
-
tasks/deployment.rake
|
25
|
-
tasks/environment.rake
|
26
|
-
test/test_cliaws.rb
|
27
|
-
test/test_helper.rb
|
28
|
-
vendor/right_http_connection-1.2.1/README.txt
|
29
|
-
vendor/right_http_connection-1.2.1/lib/right_http_connection.rb
|
data/config/hoe.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'cliaws/version'
|
2
|
-
|
3
|
-
AUTHOR = 'François Beausoleil' # can also be an array of Authors
|
4
|
-
EMAIL = "francois@teksol.info"
|
5
|
-
DESCRIPTION = "A command-line suite of tools to access Amazon Web Services, using the RightAws gems."
|
6
|
-
GEM_NAME = 'cliaws' # what ppl will type to install your gem
|
7
|
-
RUBYFORGE_PROJECT = 'cliaws' # The unix name for your project
|
8
|
-
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
9
|
-
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
10
|
-
|
11
|
-
@config_file = "~/.rubyforge/user-config.yml"
|
12
|
-
@config = nil
|
13
|
-
RUBYFORGE_USERNAME = "unknown"
|
14
|
-
def rubyforge_username
|
15
|
-
unless @config
|
16
|
-
begin
|
17
|
-
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
18
|
-
rescue
|
19
|
-
puts <<-EOS
|
20
|
-
ERROR: No rubyforge config file found: #{@config_file}
|
21
|
-
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
22
|
-
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
23
|
-
EOS
|
24
|
-
exit
|
25
|
-
end
|
26
|
-
end
|
27
|
-
RUBYFORGE_USERNAME.replace @config["username"]
|
28
|
-
end
|
29
|
-
|
30
|
-
|
31
|
-
REV = nil
|
32
|
-
# UNCOMMENT IF REQUIRED:
|
33
|
-
# REV = YAML.load(`svn info`)['Revision']
|
34
|
-
VERS = Cliaws::VERSION::STRING + (REV ? ".#{REV}" : "")
|
35
|
-
RDOC_OPTS = ['--quiet', '--title', 'cliaws documentation',
|
36
|
-
"--opname", "index.html",
|
37
|
-
"--line-numbers",
|
38
|
-
"--main", "README",
|
39
|
-
"--inline-source"]
|
40
|
-
|
41
|
-
class Hoe
|
42
|
-
def extra_deps
|
43
|
-
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
44
|
-
@extra_deps
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# Generate all the Rake tasks
|
49
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
50
|
-
$hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
51
|
-
p.developer(AUTHOR, EMAIL)
|
52
|
-
p.description = DESCRIPTION
|
53
|
-
p.summary = DESCRIPTION
|
54
|
-
p.url = HOMEPATH
|
55
|
-
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
56
|
-
p.test_globs = ["test/**/test_*.rb"]
|
57
|
-
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
58
|
-
|
59
|
-
# == Optional
|
60
|
-
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
61
|
-
p.extra_deps = [
|
62
|
-
["main", "~> 2.8"],
|
63
|
-
["right_aws", "~> 1.8"]
|
64
|
-
]
|
65
|
-
|
66
|
-
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
67
|
-
|
68
|
-
end
|
69
|
-
|
70
|
-
CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
71
|
-
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
72
|
-
$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
73
|
-
$hoe.rsync_args = '-av --delete --ignore-errors'
|
data/config/requirements.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
include FileUtils
|
3
|
-
|
4
|
-
require 'rubygems'
|
5
|
-
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
-
begin
|
7
|
-
require req_gem
|
8
|
-
rescue LoadError
|
9
|
-
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
-
puts "Installation: gem install #{req_gem} -y"
|
11
|
-
exit
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
data/lib/cliaws/version.rb
DELETED
data/log/.gitignore
DELETED
File without changes
|
data/script/console
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# File: script/console
|
3
|
-
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
-
|
5
|
-
libs = " -r irb/completion"
|
6
|
-
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
-
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
-
libs << " -r #{File.dirname(__FILE__) + '/../lib/cliaws.rb'}"
|
9
|
-
puts "Loading cliaws gem"
|
10
|
-
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/destroy'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/generate'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Generate.new.run(ARGV)
|