morpheus 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/.rspec +1 -1
  2. data/CHANGELOG.md +17 -0
  3. data/Gemfile +1 -1
  4. data/lib/morpheus.rb +3 -23
  5. data/lib/morpheus/base.rb +11 -11
  6. data/lib/morpheus/client.rb +10 -0
  7. data/lib/morpheus/client/associations.rb +6 -6
  8. data/lib/morpheus/client/cached_request_formatter.rb +20 -0
  9. data/lib/morpheus/client/log_subscriber.rb +2 -28
  10. data/lib/morpheus/client/railtie.rb +4 -4
  11. data/lib/morpheus/client/request_formatter.rb +50 -0
  12. data/lib/morpheus/client/uncached_request_formatter.rb +40 -0
  13. data/lib/morpheus/configuration.rb +30 -9
  14. data/lib/morpheus/mixins.rb +16 -0
  15. data/lib/morpheus/mixins/associations.rb +39 -37
  16. data/lib/morpheus/mixins/associations/association.rb +112 -0
  17. data/lib/morpheus/mixins/associations/belongs_to_association.rb +47 -0
  18. data/lib/morpheus/mixins/associations/has_many_association.rb +72 -0
  19. data/lib/morpheus/mixins/associations/has_one_association.rb +48 -0
  20. data/lib/morpheus/mixins/attributes.rb +97 -95
  21. data/lib/morpheus/mixins/conversion.rb +16 -14
  22. data/lib/morpheus/mixins/filtering.rb +13 -11
  23. data/lib/morpheus/mixins/finders.rb +47 -45
  24. data/lib/morpheus/mixins/introspection.rb +15 -13
  25. data/lib/morpheus/mixins/persistence.rb +32 -30
  26. data/lib/morpheus/mixins/reflections.rb +17 -15
  27. data/lib/morpheus/mixins/request_handling.rb +27 -25
  28. data/lib/morpheus/mixins/response_parsing.rb +10 -8
  29. data/lib/morpheus/mixins/url_support.rb +27 -25
  30. data/lib/morpheus/reflection.rb +5 -2
  31. data/lib/morpheus/type_caster.rb +1 -1
  32. data/lib/morpheus/version.rb +1 -1
  33. data/morpheus.gemspec +2 -2
  34. data/spec/dummy/app/resources/book.rb +1 -1
  35. data/spec/morpheus/base_spec.rb +35 -35
  36. data/spec/morpheus/client/cached_request_formatter_spec.rb +28 -0
  37. data/spec/morpheus/client/log_subscriber_spec.rb +53 -10
  38. data/spec/morpheus/client/request_formatter_spec.rb +5 -0
  39. data/spec/morpheus/client/uncached_request_formatter_spec.rb +29 -0
  40. data/spec/morpheus/configuration_spec.rb +49 -11
  41. data/spec/morpheus/{associations → mixins/associations}/association_spec.rb +1 -1
  42. data/spec/morpheus/{associations → mixins/associations}/belongs_to_association_spec.rb +1 -1
  43. data/spec/morpheus/{associations → mixins/associations}/has_many_association_spec.rb +1 -1
  44. data/spec/morpheus/{associations → mixins/associations}/has_one_association_spec.rb +1 -1
  45. data/spec/morpheus/mixins/associations_spec.rb +1 -1
  46. data/spec/morpheus/mixins/attributes_spec.rb +27 -6
  47. data/spec/morpheus/mixins/conversion_spec.rb +1 -1
  48. data/spec/morpheus/mixins/filtering_spec.rb +2 -2
  49. data/spec/morpheus/mixins/finders_spec.rb +1 -1
  50. data/spec/morpheus/mixins/introspection_spec.rb +1 -1
  51. data/spec/morpheus/mixins/persistence_spec.rb +1 -1
  52. data/spec/morpheus/mixins/reflections_spec.rb +1 -1
  53. data/spec/morpheus/mixins/request_handling_spec.rb +2 -2
  54. data/spec/morpheus/mixins/response_parsing_spec.rb +2 -2
  55. data/spec/morpheus/mixins/url_support_spec.rb +2 -2
  56. data/spec/morpheus/response_parser_spec.rb +5 -1
  57. data/spec/regressions/sorting_resources_spec.rb +119 -0
  58. data/spec/spec_helper.rb +3 -2
  59. metadata +159 -87
  60. data/lib/morpheus/associations/association.rb +0 -110
  61. data/lib/morpheus/associations/belongs_to_association.rb +0 -45
  62. data/lib/morpheus/associations/has_many_association.rb +0 -70
  63. data/lib/morpheus/associations/has_one_association.rb +0 -46
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Associations::Association do
3
+ describe Morpheus::Mixins::Associations::Association do
4
4
 
5
5
  describe '#initialize' do
6
6
  pending
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Associations::BelongsToAssociation do
3
+ describe Morpheus::Mixins::Associations::BelongsToAssociation do
4
4
 
5
5
  describe '#initialize' do
6
6
  pending
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Associations::HasManyAssociation do
3
+ describe Morpheus::Mixins::Associations::HasManyAssociation do
4
4
 
5
5
  describe '#initialize' do
6
6
  pending
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Associations::HasOneAssociation do
3
+ describe Morpheus::Mixins::Associations::HasOneAssociation do
4
4
 
5
5
  describe '#initialize' do
6
6
  pending
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Associations do
3
+ describe Morpheus::Mixins::Associations do
4
4
 
5
5
  describe '.belongs_to' do
6
6
 
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Attributes do
3
+ describe Morpheus::Mixins::Attributes do
4
4
  let(:book) { Book.new }
5
5
 
6
6
  describe '.property' do
@@ -23,11 +23,23 @@ describe Morpheus::Attributes do
23
23
  end
24
24
 
25
25
  describe '.typecast_attributes' do
26
- pending
26
+ it 'returns the attributes that will be typecasted' do
27
+ Book.typecast_attributes.should eql(HashWithIndifferentAccess.new({ :id => nil, :title => :string, :author_id => nil }))
28
+ end
27
29
  end
28
30
 
29
31
  describe '.attribute_defined?' do
30
- pending
32
+ context 'when the attribute exists as one of the default attributes' do
33
+ it 'returns true' do
34
+ Book.attribute_defined?(:title).should be_true
35
+ end
36
+ end
37
+
38
+ context 'when the attribute does not exist as one of teh default attributes' do
39
+ it 'returns false' do
40
+ Book.attribute_defined?(:publisher).should be_false
41
+ end
42
+ end
31
43
  end
32
44
 
33
45
  describe '#attributes' do
@@ -37,15 +49,24 @@ describe Morpheus::Attributes do
37
49
  end
38
50
 
39
51
  describe '#read_attribute_for_validation' do
40
- pending
52
+ before { book.title = 'Horton Hears a Who' }
53
+
54
+ it 'returns the value of the attribute' do
55
+ book.read_attribute_for_validation(:title).should eql('Horton Hears a Who')
56
+ end
41
57
  end
42
58
 
43
59
  describe '#typecast' do
44
- pending
60
+ it 'delegates to TypeCaster' do
61
+ Morpheus::TypeCaster.should_receive(:cast).with('Horton Hears a Who', :string)
62
+ book.typecast(:title, 'Horton Hears a Who')
63
+ end
45
64
  end
46
65
 
47
66
  describe '#attributes_without_basic_attributes' do
48
- pending
67
+ it 'returns a hash with basic attributes and associations removed' do
68
+ book.attributes_without_basic_attributes.should eql(HashWithIndifferentAccess.new(:title => nil, :author_id => nil))
69
+ end
49
70
  end
50
71
 
51
72
  describe "#update_attribute" do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Conversion do
3
+ describe Morpheus::Mixins::Conversion do
4
4
 
5
5
  describe '#to_model' do
6
6
  before(:each) do
@@ -1,9 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Filtering do
3
+ describe Morpheus::Mixins::Filtering do
4
4
  let(:klass) do
5
5
  Class.new do
6
- include Morpheus::Filtering
6
+ include Morpheus::Mixins::Filtering
7
7
  end
8
8
  end
9
9
  let(:name) { mock }
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Finders do
3
+ describe Morpheus::Mixins::Finders do
4
4
 
5
5
  describe '.find' do
6
6
  context 'when the argument is a single integer' do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Introspection do
3
+ describe Morpheus::Mixins::Introspection do
4
4
 
5
5
  describe '#persisted?' do
6
6
  before(:each) do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Persistence do
3
+ describe Morpheus::Mixins::Persistence do
4
4
 
5
5
  describe '#save' do
6
6
  context 'when the instance is a new record' do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::Reflections do
3
+ describe Morpheus::Mixins::Reflections do
4
4
 
5
5
  context 'when the resource has a belongs_to association' do
6
6
  before(:each) do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::RequestHandling do
3
+ describe Morpheus::Mixins::RequestHandling do
4
4
  let(:path) { mock }
5
5
  let(:params) { mock }
6
6
  let(:metadata) { mock }
@@ -8,7 +8,7 @@ describe Morpheus::RequestHandling do
8
8
  let(:block) { lambda {} }
9
9
  let(:klass) do
10
10
  Class.new do
11
- include Morpheus::RequestHandling
11
+ include Morpheus::Mixins::RequestHandling
12
12
  end
13
13
  end
14
14
 
@@ -1,9 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::ResponseParsing do
3
+ describe Morpheus::Mixins::ResponseParsing do
4
4
  let(:model) do
5
5
  Class.new do
6
- include Morpheus::ResponseParsing
6
+ include Morpheus::Mixins::ResponseParsing
7
7
  end
8
8
  end
9
9
  let(:request) { mock }
@@ -1,9 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Morpheus::UrlSupport do
3
+ describe Morpheus::Mixins::UrlSupport do
4
4
  let(:model) do
5
5
  Class.new do
6
- include Morpheus::UrlSupport
6
+ include Morpheus::Mixins::UrlSupport
7
7
 
8
8
  def self.model_name
9
9
  'OriginalModelName'
@@ -215,7 +215,11 @@ describe Morpheus::ResponseParser do
215
215
 
216
216
  module Handler; end
217
217
 
218
- before { Morpheus::Configuration.parse_error_handler = Handler }
218
+ before do
219
+ @original_parse_error_handler = Morpheus::Configuration.parse_error_handler
220
+ Morpheus::Configuration.parse_error_handler = Handler
221
+ end
222
+ after { Morpheus::Configuration.parse_error_handler = @original_parse_error_handler }
219
223
 
220
224
  it 'calls #handle on a handler instance, passing the offending string' do
221
225
  Handler.should_receive(:handle).with(offending_string)
@@ -0,0 +1,119 @@
1
+ require 'spec_helper'
2
+
3
+ # We get this error when trying to sort objects returned from a service using Morpheus.
4
+ # ArgumentError: comparison of Student with Student failed
5
+ # /morpheus-0.3.6/lib/morpheus/associations/association.rb:104
6
+ #
7
+ # Usage:
8
+ # @students = @course.students.sort { |a,b| a.first_name <=> b.first_name }
9
+ #
10
+ # Top of backtrace:
11
+ # /morpheus-0.3.6/lib/morpheus/associations/association.rb:104:in "sort"
12
+ # /morpheus-0.3.6/lib/morpheus/associations/association.rb:104:in "send"
13
+ # /morpheus-0.3.6/lib/morpheus/associations/association.rb:104:in "method_missing"
14
+ # /app/controllers/courses_and_proctorings_controller.rb:24:in "attendance"
15
+ # One can assume method missing results in the loading of students, then sort is called on the result, I'm curious if the first_name call is lost or if it is null, self (in this case a Student) is being returned.
16
+ #
17
+ # Changing the code to this solved (or at least hid) the issue:
18
+ # @students = @course.students.sort { |a,b| a.first_name.to_s <=> b.first_name.to_s }
19
+
20
+ describe 'Github Issue #2' do
21
+ context 'when the sort types are all the same' do
22
+ let(:dogs) { Dog.all }
23
+
24
+ before { stub_web! }
25
+
26
+ it 'sorts the resources correctly' do
27
+ dogs.sort { |a,b| a.name <=> b.name }.map(&:id).should == [3, 1, 2]
28
+ end
29
+
30
+ def stub_web!
31
+ Morpheus::Configuration.hydra.stub(:get, "#{Morpheus::Configuration.host}/dogs").and_return(build_morpheus_response(
32
+ 200,
33
+ [
34
+ {
35
+ :id => 1,
36
+ :valid => true,
37
+ :errors => {},
38
+ :name => 'Fido',
39
+ :breed => 'Boxer'
40
+ },
41
+ {
42
+ :id => 2,
43
+ :valid => true,
44
+ :errors => {},
45
+ :name => 'Winslow',
46
+ :breed => 'Corgi'
47
+ },
48
+ {
49
+ :id => 3,
50
+ :valid => true,
51
+ :errors => {},
52
+ :name => 'Daisy',
53
+ :breed => 'English Bulldog'
54
+ }
55
+ ]
56
+ ))
57
+ end
58
+ end
59
+
60
+ context 'when the sort types are different' do
61
+ let(:dogs) { Dog.all }
62
+
63
+ before { stub_web! }
64
+
65
+ it 'raises an ArgumentError' do
66
+ expect {
67
+ dogs.sort { |a,b| a.name <=> b.name }
68
+ }.to raise_error(ArgumentError, /comparison of Dog with Dog failed|block returned nil/)
69
+ end
70
+
71
+ def stub_web!
72
+ Morpheus::Configuration.hydra.stub(:get, "#{Morpheus::Configuration.host}/dogs").and_return(build_morpheus_response(
73
+ 200,
74
+ [
75
+ {
76
+ :id => 1,
77
+ :valid => true,
78
+ :errors => {},
79
+ :name => 'Fido',
80
+ :breed => 'Boxer'
81
+ },
82
+ {
83
+ :id => 2,
84
+ :valid => true,
85
+ :errors => {},
86
+ :name => nil,
87
+ :breed => 'Corgi'
88
+ },
89
+ {
90
+ :id => 3,
91
+ :valid => true,
92
+ :errors => {},
93
+ :name => 'Daisy',
94
+ :breed => 'English Bulldog'
95
+ }
96
+ ]
97
+ ))
98
+ end
99
+ end
100
+
101
+ context 'with any other type of Object' do
102
+ class Thing
103
+ attr_reader :name
104
+ def initialize(name = nil)
105
+ @name = name
106
+ end
107
+ end
108
+
109
+ let(:thing) { Thing.new('Thingy') }
110
+ let(:another_thing) { Thing.new }
111
+ let(:things) { [thing, another_thing] }
112
+
113
+ it 'raises an ArgumentError' do
114
+ expect {
115
+ things.sort { |a,b| a.name <=> b.name }
116
+ }.to raise_error(ArgumentError, /comparison of Thing with Thing failed|block returned nil/)
117
+ end
118
+ end
119
+ end
@@ -20,8 +20,9 @@ Rails.backtrace_cleaner.remove_silencers!
20
20
 
21
21
  ActiveRecord::Migrator.migrate File.expand_path('../dummy/db/migrate/', __FILE__)
22
22
 
23
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
24
- Dir["#{File.dirname(__FILE__)}/shared/**/*.rb"].each { |f| require f }
23
+ %w{ support shared regressions }.each do |dir|
24
+ Dir["#{File.dirname(__FILE__)}/#{dir}/**/*.rb"].each { |f| require f }
25
+ end
25
26
 
26
27
  RSpec.configure do |config|
27
28
  require 'rspec/expectations'
metadata CHANGED
@@ -1,134 +1,189 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: morpheus
3
- version: !ruby/object:Gem::Version
4
- version: 0.4.0
3
+ version: !ruby/object:Gem::Version
4
+ hash: 11
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 5
9
+ - 0
10
+ version: 0.5.0
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Ryan Moran
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-03-18 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2012-10-10 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: yajl-ruby
16
- requirement: &70093023811320 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
25
+ requirements:
19
26
  - - ~>
20
- - !ruby/object:Gem::Version
27
+ - !ruby/object:Gem::Version
28
+ hash: 19
29
+ segments:
30
+ - 1
31
+ - 1
32
+ - 0
21
33
  version: 1.1.0
22
34
  type: :runtime
23
- prerelease: false
24
- version_requirements: *70093023811320
25
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
26
37
  name: typhoeus
27
- requirement: &70093023810620 !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
28
40
  none: false
29
- requirements:
41
+ requirements:
30
42
  - - ~>
31
- - !ruby/object:Gem::Version
32
- version: 0.3.3
43
+ - !ruby/object:Gem::Version
44
+ hash: 11
45
+ segments:
46
+ - 0
47
+ - 4
48
+ - 2
49
+ version: 0.4.2
33
50
  type: :runtime
34
- prerelease: false
35
- version_requirements: *70093023810620
36
- - !ruby/object:Gem::Dependency
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
37
53
  name: activemodel
38
- requirement: &70093023810160 !ruby/object:Gem::Requirement
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
39
56
  none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 7
61
+ segments:
62
+ - 3
63
+ - 0
64
+ - 0
43
65
  version: 3.0.0
44
66
  type: :runtime
45
- prerelease: false
46
- version_requirements: *70093023810160
47
- - !ruby/object:Gem::Dependency
67
+ version_requirements: *id003
68
+ - !ruby/object:Gem::Dependency
48
69
  name: activesupport
49
- requirement: &70093023809700 !ruby/object:Gem::Requirement
70
+ prerelease: false
71
+ requirement: &id004 !ruby/object:Gem::Requirement
50
72
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ hash: 7
77
+ segments:
78
+ - 3
79
+ - 0
80
+ - 0
54
81
  version: 3.0.0
55
82
  type: :runtime
56
- prerelease: false
57
- version_requirements: *70093023809700
58
- - !ruby/object:Gem::Dependency
83
+ version_requirements: *id004
84
+ - !ruby/object:Gem::Dependency
59
85
  name: i18n
60
- requirement: &70093023809200 !ruby/object:Gem::Requirement
86
+ prerelease: false
87
+ requirement: &id005 !ruby/object:Gem::Requirement
61
88
  none: false
62
- requirements:
63
- - - ! '>='
64
- - !ruby/object:Gem::Version
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ hash: 11
93
+ segments:
94
+ - 0
95
+ - 5
96
+ - 0
65
97
  version: 0.5.0
66
98
  type: :runtime
67
- prerelease: false
68
- version_requirements: *70093023809200
69
- - !ruby/object:Gem::Dependency
99
+ version_requirements: *id005
100
+ - !ruby/object:Gem::Dependency
70
101
  name: rails
71
- requirement: &70093023808740 !ruby/object:Gem::Requirement
102
+ prerelease: false
103
+ requirement: &id006 !ruby/object:Gem::Requirement
72
104
  none: false
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ hash: 7
109
+ segments:
110
+ - 3
111
+ - 0
112
+ - 0
76
113
  version: 3.0.0
77
114
  type: :development
78
- prerelease: false
79
- version_requirements: *70093023808740
80
- - !ruby/object:Gem::Dependency
115
+ version_requirements: *id006
116
+ - !ruby/object:Gem::Dependency
81
117
  name: sqlite3
82
- requirement: &70093023808260 !ruby/object:Gem::Requirement
118
+ prerelease: false
119
+ requirement: &id007 !ruby/object:Gem::Requirement
83
120
  none: false
84
- requirements:
121
+ requirements:
85
122
  - - ~>
86
- - !ruby/object:Gem::Version
123
+ - !ruby/object:Gem::Version
124
+ hash: 29
125
+ segments:
126
+ - 1
127
+ - 3
128
+ - 3
87
129
  version: 1.3.3
88
130
  type: :development
89
- prerelease: false
90
- version_requirements: *70093023808260
91
- - !ruby/object:Gem::Dependency
131
+ version_requirements: *id007
132
+ - !ruby/object:Gem::Dependency
92
133
  name: rspec-rails
93
- requirement: &70093023807800 !ruby/object:Gem::Requirement
134
+ prerelease: false
135
+ requirement: &id008 !ruby/object:Gem::Requirement
94
136
  none: false
95
- requirements:
137
+ requirements:
96
138
  - - ~>
97
- - !ruby/object:Gem::Version
139
+ - !ruby/object:Gem::Version
140
+ hash: 43
141
+ segments:
142
+ - 2
143
+ - 9
144
+ - 0
98
145
  version: 2.9.0
99
146
  type: :development
100
- prerelease: false
101
- version_requirements: *70093023807800
147
+ version_requirements: *id008
102
148
  description: RESTful API Client
103
- email:
149
+ email:
104
150
  - ryan.moran@revolutionprep.com
105
151
  executables: []
152
+
106
153
  extensions: []
154
+
107
155
  extra_rdoc_files: []
108
- files:
156
+
157
+ files:
109
158
  - .autotest
110
159
  - .gitignore
111
160
  - .rspec
112
161
  - .travis.yml
162
+ - CHANGELOG.md
113
163
  - Gemfile
114
164
  - LICENSE.txt
115
165
  - README.md
116
166
  - Rakefile
117
167
  - lib/ext/typhoeus.rb
118
168
  - lib/morpheus.rb
119
- - lib/morpheus/associations/association.rb
120
- - lib/morpheus/associations/belongs_to_association.rb
121
- - lib/morpheus/associations/has_many_association.rb
122
- - lib/morpheus/associations/has_one_association.rb
123
169
  - lib/morpheus/base.rb
170
+ - lib/morpheus/client.rb
124
171
  - lib/morpheus/client/associations.rb
172
+ - lib/morpheus/client/cached_request_formatter.rb
125
173
  - lib/morpheus/client/inflections.rb
126
174
  - lib/morpheus/client/log_subscriber.rb
127
175
  - lib/morpheus/client/railtie.rb
176
+ - lib/morpheus/client/request_formatter.rb
177
+ - lib/morpheus/client/uncached_request_formatter.rb
128
178
  - lib/morpheus/configuration.rb
129
179
  - lib/morpheus/errors.rb
130
180
  - lib/morpheus/filter.rb
181
+ - lib/morpheus/mixins.rb
131
182
  - lib/morpheus/mixins/associations.rb
183
+ - lib/morpheus/mixins/associations/association.rb
184
+ - lib/morpheus/mixins/associations/belongs_to_association.rb
185
+ - lib/morpheus/mixins/associations/has_many_association.rb
186
+ - lib/morpheus/mixins/associations/has_one_association.rb
132
187
  - lib/morpheus/mixins/attributes.rb
133
188
  - lib/morpheus/mixins/conversion.rb
134
189
  - lib/morpheus/mixins/filtering.rb
@@ -189,15 +244,18 @@ files:
189
244
  - spec/dummy/public/favicon.ico
190
245
  - spec/dummy/public/stylesheets/.gitkeep
191
246
  - spec/dummy/script/rails
192
- - spec/morpheus/associations/association_spec.rb
193
- - spec/morpheus/associations/belongs_to_association_spec.rb
194
- - spec/morpheus/associations/has_many_association_spec.rb
195
- - spec/morpheus/associations/has_one_association_spec.rb
196
247
  - spec/morpheus/base_spec.rb
197
248
  - spec/morpheus/client/associations_spec.rb
249
+ - spec/morpheus/client/cached_request_formatter_spec.rb
198
250
  - spec/morpheus/client/log_subscriber_spec.rb
199
251
  - spec/morpheus/client/railtie_spec.rb
252
+ - spec/morpheus/client/request_formatter_spec.rb
253
+ - spec/morpheus/client/uncached_request_formatter_spec.rb
200
254
  - spec/morpheus/configuration_spec.rb
255
+ - spec/morpheus/mixins/associations/association_spec.rb
256
+ - spec/morpheus/mixins/associations/belongs_to_association_spec.rb
257
+ - spec/morpheus/mixins/associations/has_many_association_spec.rb
258
+ - spec/morpheus/mixins/associations/has_one_association_spec.rb
201
259
  - spec/morpheus/mixins/associations_spec.rb
202
260
  - spec/morpheus/mixins/attributes_spec.rb
203
261
  - spec/morpheus/mixins/conversion_spec.rb
@@ -218,34 +276,44 @@ files:
218
276
  - spec/morpheus/response_spec.rb
219
277
  - spec/morpheus/type_caster_spec.rb
220
278
  - spec/morpheus/url_builder_spec.rb
279
+ - spec/regressions/sorting_resources_spec.rb
221
280
  - spec/shared/active_model_lint_test.rb
222
281
  - spec/spec_helper.rb
223
282
  - spec/support/configuration.rb
224
- homepage: ''
283
+ homepage: https://github.com/ryanmoran/morpheus
225
284
  licenses: []
285
+
226
286
  post_install_message:
227
287
  rdoc_options: []
228
- require_paths:
288
+
289
+ require_paths:
229
290
  - lib
230
- required_ruby_version: !ruby/object:Gem::Requirement
291
+ required_ruby_version: !ruby/object:Gem::Requirement
231
292
  none: false
232
- requirements:
233
- - - ! '>='
234
- - !ruby/object:Gem::Version
235
- version: '0'
236
- required_rubygems_version: !ruby/object:Gem::Requirement
293
+ requirements:
294
+ - - ">="
295
+ - !ruby/object:Gem::Version
296
+ hash: 3
297
+ segments:
298
+ - 0
299
+ version: "0"
300
+ required_rubygems_version: !ruby/object:Gem::Requirement
237
301
  none: false
238
- requirements:
239
- - - ! '>='
240
- - !ruby/object:Gem::Version
241
- version: '0'
302
+ requirements:
303
+ - - ">="
304
+ - !ruby/object:Gem::Version
305
+ hash: 3
306
+ segments:
307
+ - 0
308
+ version: "0"
242
309
  requirements: []
310
+
243
311
  rubyforge_project:
244
- rubygems_version: 1.8.15
312
+ rubygems_version: 1.8.24
245
313
  signing_key:
246
314
  specification_version: 3
247
315
  summary: RESTful API Client
248
- test_files:
316
+ test_files:
249
317
  - spec/dummy/Rakefile
250
318
  - spec/dummy/app/controllers/application_controller.rb
251
319
  - spec/dummy/app/helpers/application_helper.rb
@@ -285,15 +353,18 @@ test_files:
285
353
  - spec/dummy/public/favicon.ico
286
354
  - spec/dummy/public/stylesheets/.gitkeep
287
355
  - spec/dummy/script/rails
288
- - spec/morpheus/associations/association_spec.rb
289
- - spec/morpheus/associations/belongs_to_association_spec.rb
290
- - spec/morpheus/associations/has_many_association_spec.rb
291
- - spec/morpheus/associations/has_one_association_spec.rb
292
356
  - spec/morpheus/base_spec.rb
293
357
  - spec/morpheus/client/associations_spec.rb
358
+ - spec/morpheus/client/cached_request_formatter_spec.rb
294
359
  - spec/morpheus/client/log_subscriber_spec.rb
295
360
  - spec/morpheus/client/railtie_spec.rb
361
+ - spec/morpheus/client/request_formatter_spec.rb
362
+ - spec/morpheus/client/uncached_request_formatter_spec.rb
296
363
  - spec/morpheus/configuration_spec.rb
364
+ - spec/morpheus/mixins/associations/association_spec.rb
365
+ - spec/morpheus/mixins/associations/belongs_to_association_spec.rb
366
+ - spec/morpheus/mixins/associations/has_many_association_spec.rb
367
+ - spec/morpheus/mixins/associations/has_one_association_spec.rb
297
368
  - spec/morpheus/mixins/associations_spec.rb
298
369
  - spec/morpheus/mixins/attributes_spec.rb
299
370
  - spec/morpheus/mixins/conversion_spec.rb
@@ -314,6 +385,7 @@ test_files:
314
385
  - spec/morpheus/response_spec.rb
315
386
  - spec/morpheus/type_caster_spec.rb
316
387
  - spec/morpheus/url_builder_spec.rb
388
+ - spec/regressions/sorting_resources_spec.rb
317
389
  - spec/shared/active_model_lint_test.rb
318
390
  - spec/spec_helper.rb
319
391
  - spec/support/configuration.rb