bl 0.0.1 → 0.0.2
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 +4 -4
- data/lib/bl.rb +45 -4
- data/lib/bl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f905f2aa9b2c5426f51cdb18784f24bd106d4fb
|
4
|
+
data.tar.gz: 50be82484620c70ccc1319c9aff31f814982db77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c258985fa07505f1dbdf7ac947434d1d5139f8ee10c37c5c7fb08eddc5f59a857f382e8b8e84f26f74cd7a68a2cbb642cda68ffe18bd502f1943ea74acb9eb99
|
7
|
+
data.tar.gz: 6b2b2677c922eb1babeb14aa345af4467c46a75c86d30d47f68fcf6f799661f77eaa47b3c37e1fc0316ef78fcb3e709896e9f7ea21de726b269071fa495565e6
|
data/lib/bl.rb
CHANGED
@@ -1,14 +1,40 @@
|
|
1
1
|
require "thor"
|
2
2
|
require "backlog_kit"
|
3
3
|
require "bl/version"
|
4
|
+
require "yaml"
|
4
5
|
|
5
6
|
module Bl
|
7
|
+
CONFIG_FILE = '.bl.yml'
|
8
|
+
|
6
9
|
class CLI < Thor
|
10
|
+
@config = nil
|
11
|
+
|
7
12
|
desc "version", "show version"
|
8
13
|
def version
|
9
14
|
puts Bl::VERSION
|
10
15
|
end
|
11
16
|
|
17
|
+
desc "config", "show config"
|
18
|
+
def config
|
19
|
+
p Bl::CLI.client
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "init", "initialize a default config file"
|
23
|
+
def init
|
24
|
+
filename = File.join(Dir.home, CONFIG_FILE)
|
25
|
+
if File.exists?(filename)
|
26
|
+
puts "#{filename} exits."
|
27
|
+
else
|
28
|
+
config = {
|
29
|
+
space_id: '',
|
30
|
+
api_key: ''
|
31
|
+
}
|
32
|
+
f = File.new(filename, 'w')
|
33
|
+
f.write(config.to_yaml)
|
34
|
+
puts "#{filename} generated."
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
12
38
|
desc "list", "list issues"
|
13
39
|
def list
|
14
40
|
issues = Bl::CLI.client.get('issues').body.each do |i|
|
@@ -60,21 +86,36 @@ module Bl
|
|
60
86
|
desc "projects", "list projects"
|
61
87
|
def projects
|
62
88
|
projects = Bl::CLI.client.get('projects').body.each do |p|
|
63
|
-
puts [p.projectKey, p.name].join("\t")
|
89
|
+
puts [p.id, p.projectKey, p.name].join("\t")
|
64
90
|
end
|
65
91
|
end
|
66
92
|
|
67
93
|
desc "types PROJECT_KEY", "list issue types in the project"
|
68
94
|
def types(pkey)
|
69
95
|
types = Bl::CLI.client.get("projects/#{pkey}/issueTypes").body.each do |t|
|
70
|
-
puts t.name
|
96
|
+
puts [t.id, t.name].join("\t")
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
desc "statuses", "list statuses"
|
101
|
+
def statuses
|
102
|
+
statuses = Bl::CLI.client.get("statuses").body.each do |s|
|
103
|
+
puts [s.id, s.name].join("\t")
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
desc "priorities", "list priorities"
|
108
|
+
def priorities
|
109
|
+
priorities = Bl::CLI.client.get("priorities").body.each do |p|
|
110
|
+
puts [p.id, p.name].join("\t")
|
71
111
|
end
|
72
112
|
end
|
73
113
|
|
74
114
|
def self.client
|
115
|
+
@config = YAML.load_file(File.join(Dir.home, CONFIG_FILE))
|
75
116
|
BacklogKit::Client.new(
|
76
|
-
space_id:
|
77
|
-
api_key:
|
117
|
+
space_id: @config[:space_id],
|
118
|
+
api_key: @config[:api_key]
|
78
119
|
)
|
79
120
|
end
|
80
121
|
end
|
data/lib/bl/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- saki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|