bl 0.0.9 → 0.0.10

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
  SHA1:
3
- metadata.gz: 13117d9256d81fecc1cfcc48fdef2098086ba5d8
4
- data.tar.gz: 968755d5cb96c8f7e1c308c25a6ea5d6adcf6359
3
+ metadata.gz: 3ca2c240c6a93cd7609d167895a09361bb836215
4
+ data.tar.gz: a2567131cbaf4b4b6c4790a31ba2b42b6afbabdb
5
5
  SHA512:
6
- metadata.gz: f14822fd5edb8df82a2e9f9ecdd01c8c4898b21ecd419a92b27b79162762731c972473f8702c11190cd8d6f5c968c87f26548e8d9c5dff1af2a82a23e91bd2de
7
- data.tar.gz: c00fab756f8b36147733a4e2ce2a4053d1e5a87b4f9236c105cf8f447a184a08e6a5438fd4f502f807b795580afdd7eb580e2d0fe7e891a5a8760c44584ca93e
6
+ metadata.gz: 35768a754d72140c1298e26424babad7b9b43f167a77a597c87be58aaae2ecfee1af5c5f69730a42f53ffa51b1236c3219bfa0c8ddaa1ffa2621406d26e4f471
7
+ data.tar.gz: 03aa5fea30c5fae3d871a9cad3c8f87b9ddbee0fc1900f2ba058e95dc7658400ffd345c443c3c70ea6df123e98f02b828daf37468e4c94f531b8a1e54e796192
data/lib/bl.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'thor'
2
2
  require 'backlog_kit'
3
3
  require 'bl/version'
4
+ require 'bl/category'
4
5
  require 'yaml'
5
6
  require 'pp'
6
7
  require 'bl/cli'
@@ -0,0 +1,28 @@
1
+ module Bl
2
+ class Category < Thor
3
+ def initialize(*)
4
+ @config = YAML.load_file(File.join(Dir.home, Bl::CONFIG_FILE))
5
+ @client = BacklogKit::Client.new(
6
+ space_id: @config[:space_id],
7
+ api_key: @config[:api_key]
8
+ )
9
+ super
10
+ end
11
+
12
+ desc 'add NAME', 'add categories'
13
+ def add(*names)
14
+ names.each do |name|
15
+ res = @client.post("projects/#{@config[:project_key]}/categories", name: name)
16
+ puts "category added: #{res.body.id}\t#{res.body.name}"
17
+ end
18
+ end
19
+
20
+ desc 'delete CATEGORY_ID', 'delete categories'
21
+ def delete(*ids)
22
+ ids.each do |id|
23
+ res = @client.delete("projects/#{@config[:project_key]}/categories/#{id}")
24
+ puts "category deleted: #{res.body.id}\t#{res.body.name}"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -235,6 +235,9 @@ module Bl
235
235
  end
236
236
  end
237
237
 
238
+ desc 'category SUBCOMMAND ...ARGS', 'manage categoryies'
239
+ subcommand 'category', Category
240
+
238
241
  desc 'project-status PROJECT_ID', 'show project status'
239
242
  def project_status(pid)
240
243
  all_issues_count = @client.get('issues/count', projectId: [pid]).body.count
@@ -1,3 +1,3 @@
1
1
  module Bl
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - saki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-03 00:00:00.000000000 Z
11
+ date: 2016-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -127,6 +127,7 @@ files:
127
127
  - bl.gemspec
128
128
  - exe/bl
129
129
  - lib/bl.rb
130
+ - lib/bl/category.rb
130
131
  - lib/bl/cli.rb
131
132
  - lib/bl/version.rb
132
133
  homepage: https://github.com/sakihet/bl