slack_chatter 0.8.5 → 0.9.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: 7bf0dee337718cce9d042317e9a0404b4ab7e340
4
- data.tar.gz: 5eecbc8e2aaff65bbfb847ef8f231d45337660bc
3
+ metadata.gz: a54944e82fda0dc0a76ac6db3ec244c35233e425
4
+ data.tar.gz: 678442e5c10e92e723a8b5b14da19cea8af400f1
5
5
  SHA512:
6
- metadata.gz: 280f3c5642df92bf1d792844b249c8e91b92dd94aa24bd67502631d8adef855fe834ea61f6f630a9d9005c89d6cc1fa8b47ed88bf0d39de171a86bff45998499
7
- data.tar.gz: 7405f046a89dced967943f30f93a0870e3710ac07ead21c5f3ba6d786c9c033b83451eaf4d2f42e4ddcb06fd94baacab8753dadc41c277cca897f81b323b07cd
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
- **Not Currently Supported**
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
- raise "not implemented"
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
@@ -1,5 +1,6 @@
1
1
 
2
2
  require 'httmultiparty'
3
+ require 'active_support'
3
4
  require 'active_support/core_ext'
4
5
 
5
6
  require 'slack_chatter/api/namespaces'
@@ -1,3 +1,3 @@
1
1
  module SlackChatter
2
- VERSION = "0.8.5"
2
+ VERSION = "0.9.0"
3
3
  end
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.8.5
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 00:00:00.000000000 Z
11
+ date: 2015-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler