yoxruby 0.1.0 → 0.2.0

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
  SHA1:
3
- metadata.gz: 3aa6331a0baad6e94d1ab3e566b8a5a3268b52c3
4
- data.tar.gz: d5e9063a000a70792f641056dde058db7161b169
3
+ metadata.gz: 39623b479e0639a4f1ce8c0ee2f4fcc75812f5c5
4
+ data.tar.gz: 6d56df3d16fdbf1ef8acefde6127d9e8addd8f46
5
5
  SHA512:
6
- metadata.gz: 0ee609dc8c63fa610343d9e8e6ef5656fd98760a30174203cbaab2c4eb2108af80e4951a66b9ffe551dfbb1cf66bcd9003287ab2e705ad0819356a7b9a5bcedd
7
- data.tar.gz: 61a4d71fbfcd97754d17b62f171e685f5e939c817e73978902c295e29657a67123f17517f207cf0ae5bc7d8487ba09a4d6c1e99464d9e9861e50e3fcd231d02c
6
+ metadata.gz: 91232f9f230f45441d07789af5d09d4cbe39b743b3cdc74455a775a938f1f6ae200f8965ef3404c069f88706e47196d7efb399df5022f85af85991f519bda3fa
7
+ data.tar.gz: a57850e57e687ba031460de3616dae2d0fd711b496a0ded8ba401fc0a9e684245f61e479f0b0aee6bf9f9d29730df12a801e50ae61fd2eb12dae80c0f91c2761
@@ -1,3 +1,3 @@
1
1
  module Yoxruby
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/yoxruby.rb CHANGED
@@ -4,7 +4,10 @@ require "json"
4
4
 
5
5
  module Yoxruby
6
6
  class Client
7
- API_BASE_URL = "http://api.justyo.co"
7
+ attr_writer :api_token, :access_token
8
+
9
+ API_BASE_URL = "https://api.justyo.co"
10
+
8
11
  def initialize(api_token=nil, access_token=nil)
9
12
  if api_token != nil
10
13
  @api_token = api_token
@@ -15,6 +18,17 @@ module Yoxruby
15
18
  @httpclient = HTTPClient.new
16
19
  end
17
20
 
21
+ def set_api_token(username, password)
22
+ url = API_BASE_URL + "/rpc/login"
23
+ res = @httpclient.post(url, {username: username, password: password})
24
+ res = JSON.parse(res.body)
25
+ token = ""
26
+ if res.has_key?('api_token')
27
+ token = res['api_token']
28
+ end
29
+ @api_token = token
30
+ end
31
+
18
32
  def yoall(**options)
19
33
  just_yo("/yoall/", options)
20
34
  end
data/yoxruby.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["horoama929@gmail.com"]
11
11
 
12
12
  spec.summary = "Simple Yo wrapper"
13
- spec.description = "Watanabe Yo x Kurosawa Ruby"
13
+ spec.description = "Simple Yo wrapper.The origin of this gem's name is Watanabe Yo x Kurosawa Ruby"
14
14
  spec.homepage = "https://github.com/horoama/yoxruby"
15
15
  spec.license = "MIT"
16
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yoxruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - horoama
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-23 00:00:00.000000000 Z
11
+ date: 2017-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,7 +66,8 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.6'
69
- description: Watanabe Yo x Kurosawa Ruby
69
+ description: Simple Yo wrapper.The origin of this gem's name is Watanabe Yo x Kurosawa
70
+ Ruby
70
71
  email:
71
72
  - horoama929@gmail.com
72
73
  executables: []