discourse_cli_tool 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 244e72a87e4ff1c75444d9afb74ee8046129f363acd4b3e0c6a562b745248cda
4
- data.tar.gz: c9524d2b293c8f9b5bca28eac115bbcddc914899ca2956d94f7295458e40b21e
3
+ metadata.gz: 2f85a2451232e1d21e616d56497f3a2eefcd7875525278e61821454ef72069d3
4
+ data.tar.gz: 4849b6f1dfa072a46ff7855fd9bf637d6e28000324cc85aa737f852203fad5f9
5
5
  SHA512:
6
- metadata.gz: 272f6c8c59412ef290169845de5c032abbdf8fbb43cd79aac3c9611841eceb5d012c7ce444074cccce4cbf9da637d9bdf3afb0b8de39e7acfaa4b95f879b5934
7
- data.tar.gz: def01275d90cfc616f732bd66172acf62ade01fdad5f1dc26658b8a1502c115c0a799bf5f7a0114c0bf1b4c58fc8698b935342f3aa54df23ecbf531a49fe7c38
6
+ metadata.gz: 41e07d72153230d31b6572e2392e747dc076d9accba1d4b37abadb1a14422d95a0df2e4d599a631be472195fa6772ec952898523eec08d03ffd597387a0896f6
7
+ data.tar.gz: ee479f290a32beb230091d6647e40d540f5897b7db39ccb9f0bcba03c708d04c6a7cb7c61bfcad984d325ae79d3447c43a19137b5da9f7c2e2832c26976f6c5d
@@ -22,7 +22,7 @@ module DiscourseCli
22
22
 
23
23
  desc "create", "Create a topic (opens $EDITOR if --raw not given)"
24
24
  option :title, type: :string, required: true
25
- option :category, type: :string
25
+ option :category, type: :numeric, desc: "Category ID"
26
26
  option :tags, type: :string, desc: "Comma-separated tags"
27
27
  option :raw, type: :string
28
28
  def create
@@ -37,7 +37,7 @@ module DiscourseCli
37
37
 
38
38
  desc "update ID", "Update a topic"
39
39
  option :title, type: :string
40
- option :category, type: :string, desc: "Category slug or name"
40
+ option :category, type: :numeric, desc: "Category ID"
41
41
  option :raw, type: :string, desc: "Replace first post content (opens $EDITOR if not given and no other options)"
42
42
  def update(id)
43
43
  updated_anything = false
@@ -48,13 +48,7 @@ module DiscourseCli
48
48
  end
49
49
 
50
50
  if options[:category]
51
- cats = client.categories
52
- cat = cats.find { |c| c["slug"] == options[:category] || c["name"] == options[:category] }
53
- unless cat
54
- $stderr.puts "Category not found: #{options[:category]}"
55
- exit 1
56
- end
57
- client.recategorize_topic(id.to_i, cat["id"])
51
+ client.recategorize_topic(id.to_i, options[:category])
58
52
  updated_anything = true
59
53
  end
60
54
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DiscourseCli
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse_cli_tool
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
  - Tim Case