vidibus-resource 0.0.7 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -2,11 +2,11 @@ require "bundler"
2
2
  Bundler::GemHelper.install_tasks
3
3
 
4
4
  require "rake"
5
- require "rake/rdoctask"
5
+ require "rdoc/task"
6
6
  require "rspec"
7
7
  require "rspec/core/rake_task"
8
8
 
9
- Rspec::Core::RakeTask.new(:rcov) do |t|
9
+ RSpec::Core::RakeTask.new(:rcov) do |t|
10
10
  t.pattern = "spec/**/*_spec.rb"
11
11
  t.rcov = true
12
12
  t.rcov_opts = ["--exclude", "^spec,/gems/"]
@@ -53,7 +53,7 @@ module Vidibus::Resource
53
53
 
54
54
  # Update resource consumers if significant changes were made.
55
55
  # TODO: Send changes only (the resourceable ones)!
56
- # TODO: Perform update asynchronously
56
+ # Performs update asynchronously.
57
57
  def update_resource_consumers
58
58
  return unless resource_consumers and resource_consumers.any?
59
59
  return unless changes.except("resource_consumers", "updated_at").any?
@@ -64,7 +64,7 @@ module Vidibus::Resource
64
64
  self.resourceable_hash_checksum = hash_checksum
65
65
  for service in resource_consumers
66
66
  begin
67
- ::Service.discover(service, realm_uuid).put("/api/resources/#{self.class.to_s.tableize}/#{uuid}", :body => {:resource => hash})
67
+ ::Service.discover(service, realm_uuid).delay.put("/api/resources/#{self.class.to_s.tableize}/#{uuid}", :body => {:resource => hash})
68
68
  rescue => e
69
69
  Rails.logger.error "An error occurred while updating resource consumer #{service}:"
70
70
  Rails.logger.error e.inspect
@@ -74,10 +74,11 @@ module Vidibus::Resource
74
74
  end
75
75
 
76
76
  # Removes this resource from consumers.
77
+ # Performs update asynchronously.
77
78
  def destroy_resource_consumers
78
79
  for service in resource_consumers
79
80
  begin
80
- ::Service.discover(service, realm_uuid).delete("/api/resources/#{self.class.to_s.tableize}/#{uuid}")
81
+ ::Service.discover(service, realm_uuid).delay.delete("/api/resources/#{self.class.to_s.tableize}/#{uuid}")
81
82
  rescue => e
82
83
  Rails.logger.error "An error occurred while destroying resource consumer #{service}:"
83
84
  Rails.logger.error e.inspect
@@ -1,5 +1,5 @@
1
1
  module Vidibus
2
2
  module Resource
3
- VERSION = "0.0.7"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -14,11 +14,13 @@ Gem::Specification.new do |s|
14
14
  s.required_rubygems_version = ">= 1.3.6"
15
15
  s.rubyforge_project = "vidibus-resource"
16
16
 
17
- s.add_dependency "rails", "~> 3.0.0"
18
- s.add_dependency "mongoid", "~> 2.0.0"
17
+ s.add_dependency "rails", "~> 3"
18
+ s.add_dependency "mongoid", "~> 2"
19
19
  s.add_dependency "vidibus-uuid"
20
20
  s.add_dependency "vidibus-service"
21
21
  s.add_dependency "vidibus-api"
22
+ s.add_dependency "delayed_job", "~> 2.0"
23
+ s.add_dependency "delayed_job_mongoid", "~> 1.0"
22
24
 
23
25
  s.add_development_dependency "bundler", ">= 1.0.0"
24
26
  s.add_development_dependency "rake", ">= 0"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidibus-resource
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 7
10
- version: 0.0.7
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Andr\xC3\xA9 Pankratz"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-06 00:00:00 +02:00
18
+ date: 2011-05-31 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,10 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- hash: 7
29
+ hash: 5
30
30
  segments:
31
31
  - 3
32
- - 0
33
- - 0
34
- version: 3.0.0
32
+ version: "3"
35
33
  type: :runtime
36
34
  version_requirements: *id001
37
35
  - !ruby/object:Gem::Dependency
@@ -42,12 +40,10 @@ dependencies:
42
40
  requirements:
43
41
  - - ~>
44
42
  - !ruby/object:Gem::Version
45
- hash: 15
43
+ hash: 7
46
44
  segments:
47
45
  - 2
48
- - 0
49
- - 0
50
- version: 2.0.0
46
+ version: "2"
51
47
  type: :runtime
52
48
  version_requirements: *id002
53
49
  - !ruby/object:Gem::Dependency
@@ -93,9 +89,39 @@ dependencies:
93
89
  type: :runtime
94
90
  version_requirements: *id005
95
91
  - !ruby/object:Gem::Dependency
96
- name: bundler
92
+ name: delayed_job
97
93
  prerelease: false
98
94
  requirement: &id006 !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ~>
98
+ - !ruby/object:Gem::Version
99
+ hash: 3
100
+ segments:
101
+ - 2
102
+ - 0
103
+ version: "2.0"
104
+ type: :runtime
105
+ version_requirements: *id006
106
+ - !ruby/object:Gem::Dependency
107
+ name: delayed_job_mongoid
108
+ prerelease: false
109
+ requirement: &id007 !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ~>
113
+ - !ruby/object:Gem::Version
114
+ hash: 15
115
+ segments:
116
+ - 1
117
+ - 0
118
+ version: "1.0"
119
+ type: :runtime
120
+ version_requirements: *id007
121
+ - !ruby/object:Gem::Dependency
122
+ name: bundler
123
+ prerelease: false
124
+ requirement: &id008 !ruby/object:Gem::Requirement
99
125
  none: false
100
126
  requirements:
101
127
  - - ">="
@@ -107,11 +133,11 @@ dependencies:
107
133
  - 0
108
134
  version: 1.0.0
109
135
  type: :development
110
- version_requirements: *id006
136
+ version_requirements: *id008
111
137
  - !ruby/object:Gem::Dependency
112
138
  name: rake
113
139
  prerelease: false
114
- requirement: &id007 !ruby/object:Gem::Requirement
140
+ requirement: &id009 !ruby/object:Gem::Requirement
115
141
  none: false
116
142
  requirements:
117
143
  - - ">="
@@ -121,11 +147,11 @@ dependencies:
121
147
  - 0
122
148
  version: "0"
123
149
  type: :development
124
- version_requirements: *id007
150
+ version_requirements: *id009
125
151
  - !ruby/object:Gem::Dependency
126
152
  name: rspec
127
153
  prerelease: false
128
- requirement: &id008 !ruby/object:Gem::Requirement
154
+ requirement: &id010 !ruby/object:Gem::Requirement
129
155
  none: false
130
156
  requirements:
131
157
  - - ">="
@@ -135,11 +161,11 @@ dependencies:
135
161
  - 0
136
162
  version: "0"
137
163
  type: :development
138
- version_requirements: *id008
164
+ version_requirements: *id010
139
165
  - !ruby/object:Gem::Dependency
140
166
  name: rack-test
141
167
  prerelease: false
142
- requirement: &id009 !ruby/object:Gem::Requirement
168
+ requirement: &id011 !ruby/object:Gem::Requirement
143
169
  none: false
144
170
  requirements:
145
171
  - - ">="
@@ -149,11 +175,11 @@ dependencies:
149
175
  - 0
150
176
  version: "0"
151
177
  type: :development
152
- version_requirements: *id009
178
+ version_requirements: *id011
153
179
  - !ruby/object:Gem::Dependency
154
180
  name: rr
155
181
  prerelease: false
156
- requirement: &id010 !ruby/object:Gem::Requirement
182
+ requirement: &id012 !ruby/object:Gem::Requirement
157
183
  none: false
158
184
  requirements:
159
185
  - - ">="
@@ -163,7 +189,7 @@ dependencies:
163
189
  - 0
164
190
  version: "0"
165
191
  type: :development
166
- version_requirements: *id010
192
+ version_requirements: *id012
167
193
  description: Allows creation of proxy objects of remote resources on distributed applications.
168
194
  email:
169
195
  - andre@vidibus.com