Skip to content

Instantly share code, notes, and snippets.

@sorah
Forked from raa0121/foooo.rb
Created July 7, 2012 17:49

Revisions

  1. sorah revised this gist Jul 7, 2012. 1 changed file with 9 additions and 6 deletions.
    15 changes: 9 additions & 6 deletions foooo.rb
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,18 @@
    #/usr/bin/env ruby
    # code:utf-8
    # coding: utf-8
    # ^ coding: is correct
    def foooo
    File::open(ARGV[0]){|f|
    File.open(ARGV[0]){|f|
    f.each do |line|
    unless(/fo+/i =~ line)
    print "Error"
    else
    # Don't use "unless-else-end"
    if /fo+/i =~ line
    print "foooo"
    else
    # should be abort?
    abort "Error"
    end
    end
    print "\n"
    puts # use puts with no argument to return
    }
    end

  2. @raa0121 raa0121 revised this gist Jun 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion foooo.rb
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    def foooo
    File::open(ARGV[0]){|f|
    f.each do |line|
    unless(/fo.*/i =~ line)
    unless(/fo+/i =~ line)
    print "Error"
    else
    print "foooo"
  3. @raa0121 raa0121 revised this gist Jun 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion foooo.rb
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ def foooo
    unless(/fo.*/i =~ line)
    print "Error"
    else
    print "fooo"
    print "foooo"
    end
    end
    print "\n"
  4. @raa0121 raa0121 revised this gist Jun 7, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion foooo.rb
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    def foooo
    File::open(ARGV[0]){|f|
    f.each do |line|
    unless(/fo.*+/i =~ line)
    unless(/fo.*/i =~ line)
    print "Error"
    else
    print "fooo"
  5. @raa0121 raa0121 revised this gist Jun 6, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion foooo.rb
    Original file line number Diff line number Diff line change
    @@ -13,4 +13,4 @@ def foooo
    }
    end

    fooo
    foooo
  6. @raa0121 raa0121 revised this gist Jun 6, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions foooo.rb
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    #/usr/bin/env ruby
    # code:utf-8
    def foooo
    File::open(ARGV[0]){|f|
    f.each do |line|
  7. @raa0121 raa0121 renamed this gist Jun 6, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions fooo.rb → foooo.rb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    def fooo
    def foooo
    File::open(ARGV[0]){|f|
    f.each do |line|
    unless(/fo.*+/i =~ line)
    @@ -11,4 +11,4 @@ def fooo
    }
    end

    foo
    fooo
  8. @raa0121 raa0121 revised this gist Jun 6, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fooo.rb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    def foo
    def fooo
    File::open(ARGV[0]){|f|
    f.each do |line|
    unless(/fo.*+/i =~ line)
  9. @raa0121 raa0121 created this gist Jun 6, 2012.
    14 changes: 14 additions & 0 deletions fooo.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    def foo
    File::open(ARGV[0]){|f|
    f.each do |line|
    unless(/fo.*+/i =~ line)
    print "Error"
    else
    print "fooo"
    end
    end
    print "\n"
    }
    end

    foo