time_cop 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/time_cop/accountability.rb +5 -3
- data/lib/time_cop/runner.rb +6 -4
- data/lib/time_cop/version.rb +1 -1
- data/time_cop.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acea5459ff2d87073e48ce8bf49624c3053d29d0
|
4
|
+
data.tar.gz: 19b808d20e27eed1a5ea49f00db0f7668e1acd4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
19
|
-
@client =
|
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
|
}
|
data/lib/time_cop/runner.rb
CHANGED
@@ -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
|
-
|
20
|
-
|
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:
|
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(
|
data/lib/time_cop/version.rb
CHANGED
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", "~>
|
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.
|
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-
|
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:
|
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:
|
26
|
+
version: 4.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: highline
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|