slackcat 0.2.0 → 0.2.1

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +64 -20
  3. data/lib/slackcat/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec17396e6bab7b65c8e0d9d3973286e0e7f04b4f
4
- data.tar.gz: 9221832546c13e35efd896d79a5546afff9e9c5e
3
+ metadata.gz: be3a8e5d238d74351da94bcdedd76868cdb958b2
4
+ data.tar.gz: 221735b558a336d5ccb5651e15776f03a27aac70
5
5
  SHA512:
6
- metadata.gz: 655a405b4cb06eec4a0e1d038932580ccf5989766ffcc64b4e1a05f1545fcf68f8a3f63275841ae103d18974a7f389e4acc9af6fa7c4f7db9d66d22631e6e14d
7
- data.tar.gz: dd7e81b21c457ee15cd1e82f0a1befea8cd2b18056138725c41c0b48abe42325a319c35492a8e002fd4ebc2c3d0dbee42fc11b6db9e4e6e55616a672e90fa03f
6
+ metadata.gz: 760e9bd8afc31213d54e8d852441416d42c252b43d2077b785d0a5bd9991e58af64268fd059bc4dc5e95010d4c028a697e2763804a495f372631c6155b6d20f6
7
+ data.tar.gz: bc3b251a6b4ecb2cddea9eecc743c5c9c9241c5893c8bc256d742ba3282e0a9976e4bcafec4dd0da950fe5ea321d68ac04f9f59cc9249eb6f4b95a8d3b8ee4d3
data/README.md CHANGED
@@ -8,35 +8,79 @@ command-line.
8
8
  Log in to your slack.com account and get your API token from
9
9
  https://api.slack.com/.
10
10
 
11
- gem install slackcat
12
- export SLACK_TOKEN=<your api token>
13
- echo 'hello world' | slackcat -c <channel>
11
+ ```sh
12
+ gem install slackcat
13
+ export SLACK_TOKEN=<your api token>
14
+ echo 'hello world' | slackcat -c <channel>
15
+ ```
14
16
 
15
- ## Usage
17
+ ## Environment variables
16
18
 
17
- `slackcat` is used similarly to unix `cat`: read data from STDIN or
18
- list filenames as arguments. Multiple files will be concatenated.
19
+ * `SLACK_TOKEN`: your token from https://api.slack.com/.
19
20
 
20
- Environment variables:
21
+ ## Command-line options
21
22
 
22
- * `SLACK_TOKEN`: your token from https://api.slack.com/.
23
+ ```
24
+ --token, -k <s>: Slack API token
25
+ --channels, -c <s>: Channels to share
26
+ --groups, -g <s>: Groups to share
27
+ --users, -u <s>: Users (DMs) to share
28
+ --filetype, -t <s>: File type identifier
29
+ --title, -T <s>: Title of file
30
+ --filename, -n <s>: Filename of file
31
+ --initial-comment, -i <s>: Initial comment to add
32
+ --post, -p: Post instead of upload
33
+ --multipart, -m: Multipart upload each file
34
+ --help, -h: Show this message
35
+ ```
23
36
 
24
- Command-line options:
37
+ ## Basic usage: text snippets
25
38
 
39
+ To upload text snippets, `slackcat` is used similarly to unix `cat`:
40
+ read data from STDIN or list filenames as arguments. Multiple files
41
+ will be concatenated.
42
+
43
+ Examples:
44
+
45
+ ```sh
46
+ date | slackcat -c general
47
+ slackcat -u buddy foo.txt bar.txt
26
48
  ```
27
- --token, -k: Slack API token
28
- --channels, -c: Channels to share
29
- --groups, -g: Private groups to share
30
- --users, -u: Users (DMs) to share
31
- --filetype, -t: File type identifier
32
- --title, -T: Title of file
33
- --filename, -n: Filename of file
34
- --initial-comment, -i: Initial comment to add
35
- --help, -h: Show this message
49
+
50
+ Uploads to slack are private by default. If you list channels, groups
51
+ or usernames, content will be shared to them.
52
+
53
+ ## Multipart file uploads
54
+
55
+ If you wish to upload binary files, for example images, use the `-m`
56
+ option, which will cause each file to be uploaded separately.
57
+
58
+ Example:
59
+
60
+ ```sh
61
+ slackcat -c general -m kitten.jpg cat.gif
62
+ ```
63
+
64
+ Slack does a good job of setting filetype correctly from mimetype,
65
+ though you may override this with the `-t` option.
66
+
67
+ This mode does not read stdin.
68
+
69
+ ## Post messages as chat text
70
+
71
+ To post text as a normal chat, instead of as a text snippet, use the
72
+ `-p` option.
73
+
74
+ Example:
75
+
76
+ ```sh
77
+ date | slackcat -c general -p
78
+ slackcat -u buddy -p foo.txt bar.txt
36
79
  ```
37
80
 
38
- File uploads to slack are private by default. If you list channels,
39
- content will be shared to them.
81
+ Due to a limitation of the slack api, your user icon will not be set,
82
+ and your username will appear as `username (bot)`. You may also pass
83
+ only one channel, group or username.
40
84
 
41
85
  ## Example usage from vim
42
86
 
@@ -1,3 +1,3 @@
1
1
  module Slackcat
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slackcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Lister