lunchy 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/History.md +19 -7
  2. data/README.md +8 -0
  3. data/bin/lunchy +2 -0
  4. data/lib/lunchy.rb +13 -3
  5. metadata +17 -5
data/History.md CHANGED
@@ -1,15 +1,27 @@
1
1
  Changes
2
2
  ================
3
3
 
4
+ 0.4.0
5
+ -----
6
+
7
+ - Fix install on 1.8.7 (marshally)
8
+ - Allow management of daemons in /Library/LaunchDaemons when lunchy is run as root
9
+
4
10
  0.3.0
5
- - New 'install' command to install new plist files (spagalloco)
6
- - Support persistent start/stop
7
- - Fix Ruby 1.8 issues, thanks tmm1!
11
+ -----
12
+
13
+ - New 'install' command to install new plist files (spagalloco)
14
+ - Support persistent start/stop
15
+ - Fix Ruby 1.8 issues, thanks tmm1!
8
16
 
9
17
  0.2.0
10
- - Only show agents with plists by default (fhemberger)
11
- - Warn and stop if pattern matches multiple agents (andyjeffries)
12
- - Add 'list', an alias for 'ls' (jnewland)
18
+ -----
19
+
20
+ - Only show agents with plists by default (fhemberger)
21
+ - Warn and stop if pattern matches multiple agents (andyjeffries)
22
+ - Add 'list', an alias for 'ls' (jnewland)
13
23
 
14
24
  0.1.0
15
- Initial release
25
+ -----
26
+
27
+ - Initial release
data/README.md CHANGED
@@ -43,6 +43,14 @@ Installation
43
43
  Lunchy is written in Ruby because I'm a good Ruby developer and a poor Bash developer. Help welcome.
44
44
 
45
45
 
46
+ Thanks
47
+ ---------------
48
+
49
+ Thanks to all the individual contributors who've improved Lunchy, see credits in History.md.
50
+
51
+ Lunchy was written as part of my project time at [Carbon Five](http://carbonfive.com). [We're hiring](http://carbonfive.com/view/page.basic/jobs) if you love working on Ruby and open source.
52
+
53
+
46
54
  About
47
55
  -----------------
48
56
 
data/bin/lunchy CHANGED
@@ -38,6 +38,8 @@ Example:
38
38
  lunchy stop mongo
39
39
  lunchy status mysql
40
40
  lunchy install /usr/local/Cellar/redis/2.2.2/io.redis.redis-server.plist
41
+
42
+ Note: if you run lunchy as root, you can manage daemons in /Library/LaunchDaemons also.
41
43
  EOS
42
44
  end
43
45
  option_parser.parse!
data/lib/lunchy.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'fileutils'
2
2
 
3
3
  class Lunchy
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
 
6
6
  def start(params)
7
7
  raise ArgumentError, "start [-w] [name]" if params.empty?
@@ -58,7 +58,7 @@ class Lunchy
58
58
  raise ArgumentError, "install [file]" if params.empty?
59
59
  filename = params[0]
60
60
  %w(~/Library/LaunchAgents /Library/LaunchAgents).each do |dir|
61
- if Dir.exist?(File.expand_path(dir))
61
+ if File.exist?(File.expand_path(dir))
62
62
  FileUtils.cp filename, File.join(File.expand_path(dir), File.basename(filename))
63
63
  return puts "#{filename} installed to #{dir}"
64
64
  end
@@ -75,7 +75,7 @@ class Lunchy
75
75
  def plists
76
76
  @plists ||= begin
77
77
  plists = {}
78
- %w(/Library/LaunchAgents ~/Library/LaunchAgents).each do |dir|
78
+ dirs.each do |dir|
79
79
  Dir["#{File.expand_path(dir)}/*.plist"].inject(plists) do |memo, filename|
80
80
  memo[File.basename(filename, ".plist")] = filename; memo
81
81
  end
@@ -84,6 +84,16 @@ class Lunchy
84
84
  end
85
85
  end
86
86
 
87
+ def dirs
88
+ result = %w(/Library/LaunchAgents ~/Library/LaunchAgents)
89
+ result << '/Library/LaunchDaemons' if root?
90
+ result
91
+ end
92
+
93
+ def root?
94
+ Process.euid == 0
95
+ end
96
+
87
97
  # def daemons
88
98
  # @daemons ||= begin
89
99
  # content = `launchctl list | grep -v -i "^-\\|anonymous"`
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lunchy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ hash: 15
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
5
11
  platform: ruby
6
12
  authors:
7
13
  - Mike Perham
@@ -9,7 +15,7 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2011-03-31 00:00:00 -07:00
18
+ date: 2011-05-13 00:00:00 -07:00
13
19
  default_executable:
14
20
  dependencies: []
15
21
 
@@ -39,21 +45,27 @@ rdoc_options: []
39
45
  require_paths:
40
46
  - lib
41
47
  required_ruby_version: !ruby/object:Gem::Requirement
48
+ none: false
42
49
  requirements:
43
50
  - - ">="
44
51
  - !ruby/object:Gem::Version
52
+ hash: 3
53
+ segments:
54
+ - 0
45
55
  version: "0"
46
- version:
47
56
  required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
48
58
  requirements:
49
59
  - - ">="
50
60
  - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
51
64
  version: "0"
52
- version:
53
65
  requirements: []
54
66
 
55
67
  rubyforge_project:
56
- rubygems_version: 1.3.5
68
+ rubygems_version: 1.5.2
57
69
  signing_key:
58
70
  specification_version: 3
59
71
  summary: Friendly wrapper around launchctl