balboa 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -17
- data/lib/balboa/cli/defaults.rb +15 -3
- data/lib/balboa/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef19d875f6ac656065f2f7d7ff0becccafc84eae
|
4
|
+
data.tar.gz: 9dfd4d4c08f7fc5275b3ee1fdbeb2abeb8827e3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcb71570d31f5e1b71c1fbbe2ae1136b721ba680cad14ea3307c0df1479b40cc7d6cf227944e27558ead12e45a3a79ca4eddb3d028500853dae01b4186cfff3f
|
7
|
+
data.tar.gz: e7c323ea423915735d1bef6799b539c6e8ea5452142793c21125103d9cf53e28c8dd46a9e2ff1d6076bf8067a8d899b45419936b2b7770c1b6978b6a796697bb
|
data/README.md
CHANGED
@@ -1,34 +1,61 @@
|
|
1
1
|
# Balboa
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/balboa.svg)](https://badge.fury.io/rb/balboa)
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
9
|
-
|
7
|
+
$ gem install balboa
|
10
8
|
|
11
|
-
|
12
|
-
gem 'balboa'
|
13
|
-
```
|
9
|
+
## Usage
|
14
10
|
|
15
|
-
|
11
|
+
A good way to start is:
|
16
12
|
|
17
|
-
$
|
13
|
+
$ balboa -h
|
18
14
|
|
19
|
-
|
15
|
+
Let's suppose you just want to punch (it will punch from the day after the last punch until it can not punch anymore):
|
20
16
|
|
21
|
-
$
|
17
|
+
$ balboa punch
|
18
|
+
|
19
|
+
Let's suppose you want to skip 11/11/2011, 12/12/2012 and 13/12/2012 (it will skip weekends and ask for punch on holidays):
|
22
20
|
|
23
|
-
|
21
|
+
$ balboa punch -s '11/11/2011,12/12/2012,13/12/2012'
|
22
|
+
|
23
|
+
Let's suppose you will work for sometime in another project:
|
24
|
+
|
25
|
+
$ balboa punch -w 'Another Project'
|
26
|
+
|
27
|
+
Let's suppose you did not input your password (or changed it after setting balboa up) on the first run. You can either:
|
28
|
+
|
29
|
+
$ balboa reset # Or
|
30
|
+
$ balboa punch -p 'New Password'
|
31
|
+
|
32
|
+
Let's suppose you don't have phantomjs on your machine. Balboa doesn't care, it will install it for you. Just punch normally.
|
33
|
+
|
34
|
+
$ balboa punch
|
35
|
+
|
36
|
+
Let's suppose you don't understand what those `|number|` means. It is the calculated default schedule. Just press enter and Balboa will fill it up for you.
|
24
37
|
|
25
|
-
|
38
|
+
```
|
39
|
+
First shift: |8|
|
40
|
+
|
41
|
+
Lunch: |12|
|
42
|
+
|
43
|
+
Second shift: |13|
|
44
|
+
|
45
|
+
Leave: |18|
|
46
|
+
```
|
26
47
|
|
27
|
-
|
48
|
+
Let's suppose your schedule is different from the default. Balboa will help you out.
|
28
49
|
|
29
|
-
|
50
|
+
```
|
51
|
+
First shift: |8| 10
|
52
|
+
|
53
|
+
Lunch: |14| 15
|
30
54
|
|
31
|
-
|
55
|
+
Second shift: |16|
|
56
|
+
|
57
|
+
Leave: |19|
|
58
|
+
```
|
32
59
|
|
33
60
|
## Contributing
|
34
61
|
|
@@ -38,4 +65,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
|
|
38
65
|
## License
|
39
66
|
|
40
67
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
data/lib/balboa/cli/defaults.rb
CHANGED
@@ -5,6 +5,8 @@ require 'yaml'
|
|
5
5
|
module Balboa
|
6
6
|
module CLI
|
7
7
|
class Defaults
|
8
|
+
TOTAL_WORK_HOURS = 8
|
9
|
+
|
8
10
|
def self.prompt(*args)
|
9
11
|
new(*args).prompt
|
10
12
|
end
|
@@ -36,6 +38,8 @@ module Balboa
|
|
36
38
|
end
|
37
39
|
|
38
40
|
def prompt_attributes
|
41
|
+
@cli.say("\nFirst run. Please type your settings!")
|
42
|
+
|
39
43
|
@config['email'] = prompt_email
|
40
44
|
@config['password'] = prompt_password
|
41
45
|
@config['project'] = prompt_project
|
@@ -67,15 +71,23 @@ module Balboa
|
|
67
71
|
end
|
68
72
|
|
69
73
|
def prompt_lunch
|
70
|
-
|
74
|
+
default = @config['start_at'].to_i + 4
|
75
|
+
|
76
|
+
@cli.ask("\nLunch: ") { |qst| qst.default = default.to_s }
|
71
77
|
end
|
72
78
|
|
73
79
|
def prompt_restart
|
74
|
-
|
80
|
+
default = @config['lunch_at'].to_i + 1
|
81
|
+
|
82
|
+
@cli.ask("\nSecond shift: ") { |qst| qst.default = default.to_s }
|
75
83
|
end
|
76
84
|
|
77
85
|
def prompt_leave
|
78
|
-
|
86
|
+
default = TOTAL_WORK_HOURS
|
87
|
+
default -= @config['lunch_at'].to_i - @config['start_at'].to_i
|
88
|
+
default += @config['restart_at'].to_i
|
89
|
+
|
90
|
+
@cli.ask("\nLeave: ") { |qst| qst.default = default.to_s }
|
79
91
|
end
|
80
92
|
end
|
81
93
|
end
|
data/lib/balboa/version.rb
CHANGED