recho 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +18 -7
  2. data/lib/recho.rb +5 -0
  3. data/recho.gemspec +2 -2
  4. metadata +2 -2
data/README.md CHANGED
@@ -1,15 +1,26 @@
1
- # echo
1
+ # echo(1) and cat(1) in ruby
2
+
3
+ ## Install
4
+
5
+ gem install recho
2
6
 
3
7
  ## Usage
4
8
 
9
+ require 'recho'
10
+
5
11
  include FileUtils
6
12
 
7
- require 'echo'
13
+ echo("foo msg") > "foo.txt"
14
+ echo("bar msg") >> "bar.txt"
15
+
16
+ cat("foo.txt", "bar.txt") # => "foo msg\nbar msg\n"
17
+
18
+ But wait! There's more!
19
+
20
+ cat("foo.txt", "bar.txt") > "cat.txt"
8
21
 
9
- echo("foo msg") > "foofile"
10
- echo("foo msg") >> "foofile"
22
+ You like that?! Yeah. Thought so.
11
23
 
12
- or
24
+ ### Alternativly, they are also module-functions on FileUtils
13
25
 
14
- FileUtils.echo("foo msg") > "foofile"
15
- FileUtils.echo("foo msg") >> "foofile"
26
+ FileUtils.echo("testing") > "testing.txt"
@@ -7,4 +7,9 @@ module FileUtils
7
7
  msg
8
8
  end
9
9
  module_function :echo
10
+
11
+ def cat(*files)
12
+ files.inject(echo("", :n)) {|m, f| m << File.read(f)}
13
+ end
14
+ module_function :cat
10
15
  end
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'recho'
6
- s.version = '0.1.0'
7
- s.date = '2009-10-28'
6
+ s.version = '0.2.0'
7
+ s.date = '2009-10-29'
8
8
 
9
9
  s.description = "echo(1) in ruby"
10
10
  s.summary = s.description
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Mizerany
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-28 00:00:00 -07:00
12
+ date: 2009-10-29 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15