lifeboat 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ require "autotest/bundler"
2
+ --color
3
+
data/Gemfile CHANGED
@@ -16,4 +16,5 @@ group :development do
16
16
  gem "bundler", "~> 1.0.0"
17
17
  gem "jeweler", "~> 1.5.2"
18
18
  gem "rcov", ">= 0"
19
+ gem "autotest"
19
20
  end
data/Gemfile.lock CHANGED
@@ -1,9 +1,12 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
+ ZenTest (4.5.0)
4
5
  activerecord (2.1.2)
5
6
  activesupport (= 2.1.2)
6
7
  activesupport (2.1.2)
8
+ autotest (4.4.6)
9
+ ZenTest (>= 4.4.1)
7
10
  diff-lcs (1.1.2)
8
11
  git (1.2.5)
9
12
  jeweler (1.5.2)
@@ -31,6 +34,7 @@ PLATFORMS
31
34
 
32
35
  DEPENDENCIES
33
36
  activerecord (>= 2.1.2)
37
+ autotest
34
38
  bundler (~> 1.0.0)
35
39
  jeweler (~> 1.5.2)
36
40
  mysql (= 2.8.1)
data/README.md CHANGED
@@ -55,20 +55,6 @@ queue automatically. Moreover, we do XML too.
55
55
  has_lifeboat :format => :xml
56
56
  end
57
57
 
58
- Provide your AWS credentials in config/aws.yml
59
-
60
-
61
- test:
62
- key: ......
63
- secret: .......
64
-
65
- development:
66
- key: ........
67
- secret: .......
68
-
69
- production:
70
- key: .......
71
- secret: ......
72
58
 
73
59
  ** We will then automatically create queue messages each time any instance of the model class is created, updated, or deleted. **
74
60
 
@@ -81,15 +67,6 @@ How did we named the queues
81
67
  ** Where: ** model can be the name of any model we include lifeboat on.
82
68
 
83
69
 
84
- ASSUMPTIONS
85
- -----------
86
-
87
- We Asume you have a file called aws.yml under you config directory with the aws key and secret
88
-
89
- test:
90
- :key 'you_key'
91
- :secret 'your_secret'
92
-
93
70
 
94
71
  Hot-Swap Slaves
95
72
  ---------------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.4.0
data/config/aws.yml CHANGED
@@ -1,3 +1,3 @@
1
- test:
1
+ testing:
2
2
  access_key_id: 'AKIAJ3GG5YKJUT3YQQYA'
3
3
  secret_access_key: 'H6FgWZTcUFEdRrhfN/atWyDj7LBABepb9OvlAw2L'
data/lib/lifeboat.rb CHANGED
@@ -46,6 +46,9 @@ module LifeBoat
46
46
  def has_lifeboat(options={})
47
47
  include LifeBoat::Queues
48
48
 
49
+ return unless (RAILS_ENV == "production") or (RAILS_ENV == "testing")
50
+
51
+
49
52
  if options[:format] == :xml
50
53
  format = :to_xml
51
54
  else
data/lifeboat.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{lifeboat}
8
- s.version = "0.3.1"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ivan Acosta-Rubio"]
12
- s.date = %q{2011-05-09}
12
+ s.date = %q{2011-06-10}
13
13
  s.description = %q{ }
14
14
  s.email = %q{ivan@bakedweb.net}
15
15
  s.extra_rdoc_files = [
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
+ ".rspec",
21
22
  "Gemfile",
22
23
  "Gemfile.lock",
23
24
  "LICENSE.txt",
@@ -52,6 +53,7 @@ Gem::Specification.new do |s|
52
53
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
53
54
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
54
55
  s.add_development_dependency(%q<rcov>, [">= 0"])
56
+ s.add_development_dependency(%q<autotest>, [">= 0"])
55
57
  else
56
58
  s.add_dependency(%q<right_aws>, [">= 1.10.0"])
57
59
  s.add_dependency(%q<activerecord>, [">= 2.1.2"])
@@ -61,6 +63,7 @@ Gem::Specification.new do |s|
61
63
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
62
64
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
63
65
  s.add_dependency(%q<rcov>, [">= 0"])
66
+ s.add_dependency(%q<autotest>, [">= 0"])
64
67
  end
65
68
  else
66
69
  s.add_dependency(%q<right_aws>, [">= 1.10.0"])
@@ -71,6 +74,7 @@ Gem::Specification.new do |s|
71
74
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
72
75
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
73
76
  s.add_dependency(%q<rcov>, [">= 0"])
77
+ s.add_dependency(%q<autotest>, [">= 0"])
74
78
  end
75
79
  end
76
80
 
@@ -1,5 +1,8 @@
1
1
  require 'rubygems'
2
2
  require 'rspec'
3
+
4
+ RAILS_ENV = "testing"
5
+
3
6
  require 'lifeboat'
4
7
 
5
8
  config = YAML::load(IO.read(File.dirname(__FILE__) + '/../config/database.yml'))
@@ -42,7 +45,6 @@ class XMLRecord < ActiveRecord::Base
42
45
  has_lifeboat :format => :xml
43
46
  end
44
47
 
45
- RAILS_ENV = "test"
46
48
 
47
49
  class Helper
48
50
  def self.clean_all_queues
@@ -108,27 +110,27 @@ describe LifeBoat do
108
110
 
109
111
  it "reads messages from a cue" do
110
112
  Fake.create(:name => "ivan")
111
- messages = LifeBoat.read_queue("create_fake_test")
113
+ messages = LifeBoat.read_queue("create_fake_testing")
112
114
  messages.size.should == 1
113
115
  end
114
116
 
115
117
  it "the message it creates contains the attributes ob the object as json" do
116
118
  f = Fake.create(:name => "ivan")
117
- q = LifeBoat.read_queue("create_fake_test")
119
+ q = LifeBoat.read_queue("create_fake_testing")
118
120
  q[0].body.should == f.attributes.to_json
119
121
  end
120
122
 
121
123
  it "creates a destroy SQS queue when parent is destroyed" do
122
124
  f = Fake.create(:name => "updated")
123
125
  f.destroy
124
- messages = LifeBoat.read_queue("destroy_fake_test")
126
+ messages = LifeBoat.read_queue("destroy_fake_testing")
125
127
  messages.size.should == 1
126
128
  end
127
129
 
128
130
  it "updates SQS queue when parent is updated" do
129
131
  f = Fake.create(:name => "Er Update")
130
132
  f.name= "28347834" ; f.save
131
- messages= LifeBoat.read_queue("update_fake_test")
133
+ messages= LifeBoat.read_queue("update_fake_testing")
132
134
  messages.size.should == 1
133
135
  end
134
136
  end
@@ -136,7 +138,7 @@ end
136
138
  describe LifeBoat, " does XML" do
137
139
  it "serialices the objects to xml" do
138
140
  f = XMLRecord.create(:name => "Yo soy XML")
139
- messages = LifeBoat.read_queue("create_xmlrecord_test")
141
+ messages = LifeBoat.read_queue("create_xmlrecord_testing")
140
142
  messages.size.should == 1
141
143
  messages[0].body.should == f.attributes.to_xml
142
144
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lifeboat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 1
10
- version: 0.3.1
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ivan Acosta-Rubio
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-09 00:00:00 Z
18
+ date: 2011-06-10 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -141,6 +141,20 @@ dependencies:
141
141
  prerelease: false
142
142
  type: :development
143
143
  requirement: *id008
144
+ - !ruby/object:Gem::Dependency
145
+ version_requirements: &id009 !ruby/object:Gem::Requirement
146
+ none: false
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ hash: 3
151
+ segments:
152
+ - 0
153
+ version: "0"
154
+ name: autotest
155
+ prerelease: false
156
+ type: :development
157
+ requirement: *id009
144
158
  description: " "
145
159
  email: ivan@bakedweb.net
146
160
  executables: []
@@ -152,6 +166,7 @@ extra_rdoc_files:
152
166
  - README.md
153
167
  files:
154
168
  - .document
169
+ - .rspec
155
170
  - Gemfile
156
171
  - Gemfile.lock
157
172
  - LICENSE.txt