Hyrule-Compendium 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hyrule_compendium.rb +5 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c8ae2028d9a31146617fa11e95e440fcaf3c09deb62532cecc4285a1dabec7b
4
- data.tar.gz: a3bfce310743fe6bd4879f1e4fdadf369c87459410b6767491bbc765c19b18ed
3
+ metadata.gz: 5b2d9bbbe32c561ccf1c94fd12ade17722d271a33099bddd1a12fa322a4cd571
4
+ data.tar.gz: 2e5cee56a637f9cd13683f71d2d879809d64b67c57f44a0e8670153c10c45b21
5
5
  SHA512:
6
- metadata.gz: 49a53bd1239809009a0f74a09351b957b96498bf2c81d2ab62c4367e3d7a9a1e7bcb545450fc429c70a440d68c3e893d27666cdbe73064e40eb55fcb3ca5c9e0
7
- data.tar.gz: 136f7deafe9023707740b4e371a29bf3efe4a7d5e9807dece28db3828a65486d1df7dbeaf02856205d62289f70f3f6ee633a18bf5d34d8310c254e386ff15bf7
6
+ metadata.gz: 06d95e42274481077bf1ca024d7b309b7a3a1898111fdf456504c3bf0673afc9169bde5fe8602d3208fde48d028772a8bb8bbe1320545c0c8a99456dd01425a0
7
+ data.tar.gz: e507fb881f8edda640373e5eaf41af0d0eaf926bb3c0d3e33d1450e02e5f90417c10f26ba66b29abfeb53edacdd82d1154eea71e6831d93d8c896788f9d1913f
@@ -119,7 +119,7 @@ class Hyrule_Compendium
119
119
  return make_req @base, timeout
120
120
  end
121
121
 
122
- def download_entry_image entry, output_file, timeout=@default_timeout
122
+ def download_entry_image entry, output_file=nil, timeout=@default_timeout
123
123
  # Downloads the image of a compendium entry.
124
124
  #
125
125
  # Parameters:
@@ -127,12 +127,14 @@ class Hyrule_Compendium
127
127
  # - type: str, int
128
128
  # * `output_file`: The output file's path.
129
129
  # - type: str
130
+ # - default: entry's name with a ".png" extension with spaces replaced with underscores
130
131
  # * `timeout`: Seconds to wait for server response until raising `Net::ReadTimeout`.
131
132
  # - type: float, int
132
133
  # - default: `@default_timeout`
133
134
 
134
- open (get_entry entry, timeout)["image"] do |image|
135
- File.open output_file, "wb" do |file|
135
+ entry_data = get_entry entry, timeout
136
+ open entry_data["image"] do |image|
137
+ File.open output_file || (entry_data["name"] + ".png").gsub(" ", "_"), "wb" do |file|
136
138
  file.write image.read
137
139
  end
138
140
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Hyrule-Compendium
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aarav Borthakur