laziness 0.1.1 → 0.1.3

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: 7a0495706602ff2301896d5baa8be859fed5f039
4
- data.tar.gz: 39deb029bfb4984b0c6c2115cae9d8bf525355b0
3
+ metadata.gz: f0de21632ae16b077bc175fec281de93eb1ed6a5
4
+ data.tar.gz: ac123e7b8d889a6e6d046dcd7fb901177d32157b
5
5
  SHA512:
6
- metadata.gz: c9124be8a72521234be07245c84058b74a894486c68cae645ddf11ea40fcc5dc495b10d85c37a9d0e8dd662a422557cead160aa3bdd7ec8a559ad1242a318631
7
- data.tar.gz: 9e544b01fe43ae2456f3008027348fb5a02be3a3b04088ddf899a220805bc78a3aea2ffbf59171754316ebb8b1a3cfa9b7900f06dfcacdc7ec329a3b115b3a28
6
+ metadata.gz: 6adc63b530bd9151372230a526a9a69a5ef8bfeebad95085142cb47a4c4dfecfb9453809cfef7c5c94dd94061284c0ec4ae2d1492d5ff549c5ad85e82a6e3eab
7
+ data.tar.gz: 24148d3b129546de9909e8ca74060c43f36e5b3b64a798aa56d3fbd2cf4deeea1a86d00aa4d48aa52cbd0c27fb36fade143e5abe438dd55755c38dc8e07d12ed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- laziness (0.1.1)
4
+ laziness (0.1.3)
5
5
  hashie
6
6
  httparty
7
7
 
@@ -12,11 +12,11 @@ GEM
12
12
  crack (0.4.2)
13
13
  safe_yaml (~> 1.0.0)
14
14
  diff-lcs (1.2.5)
15
- hashie (3.3.2)
15
+ hashie (3.4.1)
16
16
  httparty (0.13.3)
17
17
  json (~> 1.8)
18
18
  multi_xml (>= 0.5.2)
19
- json (1.8.1)
19
+ json (1.8.2)
20
20
  multi_xml (0.5.5)
21
21
  rake (10.3.2)
22
22
  rspec (3.1.0)
data/README.md CHANGED
@@ -67,7 +67,9 @@ client.channels.invite(channel_id, user_id) # invites the specific user to the s
67
67
 
68
68
  ### IM
69
69
 
70
- ### OAuth
70
+ ### Auth
71
+
72
+ client.auth.test # get info about a specific oauth token
71
73
 
72
74
  ### Presence
73
75
 
@@ -0,0 +1,10 @@
1
+ module Slack
2
+ module API
3
+ class Auth < Base
4
+ def test
5
+ response = request :get, access_token, 'auth.test'
6
+ Slack::Auth.parse response
7
+ end
8
+ end
9
+ end
10
+ end
data/lib/laziness/api.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'httparty'
2
2
 
3
3
  require 'laziness/api/base'
4
+ require 'laziness/api/auth'
4
5
  require 'laziness/api/channels'
5
6
  require 'laziness/api/users'
@@ -0,0 +1,4 @@
1
+ module Slack
2
+ class Auth < Base
3
+ end
4
+ end
@@ -6,6 +6,10 @@ module Slack
6
6
  @access_token = access_token
7
7
  end
8
8
 
9
+ def auth
10
+ @auth ||= Slack::API::Auth.new(access_token)
11
+ end
12
+
9
13
  def users
10
14
  @users ||= Slack::API::Users.new(access_token)
11
15
  end
@@ -1,3 +1,3 @@
1
1
  module Slack
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/laziness.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'laziness/version'
2
2
  require 'laziness/api'
3
3
  require 'laziness/base'
4
+ require 'laziness/auth'
4
5
  require 'laziness/channel'
5
6
  require 'laziness/client'
6
7
  require 'laziness/errors'
@@ -0,0 +1,13 @@
1
+ describe Slack::API::Auth do
2
+ let(:access_token) { "12345" }
3
+ subject { Slack::API::Auth.new access_token }
4
+
5
+ describe '.test' do
6
+ it 'returns the status of the authentication token' do
7
+ stub_slack_request :get, "auth.test?token=#{access_token}", 'auth_test.json'
8
+
9
+ auth = subject.test
10
+ expect(auth.ok).to eq true
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,8 @@
1
+ {
2
+ "ok": true,
3
+ "url": "https:\/\/tour.slack.com\/",
4
+ "team": "tour",
5
+ "user": "jimmy",
6
+ "team_id": "T024BLAH",
7
+ "user_id": "U024BLAH"
8
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: laziness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Wright
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-10 00:00:00.000000000 Z
11
+ date: 2015-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -57,20 +57,24 @@ files:
57
57
  - laziness.gemspec
58
58
  - lib/laziness.rb
59
59
  - lib/laziness/api.rb
60
+ - lib/laziness/api/auth.rb
60
61
  - lib/laziness/api/base.rb
61
62
  - lib/laziness/api/channels.rb
62
63
  - lib/laziness/api/users.rb
64
+ - lib/laziness/auth.rb
63
65
  - lib/laziness/base.rb
64
66
  - lib/laziness/channel.rb
65
67
  - lib/laziness/client.rb
66
68
  - lib/laziness/errors.rb
67
69
  - lib/laziness/user.rb
68
70
  - lib/laziness/version.rb
71
+ - spec/laziness/api/auth_spec.rb
69
72
  - spec/laziness/api/channels_spec.rb
70
73
  - spec/laziness/api/users_spec.rb
71
74
  - spec/laziness/client_spec.rb
72
75
  - spec/laziness/errors_spec.rb
73
76
  - spec/spec_helper.rb
77
+ - spec/support/fixtures/auth_test.json
74
78
  - spec/support/fixtures/channels_info.json
75
79
  - spec/support/fixtures/channels_list.json
76
80
  - spec/support/fixtures/successful_response.json
@@ -102,11 +106,13 @@ signing_key:
102
106
  specification_version: 4
103
107
  summary: A Slack API wrapper written in Ruby.
104
108
  test_files:
109
+ - spec/laziness/api/auth_spec.rb
105
110
  - spec/laziness/api/channels_spec.rb
106
111
  - spec/laziness/api/users_spec.rb
107
112
  - spec/laziness/client_spec.rb
108
113
  - spec/laziness/errors_spec.rb
109
114
  - spec/spec_helper.rb
115
+ - spec/support/fixtures/auth_test.json
110
116
  - spec/support/fixtures/channels_info.json
111
117
  - spec/support/fixtures/channels_list.json
112
118
  - spec/support/fixtures/successful_response.json