each 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (8) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +4 -0
  3. data/README.md +26 -0
  4. data/Rakefile +1 -0
  5. data/bin/each +12 -0
  6. data/each.gemspec +22 -0
  7. data/foo.txt +2 -0
  8. metadata +70 -0
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in each.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,26 @@
1
+ each
2
+ ====
3
+
4
+ A simple command to process each line of ARGF.
5
+
6
+ By the way, do you know the '-n' option of ruby?
7
+
8
+ Install
9
+ ----
10
+
11
+ $ gem install each
12
+
13
+ Example
14
+ ----
15
+
16
+ $ cat foo.txt
17
+ a b c
18
+ d e f
19
+ $ cat foo.txt | each '_.split[1].upcase'
20
+ B
21
+ E
22
+
23
+ Copyright
24
+ ----
25
+
26
+ Copyright (c) 2012 jugyo, released under the MIT license
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/each ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ funcs = ARGV.dup
4
+ ARGV.clear
5
+
6
+ while _ = ARGF.gets
7
+ _ = _.strip
8
+ funcs.each do |func|
9
+ _ = eval(func)
10
+ end
11
+ puts _
12
+ end
data/each.gemspec ADDED
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "each"
5
+ s.version = "1.0.0"
6
+ s.authors = ["jugyo"]
7
+ s.email = ["jugyo.org@gmail.com"]
8
+ s.homepage = ""
9
+ s.summary = %q{The command each}
10
+ s.description = %q{A simple command to process each line of ARGF.}
11
+
12
+ s.rubyforge_project = "each"
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ s.require_paths = ["lib"]
18
+
19
+ # specify any dependencies here; for example:
20
+ s.add_development_dependency "rake"
21
+ # s.add_runtime_dependency "rest-client"
22
+ end
data/foo.txt ADDED
@@ -0,0 +1,2 @@
1
+ a b c
2
+ d e f
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: each
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - jugyo
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-01-20 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: &70171723505620 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70171723505620
25
+ description: A simple command to process each line of ARGF.
26
+ email:
27
+ - jugyo.org@gmail.com
28
+ executables:
29
+ - each
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - .gitignore
34
+ - Gemfile
35
+ - README.md
36
+ - Rakefile
37
+ - bin/each
38
+ - each.gemspec
39
+ - foo.txt
40
+ homepage: ''
41
+ licenses: []
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ segments:
53
+ - 0
54
+ hash: -3678194404797456426
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ segments:
62
+ - 0
63
+ hash: -3678194404797456426
64
+ requirements: []
65
+ rubyforge_project: each
66
+ rubygems_version: 1.8.10
67
+ signing_key:
68
+ specification_version: 3
69
+ summary: The command each
70
+ test_files: []