vidibus-resource 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +138 -0
- data/LICENSE +20 -0
- data/README.rdoc +7 -0
- data/Rakefile +22 -0
- data/app/controllers/api/resources_controller.rb +49 -0
- data/config/routes.rb +5 -0
- data/lib/vidibus/resource/consumer/mongoid.rb +120 -0
- data/lib/vidibus/resource/provider/mongoid.rb +67 -0
- data/lib/vidibus/resource/version.rb +5 -0
- data/lib/vidibus/resource.rb +2 -0
- data/lib/vidibus-resource.rb +11 -0
- data/spec/spec_helper.rb +25 -0
- data/spec/vidibus/resource/consumer/mongoid_spec.rb +35 -0
- data/vidibus-resource.gemspec +31 -0
- metadata +214 -0
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
vidibus-resource (0.0.1)
|
5
|
+
rails (~> 3.0.0)
|
6
|
+
vidibus-api
|
7
|
+
vidibus-service
|
8
|
+
vidibus-uuid
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: http://rubygems.org/
|
12
|
+
specs:
|
13
|
+
abstract (1.0.0)
|
14
|
+
actionmailer (3.0.3)
|
15
|
+
actionpack (= 3.0.3)
|
16
|
+
mail (~> 2.2.9)
|
17
|
+
actionpack (3.0.3)
|
18
|
+
activemodel (= 3.0.3)
|
19
|
+
activesupport (= 3.0.3)
|
20
|
+
builder (~> 2.1.2)
|
21
|
+
erubis (~> 2.6.6)
|
22
|
+
i18n (~> 0.4)
|
23
|
+
rack (~> 1.2.1)
|
24
|
+
rack-mount (~> 0.6.13)
|
25
|
+
rack-test (~> 0.5.6)
|
26
|
+
tzinfo (~> 0.3.23)
|
27
|
+
activemodel (3.0.3)
|
28
|
+
activesupport (= 3.0.3)
|
29
|
+
builder (~> 2.1.2)
|
30
|
+
i18n (~> 0.4)
|
31
|
+
activerecord (3.0.3)
|
32
|
+
activemodel (= 3.0.3)
|
33
|
+
activesupport (= 3.0.3)
|
34
|
+
arel (~> 2.0.2)
|
35
|
+
tzinfo (~> 0.3.23)
|
36
|
+
activeresource (3.0.3)
|
37
|
+
activemodel (= 3.0.3)
|
38
|
+
activesupport (= 3.0.3)
|
39
|
+
activesupport (3.0.3)
|
40
|
+
arel (2.0.7)
|
41
|
+
bson (1.1.5)
|
42
|
+
builder (2.1.2)
|
43
|
+
crack (0.1.8)
|
44
|
+
diff-lcs (1.1.2)
|
45
|
+
erubis (2.6.6)
|
46
|
+
abstract (>= 1.0.0)
|
47
|
+
httparty (0.6.1)
|
48
|
+
crack (= 0.1.8)
|
49
|
+
i18n (0.5.0)
|
50
|
+
json (1.4.6)
|
51
|
+
macaddr (1.0.0)
|
52
|
+
mail (2.2.14)
|
53
|
+
activesupport (>= 2.3.6)
|
54
|
+
i18n (>= 0.4.0)
|
55
|
+
mime-types (~> 1.16)
|
56
|
+
treetop (~> 1.4.8)
|
57
|
+
mime-types (1.16)
|
58
|
+
mongo (1.1.5)
|
59
|
+
bson (>= 1.1.5)
|
60
|
+
mongoid (2.0.0.rc.4)
|
61
|
+
activemodel (~> 3.0)
|
62
|
+
mongo (~> 1.1.5)
|
63
|
+
tzinfo (~> 0.3.22)
|
64
|
+
will_paginate (~> 3.0.pre)
|
65
|
+
polyglot (0.3.1)
|
66
|
+
rack (1.2.1)
|
67
|
+
rack-mount (0.6.13)
|
68
|
+
rack (>= 1.0.0)
|
69
|
+
rack-test (0.5.7)
|
70
|
+
rack (>= 1.0)
|
71
|
+
rails (3.0.3)
|
72
|
+
actionmailer (= 3.0.3)
|
73
|
+
actionpack (= 3.0.3)
|
74
|
+
activerecord (= 3.0.3)
|
75
|
+
activeresource (= 3.0.3)
|
76
|
+
activesupport (= 3.0.3)
|
77
|
+
bundler (~> 1.0)
|
78
|
+
railties (= 3.0.3)
|
79
|
+
railties (3.0.3)
|
80
|
+
actionpack (= 3.0.3)
|
81
|
+
activesupport (= 3.0.3)
|
82
|
+
rake (>= 0.8.7)
|
83
|
+
thor (~> 0.14.4)
|
84
|
+
rake (0.8.7)
|
85
|
+
rr (1.0.2)
|
86
|
+
rspec (2.0.1)
|
87
|
+
rspec-core (~> 2.0.1)
|
88
|
+
rspec-expectations (~> 2.0.1)
|
89
|
+
rspec-mocks (~> 2.0.1)
|
90
|
+
rspec-core (2.0.1)
|
91
|
+
rspec-expectations (2.0.1)
|
92
|
+
diff-lcs (>= 1.1.2)
|
93
|
+
rspec-mocks (2.0.1)
|
94
|
+
rspec-core (~> 2.0.1)
|
95
|
+
rspec-expectations (~> 2.0.1)
|
96
|
+
thor (0.14.6)
|
97
|
+
treetop (1.4.9)
|
98
|
+
polyglot (>= 0.3.1)
|
99
|
+
tzinfo (0.3.24)
|
100
|
+
uuid (2.3.1)
|
101
|
+
macaddr (~> 1.0)
|
102
|
+
vidibus-api (0.0.1)
|
103
|
+
vidibus-service
|
104
|
+
vidibus-core_extensions (0.3.15)
|
105
|
+
vidibus-secure (0.0.3)
|
106
|
+
activesupport (~> 3.0.0)
|
107
|
+
mongoid (~> 2.0.0.beta.20)
|
108
|
+
rack
|
109
|
+
vidibus-core_extensions
|
110
|
+
vidibus-service (0.0.4)
|
111
|
+
httparty
|
112
|
+
json
|
113
|
+
mongoid (~> 2.0.0.beta.20)
|
114
|
+
vidibus-core_extensions
|
115
|
+
vidibus-secure
|
116
|
+
vidibus-uuid
|
117
|
+
vidibus-validate_uri
|
118
|
+
vidibus-uuid (0.3.8)
|
119
|
+
mongoid (~> 2.0.0.beta.20)
|
120
|
+
uuid (~> 2.3.1)
|
121
|
+
vidibus-validate_uri (0.1.4)
|
122
|
+
rails (~> 3.0.0)
|
123
|
+
will_paginate (3.0.pre2)
|
124
|
+
|
125
|
+
PLATFORMS
|
126
|
+
ruby
|
127
|
+
|
128
|
+
DEPENDENCIES
|
129
|
+
bundler (>= 1.0.0)
|
130
|
+
rack-test
|
131
|
+
rails (~> 3.0.0)
|
132
|
+
rake
|
133
|
+
rr
|
134
|
+
rspec
|
135
|
+
vidibus-api
|
136
|
+
vidibus-resource!
|
137
|
+
vidibus-service
|
138
|
+
vidibus-uuid
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Andre Pankratz
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require "bundler"
|
2
|
+
Bundler::GemHelper.install_tasks
|
3
|
+
|
4
|
+
require "rake"
|
5
|
+
require "rake/rdoctask"
|
6
|
+
require "rspec"
|
7
|
+
require "rspec/core/rake_task"
|
8
|
+
|
9
|
+
Rspec::Core::RakeTask.new(:rcov) do |t|
|
10
|
+
t.pattern = "spec/**/*_spec.rb"
|
11
|
+
t.rcov = true
|
12
|
+
t.rcov_opts = ["--exclude", "^spec,/gems/"]
|
13
|
+
end
|
14
|
+
|
15
|
+
Rake::RDocTask.new do |rdoc|
|
16
|
+
require File.expand_path("../lib/vidibus/resource/version", __FILE__)
|
17
|
+
rdoc.rdoc_dir = "rdoc"
|
18
|
+
rdoc.title = "vidibus-resource #{Vidibus::Resource::VERSION}"
|
19
|
+
rdoc.rdoc_files.include("README*")
|
20
|
+
rdoc.rdoc_files.include("lib/**/*.rb")
|
21
|
+
rdoc.options << "--charset=utf-8"
|
22
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class Api::ResourcesController < ApiController
|
2
|
+
before_filter :ensure_klass
|
3
|
+
before_filter :find_instance
|
4
|
+
|
5
|
+
# Creates resource consumer on provider.
|
6
|
+
def create
|
7
|
+
@instance.add_resource_consumer(params["service"])
|
8
|
+
render :json => {:resource => @instance.resourceable_hash}
|
9
|
+
end
|
10
|
+
|
11
|
+
# Updates resource on consumer.
|
12
|
+
def update
|
13
|
+
begin
|
14
|
+
@instance.update_resource_attributes(params["resource"])
|
15
|
+
render :nothing => true
|
16
|
+
rescue => e
|
17
|
+
Rails.logger.error 'Error while updating resource consumer: '+e.inspect
|
18
|
+
render :json => { :error => e }, :status => :bad_request
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# Removes a resource consumer from provider
|
23
|
+
def destroy
|
24
|
+
if @instance.resource_provider?
|
25
|
+
@instance.remove_resource_consumer(params["service"])
|
26
|
+
else
|
27
|
+
# TODO
|
28
|
+
end
|
29
|
+
render :nothing => true
|
30
|
+
end
|
31
|
+
|
32
|
+
protected
|
33
|
+
|
34
|
+
def ensure_klass
|
35
|
+
begin
|
36
|
+
@klass = params[:klass].classify.constantize
|
37
|
+
rescue => e
|
38
|
+
render :json => { :error => e }, :status => :bad_request
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def find_instance
|
43
|
+
result = @klass.where(:uuid => params[:uuid])
|
44
|
+
if @klass.new.respond_to?(:realm_uuid)
|
45
|
+
result.and(:realm_uuid => params[:realm])
|
46
|
+
end
|
47
|
+
@instance = result.first or render(:nothing => true, :status => :not_found)
|
48
|
+
end
|
49
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
module Vidibus::Resource
|
2
|
+
module Consumer
|
3
|
+
|
4
|
+
class ConfigurationError < StandardError; end
|
5
|
+
|
6
|
+
module Mongoid
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
9
|
+
included do
|
10
|
+
include Vidibus::Uuid::Mongoid
|
11
|
+
|
12
|
+
field :resource_attributes, :type => Hash, :default => {}
|
13
|
+
field :uuid
|
14
|
+
index :uuid
|
15
|
+
validates :uuid, :uuid => true
|
16
|
+
|
17
|
+
before_create :add_resource_consumer
|
18
|
+
before_save :set_resource_attributes
|
19
|
+
before_destroy :remove_resource_consumer
|
20
|
+
end
|
21
|
+
|
22
|
+
# Registers this consumer with provider.
|
23
|
+
def add_resource_consumer
|
24
|
+
response = resource_provider.post("/api/resources/#{self.class.to_s.tableize}/#{uuid}")
|
25
|
+
resource = response["resource"]
|
26
|
+
self.resource_attributes = resource
|
27
|
+
set_resource_attributes(true)
|
28
|
+
true # ensure true!
|
29
|
+
end
|
30
|
+
|
31
|
+
# Removes this consumer from provider.
|
32
|
+
def remove_resource_consumer
|
33
|
+
resource_provider.delete("/api/resources/#{self.class.to_s.tableize}/#{uuid}")
|
34
|
+
true # ensure true!
|
35
|
+
end
|
36
|
+
|
37
|
+
# Updates resource attributes.
|
38
|
+
# TODO: Update only data that has been changed.
|
39
|
+
def update_resource_attributes(data)
|
40
|
+
update_attributes(:resource_attributes => data)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Returns a resource provider service.
|
44
|
+
def resource_provider
|
45
|
+
@resource_provider ||= begin
|
46
|
+
service = self.class.instance_variable_get("@resource_provider") or
|
47
|
+
raise ConfigurationError.new("No resource provider has been defined. Call #{self.class}.resource_provider(service, realm)")
|
48
|
+
realm = self.class.instance_variable_get("@resource_realm") or
|
49
|
+
raise ConfigurationError.new("No resource realm has been defined. Call #{self.class}.resource_realm(realm)")
|
50
|
+
::Service.discover(service, realm)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
protected
|
55
|
+
|
56
|
+
# Populates attributes of instance from
|
57
|
+
# received resource_attributes hash.
|
58
|
+
def set_resource_attributes(force = false)
|
59
|
+
if resource_attributes_changed? or force == true
|
60
|
+
for key, value in resource_attributes
|
61
|
+
send("#{key}=", value)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
true # ensure true!
|
65
|
+
end
|
66
|
+
|
67
|
+
# Defines attributes of resource_attributes hash as
|
68
|
+
# methods on consumer instance.
|
69
|
+
def method_missing(name, *args, &block)
|
70
|
+
if name.to_s.match(/(.+)\=$/)
|
71
|
+
writer = true
|
72
|
+
attribute = $1
|
73
|
+
name = "#{attribute}="
|
74
|
+
else
|
75
|
+
attribute = name.id2name
|
76
|
+
end
|
77
|
+
if resource_attributes and (value = resource_attributes[attribute])
|
78
|
+
self.class.class_eval do
|
79
|
+
field attribute.to_sym # Mongoid field
|
80
|
+
end
|
81
|
+
if writer
|
82
|
+
send(name, *args)
|
83
|
+
else
|
84
|
+
send("#{attribute}=", value)
|
85
|
+
send(name)
|
86
|
+
end
|
87
|
+
else
|
88
|
+
super
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
module ClassMethods
|
93
|
+
|
94
|
+
# Sets up resource provider service type and realm.
|
95
|
+
def resource_provider(service, realm = nil)
|
96
|
+
@resource_provider = service
|
97
|
+
resource_realm(realm) if realm
|
98
|
+
end
|
99
|
+
|
100
|
+
# Sets up realm of resource.
|
101
|
+
def resource_realm(realm)
|
102
|
+
@resource_realm = realm
|
103
|
+
end
|
104
|
+
|
105
|
+
# Ensures that an instance with given conditions exists.
|
106
|
+
def ensure!(conditions)
|
107
|
+
self.where(conditions).first || self.create!(conditions)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Remove all intances with given conditions.
|
111
|
+
def remove(conditions)
|
112
|
+
existing = self.where(conditions).to_a
|
113
|
+
for instance in existing
|
114
|
+
instance.destroy
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require "digest/md5"
|
2
|
+
|
3
|
+
module Vidibus::Resource
|
4
|
+
module Provider
|
5
|
+
module Mongoid
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
included do
|
9
|
+
field :resource_consumers, :type => Array, :default => []
|
10
|
+
field :resourceable_hash_checksum, :type => Hash
|
11
|
+
|
12
|
+
before_update :update_resource_consumers
|
13
|
+
# before_destroy :destroy_resource_consumers
|
14
|
+
end
|
15
|
+
|
16
|
+
# Adds given resource consumer.
|
17
|
+
def add_resource_consumer(service_uuid)
|
18
|
+
list = resource_consumers || []
|
19
|
+
list << service_uuid
|
20
|
+
update_attributes(:resource_consumers => list.uniq)
|
21
|
+
end
|
22
|
+
|
23
|
+
# Removes given resource consumer.
|
24
|
+
def remove_resource_consumer(service_uuid)
|
25
|
+
self.resource_consumers.delete(service_uuid)
|
26
|
+
save
|
27
|
+
end
|
28
|
+
|
29
|
+
def resource_provider?
|
30
|
+
true
|
31
|
+
end
|
32
|
+
|
33
|
+
def resource_consumer?
|
34
|
+
false
|
35
|
+
end
|
36
|
+
|
37
|
+
# TODO: Handle attributes properly
|
38
|
+
def resourceable_hash
|
39
|
+
attributes
|
40
|
+
end
|
41
|
+
|
42
|
+
protected
|
43
|
+
|
44
|
+
# Update resource consumers if significant changes were made.
|
45
|
+
# TODO: Send changes only (the resourceable ones)!
|
46
|
+
# TODO: Perform update asynchronously
|
47
|
+
def update_resource_consumers
|
48
|
+
return unless resource_consumers and resource_consumers.any?
|
49
|
+
return unless changes.except("resource_consumers", "updated_at").any?
|
50
|
+
|
51
|
+
hash = resourceable_hash
|
52
|
+
hash_checksum = Digest::MD5.hexdigest(hash.to_s)
|
53
|
+
unless hash_checksum == resourceable_hash_checksum
|
54
|
+
self.resourceable_hash_checksum = hash_checksum
|
55
|
+
for service in resource_consumers
|
56
|
+
begin
|
57
|
+
::Service.discover(service, realm_uuid).put("/api/resources/#{self.class.to_s.tableize}/#{uuid}", :body => {:resource => hash})
|
58
|
+
rescue => e
|
59
|
+
Rails.logger.error "An error occurred while updating resource consumer #{service}:"
|
60
|
+
Rails.logger.error e.inspect
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
3
|
+
|
4
|
+
require "rubygems"
|
5
|
+
require "rspec"
|
6
|
+
require "mongoid"
|
7
|
+
require "rack/test"
|
8
|
+
require "rr"
|
9
|
+
# require "webmock/rspec"
|
10
|
+
require "vidibus-resource"
|
11
|
+
|
12
|
+
Mongoid.configure do |config|
|
13
|
+
name = "vidibus-resource_test"
|
14
|
+
host = "localhost"
|
15
|
+
config.master = Mongo::Connection.new.db(name)
|
16
|
+
config.logger = nil
|
17
|
+
end
|
18
|
+
|
19
|
+
RSpec.configure do |config|
|
20
|
+
# config.include WebMock
|
21
|
+
config.mock_with :rr
|
22
|
+
config.before(:each) do
|
23
|
+
Mongoid.master.collections.select {|c| c.name !~ /system/}.each(&:drop)
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
class Model
|
4
|
+
include Mongoid::Document
|
5
|
+
include Vidibus::Resource::Consumer::Mongoid
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "Vidibus::Resource::Consumer::Mongoid" do
|
9
|
+
|
10
|
+
let(:model) do
|
11
|
+
Model.new.tap do |m|
|
12
|
+
m.resource_attributes = {"name" => "Jenny"}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "attributes" do
|
17
|
+
it "should be readable" do
|
18
|
+
model.name.should eql("Jenny")
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should be writable" do
|
22
|
+
model.name = "Sara"
|
23
|
+
model.name.should eql("Sara")
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should be persistent" do
|
27
|
+
stub(model).add_resource_consumer
|
28
|
+
stub(model).set_resource_attributes
|
29
|
+
model.save
|
30
|
+
model.update_attributes!({:name => "Sara"})
|
31
|
+
model.reload
|
32
|
+
model.name.should eql("Sara")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path("../lib/vidibus/resource/version", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "vidibus-resource"
|
6
|
+
s.version = Vidibus::Resource::VERSION
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.authors = ["André Pankratz"]
|
9
|
+
s.email = ["andre@vidibus.com"]
|
10
|
+
s.homepage = "https://github.com/vidibus/vidibus-resource"
|
11
|
+
s.summary = "Provides handling of remote resources"
|
12
|
+
s.description = "Allows creation of proxy objects of remote resources on distributed applications."
|
13
|
+
|
14
|
+
s.required_rubygems_version = ">= 1.3.6"
|
15
|
+
s.rubyforge_project = "vidibus-resource"
|
16
|
+
|
17
|
+
s.add_dependency "rails", "~> 3.0.0"
|
18
|
+
s.add_dependency "vidibus-uuid"
|
19
|
+
s.add_dependency "vidibus-service"
|
20
|
+
s.add_dependency "vidibus-api"
|
21
|
+
|
22
|
+
s.add_development_dependency "bundler", ">= 1.0.0"
|
23
|
+
s.add_development_dependency "rake", ">= 0"
|
24
|
+
s.add_development_dependency "rspec", ">= 0"
|
25
|
+
s.add_development_dependency "rack-test", ">= 0"
|
26
|
+
s.add_development_dependency "rr", ">= 0"
|
27
|
+
|
28
|
+
s.files = `git ls-files`.split("\n")
|
29
|
+
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
30
|
+
s.require_path = 'lib'
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,214 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vidibus-resource
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- "Andr\xC3\xA9 Pankratz"
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-01-16 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rails
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 3.0.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: vidibus-uuid
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 3
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
version: "0"
|
49
|
+
type: :runtime
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: vidibus-service
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 3
|
60
|
+
segments:
|
61
|
+
- 0
|
62
|
+
version: "0"
|
63
|
+
type: :runtime
|
64
|
+
version_requirements: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: vidibus-api
|
67
|
+
prerelease: false
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
version: "0"
|
77
|
+
type: :runtime
|
78
|
+
version_requirements: *id004
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: bundler
|
81
|
+
prerelease: false
|
82
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
hash: 23
|
88
|
+
segments:
|
89
|
+
- 1
|
90
|
+
- 0
|
91
|
+
- 0
|
92
|
+
version: 1.0.0
|
93
|
+
type: :development
|
94
|
+
version_requirements: *id005
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: rake
|
97
|
+
prerelease: false
|
98
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
hash: 3
|
104
|
+
segments:
|
105
|
+
- 0
|
106
|
+
version: "0"
|
107
|
+
type: :development
|
108
|
+
version_requirements: *id006
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: rspec
|
111
|
+
prerelease: false
|
112
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
hash: 3
|
118
|
+
segments:
|
119
|
+
- 0
|
120
|
+
version: "0"
|
121
|
+
type: :development
|
122
|
+
version_requirements: *id007
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: rack-test
|
125
|
+
prerelease: false
|
126
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
127
|
+
none: false
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
hash: 3
|
132
|
+
segments:
|
133
|
+
- 0
|
134
|
+
version: "0"
|
135
|
+
type: :development
|
136
|
+
version_requirements: *id008
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
name: rr
|
139
|
+
prerelease: false
|
140
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
141
|
+
none: false
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
hash: 3
|
146
|
+
segments:
|
147
|
+
- 0
|
148
|
+
version: "0"
|
149
|
+
type: :development
|
150
|
+
version_requirements: *id009
|
151
|
+
description: Allows creation of proxy objects of remote resources on distributed applications.
|
152
|
+
email:
|
153
|
+
- andre@vidibus.com
|
154
|
+
executables: []
|
155
|
+
|
156
|
+
extensions: []
|
157
|
+
|
158
|
+
extra_rdoc_files: []
|
159
|
+
|
160
|
+
files:
|
161
|
+
- .gitignore
|
162
|
+
- Gemfile
|
163
|
+
- Gemfile.lock
|
164
|
+
- LICENSE
|
165
|
+
- README.rdoc
|
166
|
+
- Rakefile
|
167
|
+
- app/controllers/api/resources_controller.rb
|
168
|
+
- config/routes.rb
|
169
|
+
- lib/vidibus-resource.rb
|
170
|
+
- lib/vidibus/resource.rb
|
171
|
+
- lib/vidibus/resource/consumer/mongoid.rb
|
172
|
+
- lib/vidibus/resource/provider/mongoid.rb
|
173
|
+
- lib/vidibus/resource/version.rb
|
174
|
+
- spec/spec_helper.rb
|
175
|
+
- spec/vidibus/resource/consumer/mongoid_spec.rb
|
176
|
+
- vidibus-resource.gemspec
|
177
|
+
has_rdoc: true
|
178
|
+
homepage: https://github.com/vidibus/vidibus-resource
|
179
|
+
licenses: []
|
180
|
+
|
181
|
+
post_install_message:
|
182
|
+
rdoc_options: []
|
183
|
+
|
184
|
+
require_paths:
|
185
|
+
- lib
|
186
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
187
|
+
none: false
|
188
|
+
requirements:
|
189
|
+
- - ">="
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
hash: 3
|
192
|
+
segments:
|
193
|
+
- 0
|
194
|
+
version: "0"
|
195
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
|
+
none: false
|
197
|
+
requirements:
|
198
|
+
- - ">="
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
hash: 23
|
201
|
+
segments:
|
202
|
+
- 1
|
203
|
+
- 3
|
204
|
+
- 6
|
205
|
+
version: 1.3.6
|
206
|
+
requirements: []
|
207
|
+
|
208
|
+
rubyforge_project: vidibus-resource
|
209
|
+
rubygems_version: 1.3.7
|
210
|
+
signing_key:
|
211
|
+
specification_version: 3
|
212
|
+
summary: Provides handling of remote resources
|
213
|
+
test_files: []
|
214
|
+
|