dmm-sdk-ruby 0.1.0 → 0.1.1

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dmm/core.rb +5 -5
  3. data/lib/dmm/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02c630d8b65404eedf251414cbdeadeabc7b7d24
4
- data.tar.gz: a0b9670356a2c969f8281c4ad58572ac5bf610bf
3
+ metadata.gz: 498d089db9f6f4d1e749e1024b1750da45ba4941
4
+ data.tar.gz: 22c6258106af279a0fdf2b1c26481ce0a63a30ac
5
5
  SHA512:
6
- metadata.gz: b2283571572194587ebaa0d81acecc6ce1be08f6a6a0e2c5aa0e8f57167f97f306e72b7af072210db5841c1413e6ba33c7c955d0d6b69a7169e2a985766df4a7
7
- data.tar.gz: 3bcf864a109b3a007ca739337bfa9d323f5d798444b325212ace3c3440c1bbbc0ec84fa9b790c37bd0869b9792b525b565edcdddfeb543e597c69d5501049a5e
6
+ metadata.gz: 8d919840c04141d2750d00cd85dbfaf356379e2e559d3349935e26a2f3cc9cc687bf3bded9997eede8f1aba8ecb7650cd655cee5c1b3adff87f99df64737e1ac
7
+ data.tar.gz: 65e8f2665f5269cff10dc1b28cc1381f784fea1cf338d0028798ec3fe237c18631b6126560a249b7fdf4a2cafaf8cd116e544b119927c50e5a580a451d621470
data/lib/dmm/core.rb CHANGED
@@ -1,14 +1,13 @@
1
1
  #-*- encoding: utf-8 -*-
2
2
  require 'open-uri'
3
3
  require 'rexml/document'
4
- require 'dmm/version'
5
4
 
6
5
  module Dmm
7
6
  module Configuration
8
- def initialize(api_id, affiliate_id)
7
+ def initialize(api_id=nil,affiliate_id=nil)
9
8
  @url = 'http://affiliate-api.dmm.com/'
10
- @api = api_id
11
- @id = affiliate_id
9
+ @api = api_id.nil? ? 'edu1FFKxWMqbHxf1fZFH' : api_id
10
+ @id = affiliate_id.nil? ? 'penix' : affiliate_id
12
11
  @site = 'DMM.co.jp'
13
12
  @version = '2.00'
14
13
  puts 'initialize ok!!'
@@ -27,6 +26,7 @@ module Dmm
27
26
  def keyword(word, options = {:service => nil, :floor => nil, :hits => 20, :offset => 1, :sort => 'rank'})
28
27
  uri = create_uri(word)
29
28
  xmlbody = get_api(uri)
29
+ xmlbody.encoding
30
30
  @xmldoc = REXML::Document.new(xmlbody)
31
31
  @hashdoc = from_xml(@xmldoc)
32
32
  @hashdoc
@@ -132,7 +132,7 @@ module Dmm
132
132
  end
133
133
 
134
134
  end
135
- xml
135
+ xml.force_encoding("utf-8")
136
136
  end
137
137
 
138
138
  #rexml
data/lib/dmm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dmm
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dmm-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sutoh