acts_as_sdata 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/MIT-LICENSE +20 -0
- data/README.textile +200 -0
- data/Rakefile +20 -0
- data/VERSION +1 -0
- data/config/sdata.yml +13 -0
- data/config/sdata.yml.example +20 -0
- data/config/sdata.yml.tmpl.staging +14 -0
- data/generators/acts_as_sdata/acts_as_sdata_generator.rb +9 -0
- data/generators/acts_as_sdata/templates/migration.rb +69 -0
- data/init.rb +36 -0
- data/lib/s_data/active_record_extensions/base.rb +7 -0
- data/lib/s_data/active_record_extensions/mixin.rb +157 -0
- data/lib/s_data/active_record_extensions/sdata_uuid_mixin.rb +133 -0
- data/lib/s_data/atom_extensions/content_mixin.rb +14 -0
- data/lib/s_data/atom_extensions/entry_mixin.rb +41 -0
- data/lib/s_data/atom_extensions/nodes/digest.rb +48 -0
- data/lib/s_data/atom_extensions/nodes/payload.rb +34 -0
- data/lib/s_data/atom_extensions/nodes/sync_state.rb +14 -0
- data/lib/s_data/conditions_builder.rb +59 -0
- data/lib/s_data/controller_mixin.rb +11 -0
- data/lib/s_data/controller_mixin/actions.rb +87 -0
- data/lib/s_data/controller_mixin/collection_scope.rb +57 -0
- data/lib/s_data/controller_mixin/s_data_feed.rb +87 -0
- data/lib/s_data/controller_mixin/s_data_instance.rb +35 -0
- data/lib/s_data/diagnosis/application_controller_mixin.rb +16 -0
- data/lib/s_data/diagnosis/diagnosis.rb +130 -0
- data/lib/s_data/diagnosis/diagnosis_mapper.rb +39 -0
- data/lib/s_data/exceptions.rb +10 -0
- data/lib/s_data/formatting.rb +13 -0
- data/lib/s_data/namespace_definitions.rb +19 -0
- data/lib/s_data/payload.rb +158 -0
- data/lib/s_data/payload_map.rb +0 -0
- data/lib/s_data/payload_map/payload_map.rb +136 -0
- data/lib/s_data/payload_map/payload_map_hash.rb +39 -0
- data/lib/s_data/predicate.rb +31 -0
- data/lib/s_data/route_mapper.rb +143 -0
- data/lib/s_data/router_mixin.rb +10 -0
- data/lib/s_data/sync/controller_mixin.rb +122 -0
- data/lib/s_data/sync/sdata_syncing_mixin.rb +17 -0
- data/lib/s_data/virtual_base.rb +114 -0
- data/test/functional/Rakefile +0 -0
- data/test/unit/active_record_mixin/active_record_mixin_spec.rb +20 -0
- data/test/unit/active_record_mixin/acts_as_sdata_spec.rb +41 -0
- data/test/unit/active_record_mixin/find_by_sdata_instance_id_spec.rb +34 -0
- data/test/unit/active_record_mixin/payload_spec.rb +622 -0
- data/test/unit/active_record_mixin/to_atom_spec.rb +85 -0
- data/test/unit/atom_entry_mixin/atom_entry_mixin_spec.rb +11 -0
- data/test/unit/atom_entry_mixin/to_attributes_spec.rb +30 -0
- data/test/unit/class_stubs/address.rb +19 -0
- data/test/unit/class_stubs/contact.rb +25 -0
- data/test/unit/class_stubs/customer.rb +70 -0
- data/test/unit/class_stubs/model_base.rb +17 -0
- data/test/unit/class_stubs/payload.rb +15 -0
- data/test/unit/class_stubs/sd_uuid.rb +28 -0
- data/test/unit/class_stubs/user.rb +40 -0
- data/test/unit/conditions_builder_spec.rb +54 -0
- data/test/unit/controller_mixin/acts_as_sdata_spec.rb +29 -0
- data/test/unit/controller_mixin/build_sdata_feed_spec.rb +50 -0
- data/test/unit/controller_mixin/controller_mixin_spec.rb +22 -0
- data/test/unit/controller_mixin/diagnosis_spec.rb +232 -0
- data/test/unit/controller_mixin/sdata_collection_spec.rb +78 -0
- data/test/unit/controller_mixin/sdata_create_instance_spec.rb +173 -0
- data/test/unit/controller_mixin/sdata_opensearch_and_links_spec.rb +382 -0
- data/test/unit/controller_mixin/sdata_scope/linked_model_spec.rb +58 -0
- data/test/unit/controller_mixin/sdata_scope/non_linked_model_spec.rb +66 -0
- data/test/unit/controller_mixin/sdata_scope/scoping_in_config_spec.rb +64 -0
- data/test/unit/controller_mixin/sdata_show_instance_spec.rb +98 -0
- data/test/unit/controller_mixin/sdata_update_instance_spec.rb +65 -0
- data/test/unit/payload_map/payload_map_hash_spec.rb +84 -0
- data/test/unit/payload_map/payload_map_spec.rb +144 -0
- data/test/unit/predicate_spec.rb +59 -0
- data/test/unit/router_mixin/routes_spec.rb +138 -0
- data/test/unit/spec.opts +4 -0
- data/test/unit/spec_helper.rb +47 -0
- data/test/unit/spec_helpers/nokogiri_extensions.rb +16 -0
- data/test/unit/sync_controller_mixin/controller_mixin_spec.rb +22 -0
- data/test/unit/sync_controller_mixin/sdata_collection_sync_feed_spec.rb +69 -0
- metadata +175 -0
@@ -0,0 +1,59 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
+
|
3
|
+
include SData
|
4
|
+
|
5
|
+
describe Predicate do
|
6
|
+
context "when predicate string is valid" do
|
7
|
+
it "should convert given field name from hungarian notation to underscore notation" do
|
8
|
+
@predicate = Predicate.parse({ :born_at => :born_at }, "bornAt gt 1900")
|
9
|
+
ConditionsBuilder.should_receive(:build_conditions).with(:born_at, :gt, '1900')
|
10
|
+
@predicate.to_conditions
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should change field name according to a given map" do
|
14
|
+
@predicate = Predicate.parse({ :born_at => :crafted_at }, "bornAt gt 1900")
|
15
|
+
ConditionsBuilder.should_receive(:build_conditions).with(:crafted_at, :gt, '1900')
|
16
|
+
@predicate.to_conditions
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should parse predicate string correctly" do
|
20
|
+
@predicate = Predicate.parse({ :born_at => :born_at }, "bornAt gt 1900")
|
21
|
+
ConditionsBuilder.should_receive(:build_conditions).with(:born_at, :gt, '1900')
|
22
|
+
@predicate.to_conditions
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should strip wrapper quote marks" do
|
26
|
+
@predicate = Predicate.parse({ :born_at => :born_at }, "bornAt gt '1900'")
|
27
|
+
ConditionsBuilder.should_receive(:build_conditions).with(:born_at, :gt, '1900')
|
28
|
+
@predicate.to_conditions
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should accept non-alphanumeric characters as part of the value" do
|
32
|
+
@predicate = Predicate.parse({ :born_at => :born_at }, "bornAt gt '1`~!@\#$%^&*()_-+={[}]\|'\";:900'")
|
33
|
+
ConditionsBuilder.should_receive(:build_conditions).with(:born_at, :gt, "1`~!@\#$%^&*()_-+={[}]\|'\";:900")
|
34
|
+
@predicate.to_conditions
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should accept quote-marked empty string" do
|
38
|
+
@predicate = Predicate.parse({ :born_at => :born_at }, "bornAt gt ''")
|
39
|
+
ConditionsBuilder.should_receive(:build_conditions).with(:born_at, :gt, "")
|
40
|
+
@predicate.to_conditions
|
41
|
+
end
|
42
|
+
|
43
|
+
context "when condition contains 'ne' relation" do
|
44
|
+
it "should parse it correctly" do
|
45
|
+
@predicate = Predicate.parse({ :born_at => :born_at }, "bornAt ne 1900")
|
46
|
+
ConditionsBuilder.should_receive(:build_conditions).with(:born_at, :ne, "1900")
|
47
|
+
@predicate.to_conditions
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
context "when predicate string is somehow invalid" do
|
53
|
+
it "should raise exception" do
|
54
|
+
lambda { Predicate.parse({}, 'bornAt eq 1900').to_conditions }.should raise_error
|
55
|
+
lambda { Predicate.parse({}, 'alea jacta est').to_conditions }.should raise_error
|
56
|
+
lambda { Predicate.parse({}, 'blahBlahBlah').to_conditions }.should raise_error
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,138 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require "usher"
|
5
|
+
require "usher/interface/rails23"
|
6
|
+
|
7
|
+
#Usher::Interface::Rails23.stub!(:install_helpers) # we want no ActionView helpers
|
8
|
+
Usher::Interface::Rails23.class_eval { def install_helpers; end }
|
9
|
+
|
10
|
+
def mock_request(path, method, params)
|
11
|
+
request = mock "Request"
|
12
|
+
request.should_receive(:path).any_number_of_times.and_return(path)
|
13
|
+
request.should_receive(:method).any_number_of_times.and_return(method)
|
14
|
+
params = params.with_indifferent_access
|
15
|
+
request.should_receive(:path_parameters=).any_number_of_times.with(hash_including(params))
|
16
|
+
request.should_receive(:path_parameters).any_number_of_times.and_return(params)
|
17
|
+
request
|
18
|
+
end
|
19
|
+
|
20
|
+
ItemsController = Class.new
|
21
|
+
|
22
|
+
include SData
|
23
|
+
|
24
|
+
describe ControllerMixin, "#sdata_collection" do
|
25
|
+
describe "given sdata routes" do
|
26
|
+
before :all do
|
27
|
+
TestController = Class.new
|
28
|
+
@router = Usher::Interface.for(:rails23)
|
29
|
+
@router.draw(:delimiters => ['/', '.', '!', '\(', '\)' ]) do |map|
|
30
|
+
map.test '/test', :controller => 'test', :action => 'test_action'
|
31
|
+
|
32
|
+
map.sdata_resource :items
|
33
|
+
map.sdata_resource :items, :prefix => '/sdata/example/crmErp'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
it "recognizes dummy route" do
|
38
|
+
request = mock_request('/test', :get,{})
|
39
|
+
@router.recognize(request).should == TestController
|
40
|
+
end
|
41
|
+
|
42
|
+
it "recognizes collection route" do
|
43
|
+
request = mock_request('/items', :get,{})
|
44
|
+
@router.recognize(request).should == ItemsController
|
45
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_collection"}
|
46
|
+
end
|
47
|
+
|
48
|
+
it "recognizes collection route with default prefix" do
|
49
|
+
request = mock_request('/sdata/example/crmErp/-/items', :get,{})
|
50
|
+
@router.recognize(request)
|
51
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_collection", "dataset" => "-"}
|
52
|
+
end
|
53
|
+
|
54
|
+
it "recognizes collection route with custom prefix" do
|
55
|
+
request = mock_request('/sdata/example/crmErp/asdf/items', :get,{})
|
56
|
+
@router.recognize(request)
|
57
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_collection", "dataset" => "asdf"}
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "search with parenthesis" do
|
61
|
+
it "recognizes simple instance query in parenthesis" do
|
62
|
+
request = mock_request("/items(id gt 1)", :get, {})
|
63
|
+
@router.recognize(request)
|
64
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_show_instance", "predicate"=>"id gt 1"}
|
65
|
+
end
|
66
|
+
|
67
|
+
it "recognizes instance query in parenthesis within linked items" do
|
68
|
+
request = mock_request("/items/$linked(id gt 1)", :get, {})
|
69
|
+
@router.recognize(request)
|
70
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_show_instance", "condition"=>"$linked", "predicate"=>"id gt 1"}
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe "scoping with where-clauses" do
|
75
|
+
it "recognizes scoping query within non-linked items" do
|
76
|
+
request = mock_request("/items", :get, {'where name eq asdf' => nil})
|
77
|
+
@router.recognize(request)
|
78
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_collection", "where name eq asdf" => nil}
|
79
|
+
end
|
80
|
+
|
81
|
+
it "recognizes scoping query within linked items" do
|
82
|
+
request = mock_request("/items/$linked", :get, {'where name eq asdf' => nil})
|
83
|
+
@router.recognize(request)
|
84
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_collection", "condition"=>"$linked", "where name eq asdf" => nil}
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
it "recognizes collection route with linked collection" do
|
89
|
+
request = mock_request("/items/$linked", :get, {})
|
90
|
+
@router.recognize(request)
|
91
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_collection", "condition"=>"$linked" }
|
92
|
+
end
|
93
|
+
|
94
|
+
it "recognizes syncSource route for collection" do
|
95
|
+
request = mock_request("/items/$syncSource", :post, {})
|
96
|
+
@router.recognize(request)
|
97
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_collection_sync_feed" }
|
98
|
+
end
|
99
|
+
|
100
|
+
it "recognizes syncSource status route" do
|
101
|
+
request = mock_request("/items/$syncSource('DD052E5C-BFAD-4ffa-8D54-D696E4959497')", :get, {})
|
102
|
+
@router.recognize(request)
|
103
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_collection_sync_feed_status", "trackingID" => "'DD052E5C-BFAD-4ffa-8D54-D696E4959497'" }
|
104
|
+
end
|
105
|
+
|
106
|
+
it "recognizes syncSource delete route" do
|
107
|
+
request = mock_request("/items/$syncSource('bobob')", :delete, {})
|
108
|
+
@router.recognize(request)
|
109
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_collection_sync_feed_delete", "trackingID" => "'bobob'"}
|
110
|
+
end
|
111
|
+
|
112
|
+
it "recognizes syncResults route for collection" do
|
113
|
+
request = mock_request("/items/$syncResults('bobob')", :post, {})
|
114
|
+
@router.recognize(request)
|
115
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_collection_sync_results", "trackingID" => "'bobob'" }
|
116
|
+
end
|
117
|
+
|
118
|
+
it "recognizes create link route" do
|
119
|
+
request = mock_request("/items/$linked", :post, {})
|
120
|
+
@router.recognize(request)
|
121
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_create_link", "condition"=>"$linked" }
|
122
|
+
end
|
123
|
+
|
124
|
+
it "recognizes instance route with id" do
|
125
|
+
request = mock_request("/items('123')", :get, {})
|
126
|
+
@router.recognize(request)
|
127
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_show_instance", "instance_id" => "'123'"}
|
128
|
+
end
|
129
|
+
|
130
|
+
it "recognizes instance route with linked uuid" do
|
131
|
+
request = mock_request("/items/$linked('uuid')", :get, {})
|
132
|
+
@router.recognize(request)
|
133
|
+
request.path_parameters.should == {"controller"=>"items", "action"=>"sdata_show_instance", "condition" => "$linked", "instance_id" => "'uuid'"}
|
134
|
+
end
|
135
|
+
|
136
|
+
|
137
|
+
end
|
138
|
+
end
|
data/test/unit/spec.opts
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
def setup_active_record
|
2
|
+
ActiveRecord::Base.establish_connection :adapter => "sqlite3",
|
3
|
+
:database => ":memory:"
|
4
|
+
end
|
5
|
+
|
6
|
+
require 'atom'
|
7
|
+
require 'active_record'
|
8
|
+
require 'action_pack'
|
9
|
+
require 'webrat'
|
10
|
+
|
11
|
+
include Webrat::Matchers
|
12
|
+
|
13
|
+
setup_active_record
|
14
|
+
|
15
|
+
Dir[File.join(File.dirname(__FILE__), 'spec_helpers', '**', '*.rb')].each { |helper| require helper }
|
16
|
+
|
17
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
|
18
|
+
__DIR__ = File.dirname(__FILE__)
|
19
|
+
require File.expand_path(File.join(__DIR__, '..', '..', 'init'))
|
20
|
+
require File.expand_path(File.join(__DIR__, 'class_stubs', 'model_base'))
|
21
|
+
require File.expand_path(File.join(__DIR__, 'class_stubs', 'user'))
|
22
|
+
require File.expand_path(File.join(__DIR__, 'class_stubs', 'customer'))
|
23
|
+
require File.expand_path(File.join(__DIR__, 'class_stubs', 'contact'))
|
24
|
+
require File.expand_path(File.join(__DIR__, 'class_stubs', 'address'))
|
25
|
+
require File.expand_path(File.join(__DIR__, 'class_stubs', 'sd_uuid'))
|
26
|
+
|
27
|
+
SData.reset!
|
28
|
+
SData.config = {:base_url => 'http://www.example.com',
|
29
|
+
:application => 'example',
|
30
|
+
:contract_namespace => 'SData::Contracts',
|
31
|
+
:contracts => ['myContract'],
|
32
|
+
:defaultContract => ['myContract'],
|
33
|
+
:schemas => {
|
34
|
+
"xs" => "http://www.w3.org/2001/XMLSchema",
|
35
|
+
"cf" => "http://www.microsoft.com/schemas/rss/core/2005",
|
36
|
+
"sme" => "http://schemas.sage.com/sdata/sme/2007",
|
37
|
+
"sc" => "http://schemas.sage.com/sc/2009",
|
38
|
+
"crmErp" => "http://schemas.sage.com/crmErp/2008",
|
39
|
+
"http" => "http://schemas.sage.com/sdata/http/2008/1",
|
40
|
+
"sync" => "http://schemas.sage.com/sdata/sync/2008/1",
|
41
|
+
"opensearch" => "http://a9.com/-/spec/opensearch/1.1/",
|
42
|
+
"sdata" => "http://schemas.sage.com/sdata/2008/1",
|
43
|
+
"xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
44
|
+
"sle" => "http://www.microsoft.com/schemas/rss/core/2005",
|
45
|
+
"bb" => "http://www.billingboss.com/schemas/sdata"
|
46
|
+
},
|
47
|
+
:show_stack_trace => true}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Nokogiri::ElementExtensions
|
2
|
+
def name_with_ns
|
3
|
+
"#{self.namespace.prefix}:#{self.name}"
|
4
|
+
end
|
5
|
+
|
6
|
+
def attributes_with_ns
|
7
|
+
returning Hash.new do |hash|
|
8
|
+
self.attributes.each_pair do |attr_name, attr|
|
9
|
+
key_with_ns = "#{attr.namespace.prefix}:#{attr.name}"
|
10
|
+
hash[key_with_ns] = attr.value
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
Nokogiri::XML::Element.__send__ :include, Nokogiri::ElementExtensions
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
|
2
|
+
|
3
|
+
include SData::Sync
|
4
|
+
|
5
|
+
describe ControllerMixin do
|
6
|
+
describe "given a class which behaves like ActionController::Base" do
|
7
|
+
before :all do
|
8
|
+
Base = Class.new(ActionController::Base)
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "when SData::Sync::ControllerMixin is included" do
|
12
|
+
before :each do
|
13
|
+
Base.extend ControllerMixin
|
14
|
+
end
|
15
|
+
|
16
|
+
it "class should respond to .syncs_sdata" do
|
17
|
+
Base.should respond_to(:syncs_sdata)
|
18
|
+
Base.new.should_not respond_to(:syncs_sdata)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
|
2
|
+
|
3
|
+
include SData::Sync
|
4
|
+
|
5
|
+
describe ControllerMixin, "#sdata_collection_sync_feed" do
|
6
|
+
|
7
|
+
class BaseClass
|
8
|
+
attr_accessor :status
|
9
|
+
def id
|
10
|
+
1
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.find(*params)
|
14
|
+
self.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def update_attributes(*params)
|
18
|
+
self.status = :updated
|
19
|
+
self
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class VirtualModel < SData::VirtualBase
|
24
|
+
attr_accessor :baze
|
25
|
+
end
|
26
|
+
|
27
|
+
before :all do
|
28
|
+
VirtualModel.stub :baze_class => BaseClass
|
29
|
+
Base = Class.new(ActionController::Base)
|
30
|
+
Base.extend ControllerMixin
|
31
|
+
Base.acts_as_sdata :model => VirtualModel
|
32
|
+
Base.syncs_sdata
|
33
|
+
VirtualModel.acts_as_sdata
|
34
|
+
end
|
35
|
+
|
36
|
+
before :each do
|
37
|
+
@controller = Base.new
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "given params contain a target digest" do
|
41
|
+
before :each do
|
42
|
+
pending
|
43
|
+
@entry = Atom::Entry.new
|
44
|
+
@controller.stub! :params => { :entry => @entry, :instance_id => 1},
|
45
|
+
:response => OpenStruct.new,
|
46
|
+
:request => OpenStruct.new(:fresh? => true),
|
47
|
+
:current_user => OpenStruct.new(:id => 1)
|
48
|
+
|
49
|
+
@model = VirtualModel.new(BaseClass.new)
|
50
|
+
VirtualModel.should_receive(:new).and_return @model
|
51
|
+
end
|
52
|
+
|
53
|
+
describe "when update is successful" do
|
54
|
+
before :each do
|
55
|
+
@model.baze.stub! :save => true
|
56
|
+
@model.stub! :to_atom => stub(:to_xml => '<entry></entry>')
|
57
|
+
@model.stub! :owner => OpenStruct.new(:id => 1)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should respond with updated" do
|
61
|
+
@controller.should_receive(:render) do |args|
|
62
|
+
#TODO: what should I check for?.. Returns 1 right now, is this right?
|
63
|
+
end
|
64
|
+
@controller.sdata_update_instance
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
metadata
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: acts_as_sdata
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
version: 1.0.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Daniel Vartanov
|
13
|
+
- Eugene Gilburg
|
14
|
+
- Michael Johnston
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2010-06-26 00:00:00 +06:00
|
20
|
+
default_executable:
|
21
|
+
dependencies: []
|
22
|
+
|
23
|
+
description: Ruby implementation of SData (Sage Data) protocol
|
24
|
+
email: dan@vartanov.net
|
25
|
+
executables: []
|
26
|
+
|
27
|
+
extensions: []
|
28
|
+
|
29
|
+
extra_rdoc_files:
|
30
|
+
- README.textile
|
31
|
+
files:
|
32
|
+
- .gitignore
|
33
|
+
- MIT-LICENSE
|
34
|
+
- README.textile
|
35
|
+
- Rakefile
|
36
|
+
- VERSION
|
37
|
+
- config/sdata.yml
|
38
|
+
- config/sdata.yml.example
|
39
|
+
- config/sdata.yml.tmpl.staging
|
40
|
+
- generators/acts_as_sdata/acts_as_sdata_generator.rb
|
41
|
+
- generators/acts_as_sdata/templates/migration.rb
|
42
|
+
- init.rb
|
43
|
+
- lib/s_data/active_record_extensions/base.rb
|
44
|
+
- lib/s_data/active_record_extensions/mixin.rb
|
45
|
+
- lib/s_data/active_record_extensions/sdata_uuid_mixin.rb
|
46
|
+
- lib/s_data/atom_extensions/content_mixin.rb
|
47
|
+
- lib/s_data/atom_extensions/entry_mixin.rb
|
48
|
+
- lib/s_data/atom_extensions/nodes/digest.rb
|
49
|
+
- lib/s_data/atom_extensions/nodes/payload.rb
|
50
|
+
- lib/s_data/atom_extensions/nodes/sync_state.rb
|
51
|
+
- lib/s_data/conditions_builder.rb
|
52
|
+
- lib/s_data/controller_mixin.rb
|
53
|
+
- lib/s_data/controller_mixin/actions.rb
|
54
|
+
- lib/s_data/controller_mixin/collection_scope.rb
|
55
|
+
- lib/s_data/controller_mixin/s_data_feed.rb
|
56
|
+
- lib/s_data/controller_mixin/s_data_instance.rb
|
57
|
+
- lib/s_data/diagnosis/application_controller_mixin.rb
|
58
|
+
- lib/s_data/diagnosis/diagnosis.rb
|
59
|
+
- lib/s_data/diagnosis/diagnosis_mapper.rb
|
60
|
+
- lib/s_data/exceptions.rb
|
61
|
+
- lib/s_data/formatting.rb
|
62
|
+
- lib/s_data/namespace_definitions.rb
|
63
|
+
- lib/s_data/payload.rb
|
64
|
+
- lib/s_data/payload_map.rb
|
65
|
+
- lib/s_data/payload_map/payload_map.rb
|
66
|
+
- lib/s_data/payload_map/payload_map_hash.rb
|
67
|
+
- lib/s_data/predicate.rb
|
68
|
+
- lib/s_data/route_mapper.rb
|
69
|
+
- lib/s_data/router_mixin.rb
|
70
|
+
- lib/s_data/sync/controller_mixin.rb
|
71
|
+
- lib/s_data/sync/sdata_syncing_mixin.rb
|
72
|
+
- lib/s_data/virtual_base.rb
|
73
|
+
- test/functional/Rakefile
|
74
|
+
- test/unit/active_record_mixin/active_record_mixin_spec.rb
|
75
|
+
- test/unit/active_record_mixin/acts_as_sdata_spec.rb
|
76
|
+
- test/unit/active_record_mixin/find_by_sdata_instance_id_spec.rb
|
77
|
+
- test/unit/active_record_mixin/payload_spec.rb
|
78
|
+
- test/unit/active_record_mixin/to_atom_spec.rb
|
79
|
+
- test/unit/atom_entry_mixin/atom_entry_mixin_spec.rb
|
80
|
+
- test/unit/atom_entry_mixin/to_attributes_spec.rb
|
81
|
+
- test/unit/class_stubs/address.rb
|
82
|
+
- test/unit/class_stubs/contact.rb
|
83
|
+
- test/unit/class_stubs/customer.rb
|
84
|
+
- test/unit/class_stubs/model_base.rb
|
85
|
+
- test/unit/class_stubs/payload.rb
|
86
|
+
- test/unit/class_stubs/sd_uuid.rb
|
87
|
+
- test/unit/class_stubs/user.rb
|
88
|
+
- test/unit/conditions_builder_spec.rb
|
89
|
+
- test/unit/controller_mixin/acts_as_sdata_spec.rb
|
90
|
+
- test/unit/controller_mixin/build_sdata_feed_spec.rb
|
91
|
+
- test/unit/controller_mixin/controller_mixin_spec.rb
|
92
|
+
- test/unit/controller_mixin/diagnosis_spec.rb
|
93
|
+
- test/unit/controller_mixin/sdata_collection_spec.rb
|
94
|
+
- test/unit/controller_mixin/sdata_create_instance_spec.rb
|
95
|
+
- test/unit/controller_mixin/sdata_opensearch_and_links_spec.rb
|
96
|
+
- test/unit/controller_mixin/sdata_scope/linked_model_spec.rb
|
97
|
+
- test/unit/controller_mixin/sdata_scope/non_linked_model_spec.rb
|
98
|
+
- test/unit/controller_mixin/sdata_scope/scoping_in_config_spec.rb
|
99
|
+
- test/unit/controller_mixin/sdata_show_instance_spec.rb
|
100
|
+
- test/unit/controller_mixin/sdata_update_instance_spec.rb
|
101
|
+
- test/unit/payload_map/payload_map_hash_spec.rb
|
102
|
+
- test/unit/payload_map/payload_map_spec.rb
|
103
|
+
- test/unit/predicate_spec.rb
|
104
|
+
- test/unit/router_mixin/routes_spec.rb
|
105
|
+
- test/unit/spec.opts
|
106
|
+
- test/unit/spec_helper.rb
|
107
|
+
- test/unit/spec_helpers/nokogiri_extensions.rb
|
108
|
+
- test/unit/sync_controller_mixin/controller_mixin_spec.rb
|
109
|
+
- test/unit/sync_controller_mixin/sdata_collection_sync_feed_spec.rb
|
110
|
+
has_rdoc: true
|
111
|
+
homepage: http://sdata.sage.com/
|
112
|
+
licenses: []
|
113
|
+
|
114
|
+
post_install_message:
|
115
|
+
rdoc_options:
|
116
|
+
- --charset=UTF-8
|
117
|
+
require_paths:
|
118
|
+
- lib
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
segments:
|
124
|
+
- 0
|
125
|
+
version: "0"
|
126
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
segments:
|
131
|
+
- 0
|
132
|
+
version: "0"
|
133
|
+
requirements: []
|
134
|
+
|
135
|
+
rubyforge_project:
|
136
|
+
rubygems_version: 1.3.6
|
137
|
+
signing_key:
|
138
|
+
specification_version: 3
|
139
|
+
summary: Ruby implementation of SData (Sage Data) protocol
|
140
|
+
test_files:
|
141
|
+
- test/unit/router_mixin/routes_spec.rb
|
142
|
+
- test/unit/conditions_builder_spec.rb
|
143
|
+
- test/unit/sync_controller_mixin/controller_mixin_spec.rb
|
144
|
+
- test/unit/sync_controller_mixin/sdata_collection_sync_feed_spec.rb
|
145
|
+
- test/unit/active_record_mixin/active_record_mixin_spec.rb
|
146
|
+
- test/unit/active_record_mixin/find_by_sdata_instance_id_spec.rb
|
147
|
+
- test/unit/active_record_mixin/payload_spec.rb
|
148
|
+
- test/unit/active_record_mixin/to_atom_spec.rb
|
149
|
+
- test/unit/active_record_mixin/acts_as_sdata_spec.rb
|
150
|
+
- test/unit/spec_helper.rb
|
151
|
+
- test/unit/atom_entry_mixin/to_attributes_spec.rb
|
152
|
+
- test/unit/atom_entry_mixin/atom_entry_mixin_spec.rb
|
153
|
+
- test/unit/spec_helpers/nokogiri_extensions.rb
|
154
|
+
- test/unit/controller_mixin/sdata_scope/linked_model_spec.rb
|
155
|
+
- test/unit/controller_mixin/sdata_scope/non_linked_model_spec.rb
|
156
|
+
- test/unit/controller_mixin/sdata_scope/scoping_in_config_spec.rb
|
157
|
+
- test/unit/controller_mixin/sdata_update_instance_spec.rb
|
158
|
+
- test/unit/controller_mixin/sdata_create_instance_spec.rb
|
159
|
+
- test/unit/controller_mixin/sdata_collection_spec.rb
|
160
|
+
- test/unit/controller_mixin/diagnosis_spec.rb
|
161
|
+
- test/unit/controller_mixin/controller_mixin_spec.rb
|
162
|
+
- test/unit/controller_mixin/sdata_show_instance_spec.rb
|
163
|
+
- test/unit/controller_mixin/build_sdata_feed_spec.rb
|
164
|
+
- test/unit/controller_mixin/sdata_opensearch_and_links_spec.rb
|
165
|
+
- test/unit/controller_mixin/acts_as_sdata_spec.rb
|
166
|
+
- test/unit/payload_map/payload_map_spec.rb
|
167
|
+
- test/unit/payload_map/payload_map_hash_spec.rb
|
168
|
+
- test/unit/class_stubs/contact.rb
|
169
|
+
- test/unit/class_stubs/address.rb
|
170
|
+
- test/unit/class_stubs/customer.rb
|
171
|
+
- test/unit/class_stubs/sd_uuid.rb
|
172
|
+
- test/unit/class_stubs/payload.rb
|
173
|
+
- test/unit/class_stubs/user.rb
|
174
|
+
- test/unit/class_stubs/model_base.rb
|
175
|
+
- test/unit/predicate_spec.rb
|