nidobata 0.6.1 → 0.7.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 +6 -1
- data/lib/nidobata.rb +6 -4
- data/lib/nidobata/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f2712479e2437102bcbe90e409850441b427a3fba2f9fcc0c08694cb479c6ca
|
4
|
+
data.tar.gz: 1dd29ab225bd8355a2441e0863113755b520f0c83fbbd5f4a486e53488319059
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96197f640f32d701ff366451ff4e0eeba24244355c7560a2403b42b8e769ea62f605701f660c667b3171c009ef830ab85307c1410d2255be63129c7eadb0d93a
|
7
|
+
data.tar.gz: 853f6b8c3d107e3c7c2dc4f8435a56f78cc4cb1c5638fd52113c5f130e824a3799006b53a6d0fdfe872036ec54d2e94b14602e7036f34ddc31d4f1587a977b91
|
data/README.md
CHANGED
@@ -26,6 +26,12 @@ $ uname -a | nidobata post my-org-slug my-room
|
|
26
26
|
$ cat README.md | nidobata post my-org-slug my-room --pre markdown
|
27
27
|
```
|
28
28
|
|
29
|
+
If you want to post it as just markdown, not as syntax highlighted text as markdown:
|
30
|
+
|
31
|
+
```
|
32
|
+
$ cat README.md | nidobata post my-org-slug my-room --format MARKDOWN
|
33
|
+
```
|
34
|
+
|
29
35
|
## Development
|
30
36
|
|
31
37
|
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -40,4 +46,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/idobat
|
|
40
46
|
## License
|
41
47
|
|
42
48
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
43
|
-
|
data/lib/nidobata.rb
CHANGED
@@ -67,9 +67,10 @@ module Nidobata
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
-
desc 'post ORG_SLUG ROOM_NAME [MESSAGE] [--pre] [--title]', 'Post a message from stdin or 2nd argument.'
|
71
|
-
option :pre,
|
72
|
-
option :title,
|
70
|
+
desc 'post ORG_SLUG ROOM_NAME [MESSAGE] [--pre] [--title] [--format]', 'Post a message from stdin or 2nd argument.'
|
71
|
+
option :pre, type: :string, lazy_default: '', desc: 'can be used syntax highlight if argument exists'
|
72
|
+
option :title, type: :string, default: nil
|
73
|
+
option :format, type: :string, default: nil, desc: 'it is ignored if pre argument exists'
|
73
74
|
def post(slug, room_name, message = $stdin.read)
|
74
75
|
abort 'Message is required.' unless message
|
75
76
|
ensure_api_token
|
@@ -81,7 +82,8 @@ module Nidobata
|
|
81
82
|
payload = {
|
82
83
|
roomId: room_id,
|
83
84
|
source: build_message(message, options),
|
84
|
-
format: options[:pre] ? 'MARKDOWN' :
|
85
|
+
format: options[:pre] ? 'MARKDOWN' :
|
86
|
+
options[:format] ? options[:format] : 'PLAIN'
|
85
87
|
}
|
86
88
|
|
87
89
|
query CreateMessageMutation, variables: {input: payload}
|
data/lib/nidobata/version.rb
CHANGED