zombie_battleground-api 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +62 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +21 -0
  5. data/.travis.yml +5 -0
  6. data/CODE_OF_CONDUCT.md +74 -0
  7. data/Dockerfile +33 -0
  8. data/Gemfile +8 -0
  9. data/Gemfile.lock +85 -0
  10. data/LICENSE +21 -0
  11. data/LICENSE.txt +21 -0
  12. data/README.md +57 -0
  13. data/Rakefile +16 -0
  14. data/bin/console +12 -0
  15. data/bin/setup +8 -0
  16. data/docker-compose.yml +4 -0
  17. data/lib/zombie_battleground/api/client.rb +114 -0
  18. data/lib/zombie_battleground/api/errors.rb +24 -0
  19. data/lib/zombie_battleground/api/models/card.rb +46 -0
  20. data/lib/zombie_battleground/api/models/deck.rb +65 -0
  21. data/lib/zombie_battleground/api/models/match.rb +47 -0
  22. data/lib/zombie_battleground/api/models/simple_card.rb +27 -0
  23. data/lib/zombie_battleground/api/requests/get_card_request.rb +27 -0
  24. data/lib/zombie_battleground/api/requests/get_cards_request.rb +40 -0
  25. data/lib/zombie_battleground/api/requests/get_deck_request.rb +30 -0
  26. data/lib/zombie_battleground/api/requests/get_decks_request.rb +36 -0
  27. data/lib/zombie_battleground/api/requests/get_match_request.rb +30 -0
  28. data/lib/zombie_battleground/api/requests/get_matches_request.rb +34 -0
  29. data/lib/zombie_battleground/api/requests/request_helper.rb +20 -0
  30. data/lib/zombie_battleground/api/responses/get_card_response.rb +38 -0
  31. data/lib/zombie_battleground/api/responses/get_cards_response.rb +54 -0
  32. data/lib/zombie_battleground/api/responses/get_deck_response.rb +38 -0
  33. data/lib/zombie_battleground/api/responses/get_decks_response.rb +54 -0
  34. data/lib/zombie_battleground/api/responses/get_match_response.rb +38 -0
  35. data/lib/zombie_battleground/api/responses/get_matches_response.rb +54 -0
  36. data/lib/zombie_battleground/api/responses/response_helper.rb +28 -0
  37. data/lib/zombie_battleground/api/validation_helper.rb +347 -0
  38. data/lib/zombie_battleground/api/version.rb +7 -0
  39. data/lib/zombie_battleground/api.rb +40 -0
  40. data/zombie_battleground-api.gemspec +40 -0
  41. metadata +196 -0
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ZombieBattleground
4
+ class Api
5
+ VERSION = '0.1.0'
6
+ end
7
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'zombie_battleground/api/version'
4
+ require 'zombie_battleground/api/client'
5
+
6
+ module ZombieBattleground
7
+ ##
8
+ # API for Zombie Battleground
9
+ class Api
10
+ @client = ZombieBattleground::Api::Client.new
11
+
12
+ class << self
13
+ attr_accessor :client
14
+
15
+ def decks(**args)
16
+ client.decks(**args)
17
+ end
18
+
19
+ def deck(**args)
20
+ client.deck(**args)
21
+ end
22
+
23
+ def matches(**args)
24
+ client.matches(**args)
25
+ end
26
+
27
+ def match(**args)
28
+ client.match(**args)
29
+ end
30
+
31
+ def cards(**args)
32
+ client.cards(**args)
33
+ end
34
+
35
+ def card(**args)
36
+ client.card(**args)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'zombie_battleground/api/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'zombie_battleground-api'
9
+ spec.version = ZombieBattleground::Api::VERSION
10
+ spec.authors = ['John Shields']
11
+ spec.email = ['john@shields.wtf']
12
+
13
+ spec.summary = 'An implemenetation of the ZombieBattleground public API'
14
+ spec.homepage = 'https://john.shields.wtf'
15
+ spec.license = 'MIT'
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' unless spec.respond_to?(:metadata)
20
+
21
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
+ end
28
+ spec.bindir = 'exe'
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ['lib']
31
+
32
+ spec.add_development_dependency 'bundler', '~> 1.16'
33
+ spec.add_development_dependency 'rake', '~> 10.0'
34
+ spec.add_development_dependency 'rspec', '~> 3.0'
35
+ spec.add_development_dependency 'rubocop'
36
+ spec.add_dependency 'activerecord'
37
+ spec.add_dependency 'faraday'
38
+ spec.add_dependency 'json'
39
+ spec.add_dependency 'pry'
40
+ end
metadata ADDED
@@ -0,0 +1,196 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: zombie_battleground-api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - John Shields
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-02-14 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.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.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: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
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: activerecord
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
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: faraday
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: json
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description:
126
+ email:
127
+ - john@shields.wtf
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - ".gitignore"
133
+ - ".rspec"
134
+ - ".rubocop.yml"
135
+ - ".travis.yml"
136
+ - CODE_OF_CONDUCT.md
137
+ - Dockerfile
138
+ - Gemfile
139
+ - Gemfile.lock
140
+ - LICENSE
141
+ - LICENSE.txt
142
+ - README.md
143
+ - Rakefile
144
+ - bin/console
145
+ - bin/setup
146
+ - docker-compose.yml
147
+ - lib/zombie_battleground/api.rb
148
+ - lib/zombie_battleground/api/client.rb
149
+ - lib/zombie_battleground/api/errors.rb
150
+ - lib/zombie_battleground/api/models/card.rb
151
+ - lib/zombie_battleground/api/models/deck.rb
152
+ - lib/zombie_battleground/api/models/match.rb
153
+ - lib/zombie_battleground/api/models/simple_card.rb
154
+ - lib/zombie_battleground/api/requests/get_card_request.rb
155
+ - lib/zombie_battleground/api/requests/get_cards_request.rb
156
+ - lib/zombie_battleground/api/requests/get_deck_request.rb
157
+ - lib/zombie_battleground/api/requests/get_decks_request.rb
158
+ - lib/zombie_battleground/api/requests/get_match_request.rb
159
+ - lib/zombie_battleground/api/requests/get_matches_request.rb
160
+ - lib/zombie_battleground/api/requests/request_helper.rb
161
+ - lib/zombie_battleground/api/responses/get_card_response.rb
162
+ - lib/zombie_battleground/api/responses/get_cards_response.rb
163
+ - lib/zombie_battleground/api/responses/get_deck_response.rb
164
+ - lib/zombie_battleground/api/responses/get_decks_response.rb
165
+ - lib/zombie_battleground/api/responses/get_match_response.rb
166
+ - lib/zombie_battleground/api/responses/get_matches_response.rb
167
+ - lib/zombie_battleground/api/responses/response_helper.rb
168
+ - lib/zombie_battleground/api/validation_helper.rb
169
+ - lib/zombie_battleground/api/version.rb
170
+ - zombie_battleground-api.gemspec
171
+ homepage: https://john.shields.wtf
172
+ licenses:
173
+ - MIT
174
+ metadata:
175
+ allowed_push_host: https://rubygems.org
176
+ post_install_message:
177
+ rdoc_options: []
178
+ require_paths:
179
+ - lib
180
+ required_ruby_version: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ required_rubygems_version: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - ">="
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ requirements: []
191
+ rubyforge_project:
192
+ rubygems_version: 2.7.6
193
+ signing_key:
194
+ specification_version: 4
195
+ summary: An implemenetation of the ZombieBattleground public API
196
+ test_files: []