launchr 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,44 @@
1
+ # rcov generated
2
+ coverage
3
+
4
+ # rdoc generated
5
+ rdoc
6
+
7
+ # yard generated
8
+ doc
9
+ .yardoc
10
+
11
+ # jeweler generated
12
+ pkg
13
+
14
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
15
+ #
16
+ # * Create a file at ~/.gitignore
17
+ # * Include files you want ignored
18
+ # * Run: git config --global core.excludesfile ~/.gitignore
19
+ #
20
+ # After doing this, these files will be ignored in all your git projects,
21
+ # saving you from having to 'pollute' every project you touch with them
22
+ #
23
+ # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
24
+ #
25
+ # For MacOS:
26
+ #
27
+ #.DS_Store
28
+ #
29
+ # For TextMate
30
+ #*.tmproj
31
+ #tmtags
32
+ #
33
+ # For emacs:
34
+ #*~
35
+ #\#*
36
+ #.\#*
37
+ #
38
+ # For vim:
39
+ #*.swp
40
+
41
+ ext/*.o
42
+ ext/launchd-socket-listener-unload
43
+
44
+
data/.yardopts ADDED
@@ -0,0 +1,4 @@
1
+ --no-private
2
+ --exclude "mixin\/plist4r*"
3
+ -
4
+ "LICENSE"
data/Gemfile ADDED
@@ -0,0 +1,24 @@
1
+ # Add dependencies required to use your gem here.
2
+ group :runtime do
3
+ #gem 'bundler', '>= 0.9.5'
4
+ end
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+
10
+ gem "yard", ">= 0"
11
+
12
+ gem "bundler", ">= 0.9.5"
13
+
14
+ gem "jeweler", ">= 1.4.0"
15
+
16
+ gem "rcov", ">= 0"
17
+
18
+ gem "rspec", ">= 1.3.0"
19
+
20
+ gem "cucumber", ">= 0"
21
+
22
+ gem "grancher", ">= 0"
23
+
24
+ end
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Dreamcat4
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,63 @@
1
+ = brew launchd
2
+
3
+ An extension to start and stop Launchd services.
4
+
5
+ == Installation
6
+
7
+ * Get the launchd core changes for homebrew (until they merge it)
8
+
9
+ brew update
10
+ git config core.whitespace nowarn
11
+ git remote add dreamcat4 git://github.com/dreamcat4/homebrew.git
12
+ git fetch --no-tags dreamcat4 +issue-148-launchd:launchd-core-changes
13
+ git rebase launchd-core-changes
14
+
15
+ == Usage
16
+
17
+ $ brew launchd --help
18
+ start service,(s) Start launchd service(s)
19
+ Equivalent to launchctl load -w files...
20
+ Example $ brew start dnsmasq memcached couchdb
21
+
22
+ stop service,(s) Stop launchd service(s)
23
+ Equivalent to launchctl unload -w files...
24
+ Example $ brew stop mamcached dnsmasq
25
+
26
+ restart service,(s) Restart launchd service(s)
27
+ Example $ brew restart couchdb
28
+
29
+ --user At user login.
30
+ Otherwise, the default setting will be used.
31
+ Example $ brew start --user openvpn ddclient
32
+
33
+ --boot At boot time. Requires sudo/root privelidges.
34
+ Otherwise, the default setting will be used.
35
+ Example $ sudo brew start --boot nginx mysql
36
+
37
+ info [service,(s)] Info for launchd service(s)
38
+ With no arguments prints info for all services.
39
+ Example $ brew launchd info
40
+
41
+ clean Clean missing/broken launchd service(s).
42
+
43
+ Examples $ brew launchd clean
44
+ $ sudo brew launchd clean
45
+
46
+ default [--user|--boot] Set the default target to start launchd services.
47
+ The initial setting, --user will start daemons at
48
+ user login - from the Loginwindow (not over ssh).
49
+
50
+ Wheras --boot will set services to start at boot
51
+ time. But be aware that brew should be installed
52
+ to the root filesystem, not on a mounted volume.
53
+
54
+ Examples $ brew launchd default --boot
55
+ $ brew launchd default --user
56
+
57
+ --help Show this message
58
+
59
+ --version Print version information
60
+
61
+ == Copyright
62
+
63
+ Copyright (c) 2010 Dreamcat4. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,78 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+
5
+ # require 'bundler'
6
+ # begin
7
+ # Bundler.setup(:runtime, :development)
8
+ # rescue Bundler::BundlerError => e
9
+ # $stderr.puts e.message
10
+ # $stderr.puts "Run `bundle install` to install missing gems"
11
+ # exit e.status_code
12
+ # end
13
+
14
+
15
+
16
+ require 'jeweler'
17
+ Jeweler::Tasks.new do |gem|
18
+ gem.name = "launchr"
19
+ gem.summary = %Q{Dreamcat4's launchr. For managing launchd plists}
20
+ gem.description = %Q{--In development-- Launchr is meant as an easy-to-use stand in replacement for launchctl. Launchr is a companion tool to Brew (Mac Homebrew). Install launchr to manage launchd services in a convenient way.}
21
+ gem.email = "dreamcat4@gmail.com"
22
+ gem.homepage = "http://github.com/dreamcat4/launchr"
23
+ gem.authors = ["Dreamcat4"]
24
+
25
+ # Have dependencies? Add them to Gemfile
26
+
27
+
28
+
29
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
30
+ end
31
+
32
+
33
+
34
+ require 'yard'
35
+ YARD::Rake::YardocTask.new do |t|
36
+ t.after = lambda { `touch doc/.nojekyll` }
37
+ end
38
+
39
+ task :man do
40
+ `cd man1 && ronn *.ronn --manual=brew --organization=Homebrew`
41
+ end
42
+
43
+ require 'spec/rake/spectask'
44
+ Spec::Rake::SpecTask.new(:spec) do |spec|
45
+ spec.libs << 'lib' << 'spec'
46
+ spec.pattern = 'spec/**/*_spec.rb'
47
+ end
48
+
49
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
50
+ spec.libs << 'lib' << 'spec'
51
+ spec.pattern = 'spec/**/*_spec.rb'
52
+ spec.rcov = true
53
+ end
54
+
55
+
56
+
57
+
58
+ require 'cucumber/rake/task'
59
+ Cucumber::Rake::Task.new(:features)
60
+
61
+
62
+
63
+
64
+ Jeweler::GhpagesTasks.new do |ghpages|
65
+ ghpages.push_on_release = true
66
+ ghpages.set_repo_homepage = true
67
+ ghpages.user_github_com = false
68
+ ghpages.doc_task = "yard"
69
+ ghpages.keep_files = []
70
+ ghpages.map_paths = {
71
+ "doc" => "",
72
+ }
73
+ end
74
+
75
+
76
+
77
+
78
+ task :default => :spec
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.1.0
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Put back the command name onto ARGV
4
+ launchr_subcommand = File.basename(__FILE__).gsub(/^brew-|\.rb$/,"")
5
+ unless ["launchd"].include?(launchr_subcommand)
6
+ ARGV.unshift launchr_subcommand
7
+ end
8
+
9
+ # Get the real path if was executed as a symlink
10
+ require 'pathname'
11
+ __FILE_REALPATH__ = Pathname.new(__FILE__).realpath
12
+ LAUNCHR_BIN = File.expand_path(File.dirname(__FILE_REALPATH__)+"/launchr")
13
+
14
+
15
+ dir = File.expand_path "../lib", File.dirname(LAUNCHR_BIN)
16
+ $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
17
+
18
+
19
+ # Into the rabbit hole
20
+ require 'launchr/application'
21
+ app = Launchr::Application.new
22
+
23
+
24
+
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Put back the command name onto ARGV
4
+ launchr_subcommand = File.basename(__FILE__).gsub(/^brew-|\.rb$/,"")
5
+ unless ["launchd"].include?(launchr_subcommand)
6
+ ARGV.unshift launchr_subcommand
7
+ end
8
+
9
+ # Get the real path if was executed as a symlink
10
+ require 'pathname'
11
+ __FILE_REALPATH__ = Pathname.new(__FILE__).realpath
12
+ LAUNCHR_BIN = File.expand_path(File.dirname(__FILE_REALPATH__)+"/launchr")
13
+
14
+
15
+ dir = File.expand_path "../lib", File.dirname(LAUNCHR_BIN)
16
+ $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
17
+
18
+
19
+ # Into the rabbit hole
20
+ require 'launchr/application'
21
+ app = Launchr::Application.new
22
+
data/bin/brew-start.rb ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Put back the command name onto ARGV
4
+ launchr_subcommand = File.basename(__FILE__).gsub(/^brew-|\.rb$/,"")
5
+ unless ["launchd"].include?(launchr_subcommand)
6
+ ARGV.unshift launchr_subcommand
7
+ end
8
+
9
+ # Get the real path if was executed as a symlink
10
+ require 'pathname'
11
+ __FILE_REALPATH__ = Pathname.new(__FILE__).realpath
12
+ LAUNCHR_BIN = File.expand_path(File.dirname(__FILE_REALPATH__)+"/launchr")
13
+
14
+
15
+ dir = File.expand_path "../lib", File.dirname(LAUNCHR_BIN)
16
+ $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
17
+
18
+
19
+ # Into the rabbit hole
20
+ require 'launchr/application'
21
+ app = Launchr::Application.new
22
+
23
+
24
+
data/bin/brew-stop.rb ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Put back the command name onto ARGV
4
+ launchr_subcommand = File.basename(__FILE__).gsub(/^brew-|\.rb$/,"")
5
+ unless ["launchd"].include?(launchr_subcommand)
6
+ ARGV.unshift launchr_subcommand
7
+ end
8
+
9
+ # Get the real path if was executed as a symlink
10
+ require 'pathname'
11
+ __FILE_REALPATH__ = Pathname.new(__FILE__).realpath
12
+ LAUNCHR_BIN = File.expand_path(File.dirname(__FILE_REALPATH__)+"/launchr")
13
+
14
+
15
+ dir = File.expand_path "../lib", File.dirname(LAUNCHR_BIN)
16
+ $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
17
+
18
+
19
+ # Into the rabbit hole
20
+ require 'launchr/application'
21
+ app = Launchr::Application.new
22
+
23
+
24
+
data/ext/Makefile ADDED
@@ -0,0 +1,157 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ #### Start of system configuration section. ####
5
+
6
+ srcdir = .
7
+ topdir = /opt/rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/i686-darwin10.2.0
8
+ hdrdir = $(topdir)
9
+ VPATH = $(srcdir):$(topdir):$(hdrdir)
10
+ exec_prefix = $(prefix)
11
+ prefix = $(DESTDIR)/opt/rvm/rubies/ree-1.8.7-2010.01
12
+ sharedstatedir = $(prefix)/com
13
+ mandir = $(datarootdir)/man
14
+ psdir = $(docdir)
15
+ oldincludedir = $(DESTDIR)/usr/include
16
+ localedir = $(datarootdir)/locale
17
+ bindir = $(exec_prefix)/bin
18
+ libexecdir = $(exec_prefix)/libexec
19
+ sitedir = $(libdir)/ruby/site_ruby
20
+ htmldir = $(docdir)
21
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
22
+ includedir = $(prefix)/include
23
+ infodir = $(datarootdir)/info
24
+ vendorlibdir = $(vendordir)/$(ruby_version)
25
+ sysconfdir = $(prefix)/etc
26
+ libdir = $(exec_prefix)/lib
27
+ sbindir = $(exec_prefix)/sbin
28
+ rubylibdir = $(libdir)/ruby/$(ruby_version)
29
+ docdir = $(datarootdir)/doc/$(PACKAGE)
30
+ dvidir = $(docdir)
31
+ vendordir = $(libdir)/ruby/vendor_ruby
32
+ datarootdir = $(prefix)/share
33
+ pdfdir = $(docdir)
34
+ archdir = $(rubylibdir)/$(arch)
35
+ sitearchdir = $(sitelibdir)/$(sitearch)
36
+ datadir = $(datarootdir)
37
+ localstatedir = $(prefix)/var
38
+ sitelibdir = $(sitedir)/$(ruby_version)
39
+
40
+ CC = gcc
41
+ LIBRUBY = $(LIBRUBY_A)
42
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
43
+ LIBRUBYARG_SHARED =
44
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
45
+
46
+ RUBY_EXTCONF_H =
47
+ CFLAGS = -fno-common -g -O2 -pipe -fno-common $(cflags)
48
+ INCFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)
49
+ DEFS =
50
+ CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE $(DEFS) $(cppflags)
51
+ CXXFLAGS = $(CFLAGS)
52
+ ldflags = -L.
53
+ dldflags =
54
+ archflag =
55
+ DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
56
+ LDSHARED = cc -dynamic -undefined suppress -flat_namespace
57
+ AR = ar
58
+ EXEEXT =
59
+
60
+ RUBY_INSTALL_NAME = ruby
61
+ RUBY_SO_NAME = ruby
62
+ arch = i686-darwin10.2.0
63
+ sitearch = i686-darwin10.2.0
64
+ ruby_version = 1.8
65
+ ruby = /opt/rvm/rubies/ree-1.8.7-2010.01/bin/ruby
66
+ RUBY = $(ruby)
67
+ RM = rm -f
68
+ MAKEDIRS = mkdir -p
69
+ INSTALL = /opt/local/bin/ginstall -c
70
+ INSTALL_PROG = $(INSTALL) -m 0755
71
+ INSTALL_DATA = $(INSTALL) -m 644
72
+ COPY = cp
73
+
74
+ #### End of system configuration section. ####
75
+
76
+ preload =
77
+
78
+ libpath = . $(libdir)
79
+ LIBPATH = -L. -L$(libdir)
80
+ DEFFILE =
81
+
82
+ CLEANFILES = mkmf.log
83
+ DISTCLEANFILES =
84
+
85
+ extout =
86
+ extout_prefix =
87
+ target_prefix =
88
+ LOCAL_LIBS =
89
+ LIBS = -ldl -lobjc
90
+ SRCS = launchd-socket-listener-unload.cpp
91
+ OBJS = launchd-socket-listener-unload.o
92
+ TARGET = launchd-socket-listener-unload
93
+ DLLIB = $(TARGET)
94
+ EXTSTATIC =
95
+ STATIC_LIB =
96
+
97
+ BINDIR = $(bindir)
98
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
99
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
100
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
101
+
102
+ TARGET_SO = $(DLLIB)
103
+ CLEANLIBS = $(TARGET) $(TARGET).il? $(TARGET).tds $(TARGET).map
104
+ CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
105
+
106
+ all: $(DLLIB)
107
+ static: $(STATIC_LIB)
108
+
109
+ clean:
110
+ @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
111
+
112
+ distclean: clean
113
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
114
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
115
+
116
+ realclean: distclean
117
+ install: install-so install-rb
118
+
119
+ install-so: $(RUBYARCHDIR)
120
+ install-so: $(RUBYARCHDIR)/$(DLLIB)
121
+ $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
122
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
123
+ install-rb: pre-install-rb install-rb-default
124
+ install-rb-default: pre-install-rb-default
125
+ pre-install-rb: Makefile
126
+ pre-install-rb-default: Makefile
127
+ $(RUBYARCHDIR):
128
+ $(MAKEDIRS) $@
129
+
130
+ site-install: site-install-so site-install-rb
131
+ site-install-so: install-so
132
+ site-install-rb: install-rb
133
+
134
+ .SUFFIXES: .c .m .cc .cxx .cpp .C .o
135
+
136
+ .cc.o:
137
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
138
+
139
+ .cxx.o:
140
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
141
+
142
+ .cpp.o:
143
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
144
+
145
+ .C.o:
146
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
147
+
148
+ .c.o:
149
+ $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
150
+
151
+ $(DLLIB): $(OBJS) Makefile
152
+ @-$(RM) $@
153
+ $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
154
+
155
+
156
+
157
+ $(OBJS): ruby.h defines.h