trav3 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74f15ee8237114fde668fc778097f99fb478135ecffb64c266aeb2b927646f32
4
- data.tar.gz: 64a3592dd906c3eb313d02e9992dde7014c713de58fb87de16f61db3867ee9b7
3
+ metadata.gz: a9d051368b7f9cdc96624c21a8633de396652dcce787bed17be43429efc58b9b
4
+ data.tar.gz: d428964b0cc846da949efd73f6bbf5f19822f33b5c6994f18c2f8f40861d257b
5
5
  SHA512:
6
- metadata.gz: 7ef2a7d76fe194c01b582fad0b1e1fb65bed0746a12a7f9b4a837c454cdc43c56a2f1ec2560c02420d2adc5cb9ec2161a44942b11a837b291ec082ed14e0c442
7
- data.tar.gz: 83ab138e8ede9c141098aad8026a629d21297843766fff6edad90a4e3bcfae689195a3f8e72ae17ba991dee5a528d18284f15429652cd9bd9a114ea28f06838b
6
+ metadata.gz: f379a2fe4db84e699a6b33e41fd5ee7d66491d15fc437ee6ade66e0cdf5fc8e8db390cfdf66af10dfd56705aedf2bb66dc9a4c2ca63a005a793926db42403ab8
7
+ data.tar.gz: beea9526ee488f54770d5c7fcfd792660c9a1d66ae6eeaed414483fab08ee9388b5805a26b83efdbd9c35bb7667db6660138c35e54b2cb943f63bc66762dc894
data/lib/trav3/result.rb CHANGED
@@ -2,51 +2,53 @@
2
2
  require 'forwardable'
3
3
  require 'trav3/pagination'
4
4
 
5
- class InvalidRepository < StandardError
6
- def message
7
- "The repository format was invlaid.
8
- You must either provide the digit name for the repository,
9
- or `user/repo` or `user%2Frepo` as the name."
5
+ module Trav3
6
+ class InvalidRepository < StandardError
7
+ def message
8
+ "The repository format was invlaid.
9
+ You must either provide the digit name for the repository,
10
+ or `user/repo` or `user%2Frepo` as the name."
11
+ end
10
12
  end
11
- end
12
-
13
- class Unimplemented < StandardError
14
- def message
15
- "You need to implement this method"
16
- end
17
- end
18
13
 
19
- class Response
20
- extend Forwardable
21
- def_delegators :@json, :[], :dig, :keys, :values, :has_key?
22
- def_delegators :@response, :code, :code_type, :uri, :message, :read_header,
23
- :header, :value, :entity, :response, :body,
24
- :decode_content, :msg, :reading_body, :read_body,
25
- :http_version, :connection_close?, :connection_keep_alive?,
26
- :initialize_http_header, :get_fields, :each_header
27
- def initialize(response)
28
- @response = response
29
- @json = JSON.parse(response.body)
14
+ class Unimplemented < StandardError
15
+ def message
16
+ "You need to implement this method"
17
+ end
30
18
  end
31
19
 
32
- def inspect
33
- "<#{self.class} Response>"
20
+ class Response
21
+ extend Forwardable
22
+ def_delegators :@json, :[], :dig, :keys, :values, :has_key?
23
+ def_delegators :@response, :code, :code_type, :uri, :message, :read_header,
24
+ :header, :value, :entity, :response, :body,
25
+ :decode_content, :msg, :reading_body, :read_body,
26
+ :http_version, :connection_close?, :connection_keep_alive?,
27
+ :initialize_http_header, :get_fields, :each_header
28
+ def initialize(response)
29
+ @response = response
30
+ @json = JSON.parse(response.body)
31
+ end
32
+
33
+ def inspect
34
+ "<#{self.class} Response>"
35
+ end
36
+
37
+ def success?; raise Unimplemented end
38
+ def failure?; raise Unimplemented end
34
39
  end
35
40
 
36
- def success?; raise Unimplemented end
37
- def failure?; raise Unimplemented end
38
- end
41
+ class Success < Response
42
+ def page
43
+ Trav3::Pagination.new(self)
44
+ end
39
45
 
40
- class Success < Response
41
- def page
42
- Trav3::Pagination.new(self)
46
+ def success?; true end
47
+ def failure?; false end
43
48
  end
44
49
 
45
- def success?; true end
46
- def failure?; false end
47
- end
48
-
49
- class RequestError < Response
50
- def success?; false end
51
- def failure?; true end
50
+ class RequestError < Response
51
+ def success?; false end
52
+ def failure?; true end
53
+ end
52
54
  end
data/lib/trav3/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Trav3
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trav3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel P. Clark