working_man 0.1.1 → 0.2.0
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.
- data/README.md +17 -1
- data/bin/working_man +11 -5
- data/features/working_man.feature +15 -0
- data/lib/working_man/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -3,9 +3,13 @@
|
|
3
3
|
WorkingMan is here to help you get started with your work day. He opens the
|
4
4
|
applications you need as well as any URLs.
|
5
5
|
|
6
|
+
## Documentation
|
7
|
+
|
8
|
+
[http://rubydoc.info/gems/working_man/](http://rubydoc.info/gems/working_man/)
|
9
|
+
|
6
10
|
## CI Status
|
7
11
|
|
8
|
-
[](http://travis-ci.org/emachnic/working_man)
|
9
13
|
|
10
14
|
|
11
15
|
## Installation
|
@@ -51,3 +55,15 @@ After you're finished with work, run:
|
|
51
55
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
52
56
|
4. Push to the branch (`git push origin my-new-feature`)
|
53
57
|
5. Create new Pull Request
|
58
|
+
|
59
|
+
## License
|
60
|
+
|
61
|
+
"THE BEER-WARE LICENSE" (Revision 42):
|
62
|
+
|
63
|
+
[emachnic@broadmac.net][1] wrote this file. As long as you retain this notice you can do whatever
|
64
|
+
you want with this stuff. If we meet some day, and you think this stuff is worth it, you can
|
65
|
+
buy me a beer in return.
|
66
|
+
|
67
|
+
**Evan B. Machnic**
|
68
|
+
|
69
|
+
[1]: mailto:emachnic@broadmac.net
|
data/bin/working_man
CHANGED
@@ -8,7 +8,9 @@ include Methadone::Main
|
|
8
8
|
include Methadone::CLILogging
|
9
9
|
|
10
10
|
main do |run_type|
|
11
|
-
|
11
|
+
config_path = File.expand_path("#{options[:file]}")
|
12
|
+
|
13
|
+
check_config(config_path)
|
12
14
|
|
13
15
|
case run_type
|
14
16
|
when "start"
|
@@ -23,12 +25,10 @@ end
|
|
23
25
|
#
|
24
26
|
# Examples:
|
25
27
|
#
|
26
|
-
# check_config
|
28
|
+
# check_config(config_path)
|
27
29
|
#
|
28
30
|
# Returns true if everything passes
|
29
|
-
def check_config
|
30
|
-
config_path = File.expand_path('~/.working_man.yml')
|
31
|
-
|
31
|
+
def check_config(config_path)
|
32
32
|
if File.exists?(config_path)
|
33
33
|
check_config_format(config_path)
|
34
34
|
return true
|
@@ -64,6 +64,12 @@ end
|
|
64
64
|
|
65
65
|
description "WorkingMan starts and stops your work day"
|
66
66
|
|
67
|
+
on('-f path_to_file',
|
68
|
+
'--file',
|
69
|
+
'Specify a different location for YAML config file')
|
70
|
+
|
71
|
+
options[:file] = '~/.working_man.yml'
|
72
|
+
|
67
73
|
# Require run_type
|
68
74
|
arg :run_type, "'start' or 'stop' your work day"
|
69
75
|
|
@@ -24,6 +24,21 @@ Scenario: Start work successfully with app and url
|
|
24
24
|
And I run `working_man start`
|
25
25
|
Then the output should contain "Work hard today"
|
26
26
|
And the exit status should be 0
|
27
|
+
|
28
|
+
Scenario: Start work successfully specifying a config file
|
29
|
+
Given a file named "/tmp/fakehome/dotfiles/working_man_config.yml" with:
|
30
|
+
"""
|
31
|
+
apps:
|
32
|
+
- 'Twitter'
|
33
|
+
urls:
|
34
|
+
- 'http://www.google.com'
|
35
|
+
"""
|
36
|
+
When I run `working_man -f ~/dotfiles/working_man_config.yml start`
|
37
|
+
Then the output should contain "Work hard today"
|
38
|
+
And the exit status should be 0
|
39
|
+
|
40
|
+
|
41
|
+
|
27
42
|
|
28
43
|
Scenario: Start work unsuccessfully without any apps
|
29
44
|
Given a file named "/tmp/fakehome/.working_man.yml" with:
|
data/lib/working_man/version.rb
CHANGED