88miles 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/88miles.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "88miles"
8
- s.version = "1.0.3"
8
+ s.version = "1.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Myles Eftos"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4
@@ -71,18 +71,28 @@ options:
71
71
 
72
72
  grand_total = @project["grand_total"]
73
73
  grand_total += (Time.now.to_i - @project["started_at"]) if @project["running"]
74
- overdue = grand_total > @project["time_limit"] if @project["time_limit"]
74
+ remaining = @project["time_limit"] - grand_total if @project["time_limit"]
75
+ running_total = (Time.now.to_i - @project["started_at"]) if @project["running"]
76
+
77
+ if @project["running"]
78
+ spinner = HighLine::String.new([ '|', '/', '-', '\\' ][running_total % 4]).green
79
+ clock_string = to_clock_s(running_total, true)
80
+ clock_string = "[#{HighLine::String.new(to_clock_s(running_total, true)).green}]"
81
+ end
75
82
 
76
- clock_string = to_clock_s(grand_total, true)
77
- clock_string = " [#{HighLine::String.new(clock_string).red}]" if overdue
83
+ overdue = grand_total > @project["time_limit"] if @project["time_limit"]
84
+ remaining = HighLine::String.new(to_clock_s(remaining)).red if overdue
85
+ remaining = to_clock_s(remaining) unless overdue
78
86
 
79
87
  str = ""
80
88
  if @options[:time]
81
89
  str = clock_string
82
90
  else
91
+ str += "#{clock_string} " if clock_string
83
92
  str += "#{company["name"]}: #{@project["name"]}"
84
- str += " [#{clock_string}]"
85
- str += " #{HighLine::String.new("Running").green}" if @project["running"]
93
+ str += " | Remaining: #{remaining}" if remaining
94
+ str += " | Grand total: #{to_clock_s(grand_total)}"
95
+ str += " #{spinner}" if @options[:foreground]
86
96
  end
87
97
 
88
98
  print "\e[0K\r#{str}" if @options[:foreground]
@@ -15,11 +15,12 @@ If run inside a directory with a linked project, the linked project will be upda
15
15
  Usage
16
16
  88miles sync
17
17
  EOS
18
+ opt :project, "Only sync the linked project", :type => :flag, :default => false
18
19
  end
19
20
 
20
21
  instance = self.new(settings, options)
21
22
  begin
22
- instance.sync
23
+ instance.sync unless options[:project]
23
24
  instance.sync_current
24
25
  rescue OAuth2::Error => e
25
26
  say "Access to your 88 Miles may have been revoked. Please run <%= color('88miles setup', BOLD) %> again."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 88miles
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2013-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: trollop
16
- requirement: &70155498287500 !ruby/object:Gem::Requirement
16
+ requirement: &70170995983000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70155498287500
24
+ version_requirements: *70170995983000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: highline
27
- requirement: &70155498302640 !ruby/object:Gem::Requirement
27
+ requirement: &70170995997940 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.6.19
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70155498302640
35
+ version_requirements: *70170995997940
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: oauth2
38
- requirement: &70155498301620 !ruby/object:Gem::Requirement
38
+ requirement: &70170995997200 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.9.2i
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70155498301620
46
+ version_requirements: *70170995997200
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: launchy
49
- requirement: &70155498299600 !ruby/object:Gem::Requirement
49
+ requirement: &70170995995760 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 2.3.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70155498299600
57
+ version_requirements: *70170995995760
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: terminal-table
60
- requirement: &70155498298360 !ruby/object:Gem::Requirement
60
+ requirement: &70170995993940 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.4.5
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70155498298360
68
+ version_requirements: *70170995993940
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: shoulda
71
- requirement: &70155498297280 !ruby/object:Gem::Requirement
71
+ requirement: &70170995992640 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70155498297280
79
+ version_requirements: *70170995992640
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rdoc
82
- requirement: &70155498296540 !ruby/object:Gem::Requirement
82
+ requirement: &70170995991840 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '3.12'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70155498296540
90
+ version_requirements: *70170995991840
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: bundler
93
- requirement: &70155498295640 !ruby/object:Gem::Requirement
93
+ requirement: &70170995991080 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '1.0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70155498295640
101
+ version_requirements: *70170995991080
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: jeweler
104
- requirement: &70155498309320 !ruby/object:Gem::Requirement
104
+ requirement: &70170996005960 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: 1.8.7
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70155498309320
112
+ version_requirements: *70170996005960
113
113
  description: 88 Miles (http://88miles.net) is simple time tracking for freelance developers,
114
114
  designers and copywriters. This gem allows you to access you account from your command
115
115
  line.
@@ -162,7 +162,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
162
162
  version: '0'
163
163
  segments:
164
164
  - 0
165
- hash: -1440062190376042175
165
+ hash: 3912934356983210253
166
166
  required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  none: false
168
168
  requirements: