v2gpti 1.2.9 → 1.3.0

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: 96dfd8bcd38a10e116f82a7688f8a187b4d86ff6
4
- data.tar.gz: fd7bd01417b2a3e69506395c8488ad67df50ec1f
3
+ metadata.gz: f53b2eecf9f72b895dca650a0ad5054e28c4da11
4
+ data.tar.gz: 3b561a4430fa050469c30579c51ebe91f6576184
5
5
  SHA512:
6
- metadata.gz: c30a01562387426435717b97a66ade4a5f99a97ce2fc29abca6982ed581d925550415a64bbf1d20d85ccd785e6a1356035831588d8bd654977824bbbb20f2b66
7
- data.tar.gz: 36383e219a84ffcd932aec1ac291812958cab5c65aa528d17d7a829196894182de062923b79c68738a0d08e851a8cf8ad777e38a8197d16bd789c0a68dbce324
6
+ metadata.gz: e1618d849ae1535eb523d12eb76502fece99b506379a4b9f014b21cff3c0d713c7c60048a73591f625d08446a7ede574409ce0a9423fa3ef080326e3d7c38795
7
+ data.tar.gz: 81d3474a038ca15529083077340409d3da965ab8406899ee741df52f5c39d8172c09b7706afa6e4eb0d96bc0695287a19f46ced772dfac406b00457c6c07042d
@@ -65,17 +65,17 @@ module GitPivotalTrackerIntegration
65
65
  params = parameters(configuration, time_spent)
66
66
  if params[:tid].nil?
67
67
  begin
68
- @toggl.create_task(parameters(configuration, time_spent))
69
- rescue TogglException => te
70
- $LOG.log(te.backtrace.join("\n\t"))
68
+ @toggl.create_task(params)
69
+ rescue StandardError => te
70
+ $LOG.error(te.backtrace.join("\n\t"))
71
71
  end
72
72
  end
73
73
 
74
74
  #If for some reason time entry cannot be done, then catch exception and continue.
75
75
  begin
76
- @toggl.create_time_entry(parameters(configuration, time_spent))
77
- rescue TogglException => te
78
- $LOG.log(te.backtrace.join("\n\t"))
76
+ @toggl.create_time_entry(params)
77
+ rescue StandardError => te
78
+ $LOG.error(te.backtrace.join("\n\t"))
79
79
  puts "Unable to log the time."
80
80
  end
81
81
  end
@@ -145,7 +145,12 @@ module GitPivotalTrackerIntegration
145
145
  params[:tid] = task['id']
146
146
  end
147
147
  params
148
+ rescue TogglException => te
149
+ $LOG.error("[TOGGL] ---------------- #{te.message}")
150
+ $LOG.error("[TOGGL] ---------------- #{te.message}")
151
+ params
148
152
  end
153
+
149
154
  def seconds_spent(time_spent)
150
155
  seconds = 0
151
156
  time_spent.scan(/(\d+)(\w)/).each do |amount, measure|
@@ -21,8 +21,7 @@ class Toggl
21
21
  self.debug_on(debug) if !debug.nil?
22
22
  if (password.to_s == 'api_token' && username.to_s == '')
23
23
  toggl_api_file = self.toggl_file
24
- username = IO.read(toggl_api_file)
25
-
24
+ username = IO.read(toggl_api_file).strip
26
25
  end
27
26
 
28
27
  @conn = connection(username, password)
@@ -71,7 +70,10 @@ class Toggl
71
70
 
72
71
  def me(all=nil)
73
72
  # TODO: Reconcile this with get_client_projects
74
- res = get "me%s" % [all.nil? ? "" : "?with_related_data=#{all}"]
73
+ get "me%s" % [all.nil? ? "" : "?with_related_data=#{all}"]
74
+ rescue TogglException => te
75
+ puts "Failed to retrieve the Toggl User Id"
76
+ raise te
75
77
  end
76
78
 
77
79
  def my_clients(user)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: v2gpti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.9
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Wolski
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-01-24 00:00:00.000000000 Z
13
+ date: 2017-02-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: highline
@@ -186,28 +186,28 @@ dependencies:
186
186
  requirements:
187
187
  - - "~>"
188
188
  - !ruby/object:Gem::Version
189
- version: '4.2'
189
+ version: 4.2.7
190
190
  type: :runtime
191
191
  prerelease: false
192
192
  version_requirements: !ruby/object:Gem::Requirement
193
193
  requirements:
194
194
  - - "~>"
195
195
  - !ruby/object:Gem::Version
196
- version: '4.2'
196
+ version: 4.2.7
197
197
  - !ruby/object:Gem::Dependency
198
198
  name: activemodel
199
199
  requirement: !ruby/object:Gem::Requirement
200
200
  requirements:
201
201
  - - "~>"
202
202
  - !ruby/object:Gem::Version
203
- version: '4.2'
203
+ version: 4.2.7
204
204
  type: :runtime
205
205
  prerelease: false
206
206
  version_requirements: !ruby/object:Gem::Requirement
207
207
  requirements:
208
208
  - - "~>"
209
209
  - !ruby/object:Gem::Version
210
- version: '4.2'
210
+ version: 4.2.7
211
211
  - !ruby/object:Gem::Dependency
212
212
  name: bundler
213
213
  requirement: !ruby/object:Gem::Requirement