launch-agent 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/bin/launch-agent-daemonize +17 -0
- data/{ruby-launch-agent.gemspec → launch-agent.gemspec} +16 -20
- data/lib/launch_agent/daemon.rb +5 -0
- data/spec/daemon_spec.rb +5 -0
- metadata +12 -13
- data/.gitignore +0 -21
data/Rakefile
CHANGED
@@ -12,6 +12,7 @@ begin
|
|
12
12
|
gem.authors = ["youpy"]
|
13
13
|
gem.add_development_dependency "rspec", ">= 1.2.9"
|
14
14
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
|
+
gem.executables = ["launch-agent-daemonize"]
|
15
16
|
end
|
16
17
|
Jeweler::GemcutterTasks.new
|
17
18
|
rescue LoadError
|
@@ -34,7 +35,7 @@ task :spec => :check_dependencies
|
|
34
35
|
|
35
36
|
task :default => :spec
|
36
37
|
|
37
|
-
require '
|
38
|
+
require 'rdoc/task'
|
38
39
|
Rake::RDocTask.new do |rdoc|
|
39
40
|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
40
41
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
%w/rubygems launch_agent/.each {|g| require g }
|
4
|
+
|
5
|
+
def usage
|
6
|
+
print <<EOM
|
7
|
+
usage: #{File.basename($0)} command [arg ...]
|
8
|
+
EOM
|
9
|
+
exit 0
|
10
|
+
end
|
11
|
+
|
12
|
+
usage if ARGV.empty?
|
13
|
+
|
14
|
+
agent = LaunchAgent::Daemon.new(*ARGV)
|
15
|
+
action = agent.loaded? ? :unload : :load
|
16
|
+
agent.send(action)
|
17
|
+
warn '%s "%s"' % [action, ARGV.join(' ')]
|
@@ -1,44 +1,40 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{
|
7
|
+
s.name = %q{launch-agent}
|
8
8
|
s.version = "0.0.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["youpy"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-12-21}
|
13
|
+
s.default_executable = %q{launch-agent-daemonize}
|
13
14
|
s.description = %q{A library to use launchd easily}
|
14
15
|
s.email = %q{youpy@buycheapviagraonlinenow.com}
|
16
|
+
s.executables = ["launch-agent-daemonize"]
|
15
17
|
s.extra_rdoc_files = [
|
16
18
|
"LICENSE",
|
17
|
-
|
19
|
+
"README.rdoc"
|
18
20
|
]
|
19
21
|
s.files = [
|
20
22
|
".document",
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
"spec/spec_helper.rb"
|
23
|
+
"LICENSE",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"launch-agent.gemspec",
|
28
|
+
"lib/launch_agent.rb",
|
29
|
+
"lib/launch_agent/daemon.rb",
|
30
|
+
"spec/daemon_spec.rb",
|
31
|
+
"spec/spec.opts",
|
32
|
+
"spec/spec_helper.rb"
|
32
33
|
]
|
33
34
|
s.homepage = %q{http://github.com/youpy/ruby-launch-agent}
|
34
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
35
35
|
s.require_paths = ["lib"]
|
36
36
|
s.rubygems_version = %q{1.3.6}
|
37
37
|
s.summary = %q{A library to use launchd easily}
|
38
|
-
s.test_files = [
|
39
|
-
"spec/daemon_spec.rb",
|
40
|
-
"spec/spec_helper.rb"
|
41
|
-
]
|
42
38
|
|
43
39
|
if s.respond_to? :specification_version then
|
44
40
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
data/lib/launch_agent/daemon.rb
CHANGED
@@ -33,6 +33,11 @@ module LaunchAgent
|
|
33
33
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
34
34
|
<plist version="1.0">
|
35
35
|
<dict>
|
36
|
+
<key>KeepAlive</key>
|
37
|
+
<dict>
|
38
|
+
<key>SuccessfulExit</key>
|
39
|
+
<false/>
|
40
|
+
</dict>
|
36
41
|
<key>Label</key>
|
37
42
|
<string>%s</string>
|
38
43
|
<key>ProgramArguments</key>
|
data/spec/daemon_spec.rb
CHANGED
@@ -24,6 +24,11 @@ describe LaunchAgent::Daemon do
|
|
24
24
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
25
25
|
<plist version="1.0">
|
26
26
|
<dict>
|
27
|
+
<key>KeepAlive</key>
|
28
|
+
<dict>
|
29
|
+
<key>SuccessfulExit</key>
|
30
|
+
<false/>
|
31
|
+
</dict>
|
27
32
|
<key>Label</key>
|
28
33
|
<string>com.buycheapviagraonlinenow.ruby__foo_rb</string>
|
29
34
|
<key>ProgramArguments</key>
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
- 0
|
8
7
|
- 1
|
9
|
-
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- youpy
|
@@ -14,8 +14,8 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
18
|
-
default_executable:
|
17
|
+
date: 2011-12-21 00:00:00 +09:00
|
18
|
+
default_executable: launch-agent-daemonize
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rspec
|
@@ -33,8 +33,8 @@ dependencies:
|
|
33
33
|
version_requirements: *id001
|
34
34
|
description: A library to use launchd easily
|
35
35
|
email: youpy@buycheapviagraonlinenow.com
|
36
|
-
executables:
|
37
|
-
|
36
|
+
executables:
|
37
|
+
- launch-agent-daemonize
|
38
38
|
extensions: []
|
39
39
|
|
40
40
|
extra_rdoc_files:
|
@@ -42,14 +42,14 @@ extra_rdoc_files:
|
|
42
42
|
- README.rdoc
|
43
43
|
files:
|
44
44
|
- .document
|
45
|
-
- .gitignore
|
46
45
|
- LICENSE
|
47
46
|
- README.rdoc
|
48
47
|
- Rakefile
|
49
48
|
- VERSION
|
49
|
+
- bin/launch-agent-daemonize
|
50
|
+
- launch-agent.gemspec
|
50
51
|
- lib/launch_agent.rb
|
51
52
|
- lib/launch_agent/daemon.rb
|
52
|
-
- ruby-launch-agent.gemspec
|
53
53
|
- spec/daemon_spec.rb
|
54
54
|
- spec/spec.opts
|
55
55
|
- spec/spec_helper.rb
|
@@ -58,8 +58,8 @@ homepage: http://github.com/youpy/ruby-launch-agent
|
|
58
58
|
licenses: []
|
59
59
|
|
60
60
|
post_install_message:
|
61
|
-
rdoc_options:
|
62
|
-
|
61
|
+
rdoc_options: []
|
62
|
+
|
63
63
|
require_paths:
|
64
64
|
- lib
|
65
65
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -83,6 +83,5 @@ rubygems_version: 1.3.6
|
|
83
83
|
signing_key:
|
84
84
|
specification_version: 3
|
85
85
|
summary: A library to use launchd easily
|
86
|
-
test_files:
|
87
|
-
|
88
|
-
- spec/spec_helper.rb
|
86
|
+
test_files: []
|
87
|
+
|