d1lcs 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5cd611d1f32c3c2d3afb013916f19475dd08e0fb
4
- data.tar.gz: 474048e7df0caa522d3b2b66fc838e5c08dcfee0
3
+ metadata.gz: c339acdf61a0ed69d61dec2ca1ea27f40dbc24f9
4
+ data.tar.gz: d48eb32147f2ce9bf01417df864e4099dd2e3d70
5
5
  SHA512:
6
- metadata.gz: 504ef35099cccda2d39622c36ca1f373b8988849531d8f714c80adecbfbf87012954303b3f702f63c2a13615d927c7f2593358a6f9252f6712d4a6d18303a5ab
7
- data.tar.gz: fca72797fcc6eacea03969cbe772e71adec94d79ab6b2373c4c93a990b4316f30c771f4bf3d3522cb38f1985d9c61963f2d8314a0b6645973282542d713bbc42
6
+ metadata.gz: 6e8c9bf2c5440903d85487888453fed485e37caa2e54192265372c29e62560de1c604358ce73c5abcb3afe2ee9b6f7551c6c87767e87a33da6970d0cf8536750
7
+ data.tar.gz: 50dee5040376a55ec308a8f05e9e1910a44a2e8a16e1d43443f9de76121edac2a507d4374186353c11efe62842536d4dc5ef40edc02d1caf33499256e33bba01
data/lib/d1lcs/element.rb CHANGED
@@ -135,7 +135,12 @@ module D1lcs
135
135
  # @return [Hash]
136
136
  def json_parse
137
137
  begin
138
- JSON.parse(open(URI.parse(CHARA_SHEET_URL % @request)).read)
138
+ open(
139
+ URI.parse(CHARA_SHEET_URL % @request),
140
+ 'User-Agent' => D1lcs::USER_AGENT
141
+ ) { |f|
142
+ JSON.parse(f.read)
143
+ }
139
144
  rescue => e
140
145
  @logger.error { ["requestID:#{@request}", e.class, e].join(' : ') }
141
146
  nil
data/lib/d1lcs/version.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  module D1lcs
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
+ USER_AGENT = "Ruby/#{RUBY_VERSION} (#{RUBY_DESCRIPTION}) d1lcs-gem/#{VERSION}"
3
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: d1lcs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - koi-chan