pivo 0.0.4 → 0.0.5

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: 6ddf9101bfda6e5401398c93bdf1e02e99ca4b9f
4
- data.tar.gz: e250acbabf48a28012e328517827cc98529ec527
3
+ metadata.gz: cba3f715972cbd69289bc5e71900d9925651de5a
4
+ data.tar.gz: fab521b7871eccca19eb13bcb446bc018afd3889
5
5
  SHA512:
6
- metadata.gz: 222db0f22f1abc80db68da9be32bc5e5397af8ced5946dd4301337f6d8d2ba4ab2dbca3dd9baa7a666af92eb7276117661a31249680b3f001af536b1ea76e2fb
7
- data.tar.gz: c4804ca224482f05fdf1c6f7a926cae525bd10feaebc7238e23d7864a29ae1b9572e32fe663729b6b0d7585461e5f3e011c15ea398899fe45dd72782c82f0789
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 "[#{story.current_state}]\t#{story.name}\t#{story.url}"
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
- "[#{@story.estimate}][#{@story.current_state}]\t#{@story.name}\t#{@story.url}"
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
@@ -1,3 +1,3 @@
1
1
  module Pivo
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
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-05 00:00:00.000000000 Z
11
+ date: 2015-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler