metal_archives 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -21
- data/lib/metal_archives.rb +2 -0
- data/lib/metal_archives/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3de990935b078060383b45f512b4c154a67714366af214c524925040fb95cb7b
|
4
|
+
data.tar.gz: ff36ec2f5b1e5ab7bbe4c2e4593246d02f2bc780253bb9f247b5912fda8ef397
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e4ceef2436f5d44f56979a9e0ecd399e5ddd61aea837e66e38cd48938ae71ccba32ed182b56bf75e8cbce29ee458443a97174b4fb93af808a0c42450868b9e1
|
7
|
+
data.tar.gz: 75596c0feb38577c65a2e64279415a1c8510bb97b1cbb7cf722dd2ac7973e4050e65dfd1238b198519e4696a249ae12de121af7927243f1092cf6331e0dd566b
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ MetalArchives is a Ruby API that transparently wraps, caches and normalizes the
|
|
7
7
|
Add this line to your application's Gemfile.
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem "metal_archives"
|
10
|
+
gem "metal_archives"
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
@@ -29,19 +29,12 @@ Configure MetalArchives before using it:
|
|
29
29
|
```ruby
|
30
30
|
MetalArchives.configure do |c|
|
31
31
|
## Application identity (required)
|
32
|
-
c.app_name =
|
33
|
-
c.app_version =
|
34
|
-
c.app_contact =
|
35
|
-
|
36
|
-
## Request throttling (optional, overrides defaults)
|
37
|
-
c.request_rate = 1
|
38
|
-
c.request_timeout = 3
|
39
|
-
|
40
|
-
## Connect additional Faraday middleware
|
41
|
-
# c.middleware = [MyMiddleware, MyOtherMiddleware]
|
32
|
+
c.app_name = "My App"
|
33
|
+
c.app_version = "1.0"
|
34
|
+
c.app_contact = "support@mymusicapp.com"
|
42
35
|
|
43
36
|
## Custom cache size per object class (optional, overrides defaults)
|
44
|
-
c.cache_size = 100
|
37
|
+
# c.cache_size = 100
|
45
38
|
|
46
39
|
## Metal Archives endpoint (optional, overrides default)
|
47
40
|
# c.endpoint = "https://www.metal-archives.com/"
|
@@ -49,7 +42,7 @@ MetalArchives.configure do |c|
|
|
49
42
|
# c.endpoint_password = "my_password"
|
50
43
|
|
51
44
|
## Custom logger (optional)
|
52
|
-
c.logger = Logger.new File.new(
|
45
|
+
c.logger = Logger.new File.new("metal_archives.log")
|
53
46
|
c.logger.level = Logger::INFO
|
54
47
|
end
|
55
48
|
```
|
@@ -57,24 +50,24 @@ end
|
|
57
50
|
## Usage
|
58
51
|
|
59
52
|
```ruby
|
60
|
-
require
|
53
|
+
require "metal_archives"
|
61
54
|
|
62
55
|
# Search for bands
|
63
|
-
@alquimia_list = MetalArchives::Band.search(
|
56
|
+
@alquimia_list = MetalArchives::Band.search("Alquimia")
|
64
57
|
|
65
58
|
# Find bands by name
|
66
|
-
@iron_maiden = MetalArchives::Band.find_by(:name =>
|
59
|
+
@iron_maiden = MetalArchives::Band.find_by(:name => "Iron Maiden")
|
67
60
|
|
68
61
|
# Find bands by attributes
|
69
|
-
require
|
62
|
+
require "countries"
|
70
63
|
|
71
|
-
@bands_in_belgium = MetalArchives::Band.search_by :country => ISO3166::Country[
|
64
|
+
@bands_in_belgium = MetalArchives::Band.search_by :country => ISO3166::Country["BE"]
|
72
65
|
@bands_formed_in_1990 = MetalArchives::Band.search_by :year => Range.new(Date.new(1990))
|
73
66
|
|
74
|
-
# Metal Archives
|
67
|
+
# Metal Archives" usual tips apply
|
75
68
|
|
76
|
-
@bands_containing_hell = MetalArchives::Band.search_by :name =>
|
77
|
-
@non_melodic_death_bands = MetalArchives::Band.search_by :genre =>
|
69
|
+
@bands_containing_hell = MetalArchives::Band.search_by :name => "*hell*"
|
70
|
+
@non_melodic_death_bands = MetalArchives::Band.search_by :genre => "death -melodic"
|
78
71
|
|
79
72
|
# Methods returning multiple results return a MetalArchives::Collection.
|
80
73
|
# Collection wraps a paginated resource, and can be used to iterate over huge queries.
|
data/lib/metal_archives.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metal_archives
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Dejonckheere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: countries
|