amqp_directory_broadcaster 1.0.3 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,13 +11,14 @@ module AmqpDirectoryBroadcaster
11
11
  def self.parse_options
12
12
  opts = Trollop::options do
13
13
  opt :source, "The directory you want to publish JSON messages from", :type => String, :default=>"."
14
- opt :filter, "The file filter to use to select which files to send", :default => "*.json"
14
+ opt :filter, "The file filter to use to select which files to send", :type => String
15
15
  opt :broker, "The uri of the AMQP broker you want to publish to", :type => String, :default=>"localhost"
16
16
  opt :exchange, "The name of the exchange you want to publish to", :type => String
17
17
  opt :type, "The type of the exchange you want to publish to", :type => String, :default => "topic"
18
18
  opt :durable, "Whether or not the exchange is durable", :default => true
19
19
  opt :routing_key, "The routing key to use when publishing messages", :type=>String, :short => '-k'
20
20
  opt :verbose, "Output volumes of exciting, play by play information. Make sure you get your soda and chips before turning on this baby.", :default => false
21
+ opt :message_extension, "The extension that identifies message files in the source directory", :type => String, :default => "json", :short => '-x'
21
22
 
22
23
  opt :auto_delete, "Delete the message files after sending them", :default => true
23
24
  end
@@ -28,7 +29,8 @@ module AmqpDirectoryBroadcaster
28
29
  def self.broadcast(options = nil)
29
30
  options ||= parse_options
30
31
  dir = File.expand_path(options[:source])
31
- filter = File.join(dir,options[:filter])
32
+ filter = options[:filter] || "*.#{options[:message_extension]}"
33
+ filter = File.join(dir,".") + "/#{filter}" #windows hack
32
34
  exchange_name = options[:exchange]
33
35
  broker_uri = options[:broker]
34
36
  broker = AmqpDirectoryBroadcaster::Rabbit.new(broker_uri)
@@ -1,3 +1,3 @@
1
1
  module AmqpDirectoryBroadcaster
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.5'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amqp_directory_broadcaster
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 5
10
+ version: 1.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nathan Stults