Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions lib/furik/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,26 @@ def pulls
method_option :since, type: :numeric, aliases: '-d', default: 0
method_option :from, type: :string, aliases: '-f', default: Date.today.to_s
method_option :to, type: :string, aliases: '-t', default: Date.today.to_s
method_option :on, type: :string, aliases: '-o'
def activity
from = Date.parse(options[:from])
to = Date.parse(options[:to])
on = Date.parse(options[:on]) if options[:on]
from = on || Date.parse(options[:from])
to = on || Date.parse(options[:to])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このonはこのあとどこで使われるんですかっ

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since = options[:since]

diff = (to - from).to_i
diff.zero? ? from -= since : since = diff

period = case since
when 999 then 'All'
when 0 then "Today's"
else "#{since + 1}days"
if on
puts "Activities on #{on}"
else
period = case since
when 999 then 'All'
when 0 then "Today's"
else "#{since + 1}days"
end
puts "#{period} Activities"
end
puts "#{period} Activities"
puts '-'
puts ''

Expand Down
2 changes: 1 addition & 1 deletion lib/furik/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Furik
VERSION = "0.1.3"
VERSION = "0.1.4"
end