iron_mq 3.0.2 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -5,3 +5,4 @@ doc
5
5
  log
6
6
  test/config.yml
7
7
  *.sublime*
8
+ /*.gem
data/Gemfile.lock CHANGED
@@ -1,32 +1,32 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- iron_mq (3.0.1)
5
- iron_core (>= 0.4.4)
4
+ iron_mq (3.1.0)
5
+ iron_core (>= 0.5.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  beanstalk-client (1.1.1)
11
11
  concur (1.0.2)
12
- ethon (0.5.3)
13
- ffi (~> 1.0.11)
12
+ ethon (0.5.7)
13
+ ffi (~> 1.2.0)
14
14
  mime-types (~> 1.18)
15
- ffi (1.0.11)
16
- iron_core (0.4.4)
17
- rest (>= 2.1.1)
15
+ ffi (1.2.1)
16
+ iron_core (0.5.1)
17
+ rest (>= 2.2.0)
18
18
  mime-types (1.19)
19
- minitest (4.2.0)
19
+ minitest (4.4.0)
20
20
  net-http-persistent (2.8)
21
- rake (10.0.0)
22
- rest (2.1.1)
21
+ rake (10.0.3)
22
+ rest (2.2.0)
23
23
  net-http-persistent
24
24
  rest-client (>= 0.3.0)
25
25
  rest-client (1.6.7)
26
26
  mime-types (>= 1.16)
27
- test-unit (2.5.2)
28
- typhoeus (0.5.1)
29
- ethon (= 0.5.3)
27
+ test-unit (2.5.3)
28
+ typhoeus (0.5.4)
29
+ ethon (~> 0.5.7)
30
30
  uber_config (1.0.5)
31
31
 
32
32
  PLATFORMS
@@ -40,5 +40,5 @@ DEPENDENCIES
40
40
  net-http-persistent
41
41
  rake
42
42
  test-unit
43
- typhoeus
43
+ typhoeus (>= 0.5.4)
44
44
  uber_config
data/iron_mq.gemspec CHANGED
@@ -15,15 +15,15 @@ Gem::Specification.new do |gem|
15
15
  gem.version = IronMQ::VERSION
16
16
 
17
17
  gem.required_rubygems_version = ">= 1.3.6"
18
- gem.required_ruby_version = Gem::Requirement.new(">= 1.9")
19
- gem.add_runtime_dependency "iron_core", ">= 0.4.4"
18
+ gem.required_ruby_version = Gem::Requirement.new(">= 1.8")
19
+ gem.add_runtime_dependency "iron_core", ">= 0.5.1"
20
20
 
21
21
  gem.add_development_dependency "test-unit"
22
22
  gem.add_development_dependency "minitest"
23
23
  gem.add_development_dependency "rake"
24
24
  gem.add_development_dependency "beanstalk-client"
25
25
  gem.add_development_dependency "uber_config"
26
- gem.add_development_dependency "typhoeus"
26
+ gem.add_development_dependency "typhoeus", ">= 0.5.4"
27
27
  gem.add_development_dependency "concur"
28
28
  gem.add_development_dependency "net-http-persistent"
29
29
 
@@ -1,7 +1,7 @@
1
1
  require 'yaml'
2
2
 
3
3
  require 'iron_core'
4
- require_relative 'queues'
4
+ require 'iron_mq/queues'
5
5
 
6
6
  module IronMQ
7
7
 
@@ -116,7 +116,7 @@ module IronMQ
116
116
  end
117
117
 
118
118
  def subscribers(options={})
119
- res = @messages.client.get(@messages.path(options.merge(msg_id: id)) + "/subscribers", options)
119
+ res = @messages.client.get(@messages.path(options.merge(:msg_id => id)) + "/subscribers", options)
120
120
  res = @messages.client.parse_response(res)
121
121
  ret = []
122
122
  res['subscribers'].each do |m|
@@ -1,5 +1,5 @@
1
1
  require 'cgi'
2
- require_relative 'subscribers'
2
+ require 'iron_mq/subscribers'
3
3
 
4
4
  module IronMQ
5
5
  class Queues
@@ -151,14 +151,14 @@ module IronMQ
151
151
  end
152
152
 
153
153
  def add_subscriber(subscriber_hash, options={})
154
- res = @client.post("#{@client.queues.path(name: name)}/subscribers", subscribers: [subscriber_hash])
154
+ res = @client.post("#{@client.queues.path(:name => name)}/subscribers", :subscribers => [subscriber_hash])
155
155
  res = @client.parse_response(res)
156
156
  #p res
157
157
  res
158
158
  end
159
159
 
160
160
  def remove_subscriber(subscriber_hash)
161
- res = @client.delete("#{@client.queues.path(name: name)}/subscribers", {subscribers: [subscriber_hash]}, {"Content-Type"=>@client.content_type})
161
+ res = @client.delete("#{@client.queues.path(:name => name)}/subscribers", {:subscribers => [subscriber_hash]}, {"Content-Type"=>@client.content_type})
162
162
  res = @client.parse_response(res)
163
163
  #p res
164
164
  res
@@ -1,4 +1,4 @@
1
1
  module IronMQ
2
- VERSION = "3.0.2"
2
+ VERSION = "3.1.0"
3
3
  end
4
4
 
data/lib/iron_mq.rb CHANGED
@@ -1,6 +1,5 @@
1
- require 'rest'
2
- require_relative 'iron_mq/response'
3
- require_relative 'iron_mq/queues'
4
- require_relative 'iron_mq/messages'
5
- require_relative 'iron_mq/client'
6
- require_relative 'iron_mq/version'
1
+ require 'iron_mq/response'
2
+ require 'iron_mq/queues'
3
+ require 'iron_mq/messages'
4
+ require 'iron_mq/client'
5
+ require 'iron_mq/version'
data/test/long_run.rb CHANGED
@@ -1,6 +1,14 @@
1
1
  require 'yaml'
2
2
  require 'concur'
3
3
  require 'uber_config'
4
+
5
+ unless Hash.instance_methods.include?(:default_proc=)
6
+ class Hash
7
+ def default_proc=(proc)
8
+ end
9
+ end
10
+ end
11
+
4
12
  begin
5
13
  require File.join(File.dirname(__FILE__), '..', 'lib', 'iron_mq')
6
14
  rescue Exception => ex
data/test/quick_run.rb CHANGED
@@ -1,4 +1,4 @@
1
- require_relative 'test_base'
1
+ require 'test_base'
2
2
 
3
3
  TIMES = 1
4
4
 
data/test/schedule_abt.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'abt'
2
2
  require 'time'
3
- require_relative 'test_base'
3
+ require 'test_base'
4
4
 
5
5
  # Config for abt tests to run on IronWorker
6
6
  @abt_config = YAML::load_file(File.expand_path(File.join("~", "Dropbox", "configs", "abt", "test", "config.yml")))
data/test/test_base.rb CHANGED
@@ -1,7 +1,15 @@
1
- gem 'test-unit'
1
+ require 'rubygems'
2
2
  require 'test/unit'
3
3
  require 'yaml'
4
4
  require 'uber_config'
5
+
6
+ unless Hash.instance_methods.include?(:default_proc=)
7
+ class Hash
8
+ def default_proc=(proc)
9
+ end
10
+ end
11
+ end
12
+
5
13
  begin
6
14
  require File.join(File.dirname(__FILE__), '../lib/iron_mq')
7
15
  rescue Exception => ex
@@ -1,8 +1,7 @@
1
- gem 'test-unit'
2
1
  require 'test/unit'
3
2
  require 'beanstalk-client'
4
3
  require 'yaml'
5
- require_relative 'test_base'
4
+ require 'test_base'
6
5
 
7
6
  class BeanstalkTests < TestBase
8
7
  def setup
data/test/test_bulk.rb CHANGED
@@ -1,4 +1,4 @@
1
- require_relative 'test_base'
1
+ require 'test_base'
2
2
 
3
3
  class TestBulk < TestBase
4
4
 
data/test/test_iron_mq.rb CHANGED
@@ -1,7 +1,6 @@
1
- gem 'test-unit'
2
1
  require 'test/unit'
3
2
  require 'yaml'
4
- require_relative 'test_base'
3
+ require 'test_base'
5
4
 
6
5
  class IronMQTests < TestBase
7
6
  def setup
@@ -406,7 +405,7 @@ class IronMQTests < TestBase
406
405
  omit_if @skip
407
406
  puts "skip webhooks: #{@skip}"
408
407
  qname ="webhook_queue"
409
- path = "#{IronMQ::Messages.path(project_id: @client.project_id, queue_name: qname)}/webhook"
408
+ path = "#{IronMQ::Messages.path(:project_id => @client.project_id, :queue_name => qname)}/webhook"
410
409
  url = "#{@client.base_url}#{path}"
411
410
  url << "?oauth=#{@client.token}"
412
411
  p url
@@ -414,7 +413,7 @@ class IronMQTests < TestBase
414
413
  v = "hello webhook"
415
414
 
416
415
  @rest = Rest::Client.new
417
- p @rest.post(url, body: v)
416
+ p @rest.post(url, :body => v)
418
417
 
419
418
  queue = @client.queue(qname)
420
419
  msg = queue.get
@@ -1,5 +1,5 @@
1
1
  # Put config.yml file in ~/Dropbox/configs/ironmq_gem/test/config.yml
2
- require_relative 'test_base'
2
+ require 'test_base'
3
3
  require 'logger'
4
4
 
5
5
  class TestPushQueues < TestBase
@@ -30,7 +30,7 @@ class TestPushQueues < TestBase
30
30
  x = rand(1000)
31
31
  num_subscribers.times do |i|
32
32
  key = make_key(i, t, x)
33
- subscribers << {url: "http://rest-test.iron.io/code/200?store=#{key}"}
33
+ subscribers << {:url => "http://rest-test.iron.io/code/200?store=#{key}"}
34
34
  end
35
35
 
36
36
  queue = @client.queue(qname)
@@ -43,10 +43,10 @@ class TestPushQueues < TestBase
43
43
 
44
44
  # add the last one
45
45
  queue.reload # temporary, can remove
46
- queue.add_subscriber({url: "http://nowhere.com"})
46
+ queue.add_subscriber({:url => "http://nowhere.com"})
47
47
  queue.reload
48
48
  assert_equal num_subscribers + 1, queue.subscribers.size
49
- queue.remove_subscriber({url: "http://nowhere.com"})
49
+ queue.remove_subscriber({:url => "http://nowhere.com"})
50
50
  queue.reload
51
51
  assert_equal num_subscribers, queue.subscribers.size
52
52
 
@@ -153,8 +153,8 @@ class TestPushQueues < TestBase
153
153
  x = rand(1000)
154
154
 
155
155
  subscribers = []
156
- subscribers << {url: "http://rest-test.iron.io/code/503?switch_after=2&switch_to=200&namespace=push-test-failures-#{x}"}
157
- subscribers << {url: "http://rest-test.iron.io/code/503"}
156
+ subscribers << {:url => "http://rest-test.iron.io/code/503?switch_after=2&switch_to=200&namespace=push-test-failures-#{x}"}
157
+ subscribers << {:url => "http://rest-test.iron.io/code/503"}
158
158
 
159
159
  num_subscribers = 2
160
160
 
@@ -236,7 +236,7 @@ class TestPushQueues < TestBase
236
236
  x = rand(1000)
237
237
  num_subscribers.times do |i|
238
238
  key = make_key(i, t, x)
239
- subscribers << {url: "http://rest-test.iron.io/code/202?store=#{key}"}
239
+ subscribers << {:url => "http://rest-test.iron.io/code/202?store=#{key}"}
240
240
  end
241
241
 
242
242
  queue = @client.queue(qname)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_mq
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-12 00:00:00.000000000 Z
12
+ date: 2013-01-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: iron_core
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.4.4
21
+ version: 0.5.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.4.4
29
+ version: 0.5.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: test-unit
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ dependencies:
114
114
  requirements:
115
115
  - - ! '>='
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: 0.5.4
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -122,7 +122,7 @@ dependencies:
122
122
  requirements:
123
123
  - - ! '>='
124
124
  - !ruby/object:Gem::Version
125
- version: '0'
125
+ version: 0.5.4
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: concur
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -195,7 +195,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
196
  - - ! '>='
197
197
  - !ruby/object:Gem::Version
198
- version: '1.9'
198
+ version: '1.8'
199
199
  required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  none: false
201
201
  requirements: