pivo 0.0.4 → 0.0.5
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/pivo/commands.rb +4 -2
- data/lib/pivo/resource.rb +7 -2
- data/lib/pivo/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: cba3f715972cbd69289bc5e71900d9925651de5a
|
4
|
+
data.tar.gz: fab521b7871eccca19eb13bcb446bc018afd3889
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c4655d9f941361a96443f0547bc61e38d3ddbe7377721ef20e9c7cf15f03f703379892c6c0a7f4ee0ce806e15356db8fa889762a7b158e0b27b06d91c94230b
|
7
|
+
data.tar.gz: 483adda9ba16d0e6b5dc66354af4f2608d78959a0041f3522a5590ece4b11c70ee1daa94066f0dc9b5eaf7cea24b6a14bf5b04f39638ebf2fa2c409627f102b1
|
data/lib/pivo/commands.rb
CHANGED
@@ -43,24 +43,26 @@ module Pivo
|
|
43
43
|
|
44
44
|
desc "all PROJECT_NAME", "listing all stories"
|
45
45
|
option :status, type: 'string', desc: "unscheduled, unstarted, planned, rejected, started, finished, delivered, accepted"
|
46
|
+
option :format, type: 'string', desc: "default, md"
|
46
47
|
def all(project_name)
|
47
48
|
project = Resource::Project.find_by_name(project_name)
|
48
49
|
filtering_options = {}
|
49
50
|
filtering_options.merge!(with_state: options[:status]) if options[:status]
|
50
51
|
project.stories(filtering_options).each do |story|
|
51
|
-
say
|
52
|
+
say Resource::Story.new(story, (options[:format] || 'default')).to_s
|
52
53
|
end
|
53
54
|
end
|
54
55
|
|
55
56
|
desc "me PROJECT_NAME", "listing my stories"
|
56
57
|
option :status, type: 'string', desc: "unscheduled, unstarted, planned, rejected, started, finished, delivered, accepted"
|
58
|
+
option :format, type: 'string', desc: "default, md"
|
57
59
|
def me(project_name)
|
58
60
|
me = Resource::Me.new
|
59
61
|
project = Resource::Project.find_by_name(project_name)
|
60
62
|
filtering_options = {}
|
61
63
|
filtering_options.merge!(filter: "state:#{options[:status]} owner:\"#{me.name}\"")
|
62
64
|
project.stories(filtering_options).each do |story|
|
63
|
-
say Resource::Story.new(story).to_s
|
65
|
+
say Resource::Story.new(story, (options[:format] || 'default')).to_s
|
64
66
|
end
|
65
67
|
end
|
66
68
|
end
|
data/lib/pivo/resource.rb
CHANGED
@@ -38,12 +38,17 @@ module Resource
|
|
38
38
|
end
|
39
39
|
|
40
40
|
class Story
|
41
|
-
def initialize(story)
|
41
|
+
def initialize(story, format_option)
|
42
42
|
@story = story
|
43
|
+
@format_option = format_option
|
43
44
|
end
|
44
45
|
|
45
46
|
def to_s
|
46
|
-
|
47
|
+
if @format_option == 'md'
|
48
|
+
"[#{@story.name}](#{@story.url})"
|
49
|
+
else
|
50
|
+
"[#{@story.estimate}][#{@story.current_state}]\t#{@story.name}\t#{@story.url}"
|
51
|
+
end
|
47
52
|
end
|
48
53
|
end
|
49
54
|
end
|
data/lib/pivo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pivo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AKAMATSU Yuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|