layabout 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +8 -0
  6. data/Gemfile.lock +63 -0
  7. data/LICENSE +22 -0
  8. data/README.md +18 -0
  9. data/layabout.gemspec +26 -0
  10. data/lib/layabout/auth_test.rb +35 -0
  11. data/lib/layabout/channels.rb +82 -0
  12. data/lib/layabout/chat.rb +67 -0
  13. data/lib/layabout/delete_chat.rb +48 -0
  14. data/lib/layabout/file_list.rb +58 -0
  15. data/lib/layabout/file_upload.rb +73 -0
  16. data/lib/layabout/helpers.rb +21 -0
  17. data/lib/layabout/incoming_webhook.rb +41 -0
  18. data/lib/layabout/slack/channel.rb +32 -0
  19. data/lib/layabout/slack/file.rb +56 -0
  20. data/lib/layabout/slack_response.rb +37 -0
  21. data/lib/layabout/version.rb +3 -0
  22. data/lib/layabout.rb +29 -0
  23. data/spec/fixtures/upload_test.txt +1 -0
  24. data/spec/fixtures/vcr_cassettes/Layabout/_channels/returns_a_list_of_channels.yml +125 -0
  25. data/spec/fixtures/vcr_cassettes/Layabout/_say/posts_a_message.yml +54 -0
  26. data/spec/fixtures/vcr_cassettes/Layabout/_upload/uploads_a_file.yml +65 -0
  27. data/spec/fixtures/vcr_cassettes/Layabout_AuthTest/_get/tests_auth.yml +146 -0
  28. data/spec/fixtures/vcr_cassettes/Layabout_Channels/_info/returns_a_Layabout_Slack_Channel.yml +96 -0
  29. data/spec/fixtures/vcr_cassettes/Layabout_Channels/_join/returns_a_success_response.yml +95 -0
  30. data/spec/fixtures/vcr_cassettes/Layabout_Channels/_leave/returns_a_success_response.yml +95 -0
  31. data/spec/fixtures/vcr_cassettes/Layabout_Channels/_list/returns_a_list_of_Layabout_Slack_Channel.yml +105 -0
  32. data/spec/fixtures/vcr_cassettes/Layabout_Chat/_post/submits_a_message.yml +95 -0
  33. data/spec/fixtures/vcr_cassettes/Layabout_DeleteChat/_delete/deletes_the_message.yml +146 -0
  34. data/spec/fixtures/vcr_cassettes/Layabout_FileList/_list/returns_a_list_of_Layabout_Slack_File.yml +57 -0
  35. data/spec/fixtures/vcr_cassettes/Layabout_FileUpload/_upload/uploads_a_file.yml +65 -0
  36. data/spec/fixtures/vcr_cassettes/Layabout_IncomingWebhook/_post/submits_a_message.yml +44 -0
  37. data/spec/layabout/auth_test_spec.rb +12 -0
  38. data/spec/layabout/channels_spec.rb +29 -0
  39. data/spec/layabout/chat_spec.rb +12 -0
  40. data/spec/layabout/configuration_spec.rb +15 -0
  41. data/spec/layabout/delete_chat_spec.rb +13 -0
  42. data/spec/layabout/file_list_spec.rb +11 -0
  43. data/spec/layabout/file_upload_spec.rb +12 -0
  44. data/spec/layabout/incoming_webhook_spec.rb +18 -0
  45. data/spec/layabout/layabout_spec.rb +23 -0
  46. data/spec/spec_helper.rb +95 -0
  47. metadata +217 -0
@@ -0,0 +1,37 @@
1
+ require 'json'
2
+
3
+ module Layabout
4
+ class SlackResponse
5
+ attr_reader :http_response
6
+
7
+ def initialize(http_response)
8
+ @http_response = http_response
9
+ end
10
+
11
+ def success?
12
+ http_response.code == 200 && is_ok?
13
+ end
14
+
15
+ def error?
16
+ !success?
17
+ end
18
+
19
+ def body
20
+ json_returned? ? JSON.parse(http_response.body) : http_response.body
21
+ end
22
+
23
+ def [](key)
24
+ body.fetch(key)
25
+ end
26
+
27
+ private
28
+
29
+ def is_ok?
30
+ json_returned? ? body['ok'] == true : body == 'ok'
31
+ end
32
+
33
+ def json_returned?
34
+ http_response.headers['content-type'] == "application/json; charset=utf-8"
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,3 @@
1
+ module Layabout
2
+ VERSION = '0.0.1'
3
+ end
data/lib/layabout.rb ADDED
@@ -0,0 +1,29 @@
1
+ require 'uri'
2
+ require 'httpi'
3
+ require_relative 'layabout/slack_response.rb'
4
+ require_relative 'layabout/helpers'
5
+
6
+ module Layabout
7
+ extend self
8
+ extend ::Layabout::Helpers
9
+
10
+ def self.configure &block
11
+ yield configuration
12
+ end
13
+
14
+ def self.configuration
15
+ @configuration ||= Configuration.new
16
+ end
17
+
18
+ class Configuration
19
+ attr_accessor :token, :team
20
+
21
+ def valid?
22
+ !!team
23
+ end
24
+
25
+ def domain
26
+ URI.parse("https://#{team}.slack.com/")
27
+ end
28
+ end
29
+ end
@@ -0,0 +1 @@
1
+ Hello world
@@ -0,0 +1,125 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://isotope11.slack.com/api/channels.list?token=xoxp-2223009426-2222616703-2700726491-4a3e8d
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Access-Control-Allow-Origin:
22
+ - "*"
23
+ Cache-Control:
24
+ - private, no-cache, no-store, must-revalidate
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Date:
28
+ - Fri, 26 Sep 2014 12:32:33 GMT
29
+ Expires:
30
+ - Mon, 26 Jul 1997 05:00:00 GMT
31
+ Pragma:
32
+ - no-cache
33
+ Server:
34
+ - Apache
35
+ Strict-Transport-Security:
36
+ - max-age=31536000; includeSubDomains
37
+ Vary:
38
+ - Accept-Encoding
39
+ X-Accepted-Oauth-Scopes:
40
+ - read
41
+ X-Oauth-Scopes:
42
+ - identify,read,post,client
43
+ X-Xss-Protection:
44
+ - '0'
45
+ Content-Length:
46
+ - '1201'
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"ok":true,"channels":[{"id":"C029N15A8","name":"affa_tracker","is_channel":true,"created":1399390760,"creator":"U026LNDQB","is_archived":false,"is_general":false,"is_member":false,"members":["U026K09CL","U026K0CLC","U026K13DU","U026LNDQB"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"To
52
+ discuss the development of the Affa Tracker app","creator":"U026LNDQB","last_set":"1399390761"},"num_members":4},{"id":"C026JMBBH","name":"aiua","is_channel":true,"created":1395068252,"creator":"U026JJ4LP","is_archived":false,"is_general":false,"is_member":false,"members":["U026JJBGB","U026JL37B","U026K09CL","U02K9RJTP"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":4},{"id":"C02HN6TPJ","name":"chromium","is_channel":true,"created":1409343386,"creator":"U026JJ2HH","is_archived":false,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":0},{"id":"C029H63H1","name":"colon-ade","is_channel":true,"created":1399038936,"creator":"U026K0CLC","is_archived":false,"is_general":false,"is_member":false,"members":["U026K09CL","U026K0CLC","U026LNDQB"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":3},{"id":"C02D52S06","name":"elixir","is_channel":true,"created":1404914328,"creator":"U02CB4HEZ","is_archived":false,"is_general":false,"is_member":false,"members":["U026K09CL","U02CB4HEZ"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"Discuss
53
+ all things Erlang\/Elixir","creator":"U02CB4HEZ","last_set":"1404914328"},"num_members":2},{"id":"C026K09CQ","name":"general","is_channel":true,"created":1395065128,"creator":"U026K09CL","is_archived":false,"is_general":true,"is_member":true,"members":["U026JJ2HH","U026JJ2UV","U026JJ4LP","U026JJBGB","U026JL37B","U026K09CL","U026K0CLC","U026K13DU","U026LNDQB","U02C6FSCT","U02CB4HEZ","U02HKC6LR","U02K9RJTP"],"topic":{"value":"work-related
54
+ gifs, and curse words","creator":"U026JL37B","last_set":"1400785091"},"purpose":{"value":"The
55
+ #general channel is for team-wide communication and announcements. All team
56
+ members are in this channel.","creator":"","last_set":"0"},"num_members":12},{"id":"C026M741S","name":"jenkins","is_channel":true,"created":1395152901,"creator":"U026JJ4LP","is_archived":true,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"Build
57
+ Notifications","creator":"U026JJ4LP","last_set":"1395152901"},"num_members":0},{"id":"C026JJD8R","name":"learningearnings","is_channel":true,"created":1395065397,"creator":"U026JJ2UV","is_archived":false,"is_general":false,"is_member":false,"members":["U026JJ2UV","U026JL37B","U026K09CL","U026K0CLC","U02K9RJTP","U02LYDWK7"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":5},{"id":"C026JJ985","name":"paves","is_channel":true,"created":1395065313,"creator":"U026K09CL","is_archived":false,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"Discussion
58
+ around the PAVES app","creator":"U026K09CL","last_set":"1395065313"},"num_members":0},{"id":"C026K09CS","name":"random","is_channel":true,"created":1395065128,"creator":"U026K09CL","is_archived":false,"is_general":false,"is_member":true,"members":["U026JJ2UV","U026JJ4LP","U026JL37B","U026K09CL","U026K0CLC","U026K13DU","U02C6FSCT","U02CB4HEZ","U02HKC6LR","U02K9RJTP"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"A
59
+ place for non-work banter, links, articles of interest, humor or anything
60
+ else which you''d like concentrated in some place other than work-related
61
+ channels.","creator":"","last_set":"0"},"num_members":9},{"id":"C02908AHG","name":"reactjs","is_channel":true,"created":1397765758,"creator":"U026JJ2HH","is_archived":false,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":0},{"id":"C026VKGP7","name":"ruby","is_channel":true,"created":1395427609,"creator":"U026JJ2HH","is_archived":false,"is_general":false,"is_member":true,"members":["U026JJ4LP"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":1},{"id":"C02C76XRU","name":"shipt","is_channel":true,"created":1403638591,"creator":"U026JJBGB","is_archived":false,"is_general":false,"is_member":true,"members":["U026JJ4LP","U026JJBGB","U026JL37B","U026K09CL","U026K0CLC","U026LNDQB","U02C6FSCT","U02CB4HEZ","U02JX3FAF","U02K9RJTP"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":10},{"id":"C02M1SJHD","name":"solar_universe","is_channel":true,"created":1411691906,"creator":"U026K09CL","is_archived":false,"is_general":false,"is_member":true,"members":["U026JJ4LP","U026K09CL"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":2},{"id":"C029SAZ49","name":"squad","is_channel":true,"created":1399648710,"creator":"U026K0CLC","is_archived":false,"is_general":false,"is_member":false,"members":["U026K09CL","U026K0CLC","U026LNDQB"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":3},{"id":"C0294CFTJ","name":"starcraft","is_channel":true,"created":1398180301,"creator":"U026JL37B","is_archived":false,"is_general":false,"is_member":false,"members":["U026JL37B","U026K09CL","U026K0CLC"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":3},{"id":"C02DUCS9W","name":"uspto","is_channel":true,"created":1405694325,"creator":"U026K09CL","is_archived":false,"is_general":false,"is_member":false,"members":["U026JJ2HH","U026K09CL","U026K0CLC","U02K9RJTP"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":4},{"id":"C027LH86G","name":"vim","is_channel":true,"created":1396289943,"creator":"U026JJ2HH","is_archived":false,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":0},{"id":"C028ZJFRX","name":"_freenode","is_channel":true,"created":1397766131,"creator":"U026JJ2HH","is_archived":false,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":0}]}'
62
+ http_version:
63
+ recorded_at: Fri, 26 Sep 2014 12:32:33 GMT
64
+ - request:
65
+ method: get
66
+ uri: https://isotope11.slack.com/api/channels.list?token=xoxp-2223009426-2222616703-2700726491-4a3e8d
67
+ body:
68
+ encoding: US-ASCII
69
+ string: ''
70
+ headers:
71
+ Accept-Encoding:
72
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
73
+ Accept:
74
+ - "*/*"
75
+ User-Agent:
76
+ - Ruby
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ Access-Control-Allow-Origin:
83
+ - "*"
84
+ Cache-Control:
85
+ - private, no-cache, no-store, must-revalidate
86
+ Content-Type:
87
+ - application/json; charset=utf-8
88
+ Date:
89
+ - Fri, 26 Sep 2014 12:32:33 GMT
90
+ Expires:
91
+ - Mon, 26 Jul 1997 05:00:00 GMT
92
+ Pragma:
93
+ - no-cache
94
+ Server:
95
+ - Apache
96
+ Strict-Transport-Security:
97
+ - max-age=31536000; includeSubDomains
98
+ Vary:
99
+ - Accept-Encoding
100
+ X-Accepted-Oauth-Scopes:
101
+ - read
102
+ X-Oauth-Scopes:
103
+ - identify,read,post,client
104
+ X-Xss-Protection:
105
+ - '0'
106
+ Content-Length:
107
+ - '1201'
108
+ Connection:
109
+ - keep-alive
110
+ body:
111
+ encoding: UTF-8
112
+ string: '{"ok":true,"channels":[{"id":"C029N15A8","name":"affa_tracker","is_channel":true,"created":1399390760,"creator":"U026LNDQB","is_archived":false,"is_general":false,"is_member":false,"members":["U026K09CL","U026K0CLC","U026K13DU","U026LNDQB"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"To
113
+ discuss the development of the Affa Tracker app","creator":"U026LNDQB","last_set":"1399390761"},"num_members":4},{"id":"C026JMBBH","name":"aiua","is_channel":true,"created":1395068252,"creator":"U026JJ4LP","is_archived":false,"is_general":false,"is_member":false,"members":["U026JJBGB","U026JL37B","U026K09CL","U02K9RJTP"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":4},{"id":"C02HN6TPJ","name":"chromium","is_channel":true,"created":1409343386,"creator":"U026JJ2HH","is_archived":false,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":0},{"id":"C029H63H1","name":"colon-ade","is_channel":true,"created":1399038936,"creator":"U026K0CLC","is_archived":false,"is_general":false,"is_member":false,"members":["U026K09CL","U026K0CLC","U026LNDQB"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":3},{"id":"C02D52S06","name":"elixir","is_channel":true,"created":1404914328,"creator":"U02CB4HEZ","is_archived":false,"is_general":false,"is_member":false,"members":["U026K09CL","U02CB4HEZ"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"Discuss
114
+ all things Erlang\/Elixir","creator":"U02CB4HEZ","last_set":"1404914328"},"num_members":2},{"id":"C026K09CQ","name":"general","is_channel":true,"created":1395065128,"creator":"U026K09CL","is_archived":false,"is_general":true,"is_member":true,"members":["U026JJ2HH","U026JJ2UV","U026JJ4LP","U026JJBGB","U026JL37B","U026K09CL","U026K0CLC","U026K13DU","U026LNDQB","U02C6FSCT","U02CB4HEZ","U02HKC6LR","U02K9RJTP"],"topic":{"value":"work-related
115
+ gifs, and curse words","creator":"U026JL37B","last_set":"1400785091"},"purpose":{"value":"The
116
+ #general channel is for team-wide communication and announcements. All team
117
+ members are in this channel.","creator":"","last_set":"0"},"num_members":12},{"id":"C026M741S","name":"jenkins","is_channel":true,"created":1395152901,"creator":"U026JJ4LP","is_archived":true,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"Build
118
+ Notifications","creator":"U026JJ4LP","last_set":"1395152901"},"num_members":0},{"id":"C026JJD8R","name":"learningearnings","is_channel":true,"created":1395065397,"creator":"U026JJ2UV","is_archived":false,"is_general":false,"is_member":false,"members":["U026JJ2UV","U026JL37B","U026K09CL","U026K0CLC","U02K9RJTP","U02LYDWK7"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":5},{"id":"C026JJ985","name":"paves","is_channel":true,"created":1395065313,"creator":"U026K09CL","is_archived":false,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"Discussion
119
+ around the PAVES app","creator":"U026K09CL","last_set":"1395065313"},"num_members":0},{"id":"C026K09CS","name":"random","is_channel":true,"created":1395065128,"creator":"U026K09CL","is_archived":false,"is_general":false,"is_member":true,"members":["U026JJ2UV","U026JJ4LP","U026JL37B","U026K09CL","U026K0CLC","U026K13DU","U02C6FSCT","U02CB4HEZ","U02HKC6LR","U02K9RJTP"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"A
120
+ place for non-work banter, links, articles of interest, humor or anything
121
+ else which you''d like concentrated in some place other than work-related
122
+ channels.","creator":"","last_set":"0"},"num_members":9},{"id":"C02908AHG","name":"reactjs","is_channel":true,"created":1397765758,"creator":"U026JJ2HH","is_archived":false,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":0},{"id":"C026VKGP7","name":"ruby","is_channel":true,"created":1395427609,"creator":"U026JJ2HH","is_archived":false,"is_general":false,"is_member":true,"members":["U026JJ4LP"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":1},{"id":"C02C76XRU","name":"shipt","is_channel":true,"created":1403638591,"creator":"U026JJBGB","is_archived":false,"is_general":false,"is_member":true,"members":["U026JJ4LP","U026JJBGB","U026JL37B","U026K09CL","U026K0CLC","U026LNDQB","U02C6FSCT","U02CB4HEZ","U02JX3FAF","U02K9RJTP"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":10},{"id":"C02M1SJHD","name":"solar_universe","is_channel":true,"created":1411691906,"creator":"U026K09CL","is_archived":false,"is_general":false,"is_member":true,"members":["U026JJ4LP","U026K09CL"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":2},{"id":"C029SAZ49","name":"squad","is_channel":true,"created":1399648710,"creator":"U026K0CLC","is_archived":false,"is_general":false,"is_member":false,"members":["U026K09CL","U026K0CLC","U026LNDQB"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":3},{"id":"C0294CFTJ","name":"starcraft","is_channel":true,"created":1398180301,"creator":"U026JL37B","is_archived":false,"is_general":false,"is_member":false,"members":["U026JL37B","U026K09CL","U026K0CLC"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":3},{"id":"C02DUCS9W","name":"uspto","is_channel":true,"created":1405694325,"creator":"U026K09CL","is_archived":false,"is_general":false,"is_member":false,"members":["U026JJ2HH","U026K09CL","U026K0CLC","U02K9RJTP"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":4},{"id":"C027LH86G","name":"vim","is_channel":true,"created":1396289943,"creator":"U026JJ2HH","is_archived":false,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":0},{"id":"C028ZJFRX","name":"_freenode","is_channel":true,"created":1397766131,"creator":"U026JJ2HH","is_archived":false,"is_general":false,"is_member":false,"members":[],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"","creator":"","last_set":"0"},"num_members":0}]}'
123
+ http_version:
124
+ recorded_at: Fri, 26 Sep 2014 12:32:33 GMT
125
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://isotope11.slack.com/api/chat.postMessage?channel=C026VKGP7&text=hello&token=xoxp-2223009426-2222616703-2700726491-4a3e8d
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Access-Control-Allow-Origin:
22
+ - "*"
23
+ Cache-Control:
24
+ - private, no-cache, no-store, must-revalidate
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Date:
28
+ - Fri, 26 Sep 2014 12:32:33 GMT
29
+ Expires:
30
+ - Mon, 26 Jul 1997 05:00:00 GMT
31
+ Pragma:
32
+ - no-cache
33
+ Server:
34
+ - Apache
35
+ Strict-Transport-Security:
36
+ - max-age=31536000; includeSubDomains
37
+ Vary:
38
+ - Accept-Encoding
39
+ X-Accepted-Oauth-Scopes:
40
+ - post
41
+ X-Oauth-Scopes:
42
+ - identify,read,post,client
43
+ X-Xss-Protection:
44
+ - '0'
45
+ Content-Length:
46
+ - '74'
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"ok":true,"channel":"C026VKGP7","ts":"1411734753.000007"}'
52
+ http_version:
53
+ recorded_at: Fri, 26 Sep 2014 12:32:33 GMT
54
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,65 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://isotope11.slack.com/api/files.upload
6
+ body:
7
+ encoding: UTF-8
8
+ string: "-------------RubyMultipartPost\r\nContent-Disposition: form-data; name=\"file\";
9
+ filename=\"Gemfile\"\r\nContent-Length: 12\r\nContent-Type: text/plain\r\nContent-Transfer-Encoding:
10
+ binary\r\n\r\nHello world\n\r\n-------------RubyMultipartPost\r\nContent-Disposition:
11
+ form-data; name=\"token\"\r\n\r\nxoxp-2223009426-2222616703-2700726491-4a3e8d\r\n-------------RubyMultipartPost\r\nContent-Disposition:
12
+ form-data; name=\"channels\"\r\n\r\nC026VKGP7\r\n-------------RubyMultipartPost--\r\n\r\n"
13
+ headers:
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ User-Agent:
19
+ - Ruby
20
+ Content-Type:
21
+ - multipart/form-data; boundary=-----------RubyMultipartPost
22
+ Content-Length:
23
+ - '450'
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Access-Control-Allow-Origin:
30
+ - "*"
31
+ Cache-Control:
32
+ - private, no-cache, no-store, must-revalidate
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ Date:
36
+ - Fri, 26 Sep 2014 12:35:00 GMT
37
+ Expires:
38
+ - Mon, 26 Jul 1997 05:00:00 GMT
39
+ Pragma:
40
+ - no-cache
41
+ Server:
42
+ - Apache
43
+ Strict-Transport-Security:
44
+ - max-age=31536000; includeSubDomains
45
+ Vary:
46
+ - Accept-Encoding
47
+ X-Accepted-Oauth-Scopes:
48
+ - post
49
+ X-Oauth-Scopes:
50
+ - identify,read,post,client
51
+ X-Xss-Protection:
52
+ - '0'
53
+ Content-Length:
54
+ - '487'
55
+ Connection:
56
+ - keep-alive
57
+ body:
58
+ encoding: UTF-8
59
+ string: '{"ok":true,"file":{"id":"F02M41559","timestamp":1411734900,"name":"Gemfile","title":"Gemfile","mimetype":"text\/plain","filetype":"text","pretty_type":"Plain
60
+ Text","user":"U026JJ4LP","editable":true,"size":12,"mode":"snippet","is_external":false,"external_type":"","is_public":true,"public_url_shared":false,"url":"https:\/\/slack-files.com\/files-pub\/T026K09CJ-F02M41559-ed9a97\/gemfile","url_download":"https:\/\/slack-files.com\/files-pub\/T026K09CJ-F02M41559-ed9a97\/download\/gemfile","url_private":"https:\/\/files.slack.com\/files-pri\/T026K09CJ-F02M41559\/gemfile","url_private_download":"https:\/\/files.slack.com\/files-pri\/T026K09CJ-F02M41559\/download\/gemfile","permalink":"https:\/\/isotope11.slack.com\/files\/jamescook\/F02M41559\/gemfile","permalink_public":"https:\/\/slack-files.com\/T026K09CJ-F02M41559-ed9a97","edit_link":"https:\/\/isotope11.slack.com\/files\/jamescook\/F02M41559\/gemfile\/edit","preview":"Hello
61
+ world\n","preview_highlight":"<div class=\"sssh-code\"><div class=\"sssh-line\"><pre>Hello
62
+ world<\/pre><\/div>\n<div class=\"sssh-line\"><pre><\/pre><\/div>\n<\/div>","lines":2,"lines_more":0,"channels":["C026VKGP7"],"groups":[],"ims":[],"comments_count":0}}'
63
+ http_version:
64
+ recorded_at: Fri, 26 Sep 2014 12:35:00 GMT
65
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,146 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://isotope11.slack.com/api/auth.test?token=a-totally-legit-token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Access-Control-Allow-Origin:
22
+ - "*"
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ Date:
26
+ - Thu, 25 Sep 2014 02:22:53 GMT
27
+ Server:
28
+ - Apache
29
+ Strict-Transport-Security:
30
+ - max-age=31536000; includeSubDomains
31
+ Vary:
32
+ - Accept-Encoding
33
+ X-Xss-Protection:
34
+ - '0'
35
+ Content-Length:
36
+ - '55'
37
+ Connection:
38
+ - keep-alive
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"ok":false,"error":"invalid_auth"}'
42
+ http_version:
43
+ recorded_at: Thu, 25 Sep 2014 02:22:53 GMT
44
+ - request:
45
+ method: get
46
+ uri: https://isotope11.slack.com/api/auth.test?token=a-totally-legit-token
47
+ body:
48
+ encoding: US-ASCII
49
+ string: ''
50
+ headers:
51
+ Accept-Encoding:
52
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
53
+ Accept:
54
+ - "*/*"
55
+ User-Agent:
56
+ - Ruby
57
+ response:
58
+ status:
59
+ code: 200
60
+ message: OK
61
+ headers:
62
+ Access-Control-Allow-Origin:
63
+ - "*"
64
+ Cache-Control:
65
+ - private, no-cache, no-store, must-revalidate
66
+ Content-Type:
67
+ - application/json; charset=utf-8
68
+ Date:
69
+ - Thu, 25 Sep 2014 12:04:59 GMT
70
+ Expires:
71
+ - Mon, 26 Jul 1997 05:00:00 GMT
72
+ Pragma:
73
+ - no-cache
74
+ Server:
75
+ - Apache
76
+ Strict-Transport-Security:
77
+ - max-age=31536000; includeSubDomains
78
+ Vary:
79
+ - Accept-Encoding
80
+ X-Accepted-Oauth-Scopes:
81
+ - identify
82
+ X-Oauth-Scopes:
83
+ - identify,read,post,client
84
+ X-Xss-Protection:
85
+ - '0'
86
+ Content-Length:
87
+ - '127'
88
+ Connection:
89
+ - keep-alive
90
+ body:
91
+ encoding: UTF-8
92
+ string: '{"ok":true,"url":"https:\/\/isotope11.slack.com\/","team":"Isotope11","user":"jamescook","team_id":"T026K09CJ","user_id":"U026JJ4LP"}'
93
+ http_version:
94
+ recorded_at: Thu, 25 Sep 2014 12:05:02 GMT
95
+ - request:
96
+ method: get
97
+ uri: https://isotope11.slack.com/api/auth.test?token=xoxp-2223009426-2222616703-2700726491-4a3e8d
98
+ body:
99
+ encoding: US-ASCII
100
+ string: ''
101
+ headers:
102
+ Accept-Encoding:
103
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
104
+ Accept:
105
+ - "*/*"
106
+ User-Agent:
107
+ - Ruby
108
+ response:
109
+ status:
110
+ code: 200
111
+ message: OK
112
+ headers:
113
+ Access-Control-Allow-Origin:
114
+ - "*"
115
+ Cache-Control:
116
+ - private, no-cache, no-store, must-revalidate
117
+ Content-Type:
118
+ - application/json; charset=utf-8
119
+ Date:
120
+ - Thu, 25 Sep 2014 12:15:59 GMT
121
+ Expires:
122
+ - Mon, 26 Jul 1997 05:00:00 GMT
123
+ Pragma:
124
+ - no-cache
125
+ Server:
126
+ - Apache
127
+ Strict-Transport-Security:
128
+ - max-age=31536000; includeSubDomains
129
+ Vary:
130
+ - Accept-Encoding
131
+ X-Accepted-Oauth-Scopes:
132
+ - identify
133
+ X-Oauth-Scopes:
134
+ - identify,read,post,client
135
+ X-Xss-Protection:
136
+ - '0'
137
+ Content-Length:
138
+ - '127'
139
+ Connection:
140
+ - keep-alive
141
+ body:
142
+ encoding: UTF-8
143
+ string: '{"ok":true,"url":"https:\/\/isotope11.slack.com\/","team":"Isotope11","user":"jamescook","team_id":"T026K09CJ","user_id":"U026JJ4LP"}'
144
+ http_version:
145
+ recorded_at: Thu, 25 Sep 2014 12:15:59 GMT
146
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,96 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://isotope11.slack.com/api/channels.info?channel=C029N15A8&token=a-totally-legit-token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Access-Control-Allow-Origin:
22
+ - "*"
23
+ Content-Type:
24
+ - application/json; charset=utf-8
25
+ Date:
26
+ - Thu, 25 Sep 2014 02:22:53 GMT
27
+ Server:
28
+ - Apache
29
+ Strict-Transport-Security:
30
+ - max-age=31536000; includeSubDomains
31
+ Vary:
32
+ - Accept-Encoding
33
+ X-Xss-Protection:
34
+ - '0'
35
+ Content-Length:
36
+ - '55'
37
+ Connection:
38
+ - keep-alive
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"ok":false,"error":"invalid_auth"}'
42
+ http_version:
43
+ recorded_at: Thu, 25 Sep 2014 02:22:53 GMT
44
+ - request:
45
+ method: get
46
+ uri: https://isotope11.slack.com/api/channels.info?channel=C029N15A8&token=xoxp-2223009426-2222616703-2700726491-4a3e8d
47
+ body:
48
+ encoding: US-ASCII
49
+ string: ''
50
+ headers:
51
+ Accept-Encoding:
52
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
53
+ Accept:
54
+ - "*/*"
55
+ User-Agent:
56
+ - Ruby
57
+ response:
58
+ status:
59
+ code: 200
60
+ message: OK
61
+ headers:
62
+ Access-Control-Allow-Origin:
63
+ - "*"
64
+ Cache-Control:
65
+ - private, no-cache, no-store, must-revalidate
66
+ Content-Type:
67
+ - application/json; charset=utf-8
68
+ Date:
69
+ - Thu, 25 Sep 2014 12:04:59 GMT
70
+ Expires:
71
+ - Mon, 26 Jul 1997 05:00:00 GMT
72
+ Pragma:
73
+ - no-cache
74
+ Server:
75
+ - Apache
76
+ Strict-Transport-Security:
77
+ - max-age=31536000; includeSubDomains
78
+ Vary:
79
+ - Accept-Encoding
80
+ X-Accepted-Oauth-Scopes:
81
+ - read
82
+ X-Oauth-Scopes:
83
+ - identify,read,post,client
84
+ X-Xss-Protection:
85
+ - '0'
86
+ Content-Length:
87
+ - '255'
88
+ Connection:
89
+ - keep-alive
90
+ body:
91
+ encoding: UTF-8
92
+ string: '{"ok":true,"channel":{"id":"C029N15A8","name":"affa_tracker","is_channel":true,"created":1399390760,"creator":"U026LNDQB","is_archived":false,"is_general":false,"is_member":false,"members":["U026K09CL","U026K0CLC","U026K13DU","U026LNDQB"],"topic":{"value":"","creator":"","last_set":"0"},"purpose":{"value":"To
93
+ discuss the development of the Affa Tracker app","creator":"U026LNDQB","last_set":"1399390761"}}}'
94
+ http_version:
95
+ recorded_at: Thu, 25 Sep 2014 12:05:03 GMT
96
+ recorded_with: VCR 2.9.3