Anilistrb 0.1.1 → 0.1.2

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: c37a6753d90d70d087b38858e589abce6689a838143b3ff2852f6a3ef6b72a3d
4
- data.tar.gz: 462513dd66c5238b157f5430cff80cde02d9145c86bc67e8f7e6990019289dcd
3
+ metadata.gz: a47da7a03c37feaf564cd2be8a9f940ada4553aed7198878f3502883974d6a0d
4
+ data.tar.gz: 81179f4110a4e1e966f862c7a42d9c8ce8ec3eb9e4a2f6e67855ea3cb344edf9
5
5
  SHA512:
6
- metadata.gz: 7add3af6ab606fc248ae43b7470288725d824718e46abdfd1a62c29f2c5da7fb8706fb51ee2ad891a0fd5078ee96bbf17c1735b2196c86b38019df64b4ba36f1
7
- data.tar.gz: fdba066e48d239829c198ffebcc5d885d4b92de029e58ad83a45966a48e3ceae435efeec723f7159db72c56cdd801bbd773649f0355d374cb395611269990ccc
6
+ metadata.gz: 7536acc4451996a0d0b12d1e83a080d4bb3db08e0a6dbc3feab6913897855701d756beaee9262a6f9dcceeabb304c406f9bd4e0808b6a3d54d64221d93448f59
7
+ data.tar.gz: 1b364278efb0fd3527a92d84691eb2973a2d86ad10d491e9f4ca1f30970aabe8e0efa408dc570a13a10e234eb5540130b0582edf1e949f026deba4391608e66b
data/.gitignore CHANGED
@@ -9,4 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
- *.gem
12
+ *.gem
13
+ vendor/
@@ -1,13 +1,16 @@
1
- image: ruby:2.6.1-alpine3.8
1
+ # Official language image. Look for the different tagged releases at:
2
+ # https://hub.docker.com/r/library/ruby/tags/
3
+ image: "ruby:2.6"
2
4
 
5
+ # Cache gems in between builds
3
6
  cache:
4
- paths:
5
- - vendor/
7
+ paths:
8
+ - vendor/ruby
6
9
 
7
10
  before_script:
11
+ - ruby -v
8
12
  - bundle install --path vendor
9
13
 
10
- deploy:
11
- stage: deploy
14
+ rspec:
12
15
  script:
13
- - bundle exec rake
16
+ - rspec spec
@@ -1,6 +1,6 @@
1
1
  lib = File.expand_path('../lib', __FILE__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'Anilistrb/version'
3
+ require 'Anilistrb/Version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'Anilistrb'
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'bundler', '~> 1.17'
33
33
  spec.add_development_dependency 'rake', '~> 10.0'
34
34
  spec.add_development_dependency 'rspec', '~> 3.0'
35
- spec.add_development_dependency 'rubocop', '~> 0.65.0'
35
+ #spec.add_development_dependency 'rubocop', '~> 0.65.0'
36
36
 
37
37
  spec.add_runtime_dependency 'httparty', '>= 0.13.7'
38
38
  spec.add_runtime_dependency 'json', '>= 2.2'
@@ -1,30 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Anilistrb (0.1.0)
4
+ Anilistrb (0.1.1)
5
5
  httparty (>= 0.13.7)
6
6
  json (>= 2.2)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- ast (2.4.0)
12
11
  diff-lcs (1.3)
13
12
  httparty (0.16.4)
14
13
  mime-types (~> 3.0)
15
14
  multi_xml (>= 0.5.2)
16
- jaro_winkler (1.5.2)
17
15
  json (2.2.0)
18
16
  mime-types (3.2.2)
19
17
  mime-types-data (~> 3.2015)
20
18
  mime-types-data (3.2018.0812)
21
19
  multi_xml (0.6.0)
22
- parallel (1.14.0)
23
- parser (2.6.0.0)
24
- ast (~> 2.4.0)
25
- powerpack (0.1.2)
26
- psych (3.1.0)
27
- rainbow (3.0.0)
28
20
  rake (10.5.0)
29
21
  rspec (3.8.0)
30
22
  rspec-core (~> 3.8.0)
@@ -39,17 +31,6 @@ GEM
39
31
  diff-lcs (>= 1.2.0, < 2.0)
40
32
  rspec-support (~> 3.8.0)
41
33
  rspec-support (3.8.0)
42
- rubocop (0.65.0)
43
- jaro_winkler (~> 1.5.1)
44
- parallel (~> 1.10)
45
- parser (>= 2.5, != 2.5.1.1)
46
- powerpack (~> 0.1)
47
- psych (>= 3.1.0)
48
- rainbow (>= 2.2.2, < 4.0)
49
- ruby-progressbar (~> 1.7)
50
- unicode-display_width (~> 1.4.0)
51
- ruby-progressbar (1.10.0)
52
- unicode-display_width (1.4.1)
53
34
 
54
35
  PLATFORMS
55
36
  x64-mingw32
@@ -59,7 +40,6 @@ DEPENDENCIES
59
40
  bundler (~> 1.17)
60
41
  rake (~> 10.0)
61
42
  rspec (~> 3.0)
62
- rubocop (~> 0.65.0)
63
43
 
64
44
  BUNDLED WITH
65
45
  1.17.2
data/README.md CHANGED
@@ -1,17 +1,54 @@
1
1
  # Anilistrb
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/Anilistrb.svg)](https://badge.fury.io/rb/Anilistrb)
4
+ ![Gem](https://img.shields.io/gem/dt/Anilistrb.svg)
5
+ ![GitHub](https://img.shields.io/github/license/barrettotte/Anilist-Ruby.svg)
6
+ ![GitHub repo size in bytes](https://img.shields.io/github/repo-size/barrettotte/Anilist-Ruby.svg)
7
+
3
8
  A simple API wrapper for AniList's GraphQL APIv2
4
9
 
5
10
  This is a small side project for a practical introduction to both Ruby and GraphQL,
6
11
  so its not perfect
7
12
 
8
- Also learned some of the basics of Rubocop, Rspec, Rake
13
+ Also learned some of the basics of Rubocop, Rspec, Rake, Ruby metaprogramming, and publishing a ruby gem
9
14
 
10
15
 
11
16
  ## Installation
12
- * Put in gemfile: ```gem 'Anilistrb```
13
- * Execute: ```$ bundle```
14
- * or manually ```$ gem install Anilistrb```
17
+ * https://rubygems.org/gems/Anilistrb
18
+ * Put in gemfile: ```gem Anilistrb```
19
+ * Execute: ```bundle```
20
+ * or manually ```gem install Anilistrb```
21
+ * Update ```gem update Anilistrb```
22
+
23
+ ## Usage
24
+ ``` ruby
25
+ require 'Anilistrb/Client'
26
+
27
+ client = Anilistrb::Client.new
28
+ anime = client.search_anime('Konosuba')
29
+ puts anime
30
+ # [ANIME] 21202 - {
31
+ # "romaji"=>"Kono Subarashii Sekai ni Shukufuku wo!",
32
+ # "english"=>"KONOSUBA -God's blessing on this wonderful world!",
33
+ # "native"=>"この素晴らしい世界に祝福を!" }
34
+
35
+ p anime.attributes # ["id", "title", "type", "format", "status", "description", "start_date", "end_date", "season", ... ]
36
+
37
+ puts anime.data # Raw request data as a hash
38
+
39
+ user = client.search_user('barrettotte')
40
+ puts user # [USER] 247578 - barrettotte
41
+
42
+ list = client.get_animelist(247578)
43
+ puts list
44
+ # ANIME list for [USER] 247578 - barrettotte
45
+ # Completed: 244 item(s)
46
+ # Current: 9 item(s)
47
+ # Dropped: 1 item(s)
48
+ # Paused: 0 item(s)
49
+ # Planning: 284 item(s)
50
+ # Repeating: 0 item(s)
51
+ ```
15
52
 
16
53
 
17
54
  ## API Wrapper - https://graphql.anilist.co
@@ -32,22 +69,11 @@ Also learned some of the basics of Rubocop, Rspec, Rake
32
69
  * ```rake spec``` run tests
33
70
  * ```bundle exec rake install``` install locally
34
71
 
72
+
35
73
  ## Building/Publishing
36
74
  * commit + push all changes
37
75
  * ```gem build Anilistrb.gemspec```
38
- * ```gem push Anilistrb-0.1.0.gem```
39
-
40
- ## To Do
41
- - [x] GraphQL Client and basic get_media(id)
42
- - [x] Rubocop, Unit tests
43
- - [x] All get by id functions
44
- - [x] All search functions
45
- - [x] Test gem usage in a simple program
46
- - [x] Documentation
47
- - [x] Publish gem
48
-
49
- ## Scrapped out of laziness
50
- * Dockerize, GitLab CI/CD
76
+ * ```gem push Anilistrb-x.x.x.gem```
51
77
 
52
78
 
53
79
  ## Sources
@@ -0,0 +1,4 @@
1
+ FROM ruby:2.6.1-alpine3.8
2
+
3
+ COPY myapp.rb /app
4
+ RUN gem install Anilistrb && ruby myapp.rb
@@ -2,4 +2,9 @@ require 'Anilistrb/Client'
2
2
 
3
3
  client = Anilistrb::Client.new
4
4
  anime = client.search_anime('Konosuba')
5
- puts anime
5
+ #puts anime
6
+ #puts anime.attributes
7
+ user = client.search_user('barrettotte')
8
+ #puts user
9
+ list = client.get_animelist(247578)
10
+ puts list
@@ -1,3 +1,3 @@
1
1
  module Anilistrb
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Anilistrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - barrettotte
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
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.65.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.65.0
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: httparty
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -101,7 +87,6 @@ executables: []
101
87
  extensions: []
102
88
  extra_rdoc_files: []
103
89
  files:
104
- - ".dockerfile"
105
90
  - ".gitignore"
106
91
  - ".gitlab-ci.yml"
107
92
  - ".rspec"
@@ -121,6 +106,7 @@ files:
121
106
  - dev/animelist.json
122
107
  - dev/run.bat
123
108
  - dev/test.bat
109
+ - example/.dockerfile
124
110
  - example/install.bat
125
111
  - example/myapp.bat
126
112
  - example/myapp.rb
@@ -1 +0,0 @@
1
- FROM ruby:2.6.1-alpine3.8