ipt 1.0.0 → 1.0.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 +4 -4
- data/README.md +1 -1
- data/lib/pt/action.rb +24 -16
- data/lib/pt/cli.rb +14 -1
- data/lib/pt/client.rb +1 -1
- data/lib/pt/data_table.rb +7 -2
- data/lib/pt/io.rb +2 -2
- data/lib/pt/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: 7ac8ce93770bfa51fcefbeae2775e1df4be4f016
|
4
|
+
data.tar.gz: 5f260a22628dec679495fc37387d022cc3529456
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c6e1b4178aebdc9c14b3e86197ec27cabf29209bb2b5b777a46f5730173f101a710e0b1d61117630f869babbf5fec8d0cc11058e98a82130dcf554edb6a1b41
|
7
|
+
data.tar.gz: c2032fa31e7b5da56d719cc343c48b3d15f099a16b5a94a8477f592930fd8e870e95dbc2efe5121de9824db935ad7bc79063a438ccebdd4e7d1c9fab74b79132
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[](https://badge.fury.io/rb/ipt)
|
2
2
|
[](https://travis-ci.org/drselump14/ipt)
|
3
3
|
|
4
4
|
# ipt
|
data/lib/pt/action.rb
CHANGED
@@ -73,15 +73,16 @@ module PT
|
|
73
73
|
def comment_story(story)
|
74
74
|
say("Please write your comment")
|
75
75
|
comment = edit_using_editor
|
76
|
-
|
76
|
+
begin
|
77
|
+
@client.comment_task(story, comment)
|
77
78
|
congrats("Comment sent, thanks!")
|
78
79
|
save_recent_task( story.id )
|
79
|
-
|
80
|
-
error("Ummm, something went wrong.")
|
80
|
+
rescue
|
81
|
+
error("Ummm, something went wrong. Comment cancelled")
|
81
82
|
end
|
82
83
|
end
|
83
84
|
|
84
|
-
def
|
85
|
+
def add_label_story(story)
|
85
86
|
label = ask("Which label?")
|
86
87
|
@client.add_label(story, label );
|
87
88
|
congrats("#{label} added, thanks!")
|
@@ -179,14 +180,14 @@ module PT
|
|
179
180
|
end
|
180
181
|
|
181
182
|
# set story type
|
182
|
-
type =
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
183
|
+
type = HighLine.new.choose do |menu|
|
184
|
+
menu.prompt = 'Please set type of story:'
|
185
|
+
menu.choice(:feature)
|
186
|
+
menu.choice(:bug)
|
187
|
+
menu.choice(:chore)
|
188
|
+
menu.choice(:release)
|
189
|
+
menu.default = :feature
|
190
|
+
end
|
190
191
|
|
191
192
|
description = edit_using_editor if ask('Do you want to write description now?(y/n)') == 'y'
|
192
193
|
story = @client.create_story(
|
@@ -196,7 +197,7 @@ module PT
|
|
196
197
|
story_type: type,
|
197
198
|
description: description
|
198
199
|
)
|
199
|
-
congrats("#{type} #{('for' + owner.name ) if owner} has been created \n #{story.url}")
|
200
|
+
congrats("#{type} #{(' for ' + owner.name ) if owner} has been created \n #{story.url}")
|
200
201
|
story
|
201
202
|
end
|
202
203
|
|
@@ -251,9 +252,13 @@ module PT
|
|
251
252
|
temp_path = "/tmp/editor-#{ Process.pid }.txt"
|
252
253
|
File.write(temp_path, content) if content
|
253
254
|
system "#{ editor } #{ temp_path }"
|
254
|
-
|
255
|
-
|
256
|
-
|
255
|
+
begin
|
256
|
+
content = File.read(temp_path)
|
257
|
+
File.delete(temp_path)
|
258
|
+
content
|
259
|
+
rescue
|
260
|
+
""
|
261
|
+
end
|
257
262
|
end
|
258
263
|
|
259
264
|
def choose_person
|
@@ -262,6 +267,9 @@ module PT
|
|
262
267
|
select("Please select a member to see his tasks.", table)
|
263
268
|
end
|
264
269
|
|
270
|
+
def open_story_from
|
271
|
+
end
|
272
|
+
|
265
273
|
def save_recent_task( task_id )
|
266
274
|
# save list of recently accessed tasks
|
267
275
|
unless (Settings[:recent_tasks])
|
data/lib/pt/cli.rb
CHANGED
@@ -21,7 +21,7 @@ module PT
|
|
21
21
|
attr_reader :project
|
22
22
|
|
23
23
|
TYPE=%w[feature bug chore release]
|
24
|
-
ACTION = %w[show open start finish deliver accept reject done assign estimate tasks comment
|
24
|
+
ACTION = %w[show open start finish deliver accept reject done assign estimate tasks comment add_label edit unstart]
|
25
25
|
|
26
26
|
default_task :mywork
|
27
27
|
|
@@ -68,6 +68,14 @@ module PT
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
+
desc "label <label>", "filter stories by label"
|
72
|
+
def label(_label=nil)
|
73
|
+
_label ||= select('Please select label', LabelsTable.new(@client.project.labels)).name
|
74
|
+
select_story_from_paginated_table(title: "stories with label:#{_label}") do |page|
|
75
|
+
@client.get_stories(filter: "label:#{_label}", page: page)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
71
79
|
TYPE.each do |type|
|
72
80
|
desc "#{type} <owner>", "show all #{type} stories"
|
73
81
|
define_method(type.to_sym) do |owner = nil|
|
@@ -159,5 +167,10 @@ module PT
|
|
159
167
|
end
|
160
168
|
show_story(story)
|
161
169
|
end
|
170
|
+
|
171
|
+
desc 'notifications', "show notifications"
|
172
|
+
def notifications
|
173
|
+
NotificationsTable.new(@client.notifications).print
|
174
|
+
end
|
162
175
|
end
|
163
176
|
end
|
data/lib/pt/client.rb
CHANGED
data/lib/pt/data_table.rb
CHANGED
@@ -97,10 +97,15 @@ module PT
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
-
class
|
100
|
+
class NotificationsTable < DataTable
|
101
|
+
def self.fields
|
102
|
+
[:message, :context]
|
103
|
+
end
|
104
|
+
end
|
101
105
|
|
106
|
+
class LabelsTable < DataTable
|
102
107
|
def self.fields
|
103
|
-
[:
|
108
|
+
[:name]
|
104
109
|
end
|
105
110
|
end
|
106
111
|
|
data/lib/pt/io.rb
CHANGED
@@ -153,7 +153,7 @@ module PT
|
|
153
153
|
menu.choice(:deliver, nil,'deliver'.yellow) { deliver_story(story) }
|
154
154
|
menu.choice(:accept, nil,'accept'.green) { accept_story(story) }
|
155
155
|
menu.choice(:reject, nil,'reject'.red) { reject_story(story) }
|
156
|
-
%w[unstart assign estimate tasks comment
|
156
|
+
%w[unstart assign estimate tasks comment add_label open].each do |action|
|
157
157
|
menu.choice(action.to_sym) { send("#{action}_story", story) }
|
158
158
|
end
|
159
159
|
menu.choice('id (copy story id)') { copy_story_id(story)}
|
@@ -167,7 +167,7 @@ module PT
|
|
167
167
|
def choose_filter
|
168
168
|
HighLine.new.choose do |menu|
|
169
169
|
menu.prompt = "Please choose filter ( [number/name]:select filter | [Enter]:back to table)".magenta
|
170
|
-
%w[current backlog mywork bug feature unstarted started finished delivered accepted rejected].each do |f|
|
170
|
+
%w[current backlog mywork label bug feature unstarted started finished delivered accepted rejected].each do |f|
|
171
171
|
menu.choice(f.to_sym) do
|
172
172
|
say 'filtering ' + f
|
173
173
|
send(f.to_sym)
|
data/lib/pt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ipt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Slamet Kristanto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|