beggar 0.0.3.alpha → 0.0.4.alpha
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/beggar/base.rb +4 -0
- data/lib/beggar/hours.rb +2 -1
- data/lib/beggar/version.rb +1 -1
- data/spec/base_spec.rb +2 -0
- data/spec/hours_spec.rb +2 -1
- metadata +6 -6
data/Gemfile.lock
CHANGED
data/lib/beggar/base.rb
CHANGED
data/lib/beggar/hours.rb
CHANGED
@@ -6,7 +6,8 @@ module Beggar
|
|
6
6
|
attr_accessor :project_id
|
7
7
|
|
8
8
|
def worked
|
9
|
-
|
9
|
+
params = { project_id: project_id, from: CurrentMonth.first_day, to: Date.today }
|
10
|
+
@@worked ||= Basecamp::TimeEntry.report(params).select { |te| te.person_id == Base.me.id }.map(&:hours).inject(&:+)
|
10
11
|
end
|
11
12
|
|
12
13
|
def max_up_today
|
data/lib/beggar/version.rb
CHANGED
data/spec/base_spec.rb
CHANGED
@@ -3,6 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe Beggar::Base do
|
4
4
|
before do
|
5
5
|
Basecamp.stub(:establish_connection!)
|
6
|
+
Basecamp::Person.stub(me: 'x')
|
6
7
|
Beggar::CurrentMonth.stub(to_s: 'a')
|
7
8
|
Beggar::Hours.stub(to_s: 'b')
|
8
9
|
Beggar::Salary.stub(to_s: 'c')
|
@@ -14,4 +15,5 @@ describe Beggar::Base do
|
|
14
15
|
end
|
15
16
|
|
16
17
|
its(:summary) { should == %(a || b || c\n) }
|
18
|
+
its(:me) { should == 'x' }
|
17
19
|
end
|
data/spec/hours_spec.rb
CHANGED
@@ -5,7 +5,8 @@ require 'spec_helper'
|
|
5
5
|
describe 'Beggar::Hours' do
|
6
6
|
context 'user was working in current month 2 days (8h and 6h)' do
|
7
7
|
before do
|
8
|
-
|
8
|
+
time_entries = double(map: [8.0, 6.0])
|
9
|
+
api_response = double(select: time_entries)
|
9
10
|
Basecamp::TimeEntry.stub(report: api_response)
|
10
11
|
Beggar::CurrentMonth.stub(working_days_up_today: 2)
|
11
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beggar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4.alpha
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70123487624900 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70123487624900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: basecamp
|
27
|
-
requirement: &
|
27
|
+
requirement: &70123487624380 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70123487624380
|
36
36
|
description: Tool for generating time reports from Basecamp. You can specify rate
|
37
37
|
for each project and get value of your month salary.
|
38
38
|
email:
|