kosapi_client 0.5.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.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/bin/console +15 -0
  3. data/bin/setup +23 -0
  4. data/lib/kosapi_client.rb +22 -0
  5. data/lib/kosapi_client/api_client.rb +43 -0
  6. data/lib/kosapi_client/configuration.rb +23 -0
  7. data/lib/kosapi_client/entity.rb +19 -0
  8. data/lib/kosapi_client/entity/author.rb +17 -0
  9. data/lib/kosapi_client/entity/base_entity.rb +16 -0
  10. data/lib/kosapi_client/entity/base_person.rb +20 -0
  11. data/lib/kosapi_client/entity/boolean.rb +14 -0
  12. data/lib/kosapi_client/entity/course.rb +34 -0
  13. data/lib/kosapi_client/entity/course_event.rb +20 -0
  14. data/lib/kosapi_client/entity/data_mappings.rb +122 -0
  15. data/lib/kosapi_client/entity/enum.rb +11 -0
  16. data/lib/kosapi_client/entity/exam.rb +25 -0
  17. data/lib/kosapi_client/entity/id.rb +13 -0
  18. data/lib/kosapi_client/entity/link.rb +54 -0
  19. data/lib/kosapi_client/entity/ml_string.rb +42 -0
  20. data/lib/kosapi_client/entity/parallel.rb +20 -0
  21. data/lib/kosapi_client/entity/person.rb +10 -0
  22. data/lib/kosapi_client/entity/result_page.rb +46 -0
  23. data/lib/kosapi_client/entity/student.rb +25 -0
  24. data/lib/kosapi_client/entity/teacher.rb +14 -0
  25. data/lib/kosapi_client/entity/teacher_timetable_slot.rb +16 -0
  26. data/lib/kosapi_client/entity/timetable_slot.rb +16 -0
  27. data/lib/kosapi_client/hash_utils.rb +17 -0
  28. data/lib/kosapi_client/http_client.rb +36 -0
  29. data/lib/kosapi_client/kosapi_client.rb +45 -0
  30. data/lib/kosapi_client/kosapi_response.rb +32 -0
  31. data/lib/kosapi_client/oauth2_http_adapter.rb +36 -0
  32. data/lib/kosapi_client/request_builder.rb +59 -0
  33. data/lib/kosapi_client/request_builder_delegator.rb +52 -0
  34. data/lib/kosapi_client/resource.rb +12 -0
  35. data/lib/kosapi_client/resource/course_events_builder.rb +13 -0
  36. data/lib/kosapi_client/resource/courses_builder.rb +12 -0
  37. data/lib/kosapi_client/resource/exams_builder.rb +13 -0
  38. data/lib/kosapi_client/resource/parallels_builder.rb +20 -0
  39. data/lib/kosapi_client/resource/teachers_builder.rb +16 -0
  40. data/lib/kosapi_client/resource_mapper.rb +20 -0
  41. data/lib/kosapi_client/response_converter.rb +65 -0
  42. data/lib/kosapi_client/response_links.rb +40 -0
  43. data/lib/kosapi_client/response_preprocessor.rb +48 -0
  44. data/lib/kosapi_client/url_builder.rb +24 -0
  45. data/lib/kosapi_client/version.rb +3 -0
  46. data/spec/integration/course_events_spec.rb +13 -0
  47. data/spec/integration/courses_spec.rb +28 -0
  48. data/spec/integration/exams_spec.rb +20 -0
  49. data/spec/integration/parallels_spec.rb +68 -0
  50. data/spec/kosapi_client/api_client_spec.rb +22 -0
  51. data/spec/kosapi_client/configuration_spec.rb +30 -0
  52. data/spec/kosapi_client/entity/base_entity_spec.rb +20 -0
  53. data/spec/kosapi_client/entity/base_person_spec.rb +19 -0
  54. data/spec/kosapi_client/entity/boolean_spec.rb +23 -0
  55. data/spec/kosapi_client/entity/course_event_spec.rb +30 -0
  56. data/spec/kosapi_client/entity/data_mappings_spec.rb +154 -0
  57. data/spec/kosapi_client/entity/enum_spec.rb +20 -0
  58. data/spec/kosapi_client/entity/id_spec.rb +13 -0
  59. data/spec/kosapi_client/entity/link_spec.rb +89 -0
  60. data/spec/kosapi_client/entity/ml_string_spec.rb +52 -0
  61. data/spec/kosapi_client/entity/parallel_spec.rb +18 -0
  62. data/spec/kosapi_client/entity/result_page_spec.rb +42 -0
  63. data/spec/kosapi_client/entity/teacher_timetable_slot_spec.rb +19 -0
  64. data/spec/kosapi_client/entity/timetable_slot_spec.rb +22 -0
  65. data/spec/kosapi_client/hash_utils_spec.rb +20 -0
  66. data/spec/kosapi_client/http_client_spec.rb +30 -0
  67. data/spec/kosapi_client/kosapi_client_spec.rb +57 -0
  68. data/spec/kosapi_client/kosapi_response_spec.rb +96 -0
  69. data/spec/kosapi_client/oauth2_http_adapter_spec.rb +25 -0
  70. data/spec/kosapi_client/request_builder_delegator_spec.rb +72 -0
  71. data/spec/kosapi_client/request_builder_spec.rb +80 -0
  72. data/spec/kosapi_client/resource/courses_builder_spec.rb +20 -0
  73. data/spec/kosapi_client/resource/parallels_builder_spec.rb +49 -0
  74. data/spec/kosapi_client/resource_mapper_spec.rb +33 -0
  75. data/spec/kosapi_client/response_converter_spec.rb +58 -0
  76. data/spec/kosapi_client/response_links_spec.rb +52 -0
  77. data/spec/kosapi_client/response_preprocessor_spec.rb +51 -0
  78. data/spec/kosapi_client/url_builder_spec.rb +44 -0
  79. data/spec/spec_helper.rb +40 -0
  80. data/spec/support/client_helpers.rb +11 -0
  81. data/spec/support/helpers.rb +7 -0
  82. data/spec/support/shared_examples_for_fluent_api.rb +7 -0
  83. metadata +401 -0
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe KOSapiClient::Resource::CoursesBuilder do
4
+
5
+ let(:url_builder) { instance_double(KOSapiClient::URLBuilder, url: 'http://example.com', set_query_param: nil) }
6
+ let(:response) { double(foo: :bar) }
7
+ let(:http_client) { double(send_request: response) }
8
+ subject(:builder) { KOSapiClient::Resource::CoursesBuilder.new('http://example.com', http_client, url_builder) }
9
+
10
+ describe '#detail' do
11
+
12
+ it_behaves_like 'fluent api command', method_name, 10
13
+
14
+ it 'sets detail query parameter' do
15
+ expect(url_builder).to receive(:set_query_param).with(:detail, 1)
16
+ builder.detail
17
+ end
18
+
19
+ end
20
+ end
@@ -0,0 +1,49 @@
1
+ require 'spec_helper'
2
+
3
+ describe KOSapiClient::Resource::ParallelsBuilder do
4
+
5
+ let(:url_builder) { instance_double(KOSapiClient::URLBuilder, url: 'http://example.com') }
6
+ let(:response) { double(foo: :bar) }
7
+ let(:http_client) { double(send_request: response) }
8
+ subject(:builder) { KOSapiClient::Resource::ParallelsBuilder.new('http://example.com', http_client, url_builder) }
9
+
10
+ describe '#related' do
11
+
12
+ before { allow(url_builder).to receive(:set_path) }
13
+
14
+ it 'throws error when parallel id not set' do
15
+ expect { builder.related }.to raise_error(RuntimeError)
16
+ end
17
+
18
+ it 'returns self' do
19
+ builder.find(42)
20
+ expect(builder.related).to eq builder
21
+ end
22
+
23
+ it 'adds related to URL' do
24
+ expect(url_builder).to receive(:set_path).with(42, 'related')
25
+ builder.find(42).related
26
+ end
27
+
28
+ end
29
+
30
+ describe '#students' do
31
+
32
+ before { allow(url_builder).to receive(:set_path) }
33
+
34
+ it 'throws error when parallel id not set' do
35
+ expect { builder.students }.to raise_error(RuntimeError)
36
+ end
37
+
38
+ it 'returns self' do
39
+ builder.find(42)
40
+ expect(builder.students).to eq builder
41
+ end
42
+
43
+ it 'adds students to URL' do
44
+ expect(url_builder).to receive(:set_path).with(42, 'students')
45
+ builder.find(42).students
46
+ end
47
+
48
+ end
49
+ end
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe KOSapiClient::ResourceMapper do
4
+
5
+ let(:dummy_class) { Class.new { include KOSapiClient::ResourceMapper } }
6
+ let(:dummy_instance) { dummy_class.new }
7
+
8
+ it 'defines class method .resource' do
9
+ expect(dummy_class).to respond_to(:resource)
10
+ end
11
+
12
+ describe '.resource' do
13
+
14
+ it 'creates instance method with the resource name' do
15
+ dummy_class.resource(:foo)
16
+ expect(dummy_instance).to respond_to(:foo)
17
+ end
18
+
19
+ it 'creates method which returns builder delegator' do
20
+ dummy_class.resource(:foo)
21
+ allow(dummy_instance).to receive(:create_builder)
22
+ expect(dummy_instance.foo).to be_an_instance_of(KOSapiClient::RequestBuilderDelegator)
23
+ end
24
+
25
+ it 'calls #create_builder' do
26
+ dummy_class.resource(:foo)
27
+ expect(dummy_instance).to receive(:create_builder).with(:foo)
28
+ dummy_instance.foo
29
+ end
30
+
31
+ end
32
+
33
+ end
@@ -0,0 +1,58 @@
1
+ require 'spec_helper'
2
+
3
+ describe KOSapiClient::ResponseConverter do
4
+
5
+ let(:client) { instance_double(KOSapiClient::HTTPClient) }
6
+ subject(:converter) { described_class.new(client) }
7
+
8
+ describe '#convert' do
9
+
10
+ context 'with paginated response' do
11
+
12
+ let(:next_link) { instance_double(KOSapiClient::Entity::Link) }
13
+ let(:prev_link) { instance_double(KOSapiClient::Entity::Link) }
14
+ let(:links) { instance_double(KOSapiClient::ResponseLinks, next: next_link, prev: prev_link) }
15
+ let(:api_response) { double(is_paginated?: true, items: [{xsi_type: 'courseEvent', capacity: 70}, {xsi_type: 'courseEvent', capacity: 40}], links_hash: links) }
16
+
17
+ before(:each) { allow(converter).to receive(:create_links).and_return(links) }
18
+
19
+ it 'processes paginated response' do
20
+ result = converter.convert(api_response)
21
+ expect(result).to be_an_instance_of(KOSapiClient::Entity::ResultPage)
22
+ end
23
+
24
+ it 'creates next link' do
25
+ result = converter.convert(api_response)
26
+ expect(result.next).to be next_link
27
+ end
28
+
29
+ it 'creates prev link' do
30
+ result = converter.convert(api_response)
31
+ expect(result.prev).to be prev_link
32
+ end
33
+ end
34
+
35
+ context 'with single entry response' do
36
+
37
+ let(:api_response) { double(is_paginated?: false, item: {xsi_type: 'courseEvent', capacity: 70}) }
38
+
39
+ it 'processes non-paginated response' do
40
+ result = converter.convert(api_response)
41
+ expect(result).to be_an_instance_of(KOSapiClient::Entity::CourseEvent)
42
+ end
43
+
44
+ end
45
+
46
+ context 'unknown type' do
47
+
48
+ let(:api_response) { double(is_paginated?: false, item: {xsi_type: 'unknownType'}) }
49
+
50
+ it 'raises error when type not found' do
51
+ expect { converter.convert(api_response) }.to raise_error(RuntimeError)
52
+ end
53
+
54
+ end
55
+
56
+ end
57
+
58
+ end
@@ -0,0 +1,52 @@
1
+ require 'spec_helper'
2
+
3
+ describe KOSapiClient::ResponseLinks do
4
+
5
+ let(:client) { instance_double(KOSapiClient::HTTPClient) }
6
+ subject(:links) { described_class.new }
7
+
8
+ describe '.parse' do
9
+
10
+ context 'with no links' do
11
+ it 'returns instance with no links set' do
12
+ links = described_class.parse(nil, client)
13
+ expect(links.next).not_to be
14
+ expect(links.prev).not_to be
15
+ end
16
+ end
17
+
18
+ context 'with both links' do
19
+ it 'parses both links' do
20
+ links = described_class.parse([{rel: 'prev', href: 'courses/?offset=0&limit=10'}, {rel: 'next', href: 'courses/?offset=20&limit=10'}], client)
21
+ expect(links.next.link_href).to eq 'courses/?offset=20&limit=10'
22
+ expect(links.prev.link_href).to eq 'courses/?offset=0&limit=10'
23
+ end
24
+ end
25
+
26
+ context 'with next link' do
27
+ it 'parses next link' do
28
+ links = described_class.parse({rel: 'next', href: 'courses/?offset=20&limit=10'}, client)
29
+ expect(links.next.link_href).to eq 'courses/?offset=20&limit=10'
30
+ expect(links.next.link_rel).to eq 'next'
31
+ expect(links.prev).not_to be
32
+ end
33
+ end
34
+
35
+ context 'with prev link' do
36
+ it 'parses prev link' do
37
+ links = described_class.parse({rel: 'prev', href: 'courses/?offset=20&limit=10'}, client)
38
+ expect(links.next).not_to be
39
+ expect(links.prev.link_href).to eq 'courses/?offset=20&limit=10'
40
+ expect(links.prev.link_rel).to eq 'prev'
41
+ end
42
+ end
43
+
44
+ it 'injects http client' do
45
+ links = described_class.parse({rel: 'next', href: 'courses/?offset=20&limit=10'}, client)
46
+ expect(client).to receive(:send_request)
47
+ links.next.follow
48
+ end
49
+
50
+ end
51
+
52
+ end
@@ -0,0 +1,51 @@
1
+ require 'spec_helper'
2
+
3
+ describe KOSapiClient::ResponsePreprocessor do
4
+ subject(:preprocessor) { KOSapiClient::ResponsePreprocessor.new }
5
+ let(:response) { double(parsed: parsed_response) }
6
+ let(:parsed_response) { {atom_entry: {}, 'sampleKey' => 'value', 'nestedHash' => ['stuff', {'foo'=>'bar'}]} }
7
+
8
+ it 'stringifies hash keys and make then snakecase' do
9
+ result = preprocessor.preprocess(response)
10
+ expect(result).to eq({atom_entry: {}, sample_key: 'value', nested_hash: ['stuff', {foo: 'bar'}]})
11
+ end
12
+
13
+ it 'converts entries to array when required' do
14
+ resp = {atom_feed: {
15
+ atom_entry: {id: '1234'}
16
+ }}
17
+ result = preprocessor.preprocess(double(parsed: resp))
18
+ expect(result).to eq({atom_feed: {atom_entry: [{id: '1234'}]}})
19
+ end
20
+
21
+ it 'merges contents to entries in feed' do
22
+ resp = {atom_feed: {
23
+ atom_entry: [{id: '1234', atom_content: {foo: :bar}}]
24
+ }}
25
+ result = preprocessor.preprocess(double(parsed: resp))
26
+ expect(result).to eq({atom_feed: {atom_entry: [{id: '1234', foo: :bar}]}})
27
+ end
28
+
29
+ it 'merges content in single entry' do
30
+ resp = {atom_entry: {id: '1234', atom_content: {foo: :bar}}}
31
+ result = preprocessor.preprocess(double(parsed: resp))
32
+ expect(result).to eq({atom_entry: {id: '1234', foo: :bar}})
33
+ end
34
+
35
+ it 'handles empty response' do
36
+ resp = {atom_feed: {} }
37
+ result = preprocessor.preprocess(double(parsed: resp))
38
+ expect(result).to eq({atom_feed: {}})
39
+ end
40
+
41
+ context 'with invalid response' do
42
+
43
+ let(:parsed_response) { 'foo' }
44
+
45
+ it 'raises error when parsed type is not a hash' do
46
+ expect { preprocessor.preprocess(response) }.to raise_error(RuntimeError)
47
+ end
48
+
49
+ end
50
+
51
+ end
@@ -0,0 +1,44 @@
1
+ require 'spec_helper'
2
+
3
+ describe KOSapiClient::URLBuilder do
4
+
5
+ let(:root) { 'http://example.com' }
6
+ subject(:builder) { KOSapiClient::URLBuilder.new(root) }
7
+
8
+ describe '#set_query_param' do
9
+
10
+ it 'adds new query parameters to ur' do
11
+ builder.set_query_param('foo', 'bar')
12
+ builder.set_query_param('boo', 'far')
13
+ expect(builder.url).to eq 'http://example.com?foo=bar&boo=far'
14
+ end
15
+
16
+ it 'overwrites already used query parameters' do
17
+ builder.set_query_param('foo', 'bar')
18
+ builder.set_query_param('foo', 'far')
19
+ expect(builder.url).to eq 'http://example.com?foo=far'
20
+ end
21
+
22
+ end
23
+
24
+ describe '#set_path' do
25
+
26
+ it 'sets path correctly' do
27
+ builder.set_path('foo', 'bar')
28
+ expect(builder.url).to eq 'http://example.com/foo/bar'
29
+ end
30
+
31
+ context 'with custom root' do
32
+
33
+ let(:root) { 'https://kosapi.fit.cvut.cz/api/3' }
34
+
35
+ it 'creates correct path' do
36
+ builder.set_path('bar')
37
+ expect(builder.url).to eq 'https://kosapi.fit.cvut.cz/api/3/bar'
38
+ end
39
+
40
+ end
41
+
42
+ end
43
+
44
+ end
@@ -0,0 +1,40 @@
1
+ require 'dotenv'
2
+ Dotenv.load
3
+
4
+ if ENV['CODECLIMATE_REPO_TOKEN']
5
+ require 'simplecov'
6
+ SimpleCov.start
7
+ end
8
+
9
+ if ENV['TRAVIS']
10
+ require 'coveralls'
11
+ Coveralls.wear!
12
+ end
13
+
14
+ require 'rspec/given'
15
+ require 'kosapi_client'
16
+
17
+ Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
18
+
19
+ RSpec.configure do |config|
20
+ #config.treat_symbols_as_metadata_keys_with_true_values = true
21
+ config.extend Helpers
22
+ config.include ClientHelpers
23
+ end
24
+
25
+ require 'vcr'
26
+
27
+ VCR.configure do |c|
28
+ c.configure_rspec_metadata!
29
+ c.hook_into :faraday
30
+ c.default_cassette_options = {
31
+ #serialize_with: :json,
32
+ # TODO: Track down UTF-8 issue and remove
33
+ #preserve_exact_body_bytes: true,
34
+ #decode_compressed_response: true,
35
+ record: ENV['TRAVIS'] ? :none : :once
36
+ }
37
+ c.cassette_library_dir = 'spec/cassettes'
38
+ end
39
+
40
+ VCR.turn_off! ignore_cassettes: true if ENV['TRAVIS']
@@ -0,0 +1,11 @@
1
+ module ClientHelpers
2
+
3
+ def create_kosapi_client
4
+ credentials = {
5
+ client_id: ENV['KOSAPI_OAUTH_CLIENT_ID'],
6
+ client_secret: ENV['KOSAPI_OAUTH_CLIENT_SECRET']
7
+ }
8
+ KOSapiClient.new(credentials)
9
+ end
10
+
11
+ end
@@ -0,0 +1,7 @@
1
+ module Helpers
2
+
3
+ def method_name(name=description)
4
+ name[1..-1].to_sym
5
+ end
6
+
7
+ end
@@ -0,0 +1,7 @@
1
+ shared_examples_for 'fluent api command' do |method, *args|
2
+
3
+ it 'returns self' do
4
+ expect(builder.send(method, *args)).to be builder
5
+ end
6
+
7
+ end
metadata ADDED
@@ -0,0 +1,401 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kosapi_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ platform: ruby
6
+ authors:
7
+ - Tibor Szolár
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-01-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-given
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: dotenv
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: vcr
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: codeclimate-test-reporter
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 1.0.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 1.0.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: guard-rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: coveralls
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: fuubar
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 2.2.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 2.2.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: simplecov
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: oauth2
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: faraday
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '0.9'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '0.9'
195
+ - !ruby/object:Gem::Dependency
196
+ name: corefines
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '1.6'
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '1.6'
209
+ - !ruby/object:Gem::Dependency
210
+ name: escape_utils
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: uri_template
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ">="
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
237
+ - !ruby/object:Gem::Dependency
238
+ name: ox
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ">="
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
244
+ type: :runtime
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
251
+ description: REST client for KOSapi service
252
+ email: szolatib@fit.cvut.cz
253
+ executables:
254
+ - console
255
+ - setup
256
+ extensions: []
257
+ extra_rdoc_files: []
258
+ files:
259
+ - bin/console
260
+ - bin/setup
261
+ - lib/kosapi_client.rb
262
+ - lib/kosapi_client/api_client.rb
263
+ - lib/kosapi_client/configuration.rb
264
+ - lib/kosapi_client/entity.rb
265
+ - lib/kosapi_client/entity/author.rb
266
+ - lib/kosapi_client/entity/base_entity.rb
267
+ - lib/kosapi_client/entity/base_person.rb
268
+ - lib/kosapi_client/entity/boolean.rb
269
+ - lib/kosapi_client/entity/course.rb
270
+ - lib/kosapi_client/entity/course_event.rb
271
+ - lib/kosapi_client/entity/data_mappings.rb
272
+ - lib/kosapi_client/entity/enum.rb
273
+ - lib/kosapi_client/entity/exam.rb
274
+ - lib/kosapi_client/entity/id.rb
275
+ - lib/kosapi_client/entity/link.rb
276
+ - lib/kosapi_client/entity/ml_string.rb
277
+ - lib/kosapi_client/entity/parallel.rb
278
+ - lib/kosapi_client/entity/person.rb
279
+ - lib/kosapi_client/entity/result_page.rb
280
+ - lib/kosapi_client/entity/student.rb
281
+ - lib/kosapi_client/entity/teacher.rb
282
+ - lib/kosapi_client/entity/teacher_timetable_slot.rb
283
+ - lib/kosapi_client/entity/timetable_slot.rb
284
+ - lib/kosapi_client/hash_utils.rb
285
+ - lib/kosapi_client/http_client.rb
286
+ - lib/kosapi_client/kosapi_client.rb
287
+ - lib/kosapi_client/kosapi_response.rb
288
+ - lib/kosapi_client/oauth2_http_adapter.rb
289
+ - lib/kosapi_client/request_builder.rb
290
+ - lib/kosapi_client/request_builder_delegator.rb
291
+ - lib/kosapi_client/resource.rb
292
+ - lib/kosapi_client/resource/course_events_builder.rb
293
+ - lib/kosapi_client/resource/courses_builder.rb
294
+ - lib/kosapi_client/resource/exams_builder.rb
295
+ - lib/kosapi_client/resource/parallels_builder.rb
296
+ - lib/kosapi_client/resource/teachers_builder.rb
297
+ - lib/kosapi_client/resource_mapper.rb
298
+ - lib/kosapi_client/response_converter.rb
299
+ - lib/kosapi_client/response_links.rb
300
+ - lib/kosapi_client/response_preprocessor.rb
301
+ - lib/kosapi_client/url_builder.rb
302
+ - lib/kosapi_client/version.rb
303
+ - spec/integration/course_events_spec.rb
304
+ - spec/integration/courses_spec.rb
305
+ - spec/integration/exams_spec.rb
306
+ - spec/integration/parallels_spec.rb
307
+ - spec/kosapi_client/api_client_spec.rb
308
+ - spec/kosapi_client/configuration_spec.rb
309
+ - spec/kosapi_client/entity/base_entity_spec.rb
310
+ - spec/kosapi_client/entity/base_person_spec.rb
311
+ - spec/kosapi_client/entity/boolean_spec.rb
312
+ - spec/kosapi_client/entity/course_event_spec.rb
313
+ - spec/kosapi_client/entity/data_mappings_spec.rb
314
+ - spec/kosapi_client/entity/enum_spec.rb
315
+ - spec/kosapi_client/entity/id_spec.rb
316
+ - spec/kosapi_client/entity/link_spec.rb
317
+ - spec/kosapi_client/entity/ml_string_spec.rb
318
+ - spec/kosapi_client/entity/parallel_spec.rb
319
+ - spec/kosapi_client/entity/result_page_spec.rb
320
+ - spec/kosapi_client/entity/teacher_timetable_slot_spec.rb
321
+ - spec/kosapi_client/entity/timetable_slot_spec.rb
322
+ - spec/kosapi_client/hash_utils_spec.rb
323
+ - spec/kosapi_client/http_client_spec.rb
324
+ - spec/kosapi_client/kosapi_client_spec.rb
325
+ - spec/kosapi_client/kosapi_response_spec.rb
326
+ - spec/kosapi_client/oauth2_http_adapter_spec.rb
327
+ - spec/kosapi_client/request_builder_delegator_spec.rb
328
+ - spec/kosapi_client/request_builder_spec.rb
329
+ - spec/kosapi_client/resource/courses_builder_spec.rb
330
+ - spec/kosapi_client/resource/parallels_builder_spec.rb
331
+ - spec/kosapi_client/resource_mapper_spec.rb
332
+ - spec/kosapi_client/response_converter_spec.rb
333
+ - spec/kosapi_client/response_links_spec.rb
334
+ - spec/kosapi_client/response_preprocessor_spec.rb
335
+ - spec/kosapi_client/url_builder_spec.rb
336
+ - spec/spec_helper.rb
337
+ - spec/support/client_helpers.rb
338
+ - spec/support/helpers.rb
339
+ - spec/support/shared_examples_for_fluent_api.rb
340
+ homepage: https://github.com/cvut/kosapi_client.rb
341
+ licenses:
342
+ - MIT
343
+ metadata: {}
344
+ post_install_message:
345
+ rdoc_options: []
346
+ require_paths:
347
+ - lib
348
+ required_ruby_version: !ruby/object:Gem::Requirement
349
+ requirements:
350
+ - - ">="
351
+ - !ruby/object:Gem::Version
352
+ version: 2.0.0
353
+ required_rubygems_version: !ruby/object:Gem::Requirement
354
+ requirements:
355
+ - - ">="
356
+ - !ruby/object:Gem::Version
357
+ version: '0'
358
+ requirements: []
359
+ rubyforge_project:
360
+ rubygems_version: 2.5.1
361
+ signing_key:
362
+ specification_version: 4
363
+ summary: Simple Ruby client library for accessing KOSapi service resources
364
+ test_files:
365
+ - spec/integration/course_events_spec.rb
366
+ - spec/integration/courses_spec.rb
367
+ - spec/integration/exams_spec.rb
368
+ - spec/integration/parallels_spec.rb
369
+ - spec/kosapi_client/api_client_spec.rb
370
+ - spec/kosapi_client/configuration_spec.rb
371
+ - spec/kosapi_client/entity/base_entity_spec.rb
372
+ - spec/kosapi_client/entity/base_person_spec.rb
373
+ - spec/kosapi_client/entity/boolean_spec.rb
374
+ - spec/kosapi_client/entity/course_event_spec.rb
375
+ - spec/kosapi_client/entity/data_mappings_spec.rb
376
+ - spec/kosapi_client/entity/enum_spec.rb
377
+ - spec/kosapi_client/entity/id_spec.rb
378
+ - spec/kosapi_client/entity/link_spec.rb
379
+ - spec/kosapi_client/entity/ml_string_spec.rb
380
+ - spec/kosapi_client/entity/parallel_spec.rb
381
+ - spec/kosapi_client/entity/result_page_spec.rb
382
+ - spec/kosapi_client/entity/teacher_timetable_slot_spec.rb
383
+ - spec/kosapi_client/entity/timetable_slot_spec.rb
384
+ - spec/kosapi_client/hash_utils_spec.rb
385
+ - spec/kosapi_client/http_client_spec.rb
386
+ - spec/kosapi_client/kosapi_client_spec.rb
387
+ - spec/kosapi_client/kosapi_response_spec.rb
388
+ - spec/kosapi_client/oauth2_http_adapter_spec.rb
389
+ - spec/kosapi_client/request_builder_delegator_spec.rb
390
+ - spec/kosapi_client/request_builder_spec.rb
391
+ - spec/kosapi_client/resource/courses_builder_spec.rb
392
+ - spec/kosapi_client/resource/parallels_builder_spec.rb
393
+ - spec/kosapi_client/resource_mapper_spec.rb
394
+ - spec/kosapi_client/response_converter_spec.rb
395
+ - spec/kosapi_client/response_links_spec.rb
396
+ - spec/kosapi_client/response_preprocessor_spec.rb
397
+ - spec/kosapi_client/url_builder_spec.rb
398
+ - spec/spec_helper.rb
399
+ - spec/support/client_helpers.rb
400
+ - spec/support/helpers.rb
401
+ - spec/support/shared_examples_for_fluent_api.rb