bl 0.6.0 → 0.6.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
  SHA1:
3
- metadata.gz: 4d76c1fa3d3501015e87be05a03ff5b6fe694ad9
4
- data.tar.gz: bd1d24d7fd6740ce1275aa2fcb269a43ea1f00bf
3
+ metadata.gz: d05f12acc0e75e703832ab0cce2346b918a8ab72
4
+ data.tar.gz: 823008f346a5f109ff1d7273d9a01af2f9f10d4a
5
5
  SHA512:
6
- metadata.gz: cabd93779373d7a938b5d1c0be3bb1fee721a425af260417ed176eadbc663370e514e0f7e3663a18890375694d4537f55402bd80c51d54a66a48390ff3170311
7
- data.tar.gz: 4f2121b52394a1a77b6457b3a51e80dc2b8b7d838e1983c5dd1101f4e2f239c4bf6f6719311f1e1ea7ecac64e7b4b72f09d349f8001b5e9845244fe18865706a
6
+ metadata.gz: d375b572e522e8ccef165b619e8b1bc1b1d7ed51fd4982403acfbc9ddb5b1cfdc653664e25f7a6f6966c85b1f34d2a14f4a66d9a5a0772bf4025bb95271b29be
7
+ data.tar.gz: c64446967123dae6b41cce1da774cf95404baf178b264d6e310816756e70469550e28dcfc73c319c10f2052e1f3ec9aa8b236101eee3521a391718c3bc2e0791
@@ -1,6 +1,5 @@
1
1
  module Bl
2
2
  class Category < Command
3
-
4
3
  def initialize(*)
5
4
  @config = Bl::Config.instance
6
5
  @url = "projects/#{@config[:project_key]}/categories"
@@ -1,7 +1,5 @@
1
1
  module Bl
2
-
3
2
  class CLI < Command
4
-
5
3
  def initialize(*)
6
4
  @config = Bl::Config.instance
7
5
  super
@@ -72,8 +70,8 @@ module Bl
72
70
  end
73
71
  opts[:dueDateUntil] = Date.today.to_s if options[:overdue]
74
72
  if options[:priority]
75
- opts[:sort] = "priority"
76
- opts[:order] = "asc"
73
+ opts[:sort] = 'priority'
74
+ opts[:order] = 'asc'
77
75
  end
78
76
  opts[:categoryId] = [-1] if options[:nocategory]
79
77
  res = request(:get, 'issues', opts)
@@ -103,13 +101,13 @@ module Bl
103
101
  puts formatter.render(body, fields: fields, vertical: true)
104
102
 
105
103
  puts '--'
106
- puts "attachments:"
104
+ puts 'attachments:'
107
105
  body[0].attachments.each do |file|
108
106
  puts ['-', file.id, file.name, file.size].join("\t")
109
107
  puts "\tview url: https://#{@config[:space_id]}.backlog.jp/ViewAttachment.action?attachmentId=#{file.id}"
110
108
  puts "\tdownload url: https://#{@config[:space_id]}.backlog.jp/downloadAttachment/#{file.id}/#{file.name}"
111
109
  end
112
- puts "shared files:"
110
+ puts 'shared files:'
113
111
  body[0].sharedFiles.each do |file|
114
112
  puts ['-', file.id, file.name, file.size].join("\t")
115
113
  puts "\tfile url: https://#{@config[:space_id]}.backlog.jp/ViewSharedFile.action?projectKey=#{@config[:project_key]}&sharedFileId=#{file.id}"
@@ -132,7 +130,7 @@ module Bl
132
130
  issue_default_options.merge({summary: s}).merge(delete_class_options(options.to_h))
133
131
  )
134
132
  puts '💡 issue added'
135
- print_issue_response(printable_issues(res.body))
133
+ print_response(res, :issue)
136
134
  end
137
135
  end
138
136
 
@@ -143,7 +141,7 @@ module Bl
143
141
  keys.each do |k|
144
142
  res = request(:patch, "issues/#{k}", delete_class_options(options.to_h))
145
143
  puts 'issue updated'
146
- print_issue_response(printable_issues(res.body))
144
+ print_response(res, :issue)
147
145
  end
148
146
  end
149
147
 
@@ -152,7 +150,7 @@ module Bl
152
150
  keys.each do |k|
153
151
  res = request(:patch, "issues/#{k}", statusId: 4)
154
152
  puts '🎉 issue closed'
155
- print_issue_response(printable_issues(res.body))
153
+ print_response(res, :issue)
156
154
  end
157
155
  end
158
156
 
@@ -238,6 +236,5 @@ module Bl
238
236
 
239
237
  desc 'wiki SUBCOMMAND ...ARGS', 'manage wikis'
240
238
  subcommand 'wiki', Wiki
241
-
242
239
  end
243
240
  end
@@ -18,7 +18,7 @@ module Bl
18
18
  end
19
19
 
20
20
  def render(*args)
21
- @format.render(args[0], args[1].merge({max_width: TPUT_COLS}))
21
+ @format.render(args[0], args[1].merge(max_width: TPUT_COLS))
22
22
  end
23
23
 
24
24
  module Format
@@ -1,6 +1,5 @@
1
1
  module Bl
2
2
  class Groups < Command
3
-
4
3
  def initialize(*)
5
4
  @config = Bl::Config.instance
6
5
  @url = 'groups'
@@ -23,7 +22,7 @@ module Bl
23
22
  desc 'add GROUP_NAME', ''
24
23
  options members: :array
25
24
  def add(name)
26
- res = request(:post, @url, {name: name}.merge(delete_class_options(options)))
25
+ res = request(:post, @url, { name: name }.merge(delete_class_options(options)))
27
26
  puts 'group added'
28
27
  print_group_and_members(res.body)
29
28
  end
@@ -1,6 +1,5 @@
1
1
  module Bl
2
2
  class Milestone < Command
3
-
4
3
  def initialize(*)
5
4
  @config = Bl::Config.instance
6
5
  @url = "projects/#{@config[:project_key]}/versions"
@@ -22,7 +21,8 @@ module Bl
22
21
  options MILESTONE_PARAMS
23
22
  def add(*names)
24
23
  names.each do |name|
25
- res = request(:post,
24
+ res = request(
25
+ :post,
26
26
  @url,
27
27
  name: name,
28
28
  description: options[:description],
@@ -110,7 +110,8 @@ module Bl
110
110
  args = {
111
111
  projectId: [project_id],
112
112
  }.merge(args)
113
- request(:get,
113
+ request(
114
+ :get,
114
115
  'issues/count',
115
116
  args
116
117
  ).body.count
@@ -1,6 +1,5 @@
1
1
  module Bl
2
2
  class Users < Command
3
-
4
3
  def initialize(*)
5
4
  @config = Bl::Config.instance
6
5
  @url = 'users'
@@ -21,7 +20,15 @@ module Bl
21
20
 
22
21
  desc 'add USER_ID PASSWORD NAME MAIL_ADDRESS ROLE_TYPE', ''
23
22
  def add(id, pass, name, mail_address, role_type)
24
- res = request(:post, "#{@url}", userId: id, password: pass, name: name, mailAddress: mail_address, roleType: role_type)
23
+ res = request(
24
+ :post,
25
+ @url,
26
+ userId: id,
27
+ password: pass,
28
+ name: name,
29
+ mailAddress: mail_address,
30
+ roleType: role_type
31
+ )
25
32
  puts 'user added'
26
33
  print_response(res)
27
34
  end
@@ -1,3 +1,3 @@
1
1
  module Bl
2
- VERSION = '0.6.0'.freeze
2
+ VERSION = '0.6.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - saki