komagata-try 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Masaki Komagata
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,26 @@
1
+ = try
2
+
3
+ Merging stdout and stderr.
4
+ This command do nothing when params return exit(0).
5
+
6
+ == INSTALATION
7
+
8
+ $ gem install komagata-try -s http://gems.github.com
9
+
10
+ == USAGE
11
+
12
+ $ try ls /tmp
13
+ $ try ls /tmpp
14
+ --stdout--
15
+
16
+ --stderr--
17
+ ls: /tmpp: No such file or directory
18
+
19
+ for testing.
20
+
21
+ $ try rake spec | mail -s "[test] foo projects" foo@example.com
22
+ $ try script/cucumber features -s -l ja | growlnotify
23
+
24
+ == Copyright
25
+
26
+ Copyright (c) 2009 komagata. See LICENSE for details.
data/bin/try ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.join(File.dirname(__FILE__), "..", "lib", "try")
3
+
4
+ Try::Command.run(ARGV)
data/lib/try.rb ADDED
@@ -0,0 +1,20 @@
1
+ require "rubygems"
2
+ require "systemu"
3
+
4
+ class Try
5
+ class Command
6
+ class << self
7
+ def run(argv)
8
+ stats, out, err = systemu(argv.join(" "))
9
+ if stats.to_i != 0
10
+ puts %W(
11
+ --stdout--
12
+ #{out}
13
+ --stderr--
14
+ #{err}
15
+ )
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'try'
8
+
9
+ class Test::Unit::TestCase
10
+ end
data/test/try_test.rb ADDED
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class TryTest < Test::Unit::TestCase
4
+ should "no return" do
5
+ assert_nil Try::Command.run(%w(ls /))
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: komagata-try
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Masaki Komagata
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-17 00:00:00 -07:00
13
+ default_executable: try
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: systemu
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.2.0
24
+ version:
25
+ description: Merging stdout and stderr.
26
+ email: komagata@gmail.com
27
+ executables:
28
+ - try
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - LICENSE
33
+ - README.rdoc
34
+ files:
35
+ - bin/try
36
+ - lib/try.rb
37
+ - test/test_helper.rb
38
+ - test/try_test.rb
39
+ - LICENSE
40
+ - README.rdoc
41
+ has_rdoc: false
42
+ homepage: http://github.com/komagata/try
43
+ licenses:
44
+ post_install_message:
45
+ rdoc_options:
46
+ - --charset=UTF-8
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: "0"
60
+ version:
61
+ requirements: []
62
+
63
+ rubyforge_project:
64
+ rubygems_version: 1.3.5
65
+ signing_key:
66
+ specification_version: 3
67
+ summary: Merging stdout and stderr.
68
+ test_files:
69
+ - test/test_helper.rb
70
+ - test/try_test.rb