slack_chatter 0.8.5 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +41 -2
- data/lib/slack_chatter/api/files.rb +4 -2
- data/lib/slack_chatter/client.rb +1 -0
- data/lib/slack_chatter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a54944e82fda0dc0a76ac6db3ec244c35233e425
|
4
|
+
data.tar.gz: 678442e5c10e92e723a8b5b14da19cea8af400f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df50ed61c41a5e68673f51a6701cd6b3da43ec55beecc71966a674223f8274e1022f245daac14f164086f7e2d1896fcd8c589fcfb0229c2a1f9264329f14237d
|
7
|
+
data.tar.gz: b1a507b63259fb65156ce2e7dc11f71f26551f662c706595115fb77f3cd7a3a3a3a7b460d7a208b68365c596537756562fe55f362b92ebad85f122c98d210359
|
data/README.md
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
# SlackChatter
|
2
2
|
|
3
3
|
SlackChatter is a simple-to-use Slack API wrapper for ruby which makes it quick and easy to constantly annoy your friends, co-workers, and loved ones with waaayyyyy to many process status updates. It provides easy-access to all of the functionallity supported by the Slack Api with the following exceptions:
|
4
|
-
- File uploading
|
5
4
|
- Real-Time Messaging
|
6
5
|
(These are currently in the works and should be available shortly)
|
7
6
|
|
7
|
+
Release Notes:
|
8
|
+
- 0.9.0 - Added File uploading
|
9
|
+
- 0.8.5 - Stable bug-free version
|
10
|
+
|
8
11
|
## Installation
|
9
12
|
|
10
13
|
Add this line to your application's Gemfile:
|
@@ -358,7 +361,43 @@ Options:
|
|
358
361
|
- page: integer - Page number of results to return
|
359
362
|
|
360
363
|
#### Upload a File
|
361
|
-
|
364
|
+
```ruby
|
365
|
+
response = client.files.upload({file: "../robot.png"})
|
366
|
+
=> #<SlackChatter::Response ok=true, file={
|
367
|
+
"id"=>"F068PHD0R",
|
368
|
+
"created"=>1434080019,
|
369
|
+
"timestamp"=>1434080019,
|
370
|
+
"name"=>"robot.png",
|
371
|
+
"title"=>"robot",
|
372
|
+
"mimetype"=>"image/png",
|
373
|
+
"filetype"=>"png",
|
374
|
+
"pretty_type"=>"PNG",
|
375
|
+
"user"=>"U043CDAQU",
|
376
|
+
"editable"=>false,
|
377
|
+
"size"=>3446,
|
378
|
+
"mode"=>"hosted",
|
379
|
+
"is_external"=>false,
|
380
|
+
"external_type"=>"",
|
381
|
+
"is_public"=>false,
|
382
|
+
"public_url_shared"=>false,
|
383
|
+
"url"=>"https://slack-files.com/files-pub/T043CDAQN-F068PHD0R-5ef86791d5/robot.png",
|
384
|
+
"url_download"=>"https://slack-files.com/files-pub/T043CDAQN-F068PHD0R-5ef86791d5/download/robot.png",
|
385
|
+
"url_private"=>"https://files.slack.com/files-pri/T043CDAQN-F068PHD0R/robot.png",
|
386
|
+
"url_private_download"=>"https://files.slack.com/files-pri/T043CDAQN-F068PHD0R/download/my_heart.png", "thumb_64"=>"https://slack-files.com/files-tmb/T043CDAQN-F068PHD0R-e1ebed375a/my_heart_64.png",
|
387
|
+
"thumb_80"=>"https://slack-files.com/files-tmb/T043CDAQN-F068PHD0R-e1ebed375a/my_heart_80.png",
|
388
|
+
"thumb_360"=>"https://slack-files.com/files-tmb/T043CDAQN-F068PHD0R-e1ebed375a/my_heart_360.png",
|
389
|
+
"thumb_360_w"=>227,
|
390
|
+
"thumb_360_h"=>185,
|
391
|
+
"thumb_160"=>"https://slack-files.com/files-tmb/T043CDAQN-F068PHD0R-e1ebed375a/my_heart_160.png",
|
392
|
+
"image_exif_rotation"=>1,
|
393
|
+
"permalink"=>"https://myteam.slack.com/files/sly_fox/F068PHD0R/my_heart.png",
|
394
|
+
"permalink_public"=>"https://slack-files.com/T043CDAQN-F068PHD0R-5ef86791d5",
|
395
|
+
"channels"=>[],
|
396
|
+
"groups"=>[],
|
397
|
+
"ims"=>[],
|
398
|
+
"comments_count"=>0
|
399
|
+
}, response=#<HTTParty::Response:0x1016d4a50 ...}>, code=200>
|
400
|
+
```
|
362
401
|
|
363
402
|
### Search
|
364
403
|
#### Search Everything
|
@@ -14,8 +14,10 @@ module SlackChatter
|
|
14
14
|
call_method("files", "list", opts)
|
15
15
|
end
|
16
16
|
|
17
|
-
def upload
|
18
|
-
|
17
|
+
def upload opts={}
|
18
|
+
opts = opts.with_indifferent_access
|
19
|
+
filename = opts.delete(:file) || opts.delete(:content)
|
20
|
+
client.post("files.upload", {}, query: opts.merge({file: UploadIO.new(File.open(filename), "multipart/form-data")}))
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
data/lib/slack_chatter/client.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack_chatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Will Bryant
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|