example.rb in sq_ruby_grep-0.0.3 vs example.rb in sq_ruby_grep-0.0.4
- old
+ new
@@ -1,12 +1,5 @@
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'sq_ruby_grep'
-SqRubyGrep.grep(file_path:'test/fixtures/text.txt', pattern: /non/, after_lines: 2, before_lines: 2, colorize: true).each do |result|
- p '------------'
- puts result.before_context
- puts '---' + result.match_line
- puts result.after_context
- p '------------'
-end
-
+puts SqRubyGrep.run(file_path:'test/fixtures/text.txt', pattern: /needle/, after_lines: 1, before_lines: 2)