awful 0.0.100 → 0.0.101

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50d02ca7f4785757f6395f57adfb6abc67ebe910
4
- data.tar.gz: 94e397b20a81d50055b58fa59ed89b514df689a6
3
+ metadata.gz: 97898e016a1a9ab513f0bc272ce427778968dd65
4
+ data.tar.gz: 85272e8e58adb64c441b9d5957409b1de9223523
5
5
  SHA512:
6
- metadata.gz: 628f75c481ce62633bc10f651859938930529d68fcf98e81bc636a52b70eabd918a6f6458553f93e4d320d44460c634ad218495a1f3138ae369c99a52b812310
7
- data.tar.gz: 5914cbd75df8144b5428772b83716a4b2192718bb48720fdca68f48335315f1d152721979984ab9ffcccb345c1f78a812607a168dc738bef1beb66ab2314441e
6
+ metadata.gz: f800aa388fd1712d601a594364cad4e7e417c1691bc8f2c96185da77cdfe0c0d4db5f6437afc8515dd8cb7944e549c66f2d71b9ff2d9855ffe96f28d3e779ac7
7
+ data.tar.gz: f4face869d54d7a83e3cf9b2c34b2390f10b61fe55615ab6498321c5cd5a14a11721f12a82c4166491cf8ac34e13ebae638565f0eec8d5557a5631c2d0cb6887
data/lib/awful/sqs.rb CHANGED
@@ -14,6 +14,14 @@ module Awful
14
14
  def is_url?(str)
15
15
  str =~ /\A#{URI::regexp}\z/
16
16
  end
17
+
18
+ def queue_url(name)
19
+ if is_url?(name)
20
+ name
21
+ else
22
+ sqs.get_queue_url(queue_name: name).queue_url
23
+ end
24
+ end
17
25
  end
18
26
 
19
27
  desc 'ls [PATTERN]', 'list subnets [with any tags matching PATTERN]'
@@ -42,13 +50,17 @@ module Awful
42
50
  desc 'dump NAME_OR_URL ...', 'get attributes for queues by queue name or url'
43
51
  def dump(*names)
44
52
  names.map do |name|
45
- url = is_url?(name) ? name : sqs.get_queue_url(queue_name: name).queue_url
46
- sqs.get_queue_attributes(queue_url: url, attribute_names: %w[All]).attributes
53
+ sqs.get_queue_attributes(queue_url: queue_url(name), attribute_names: %w[All]).attributes
47
54
  end.tap do |queues|
48
55
  queues.each do |queue|
49
56
  puts YAML.dump(stringify_keys(queue))
50
57
  end
51
58
  end
52
59
  end
60
+
61
+ desc 'send NAME_OR_URL MSG', 'send message to queue'
62
+ def send(name, msg)
63
+ sqs.send_message(queue_url: queue_url(name), message_body: msg)
64
+ end
53
65
  end
54
66
  end
data/lib/awful/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.100'
2
+ VERSION = '0.0.101'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.100
4
+ version: 0.0.101
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-15 00:00:00.000000000 Z
11
+ date: 2016-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler