working_man 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ .DS_Store
2
+ results.html
3
+ pkg
4
+ html
5
+ config/setup.yml
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in working_man.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,23 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ working_man (0.0.1)
5
+ methadone
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ json (1.6.5)
11
+ methadone (0.5.1)
12
+ bundler
13
+ rake (0.9.2.2)
14
+ rdoc (3.12)
15
+ json (~> 1.4)
16
+
17
+ PLATFORMS
18
+ ruby
19
+
20
+ DEPENDENCIES
21
+ rake (~> 0.9.2)
22
+ rdoc
23
+ working_man!
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Evan Machnic
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # WorkingMan
2
+
3
+ WorkingMan is here to help you get started with your work day. He opens the
4
+ applications you need as well as any URLs.
5
+
6
+ ## Installation
7
+
8
+ Install like normal in your system then start/stop as needed.
9
+
10
+ $ gem install working_man
11
+
12
+ ## Usage
13
+
14
+ WorkingMan reads applications and URLs from `config/setup.yml`. You just need
15
+ to customize it to your needs and then run.
16
+
17
+ To start your work day, run the following:
18
+
19
+ $ working_man start
20
+
21
+ After you're finished with work, run:
22
+
23
+ $ working_man stop
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ require 'bundler'
2
+ require 'rake/clean'
3
+ require 'rake/testtask'
4
+ gem 'rdoc' # we need the installed RDoc gem, not the system one
5
+ require 'rdoc/task'
6
+
7
+ include Rake::DSL
8
+
9
+ Bundler::GemHelper.install_tasks
10
+
11
+ Rake::TestTask.new do |t|
12
+ t.pattern = 'test/tc_*.rb'
13
+ end
14
+
15
+ Rake::RDocTask.new do |rd|
16
+
17
+ rd.main = "README.rdoc"
18
+
19
+ rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
20
+ end
21
+
22
+ task :default => [:test,:features]
data/bin/working_man ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'methadone'
5
+ require 'working_man'
6
+
7
+ include Methadone::Main
8
+
9
+ main do |run_type|
10
+ # your program code here
11
+ # You can access CLI options via
12
+ # the options Hash
13
+ case run_type
14
+ when "start"
15
+ WorkingMan.start_work
16
+ when "stop"
17
+ WorkingMan.stop_work
18
+ end
19
+ end
20
+
21
+ # supplemental methods here
22
+
23
+ # Declare command-line interface here
24
+
25
+ # description "one line description of your app"
26
+ #
27
+ # Accept flags via:
28
+ # on("--flag VAL","Some flag")
29
+ # options[flag] will contain VAL
30
+ #
31
+ # Specify switches via:
32
+ # on("--[no-]switch","Some switch")
33
+ #
34
+ # Or, just call OptionParser methods on opts
35
+ #
36
+ # Require an argument
37
+ # arg :some_arg
38
+ #
39
+ # # Make an argument optional
40
+ # arg :optional_arg, :optional
41
+
42
+ version WorkingMan::VERSION
43
+
44
+ go!
@@ -0,0 +1,11 @@
1
+ # Default applications for startup and shutdown.
2
+ # Add/remove applications to customize
3
+ apps:
4
+ - 'Google Chrome'
5
+ - 'Propane'
6
+ - 'Skype'
7
+ - 'iChat'
8
+
9
+ # URLs open in default browser
10
+ urls:
11
+ - 'http://google.com'
@@ -0,0 +1,21 @@
1
+ module WorkingMan
2
+ class Actions
3
+ def self.close_applications apps
4
+ apps.each do |app_name|
5
+ `osascript -e "tell application \\"#{app_name}\\" to quit"`
6
+ end
7
+ end
8
+
9
+ def self.launch_applications apps
10
+ apps.each do |app_name|
11
+ `open -a "#{app_name}.app"`
12
+ end
13
+ end
14
+
15
+ def self.open_urls urls
16
+ urls.each do |url|
17
+ `open #{url}`
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,3 @@
1
+ module WorkingMan
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,15 @@
1
+ require "working_man/version"
2
+ require "working_man/actions"
3
+
4
+ module WorkingMan
5
+ @config = YAML::load(File.open('config/setup.yml'))
6
+
7
+ def self.start_work
8
+ WorkingMan::Actions.launch_applications(@config['apps'])
9
+ WorkingMan::Actions.open_urls(@config['urls'])
10
+ end
11
+
12
+ def self.stop_work
13
+ WorkingMan::Actions.close_applications(@config['apps'])
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ require 'test/unit'
2
+
3
+ class TestSomething < Test::Unit::TestCase
4
+ def test_truth
5
+ assert true
6
+ end
7
+ end
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/working_man/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Evan Machnic"]
6
+ gem.email = ["emachnic@broadmac.net"]
7
+ gem.description = %q{Start/stop your work apps for the day}
8
+ gem.summary = %q{Start/stop your work apps for the day}
9
+ gem.homepage = "http://github.com/emachnic/working_man"
10
+
11
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
+ gem.files = `git ls-files`.split("\n")
13
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
+ gem.name = "working_man"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = WorkingMan::VERSION
17
+ gem.add_development_dependency('rdoc')
18
+ gem.add_development_dependency('rake','~> 0.9.2')
19
+ gem.add_dependency('methadone')
20
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: working_man
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Evan Machnic
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-03-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rdoc
16
+ requirement: &70129259281780 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70129259281780
25
+ - !ruby/object:Gem::Dependency
26
+ name: rake
27
+ requirement: &70129259281180 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 0.9.2
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70129259281180
36
+ - !ruby/object:Gem::Dependency
37
+ name: methadone
38
+ requirement: &70129259280680 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70129259280680
47
+ description: Start/stop your work apps for the day
48
+ email:
49
+ - emachnic@broadmac.net
50
+ executables:
51
+ - working_man
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - .gitignore
56
+ - Gemfile
57
+ - Gemfile.lock
58
+ - LICENSE
59
+ - README.md
60
+ - Rakefile
61
+ - bin/working_man
62
+ - config/setup.yml.example
63
+ - lib/working_man.rb
64
+ - lib/working_man/actions.rb
65
+ - lib/working_man/version.rb
66
+ - test/tc_something.rb
67
+ - working_man.gemspec
68
+ homepage: http://github.com/emachnic/working_man
69
+ licenses: []
70
+ post_install_message:
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ segments:
81
+ - 0
82
+ hash: -175493272456662049
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ segments:
90
+ - 0
91
+ hash: -175493272456662049
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 1.8.17
95
+ signing_key:
96
+ specification_version: 3
97
+ summary: Start/stop your work apps for the day
98
+ test_files:
99
+ - test/tc_something.rb