kato-cli 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +39 -2
- data/bin/kato +2 -4
- data/lib/kato/cli/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -16,15 +16,52 @@ Or install it yourself as:
|
|
16
16
|
|
17
17
|
$ gem install kato-cli
|
18
18
|
|
19
|
+
## Configuration
|
20
|
+
|
21
|
+
At minimum, `kato` needs to be given a list of available rooms. This is
|
22
|
+
specified in `~/.kato.yml`. Provide nicknames for rooms to access them more
|
23
|
+
easily when posting. For example,
|
24
|
+
|
25
|
+
room-list:
|
26
|
+
dev: de8cba109388dee98498
|
27
|
+
meetings: 3d809831aa8481177dcce
|
28
|
+
|
29
|
+
defines a room called `dev` with the room id `de8cba109388dee98498` and another
|
30
|
+
room called `meetings` with room id `3d809831aa8481177dcce`.
|
31
|
+
|
32
|
+
This allows you to specify the room by its nickname when invoking the `kato`
|
33
|
+
command:
|
34
|
+
|
35
|
+
$ kato --room dev
|
36
|
+
|
37
|
+
You can also configure a default room to send messages to as well as a default
|
38
|
+
display name.
|
39
|
+
|
40
|
+
room: dev
|
41
|
+
user: tommcdo
|
42
|
+
|
19
43
|
## Usage
|
20
44
|
|
21
45
|
kato [-u|--user USERNAME] [-f|--renderer text|markdown|code] [-r|--room ROOM]
|
22
46
|
|
23
|
-
|
47
|
+
* `-u` or `--user` specifies the display name to send the message from
|
48
|
+
* `-f` or `--renderer` specifies how the message will be rendered (`text`, `markdown`
|
49
|
+
or `code`)
|
50
|
+
* `-r` or `--room` specifies the room (by its nickname as set in `~/.kato.yml`) to
|
51
|
+
send the message to
|
52
|
+
|
53
|
+
The message will be read from standard input. You can either pipe another program's
|
54
|
+
output into `kato` or type it into the command line, followed by the end-of-file
|
55
|
+
signal (usually `Ctrl-D`).
|
56
|
+
|
57
|
+
## Vim integration
|
58
|
+
|
59
|
+
Check out [kato.vim](https://github.com/tommcdo/vim-kato) if you'd like to send
|
60
|
+
code snippets directly from inside Vim.
|
24
61
|
|
25
62
|
## Contributing
|
26
63
|
|
27
|
-
1. Fork it ( http://github.com
|
64
|
+
1. Fork it ( http://github.com/tommcdo/kato-cli/fork )
|
28
65
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
66
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
67
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/bin/kato
CHANGED
@@ -5,9 +5,7 @@ require 'optparse'
|
|
5
5
|
require 'yaml'
|
6
6
|
|
7
7
|
user = 'kato-cli'
|
8
|
-
options = {
|
9
|
-
:renderer => :text,
|
10
|
-
}
|
8
|
+
options = {}
|
11
9
|
|
12
10
|
config_file = File.expand_path('~/.kato.yml')
|
13
11
|
unless File.readable?(config_file)
|
@@ -26,7 +24,7 @@ OptionParser.new do |opts|
|
|
26
24
|
opts.banner = "Usage: kato [options]"
|
27
25
|
opts.on('-u', '--user NAME', 'Username') { |v| user = v }
|
28
26
|
opts.on('-r', '--room NAME', 'Room') { |v| room = config['room-list'][v] }
|
29
|
-
opts.on('-f', '--renderer [TYPE]', [:
|
27
|
+
opts.on('-f', '--renderer [TYPE]', [:default, :markdown, :code], 'Renderer (default, markdown, code)') { |v| options[:renderer] = v }
|
30
28
|
end.parse!
|
31
29
|
|
32
30
|
Kato::Cli.post(user, STDIN.read, room, options)
|
data/lib/kato/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kato-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|