dtachr 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.md +19 -6
  2. data/Rakefile +6 -5
  3. data/dtachr.gemspec +11 -4
  4. data/lib/dtachr.rb +17 -15
  5. metadata +14 -8
data/README.md CHANGED
@@ -1,8 +1,22 @@
1
- = dtachr
1
+ # dtachr
2
2
 
3
- Description goes here.
3
+ `dtachr` wraps the [dtach](http://dtach.sourceforge.net) command line utlity
4
+ to automate the creation of a socket file and send a notification to
5
+ [terminal-notifier](https://github.com/alloy/terminal-notifier). This utility
6
+ will only work with both `dtach` and `terminal-notifier` installed and in
7
+ PATH.
4
8
 
5
- == Contributing to dtachr
9
+ ## Install Dependencies
10
+
11
+ The recommended method of installation is [Homebrew](http://brew.sh). With
12
+ Homebrew it is as simple as `brew install dtach terminal-notifier`. Both the
13
+ `dtach` and `terminal-notifier` commands must be available in the PATH for
14
+ dtachr to function.
15
+
16
+ In the future I'd like to add support for various notifiers so this can be used
17
+ somewhere besides OSX.
18
+
19
+ ## Contributing to dtachr
6
20
 
7
21
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
22
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
@@ -12,8 +26,7 @@ Description goes here.
12
26
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
27
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
28
 
15
- == Copyright
29
+ ## Copyright
16
30
 
17
- Copyright (c) 2013 Bryan Swift. See LICENSE.txt for
18
- further details.
31
+ Copyright (c) 2013 Bryan Swift. See LICENSE.txt for further details.
19
32
 
data/Rakefile CHANGED
@@ -87,16 +87,17 @@ end
87
87
  #
88
88
  #############################################################################
89
89
 
90
- desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
91
- task :release => :build do
90
+ desc "Create tag v#{version}"
91
+ task :release do
92
92
  unless `git branch` =~ /^\* master$/
93
93
  puts "You must be on the master branch to release!"
94
94
  exit!
95
95
  end
96
- sh "git commit --allow-empty -a -m 'Release #{version}'"
97
96
  sh "git tag v#{version}"
98
- sh "git push origin master"
99
- sh "git push origin v#{version}"
97
+ end
98
+
99
+ desc "Push #{gem_file} to Rubygems"
100
+ task :publish do
100
101
  sh "gem push pkg/#{name}-#{version}.gem"
101
102
  end
102
103
 
data/dtachr.gemspec CHANGED
@@ -13,14 +13,20 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'dtachr'
16
- s.version = '0.0.2'
17
- s.date = '2013-11-08'
16
+ s.version = '0.0.3'
17
+ s.date = '2013-11-14'
18
18
  s.rubyforge_project = 'dtachr'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
21
21
  ## as you like.
22
- s.summary = "Short description used in Gem listings."
23
- s.description = "Long description. Maybe copied from the README."
22
+ s.summary = "Wrapper for `dtach` utility."
23
+ s.description = <<DESC
24
+ `dtachr` wraps the [dtach](http://dtach.sourceforge.net) command line utlity
25
+ to automate the creation of a socket file and send a notification to
26
+ [terminal-notifier](https://github.com/alloy/terminal-notifier). This utility
27
+ will only work with both `dtach` and `terminal-notifier` installed and in
28
+ PATH.
29
+ DESC
24
30
 
25
31
  ## List the primary authors. If there are a bunch of authors, it's probably
26
32
  ## better to set the email to an email list or something. If you don't have
@@ -28,6 +34,7 @@ Gem::Specification.new do |s|
28
34
  s.authors = ["Bryan Swift"]
29
35
  s.email = 'bryan.j.swift@gmail.com'
30
36
  s.homepage = 'http://github.com/bryanjswift/dtachr'
37
+ s.license = 'MIT'
31
38
 
32
39
  ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
33
40
  ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
data/lib/dtachr.rb CHANGED
@@ -5,25 +5,27 @@ require 'rubygems'
5
5
  require 'docopt'
6
6
 
7
7
  module Dtachr
8
-
9
- VERSION = '0.0.2'
8
+
9
+ VERSION = '0.0.3'
10
+ NAME = 'dtachr'
11
+
10
12
  DOC = <<-DOCOPT
11
13
  dtachr
12
14
 
13
15
  Usage:
14
- #{__FILE__} [--socket=<sock>] <parts>...
15
- #{__FILE__} -h | --help
16
- #{__FILE__} -v | --version
16
+ #{Dtachr::NAME} [--socket=<sock>] <parts>...
17
+ #{Dtachr::NAME} -h | --help
18
+ #{Dtachr::NAME} -v | --version
17
19
 
18
20
  Options:
19
- -h --help Show this screen
20
- -v --version Show the version
21
- -n --socket=<sock> Temporary file to use as socket for dtach command
21
+ -h --help Show this screen
22
+ -v --version Show the version
23
+ -n --socket=<sock> Temporary file to use as socket for dtach command
22
24
 
23
25
  DOCOPT
24
-
26
+
25
27
  class Runner
26
-
28
+
27
29
  def initialize(args)
28
30
  @opts = Docopt::docopt(Dtachr::DOC, {
29
31
  :argv => args,
@@ -34,14 +36,14 @@ module Dtachr
34
36
  rescue Docopt::Exit => e
35
37
  puts e.message
36
38
  end
37
-
39
+
38
40
  def call
39
41
  return unless @opts
40
42
  execute("dtach -n #{@socket} #{@command} && terminal-notifier -message '`#{@command}` finished.'")
41
43
  end
42
-
44
+
43
45
  private
44
-
46
+
45
47
  def execute(command)
46
48
  `#{command}`
47
49
  end
@@ -49,7 +51,7 @@ module Dtachr
49
51
  def gen_socket
50
52
  "tmp"
51
53
  end
52
-
54
+
53
55
  end
54
-
56
+
55
57
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dtachr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bryan Swift
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-11-08 00:00:00 -05:00
18
+ date: 2013-11-14 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -74,7 +74,13 @@ dependencies:
74
74
  name: rdoc
75
75
  version_requirements: *id003
76
76
  prerelease: false
77
- description: Long description. Maybe copied from the README.
77
+ description: |
78
+ `dtachr` wraps the [dtach](http://dtach.sourceforge.net) command line utlity
79
+ to automate the creation of a socket file and send a notification to
80
+ [terminal-notifier](https://github.com/alloy/terminal-notifier). This utility
81
+ will only work with both `dtach` and `terminal-notifier` installed and in
82
+ PATH.
83
+
78
84
  email: bryan.j.swift@gmail.com
79
85
  executables:
80
86
  - dtachr
@@ -94,8 +100,8 @@ files:
94
100
  - lib/dtachr.rb
95
101
  has_rdoc: true
96
102
  homepage: http://github.com/bryanjswift/dtachr
97
- licenses: []
98
-
103
+ licenses:
104
+ - MIT
99
105
  post_install_message:
100
106
  rdoc_options:
101
107
  - --charset=UTF-8
@@ -125,6 +131,6 @@ rubyforge_project: dtachr
125
131
  rubygems_version: 1.6.2
126
132
  signing_key:
127
133
  specification_version: 2
128
- summary: Short description used in Gem listings.
134
+ summary: Wrapper for `dtach` utility.
129
135
  test_files: []
130
136