Skip to content

Commit 5205409

Browse files
committed
Switched to new bundler way.
1 parent a0ca76c commit 5205409

10 files changed

+81
-94
lines changed

Gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source "https://rubygems.org"
2+
3+
gemspec

Gemfile.lock

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
PATH
2+
remote: .
3+
specs:
4+
iron_mq (1.8.0)
5+
iron_core (>= 0.1.4)
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
beanstalk-client (1.1.1)
11+
ffi (1.0.11)
12+
iron_core (0.1.4)
13+
bundler (> 1.0.0)
14+
rest
15+
rest-client
16+
mime-types (1.19)
17+
rake (0.9.2.2)
18+
rest (1.0.0)
19+
rest-client (>= 0.3.0)
20+
rest-client (1.6.7)
21+
mime-types (>= 1.16)
22+
test-unit (2.5.0)
23+
typhoeus (0.4.2)
24+
ffi (~> 1.0)
25+
mime-types (~> 1.18)
26+
uber_config (0.0.3)
27+
28+
PLATFORMS
29+
ruby
30+
31+
DEPENDENCIES
32+
beanstalk-client
33+
iron_mq!
34+
rake
35+
test-unit
36+
typhoeus
37+
uber_config

Rakefile

-18
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
require 'rubygems'
22
require 'rake'
33

4-
begin
5-
require 'jeweler2'
6-
Jeweler::Tasks.new do |gem|
7-
gem.name = "iron_mq"
8-
gem.summary = "Ruby client for IronMQ"
9-
gem.description = "Ruby client for IronMQ"
10-
gem.email = "[email protected]"
11-
gem.homepage = "http://www.iron.io"
12-
gem.authors = ["Travis Reeder"]
13-
gem.add_dependency 'iron_core', '>= 0.1.4'
14-
#gem.add_dependency 'typhoeus'
15-
gem.required_ruby_version = '>= 1.9'
16-
end
17-
Jeweler::GemcutterTasks.new
18-
rescue LoadError
19-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler2"
20-
end
21-
224
require 'rake/testtask'
235
Rake::TestTask.new(:test) do |test|
246
test.libs << 'lib' << 'test'

VERSION.yml

-5
This file was deleted.

iron_mq.gemspec

+23-52
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,29 @@
1-
# Generated by jeweler
2-
# DO NOT EDIT THIS FILE DIRECTLY
3-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4-
# -*- encoding: utf-8 -*-
1+
require File.expand_path('../lib/iron_mq/version', __FILE__)
52

6-
Gem::Specification.new do |s|
7-
s.name = "iron_mq"
8-
s.version = "1.7.4"
3+
Gem::Specification.new do |gem|
4+
gem.authors = ["Travis Reeder"]
5+
gem.email = ["[email protected]"]
6+
gem.description = "Ruby client for IronMQ by www.iron.io"
7+
gem.summary = "Ruby client for IronMQ by www.iron.io"
8+
gem.homepage = "https://github.com/iron-io/iron_mq_ruby"
99

10-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11-
s.authors = ["Travis Reeder"]
12-
s.date = "2012-06-25"
13-
s.description = "Ruby client for IronMQ"
14-
s.email = "[email protected]"
15-
s.extra_rdoc_files = [
16-
"README.md"
17-
]
18-
s.files = [
19-
"README.md",
20-
"Rakefile",
21-
"VERSION.yml",
22-
"iron_mq.gemspec",
23-
"lib/iron_mq.rb",
24-
"lib/iron_mq/client.rb",
25-
"lib/iron_mq/messages.rb",
26-
"lib/iron_mq/queues.rb",
27-
"test/Gemfile",
28-
"test/Gemfile.lock",
29-
"test/long_run.rb",
30-
"test/long_run_worker.rb",
31-
"test/quick_run.rb",
32-
"test/schedule_abt.rb",
33-
"test/test_base.rb",
34-
"test/test_beanstalkd.rb",
35-
"test/test_iron_mq.rb"
36-
]
37-
s.homepage = "http://www.iron.io"
38-
s.require_paths = ["lib"]
39-
s.required_ruby_version = Gem::Requirement.new(">= 1.9")
40-
s.rubygems_version = "1.8.24"
41-
s.summary = "Ruby client for IronMQ"
10+
gem.files = `git ls-files`.split($\)
11+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
12+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13+
gem.name = "iron_mq"
14+
gem.require_paths = ["lib"]
15+
gem.version = IronMQ::VERSION
16+
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.1.4"
20+
21+
gem.add_development_dependency "test-unit"
22+
gem.add_development_dependency "rake"
23+
gem.add_development_dependency "beanstalk-client"
24+
gem.add_development_dependency "uber_config"
25+
gem.add_development_dependency "typhoeus"
4226

43-
if s.respond_to? :specification_version then
44-
s.specification_version = 3
4527

46-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47-
s.add_runtime_dependency(%q<iron_core>, [">= 0"])
48-
s.add_runtime_dependency(%q<iron_core>, [">= 0"])
49-
else
50-
s.add_dependency(%q<iron_core>, [">= 0"])
51-
s.add_dependency(%q<iron_core>, [">= 0"])
52-
end
53-
else
54-
s.add_dependency(%q<iron_core>, [">= 0"])
55-
s.add_dependency(%q<iron_core>, [">= 0"])
56-
end
5728
end
5829

lib/iron_mq.rb

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
require_relative 'iron_mq/queues'
22
require_relative 'iron_mq/messages'
33
require_relative 'iron_mq/client'
4+
require_relative 'iron_mq/version'

lib/iron_mq/client.rb

+4-12
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,6 @@
33
require 'iron_core'
44

55
module IronMQ
6-
@@version = nil
7-
8-
def self.version
9-
if @@version.nil?
10-
v = YAML.load(File.read(File.dirname(__FILE__) + '/../../VERSION.yml'))
11-
$stderr.puts v.inspect
12-
@@version = [v[:major].to_s, v[:minor].to_s, v[:patch].to_s].join('.')
13-
end
14-
15-
@@version
16-
end
176

187
class Client < IronCore::Client
198
AWS_US_EAST_HOST = 'mq-aws-us-east-1.iron.io'
@@ -23,7 +12,10 @@ class Client < IronCore::Client
2312
def initialize(options={})
2413
super('mq', options, [:queue_name])
2514

26-
load_from_hash('defaults', {:scheme => 'https', :host => IronMQ::Client::AWS_US_EAST_HOST, :port => 443, :api_version => 1, :user_agent => 'iron_mq_ruby-' + IronMQ.version + ' (iron_core_ruby-' + IronCore.version + ')', :queue_name => 'default'})
15+
load_from_hash('defaults', {:scheme => 'https', :host => IronMQ::Client::AWS_US_EAST_HOST, :port => 443,
16+
:api_version => 1,
17+
:user_agent => 'iron_mq_ruby-' + IronMQ::VERSION + ' (iron_core_ruby-' + IronCore.version + ')',
18+
:queue_name => 'default'})
2719

2820
if (not @token) || (not @project_id)
2921
IronCore::Logger.error 'IronMQ', 'Both token and project_id must be specified'

lib/iron_mq/queues.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def get(options={})
4343
def post(options={})
4444
options[:name] ||= @client.queue_name
4545
res = @client.parse_response(@client.post(path(options), options))
46-
p res
4746
res
47+
p res
4848

4949
end
5050

lib/iron_mq/version.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module IronMQ
2+
VERSION = "1.8.0"
3+
end

test/quick_run.rb

+9-6
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,41 @@ class QuickRun < TestBase
66
def setup
77
super
88
@client.queue_name = 'ironmq-gem-quick'
9+
clear_queue
910
end
1011

1112
def test_basics
13+
1214
res = @client.messages.post("hello world!")
15+
p res
1316
assert res.id
1417
post_id = res.id
1518
assert res.msg
16-
p res
1719

1820
res = @client.messages.get()
21+
p res
22+
puts "post_id=" + post_id.inspect
1923
assert res.id
20-
assert res.id == post_id
24+
assert_equal res.id, post_id
2125
assert res.body
22-
p res
2326

2427
res = @client.messages.delete(res["id"])
25-
assert res.msg
2628
p res
29+
assert res.msg
2730

2831
res = @client.messages.get()
2932
p res
3033
assert res.nil?
3134

3235
res = @client.messages.post("hello world!", :queue_name=>'test2')
36+
p res
3337
assert res.id
3438
assert res.msg
35-
p res
3639

3740
res = @client.messages.get(:queue_name=>'test2')
41+
p res
3842
assert res.id
3943
assert res.body
40-
p res
4144

4245
res = res.delete
4346
p res

0 commit comments

Comments
 (0)