cmd_tools 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -20,3 +20,7 @@ Launch emacs in (G|C)UI mode.
20
20
  ==== Usage
21
21
  alias em='emacs_launcher_gui'
22
22
  alias e='emacs_launcher_cui'
23
+ === +emacs_launcher_stop+
24
+ Stop emacs daemon launched by +emacs_launcher_(g|c)ui+.
25
+ ==== Usage
26
+ emacs_launcher_stop
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "cmd_tools"
4
+ ::CmdTools::Bin::EmacsLauncher.stop
data/cmd_tools.gemspec CHANGED
@@ -21,6 +21,7 @@ Command line tools:
21
21
  s.executables << 'tsh'
22
22
  s.executables << 'emacs_launcher_gui'
23
23
  s.executables << 'emacs_launcher_cui'
24
+ s.executables << 'emacs_launcher_stop'
24
25
  s.post_install_message = <<-EOS
25
26
 
26
27
  # CmdTools.
@@ -18,17 +18,22 @@ module CmdTools
18
18
  case mode
19
19
  when :gui
20
20
  if self.number_of_frames <= 1 # emacs daemon has one (invisible) frame.
21
- system "emacsclient -c -n #{files}"
21
+ exec "emacsclient -c -n #{files}"
22
22
  else
23
- system "emacsclient -n #{files}"
23
+ exec "emacsclient -n #{files}"
24
24
  end
25
25
  when :cui
26
- system "emacsclient -t #{files}"
26
+ exec "emacsclient -t #{files}"
27
27
  else
28
28
  raise ArgumentError, "Unknown mode: #{mode}"
29
29
  end
30
30
  end
31
31
 
32
+ # Stop emacs daemon.
33
+ def self.stop
34
+ exec "emacsclient -e '(kill-emacs)'"
35
+ end
36
+
32
37
  def self.daemon_running?
33
38
  system "emacsclient -e '()' > /dev/null 2>&1"
34
39
  end
@@ -1,3 +1,3 @@
1
1
  module CmdTools
2
- VERSION = '1.0.4'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cmd_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-21 00:00:00.000000000 Z
12
+ date: 2012-08-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby_patch
16
- requirement: &2153327180 !ruby/object:Gem::Requirement
16
+ requirement: &2156021280 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0.3'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2153327180
24
+ version_requirements: *2156021280
25
25
  description: ! "Command line tools:\n tsh: mv files to ~/.myTrash.\n bak: backup
26
26
  files.\n emacs_launcher_(g|c)ui: launch emacsclient and daemon (if necessary).\n"
27
27
  email:
@@ -30,6 +30,7 @@ executables:
30
30
  - tsh
31
31
  - emacs_launcher_gui
32
32
  - emacs_launcher_cui
33
+ - emacs_launcher_stop
33
34
  extensions: []
34
35
  extra_rdoc_files: []
35
36
  files:
@@ -37,6 +38,7 @@ files:
37
38
  - bin/bak
38
39
  - bin/emacs_launcher_cui
39
40
  - bin/emacs_launcher_gui
41
+ - bin/emacs_launcher_stop
40
42
  - bin/tsh
41
43
  - cmd_tools.gemspec
42
44
  - lib/cmd_tools.rb