Class Shell::Glob
In: shell/builtin-command.rb
Parent: BuiltInCommand

Methods

each   new  

Public Class methods

[Source]

# File shell/builtin-command.rb, line 57
    def initialize(sh, pattern)
      super sh

      @pattern = pattern
      Thread.critical = true
      back = Dir.pwd
      begin
        Dir.chdir @shell.cwd
        @files = Dir[pattern]
      ensure
        Dir.chdir back
        Thread.critical = false
      end
    end

Public Instance methods

[Source]

# File shell/builtin-command.rb, line 72
    def each(rs = nil)
      rs =  @shell.record_separator unless rs
      for f  in @files
        yield f+rs
      end
    end

[Validate]

ruby-doc.org is a community service provided by James Britt and Happy Camper Studios, a Phoenix, Arizona, Ruby application development company.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.