cliaws 1.1.1 → 1.1.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/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 1.1.2 2008-04-30
2
+
3
+ * New clisqs info.
4
+ * New internal method for fetching multiple messages in one swoop in Cliaws::Sqs.
5
+
1
6
  == 1.1.1 2008-04-17
2
7
 
3
8
  * Renamed send to push for clisqs.
data/bin/clis3 CHANGED
@@ -18,6 +18,12 @@ Main {
18
18
  argument_required
19
19
  end
20
20
 
21
+ mode("url") do
22
+ def run
23
+ puts Cliaws.s3.url(params["s3_object"].value)
24
+ end
25
+ end
26
+
21
27
  mode("list") do
22
28
  def run
23
29
  puts Cliaws.s3.list(params["s3_object"].value)
data/bin/clisqs CHANGED
@@ -89,6 +89,15 @@ Main {
89
89
  end
90
90
  end
91
91
 
92
+ mode("info") do
93
+ mixin :qname
94
+ def run
95
+ info = Cliaws.sqs.info(queue_name)
96
+ puts "Visibility: #{info[:visibility_timeout]}"
97
+ puts "Number of messages: #{info[:size]}"
98
+ end
99
+ end
100
+
92
101
  def queue_name
93
102
  params["queue_name"].value
94
103
  end
data/lib/cliaws/s3.rb CHANGED
@@ -3,8 +3,17 @@ require "activesupport"
3
3
 
4
4
  module Cliaws
5
5
  class S3
6
+ attr_reader :access_key_id, :secret_access_key
7
+ protected :access_key_id, :secret_access_key
8
+
6
9
  def initialize(access_key_id, secret_access_key)
7
- @s3 = RightAws::S3.new(access_key_id, secret_access_key, :logger => Logger.new("/dev/null"))
10
+ @access_key_id, @secret_access_key = access_key_id, secret_access_key
11
+ end
12
+
13
+ def url(full_name)
14
+ bucket_name, path = full_name.split("/", 2)
15
+ bucket = s3g.bucket(bucket_name, false)
16
+ bucket.get(path)
8
17
  end
9
18
 
10
19
  def list(glob)
@@ -43,8 +52,16 @@ module Cliaws
43
52
  protected
44
53
  def bucket_and_key_name(full_name)
45
54
  bucket_name, path = full_name.split("/", 2)
46
- bucket = @s3.bucket(bucket_name, false)
55
+ bucket = s3.bucket(bucket_name, false)
47
56
  [bucket, path]
48
57
  end
58
+
59
+ def s3
60
+ @s3 ||= RightAws::S3.new(access_key_id, secret_access_key, :logger => Logger.new("/dev/null"))
61
+ end
62
+
63
+ def s3g
64
+ @s3i ||= RightAws::S3Generator.new(access_key_id, secret_access_key, :logger => Logger.new("/dev/null"))
65
+ end
49
66
  end
50
67
  end
data/lib/cliaws/sqs.rb CHANGED
@@ -22,6 +22,11 @@ module Cliaws
22
22
  q(qname).pop.to_s
23
23
  end
24
24
 
25
+ # Fetches a number of messages.
26
+ def fetch(qname, size)
27
+ q(qname).receive_messages(size)
28
+ end
29
+
25
30
  # Returns the size of the queue.
26
31
  def size(qname)
27
32
  q(qname).size
@@ -42,6 +47,12 @@ module Cliaws
42
47
  q(qname).delete(force)
43
48
  end
44
49
 
50
+ # Retrieves information about a queue
51
+ def info(qname)
52
+ queue = q(qname)
53
+ { :visibility_timeout => queue.visibility, :size => queue.size }
54
+ end
55
+
45
56
  protected
46
57
  def q(qname, create=false)
47
58
  @sqs.queue(qname, create)
@@ -2,7 +2,7 @@ module Cliaws #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 1
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data.tar.gz.sig CHANGED
@@ -1,2 +1,4 @@
1
- ����,���2"�����W���1�Od�T�N?��gW��,I(��&����F���w䤥��~�KtC:�(��'�y`Nǰ��$��?�R�OI2�V
2
- Uq}ꄀ���\��
1
+ h��ܕ�
2
+ mgKVػ�V3�8��a����$�����&*3s~Ok�
3
+ ��K�#%����{t/Vqٷ, ���j rr��%���@4��D� /��UH1����BvU���d�PM!U�6>�����נ��53�'{NH^�U1�%�ʐ�� DO{�Q�ˊ}E l���
4
+ 7|%�~k��b�����a{KG�!���Mu{�'�u��P|��/R{&M���PK٨���]�8 ��N�Rc�
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.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Fran\xC3\xA7ois Beausoleil"
@@ -30,7 +30,7 @@ cert_chain:
30
30
  DdYn10CtfIKBFg==
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2008-04-17 00:00:00 -04:00
33
+ date: 2008-04-30 00:00:00 -04:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file