rubyc 0.0.17 → 0.1.0.alpha

Sign up to get free protection for your applications and to get access to all the features.
data/Guardfile CHANGED
@@ -3,7 +3,8 @@
3
3
 
4
4
  guard 'minitest' do
5
5
  watch(%r|^spec/(.*)_spec\.rb|)
6
- watch(%r|^lib/rubyc(.*)\.rb|) { |m| "spec/#{m[1]}_spec.rb" }
7
- watch(%r|^lib/(.*)\.rb|) { |m| "spec/test_spec.rb" }
8
- watch(%r|^spec/spec_helper\.rb|) { "spec" }
6
+ watch(%r|lib\/([^\/]+)\/([^\/]+)\.rb|) { |m| "spec/#{m[2]}_spec.rb"}
7
+ watch(%r|^spec/spec_helper\.rb|) { "spec" }
9
8
  end
9
+
10
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Martin Chabot
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
  ## Description
3
3
  Adds Ruby's power to the command line.
4
4
  ## Introduction
5
- Sometimes we need to process files or streams at the bash prompt for filtering, parsing, calculating etc. Unix offers many tools for doing those actions: grep, sed, awk etc. However, their usage are not easy to remember besause of their cryptic syntax. They also use Unix regexes which are more limited than ruby's ones.
5
+ Sometimes we need to process files or streams at the bash prompt for filtering, parsing, calculating etc. Unix offers many tools for doing those actions: grep, sed, awk etc. However, their usage are not easy to remember besause of their cryptic syntax. They also use Unix regexes which are more limited than Ruby's ones.
6
6
 
7
- The Ruby interpreter offers us many command line options for processing files or pipes. The -p, -n options allows us to process lines one at a time. But their syntaxes are not really easy to remember, since it uses non Rubyish syntax, using $_, gets and print kernel methods.
7
+ The Ruby interpreter offers us many command line options for processing files or pipes. The -p, -n options in combination of the -e option, allows us to process lines one at a time. Personnaly I never remember how to use them.
8
8
 
9
9
  For this reason, I have created Rubyc, which stands for Ruby Command line. Rubyc supports many enumerator methods applied to STDIN. The current line is represented by the "line" variable name or it's shorter alias 'l'.
10
10
  ## Installation
@@ -64,11 +64,10 @@ The Rubyc way:
64
64
  ``` bash
65
65
  $ cat development.log | rubyc count_by 'l =~ /INSERT INTO \"(\w+)\"/; $1'
66
66
  ---
67
- trunk_groups: 14
68
- ld_call_records: 18
69
- ld_provider_rates: 102191
70
- cdrs: 47
71
- tf_call_records: 18
67
+ users: 14
68
+ adresses: 18
69
+ objects: 102191
70
+ phone_numbers: 47
72
71
  ```
73
72
 
74
73
 
data/Rakefile CHANGED
@@ -8,6 +8,7 @@ require 'cucumber/rake/task'
8
8
 
9
9
  Rake::TestTask.new do |t|
10
10
  t.pattern = "spec/*_spec.rb"
11
+ t.libs << 'spec'
11
12
  end
12
13
 
13
14
  Cucumber::Rake::Task.new(:features) do |t|