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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f45b08f8dcbfd135c1b05f84514f30922104afa4d82daa8581849699f7bf1291
4
- data.tar.gz: 94e8467a36e84eaeb1774fa5acfa76c9d0313ff1339c81d11053934052cbb8ca
3
+ metadata.gz: 7f2712479e2437102bcbe90e409850441b427a3fba2f9fcc0c08694cb479c6ca
4
+ data.tar.gz: 1dd29ab225bd8355a2441e0863113755b520f0c83fbbd5f4a486e53488319059
5
5
  SHA512:
6
- metadata.gz: fe979a8a8dc2f0b6143c49534fccc4077ccf756888af7aed385abb9666bf04c164869c7bb48aa53e7a771f815695547132613ba81dfc855e6eac034ebf2be673
7
- data.tar.gz: 7dfffddebaef837ffc655b584f2ca3318d3ff661ca68fc90d8a61fa75b08eda310464c0f57426c1bf45b1c458f37735e620440cb3192266251f3a5805594753f
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
-
@@ -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, type: :string, lazy_default: '', desc: 'can be used syntax highlight if argument exists'
72
- option :title, type: :string, default: nil
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' : 'PLAIN'
85
+ format: options[:pre] ? 'MARKDOWN' :
86
+ options[:format] ? options[:format] : 'PLAIN'
85
87
  }
86
88
 
87
89
  query CreateMessageMutation, variables: {input: payload}
@@ -1,3 +1,3 @@
1
1
  module Nidobata
2
- VERSION = '0.6.1'
2
+ VERSION = '0.7.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nidobata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hibariya