vidibus-service 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Andre Pankratz
1
+ Copyright (c) 2010-2011 Andre Pankratz
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Vidibus::Service [![](http://travis-ci.org/vidibus/vidibus-service.png)](http://travis-ci.org/vidibus/vidibus-service) [![](http://stillmaintained.com/vidibus/vidibus-service.png)](http://stillmaintained.com/vidibus/vidibus-service)
2
+
3
+ DESCRIBE
4
+
5
+ This gem is part of [Vidibus](http://vidibus.org), an open source toolset for building distributed (video) applications.
6
+
7
+
8
+ ## Installation
9
+
10
+ Add `gem "vidibus-service"` to your Gemfile. Then call `bundle install` on your console.
11
+
12
+
13
+ ## Requirements
14
+
15
+ In order to work properly this gem needs the route /connector to call a Rack app. Usually this
16
+ route gets provided automatically but that may fail if your application has some sort of catch-all
17
+ route. To check if the route works as expected, just call http://yourapp.com/connector and expect
18
+ an error message like this:
19
+
20
+ ```
21
+ This service has not been configured yet. Use your Connector to set it up.
22
+ ```
23
+
24
+ If you don't see this error message, add the route manually at the top of your routes.rb:
25
+
26
+ ```ruby
27
+ match "/connector" => Vidibus::Service::ConnectorApp
28
+ ```
29
+
30
+
31
+ ## Usage
32
+
33
+ DESCRIBE
34
+
35
+
36
+ ## Copyright
37
+
38
+ © 2010-2011 Andre Pankratz. See LICENSE for details.
data/Rakefile CHANGED
@@ -1,35 +1,25 @@
1
- require "rubygems"
2
- require "rake"
3
- require "rake/rdoctask"
1
+ require "bundler"
2
+ require "rdoc/task"
4
3
  require "rspec"
5
4
  require "rspec/core/rake_task"
6
5
 
7
- begin
8
- require "jeweler"
9
- Jeweler::Tasks.new do |gem|
10
- gem.name = "vidibus-service"
11
- gem.summary = %Q{Provides tools for Vidibus services}
12
- gem.description = %Q{Description...}
13
- gem.email = "andre@vidibus.com"
14
- gem.homepage = "http://github.com/vidibus/vidibus-service"
15
- gem.authors = ["Andre Pankratz"]
16
- end
17
- Jeweler::GemcutterTasks.new
18
- rescue LoadError
19
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
20
- end
6
+ Bundler::GemHelper.install_tasks
7
+
8
+ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
9
+ require "vidibus/service/version"
21
10
 
22
- Rspec::Core::RakeTask.new(:rcov) do |t|
11
+ RSpec::Core::RakeTask.new(:rcov) do |t|
23
12
  t.pattern = "spec/**/*_spec.rb"
24
13
  t.rcov = true
25
14
  t.rcov_opts = ["--exclude", "^spec,/gems/"]
26
15
  end
27
16
 
28
17
  Rake::RDocTask.new do |rdoc|
29
- version = File.exist?("VERSION") ? File.read("VERSION") : ""
30
18
  rdoc.rdoc_dir = "rdoc"
31
- rdoc.title = "vidibus-service #{version}"
19
+ rdoc.title = "vidibus-sysinfo #{Vidibus::Service::VERSION}"
32
20
  rdoc.rdoc_files.include("README*")
33
21
  rdoc.rdoc_files.include("lib/**/*.rb")
34
22
  rdoc.options << "--charset=utf-8"
35
23
  end
24
+
25
+ task :default => :rcov
data/config/routes.rb CHANGED
@@ -1,4 +1,4 @@
1
- require "service/connector_app"
1
+ require "vidibus/service/connector_app"
2
2
 
3
3
  Rails.application.routes.draw do
4
4
  match "/connector" => Vidibus::Service::ConnectorApp
@@ -1,11 +1,9 @@
1
- # require "rails"
2
1
  require "vidibus-secure"
3
2
  require "vidibus-validate_uri"
4
3
  require "vidibus-uuid"
5
4
  require "vidibus-core_extensions"
6
5
 
7
- $:.unshift(File.join(File.dirname(__FILE__), "vidibus"))
8
- require "service"
6
+ require "vidibus/service"
9
7
 
10
8
  if defined?(Rails)
11
9
  module Vidibus::Service
@@ -1,13 +1,8 @@
1
- module Vidibus # :nodoc
2
- module Service # :nodoc
3
- class Error < StandardError; end
4
- end
5
- end
6
-
7
- require "service/client"
8
- require "service/mongoid"
9
- require "service/connector_app"
10
- require "service/controller_validations"
1
+ require "vidibus/service/errors"
2
+ require "vidibus/service/client"
3
+ require "vidibus/service/mongoid"
4
+ require "vidibus/service/connector_app"
5
+ require "vidibus/service/controller_validations"
11
6
 
12
7
  # Shorthand for Service.discover
13
8
  def Service(wanted, realm)
@@ -161,7 +161,8 @@ module Vidibus
161
161
 
162
162
  this = service.new(data)
163
163
  this.valid?
164
- raise ValidationError unless this.errors.except(:secret).empty?
164
+ errors = this.errors.respond_to?(:messages) ? this.errors.messages : this.errors # Support Rails < 3.0.9
165
+ raise ValidationError unless errors.except(:secret).empty?
165
166
 
166
167
  set_secret!(this)
167
168
  this.save or raise ValidationError
@@ -0,0 +1,5 @@
1
+ module Vidibus # :nodoc
2
+ module Service # :nodoc
3
+ class Error < StandardError; end
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Vidibus
2
+ module Service
3
+ VERSION = "0.1.2"
4
+ end
5
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidibus-service
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andre Pankratz
@@ -15,28 +15,26 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-04 00:00:00 +02:00
18
+ date: 2011-09-08 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
+ name: mongoid
22
23
  prerelease: false
23
- type: :runtime
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- hash: 15
29
+ hash: 7
30
30
  segments:
31
31
  - 2
32
- - 0
33
- - 0
34
- version: 2.0.0
35
- name: mongoid
32
+ version: "2"
33
+ type: :runtime
36
34
  version_requirements: *id001
37
35
  - !ruby/object:Gem::Dependency
36
+ name: vidibus-core_extensions
38
37
  prerelease: false
39
- type: :runtime
40
38
  requirement: &id002 !ruby/object:Gem::Requirement
41
39
  none: false
42
40
  requirements:
@@ -46,11 +44,11 @@ dependencies:
46
44
  segments:
47
45
  - 0
48
46
  version: "0"
49
- name: vidibus-core_extensions
47
+ type: :runtime
50
48
  version_requirements: *id002
51
49
  - !ruby/object:Gem::Dependency
50
+ name: vidibus-secure
52
51
  prerelease: false
53
- type: :runtime
54
52
  requirement: &id003 !ruby/object:Gem::Requirement
55
53
  none: false
56
54
  requirements:
@@ -60,11 +58,11 @@ dependencies:
60
58
  segments:
61
59
  - 0
62
60
  version: "0"
63
- name: vidibus-secure
61
+ type: :runtime
64
62
  version_requirements: *id003
65
63
  - !ruby/object:Gem::Dependency
64
+ name: vidibus-uuid
66
65
  prerelease: false
67
- type: :runtime
68
66
  requirement: &id004 !ruby/object:Gem::Requirement
69
67
  none: false
70
68
  requirements:
@@ -74,11 +72,11 @@ dependencies:
74
72
  segments:
75
73
  - 0
76
74
  version: "0"
77
- name: vidibus-uuid
75
+ type: :runtime
78
76
  version_requirements: *id004
79
77
  - !ruby/object:Gem::Dependency
78
+ name: vidibus-validate_uri
80
79
  prerelease: false
81
- type: :runtime
82
80
  requirement: &id005 !ruby/object:Gem::Requirement
83
81
  none: false
84
82
  requirements:
@@ -88,11 +86,11 @@ dependencies:
88
86
  segments:
89
87
  - 0
90
88
  version: "0"
91
- name: vidibus-validate_uri
89
+ type: :runtime
92
90
  version_requirements: *id005
93
91
  - !ruby/object:Gem::Dependency
92
+ name: httparty
94
93
  prerelease: false
95
- type: :runtime
96
94
  requirement: &id006 !ruby/object:Gem::Requirement
97
95
  none: false
98
96
  requirements:
@@ -102,11 +100,11 @@ dependencies:
102
100
  segments:
103
101
  - 0
104
102
  version: "0"
105
- name: httparty
103
+ type: :runtime
106
104
  version_requirements: *id006
107
105
  - !ruby/object:Gem::Dependency
106
+ name: json
108
107
  prerelease: false
109
- type: :runtime
110
108
  requirement: &id007 !ruby/object:Gem::Requirement
111
109
  none: false
112
110
  requirements:
@@ -116,25 +114,27 @@ dependencies:
116
114
  segments:
117
115
  - 0
118
116
  version: "0"
119
- name: json
117
+ type: :runtime
120
118
  version_requirements: *id007
121
119
  - !ruby/object:Gem::Dependency
120
+ name: bundler
122
121
  prerelease: false
123
- type: :development
124
122
  requirement: &id008 !ruby/object:Gem::Requirement
125
123
  none: false
126
124
  requirements:
127
125
  - - ">="
128
126
  - !ruby/object:Gem::Version
129
- hash: 3
127
+ hash: 23
130
128
  segments:
129
+ - 1
131
130
  - 0
132
- version: "0"
133
- name: jeweler
131
+ - 0
132
+ version: 1.0.0
133
+ type: :development
134
134
  version_requirements: *id008
135
135
  - !ruby/object:Gem::Dependency
136
+ name: rake
136
137
  prerelease: false
137
- type: :development
138
138
  requirement: &id009 !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
@@ -144,27 +144,25 @@ dependencies:
144
144
  segments:
145
145
  - 0
146
146
  version: "0"
147
- name: rake
147
+ type: :development
148
148
  version_requirements: *id009
149
149
  - !ruby/object:Gem::Dependency
150
+ name: rdoc
150
151
  prerelease: false
151
- type: :development
152
152
  requirement: &id010 !ruby/object:Gem::Requirement
153
153
  none: false
154
154
  requirements:
155
- - - ~>
155
+ - - ">="
156
156
  - !ruby/object:Gem::Version
157
- hash: 15
157
+ hash: 3
158
158
  segments:
159
- - 2
160
- - 0
161
159
  - 0
162
- version: 2.0.0
163
- name: rspec
160
+ version: "0"
161
+ type: :development
164
162
  version_requirements: *id010
165
163
  - !ruby/object:Gem::Dependency
164
+ name: rcov
166
165
  prerelease: false
167
- type: :development
168
166
  requirement: &id011 !ruby/object:Gem::Requirement
169
167
  none: false
170
168
  requirements:
@@ -174,12 +172,26 @@ dependencies:
174
172
  segments:
175
173
  - 0
176
174
  version: "0"
177
- name: rr
175
+ type: :development
178
176
  version_requirements: *id011
179
177
  - !ruby/object:Gem::Dependency
178
+ name: rspec
180
179
  prerelease: false
181
- type: :development
182
180
  requirement: &id012 !ruby/object:Gem::Requirement
181
+ none: false
182
+ requirements:
183
+ - - ~>
184
+ - !ruby/object:Gem::Version
185
+ hash: 7
186
+ segments:
187
+ - 2
188
+ version: "2"
189
+ type: :development
190
+ version_requirements: *id012
191
+ - !ruby/object:Gem::Dependency
192
+ name: rr
193
+ prerelease: false
194
+ requirement: &id013 !ruby/object:Gem::Requirement
183
195
  none: false
184
196
  requirements:
185
197
  - - ">="
@@ -188,12 +200,26 @@ dependencies:
188
200
  segments:
189
201
  - 0
190
202
  version: "0"
191
- name: relevance-rcov
192
- version_requirements: *id012
203
+ type: :development
204
+ version_requirements: *id013
193
205
  - !ruby/object:Gem::Dependency
206
+ name: webmock
194
207
  prerelease: false
208
+ requirement: &id014 !ruby/object:Gem::Requirement
209
+ none: false
210
+ requirements:
211
+ - - ">="
212
+ - !ruby/object:Gem::Version
213
+ hash: 3
214
+ segments:
215
+ - 0
216
+ version: "0"
195
217
  type: :development
196
- requirement: &id013 !ruby/object:Gem::Requirement
218
+ version_requirements: *id014
219
+ - !ruby/object:Gem::Dependency
220
+ name: rack-test
221
+ prerelease: false
222
+ requirement: &id015 !ruby/object:Gem::Requirement
197
223
  none: false
198
224
  requirements:
199
225
  - - ">="
@@ -202,44 +228,33 @@ dependencies:
202
228
  segments:
203
229
  - 0
204
230
  version: "0"
205
- name: webmock
206
- version_requirements: *id013
207
- description: Description...
231
+ type: :development
232
+ version_requirements: *id015
233
+ description: Enables Vidibus Services for the embedding Rails application
208
234
  email: andre@vidibus.com
209
235
  executables: []
210
236
 
211
237
  extensions: []
212
238
 
213
- extra_rdoc_files:
214
- - LICENSE
215
- - README.rdoc
239
+ extra_rdoc_files: []
240
+
216
241
  files:
217
- - .bundle/config
218
- - .document
219
- - .rspec
220
- - Gemfile
221
- - LICENSE
222
- - README.rdoc
223
- - Rakefile
224
- - VERSION
225
- - app/models/service.rb
226
- - config/locales/en.yml
227
- - config/routes.rb
228
- - lib/vidibus-service.rb
229
- - lib/vidibus/service.rb
230
242
  - lib/vidibus/service/client.rb
231
243
  - lib/vidibus/service/connector_app.rb
232
244
  - lib/vidibus/service/controller_validations.rb
245
+ - lib/vidibus/service/errors.rb
233
246
  - lib/vidibus/service/mongoid.rb
234
- - spec/spec_helper.rb
235
- - spec/vidibus/service/client_spec.rb
236
- - spec/vidibus/service/connector_app_spec.rb
237
- - spec/vidibus/service/controller_validations_spec.rb
238
- - spec/vidibus/service/mongoid_spec.rb
239
- - spec/vidibus/service_spec.rb
240
- - vidibus-service.gemspec
247
+ - lib/vidibus/service/version.rb
248
+ - lib/vidibus/service.rb
249
+ - lib/vidibus-service.rb
250
+ - app/models/service.rb
251
+ - config/locales/en.yml
252
+ - config/routes.rb
253
+ - LICENSE
254
+ - README.md
255
+ - Rakefile
241
256
  has_rdoc: true
242
- homepage: http://github.com/vidibus/vidibus-service
257
+ homepage: https://github.com/vidibus/vidibus-service
243
258
  licenses: []
244
259
 
245
260
  post_install_message:
@@ -261,21 +276,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
276
  requirements:
262
277
  - - ">="
263
278
  - !ruby/object:Gem::Version
264
- hash: 3
279
+ hash: 23
265
280
  segments:
266
- - 0
267
- version: "0"
281
+ - 1
282
+ - 3
283
+ - 6
284
+ version: 1.3.6
268
285
  requirements: []
269
286
 
270
- rubyforge_project:
287
+ rubyforge_project: vidibus-service
271
288
  rubygems_version: 1.6.2
272
289
  signing_key:
273
290
  specification_version: 3
274
- summary: Provides tools for Vidibus services
275
- test_files:
276
- - spec/spec_helper.rb
277
- - spec/vidibus/service/client_spec.rb
278
- - spec/vidibus/service/connector_app_spec.rb
279
- - spec/vidibus/service/controller_validations_spec.rb
280
- - spec/vidibus/service/mongoid_spec.rb
281
- - spec/vidibus/service_spec.rb
291
+ summary: Service handling for Vidibus applications
292
+ test_files: []
293
+