esa 0.0.4 → 0.0.5

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: 2b50bf1ea2984c2e282f9b7afc4f0f1927f91f3e
4
- data.tar.gz: 219f7cd0de527986a35c0e5374f5d962a0a80e56
3
+ metadata.gz: 30cc49fd90d3c354de6a2df5859e965db3cb2d3e
4
+ data.tar.gz: 6173bc7cab772617c3f975440e328dc64a903993
5
5
  SHA512:
6
- metadata.gz: 3f588ce3f76712777c9d44e0463a1578dd782c441e32a59fe139d88618153a1497b8e5bc08a0088350097d45abaa8bcae5e3a6506e062d9a3d52c2771ef5a4a3
7
- data.tar.gz: 2231108c9643d5043fe135e53e9c939e7fec636bfcc934c4422f4dc6cfa85212165b492c19afe2bc337a0a00608c57fab78dd0dab21f9734c0a1316a15d4ff2a
6
+ metadata.gz: 14401b1a726694c1ab69dd3f22f5516457a3db14b74a283975b26263ae78cccaa42283fca5bdaf0ac0fc862dc6535504b12378c2a5b5d8c528e99dba9610321a
7
+ data.tar.gz: 2f7a659405b4f535b339885c76ff2cf7d0545386ac4963a3a10b870143d5639012882e0cdf35ea6fc967db1972df8cb843f93ef5a6d60d18d53df3251ec925e4
data/CHANGELOG.md CHANGED
@@ -1,2 +1,5 @@
1
+ ## 0.0.5 (2015-05-21)
2
+ - [Use current_team! instead of current_team by fukayatsu · Pull Request #8 · esaio/esa-ruby](https://github.com/esaio/esa-ruby/pull/8)
3
+
1
4
  ## 0.0.4 (2015-05-14)
2
5
  - [Fix Esa::Response#headers and implement its spec by yasaichi · Pull Request #7 · esaio/esa-ruby](https://github.com/esaio/esa-ruby/pull/7)
data/README.md CHANGED
@@ -31,6 +31,9 @@ client.team('bar')
31
31
  client.posts
32
32
  #=> GET /v1/teams/foo/posts
33
33
 
34
+ client.posts(q: 'in:help')
35
+ #=> GET /v1/teams/docs/posts?q=in%3Ahelp
36
+
34
37
  client.current_team = 'foobar'
35
38
  client.post(1)
36
39
  #=> GET /v1/teams/foobar/posts/1
@@ -9,23 +9,23 @@ module Esa
9
9
  end
10
10
 
11
11
  def posts(params = nil, headers = nil)
12
- send_get("/v1/teams/#{current_team}/posts", params, headers)
12
+ send_get("/v1/teams/#{current_team!}/posts", params, headers)
13
13
  end
14
14
 
15
15
  def post(number, params = nil, headers = nil)
16
- send_get("/v1/teams/#{current_team}/posts/#{number}", params, headers)
16
+ send_get("/v1/teams/#{current_team!}/posts/#{number}", params, headers)
17
17
  end
18
18
 
19
19
  def create_post(params = nil, headers = nil)
20
- send_post("/v1/teams/#{current_team}/posts", wrap(params, :post), headers)
20
+ send_post("/v1/teams/#{current_team!}/posts", wrap(params, :post), headers)
21
21
  end
22
22
 
23
23
  def update_post(number, params = nil, headers = nil)
24
- send_patch("/v1/teams/#{current_team}/posts/#{number}", wrap(params, :post), headers)
24
+ send_patch("/v1/teams/#{current_team!}/posts/#{number}", wrap(params, :post), headers)
25
25
  end
26
26
 
27
27
  def delete_post(number, params = nil, headers = nil)
28
- send_delete("/v1/teams/#{current_team}/posts/#{number}", params, headers)
28
+ send_delete("/v1/teams/#{current_team!}/posts/#{number}", params, headers)
29
29
  end
30
30
 
31
31
  private
data/lib/esa/client.rb CHANGED
@@ -11,11 +11,11 @@ module Esa
11
11
  @api_endpoint = api_endpoint
12
12
  @current_team = current_team
13
13
  end
14
- attr_writer :current_team
14
+ attr_accessor :current_team
15
15
 
16
- def current_team
16
+ def current_team!
17
17
  raise TeamNotSpecifiedError, "current_team is not specified" unless @current_team
18
- @current_team
18
+ current_team
19
19
  end
20
20
 
21
21
  def send_get(path, params = nil, headers = nil)
@@ -56,7 +56,6 @@ module Esa
56
56
  {
57
57
  url: faraday_url,
58
58
  headers: faraday_headers,
59
- # ssl: { verify: !!faraday_url.match(/^https:\/\//) },
60
59
  }
61
60
  end
62
61
 
data/lib/esa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Esa
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -13,11 +13,11 @@ RSpec.describe Esa::Client do
13
13
  end
14
14
  subject(:client) { described_class.new(options) }
15
15
 
16
- describe "#current_team" do
16
+ describe "#current_team!" do
17
17
  context 'team not specified' do
18
18
  it 'raise error' do
19
19
  expect do
20
- client.current_team
20
+ client.current_team!
21
21
  end.to raise_error Esa::TeamNotSpecifiedError
22
22
  end
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - fukayatsu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-13 00:00:00.000000000 Z
11
+ date: 2015-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday