time_cop 0.8.0 → 0.8.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d92283db162ec5be4691e842d3af922fadb985af
4
- data.tar.gz: 3d7dc0135dae7784ab0dfbea08f0b88f4d918a5e
3
+ metadata.gz: acea5459ff2d87073e48ce8bf49624c3053d29d0
4
+ data.tar.gz: 19b808d20e27eed1a5ea49f00db0f7668e1acd4d
5
5
  SHA512:
6
- metadata.gz: 707941008f8ea575c15242bf06d8fc5a965ee8baa0779364803828eae8b2b1aad1172f1007bfa9ba65f82055a4f644b210ea61f302ec0f20fdd22efef3f22383
7
- data.tar.gz: 83e1af161c88299a0661f6b028487da1893946252d91d41ca2ffdbeed5907d5f7c8cf01f54ea7be098369d979b5047318d2550dfcdef3a407fd0d3e713d742b8
6
+ metadata.gz: 479b1ff4901d55092c744987364cb33cbc3c7f3f3ffed69d2777467f747f362a998713499d57d54f68d0d8e7e2fd887e99c6d62f3c63a92a8e41ca4733cd30fc
7
+ data.tar.gz: f9c45e804a9e90345a424b1866ee754ab17a030b3e0ccd15c11b4463f45e5a97d37e1e138c9effb65914ed9c57363e04b7f81f5763ca8d251079410d8a9802c0
@@ -15,15 +15,15 @@ module TimeCop
15
15
  q4: [{month: 10, day: 1}, {month: 12, day: 31}]
16
16
  }
17
17
 
18
- def initialize(username:, password:, subdomain: 'wildland', date: Date.today, today: Date.today, report_builder: nil, email: nil, hours_per_week: 32)
19
- @client = Harvest.client(username: username, password: password, subdomain: subdomain)
18
+ def initialize(harvest_client:, date: Date.today, today: Date.today, report_builder: nil, email: nil, hours_per_week: 32)
19
+ @client = harvest_client
20
20
  @date = date
21
21
  @today = today
22
22
  @hours_per_week = hours_per_week
23
23
  @report_builder = report_builder ||
24
24
  ReportBuilder.new(
25
25
  client: client,
26
- user: email ? fetch_user(email) : default_user,
26
+ user: (email ? fetch_user(email) : default_user),
27
27
  start_date: start_of_quarter_date,
28
28
  end_date: end_of_quarter_date
29
29
  )
@@ -167,8 +167,10 @@ module TimeCop
167
167
  hours: {
168
168
  charged: total_quarter_time_tracked,
169
169
  needed: expected_quarter_hours,
170
+ left: quarterly_hours_delta,
170
171
  average_charged: average_quarter_hours_per_day,
171
172
  average_needed: quarterly_hours_per_business_day_needed,
173
+ current_hours: current_hours_delta,
172
174
  total_projected: projected_quarter_hours
173
175
  }
174
176
  }
@@ -16,8 +16,11 @@ module TimeCop
16
16
  interactive_hash[:hours_per_week] = ENV['HARVEST_HOURS_PER_WEEK'].nil? ? cli.ask('Hours per week? Defaults to Full Time (34)') { |q| q.default = 34 }.to_f : ENV['HARVEST_HOURS_PER_WEEK'].to_f
17
17
  year = cli.ask("Year? Defaults to #{Date.today.year}") { |q| q.default = Date.today.year }.to_i
18
18
  accountability_options = {
19
- username: (username.nil? ? options[:username] : username),
20
- password: (password.nil? ? options[:password] : password),
19
+ harvest_client: Harvest.client(
20
+ username: (username.nil? ? options[:username] : username),
21
+ password: (password.nil? ? options[:password] : password),
22
+ subdomain: 'wildland'
23
+ ),
21
24
  email: options[:email]
22
25
  }
23
26
  q_dates = [
@@ -84,8 +87,7 @@ module TimeCop
84
87
  end
85
88
  else
86
89
  accountability_options = {
87
- username: (options[:username]),
88
- password: (options[:password]),
90
+ harvest_client: Harvest.client(username: options[:username], password: options[:password], subdomain: 'wildland'),
89
91
  email: options[:email]
90
92
  }
91
93
  accountability = Accountability.new(
@@ -1,3 +1,3 @@
1
1
  module TimeCop
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
data/time_cop.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
31
 
32
- spec.add_runtime_dependency "harvested", "~> 3.1.1"
32
+ spec.add_runtime_dependency "harvested", "~> 4.0.0"
33
33
  spec.add_runtime_dependency "highline", "~> 1.7.8"
34
34
  spec.add_runtime_dependency 'activesupport', '~> 5.0'
35
35
  spec.add_runtime_dependency 'paint', '~> 2.0.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_cop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Clopton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-21 00:00:00.000000000 Z
11
+ date: 2018-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: harvested
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.1
19
+ version: 4.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.1.1
26
+ version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: highline
29
29
  requirement: !ruby/object:Gem::Requirement