Top Level Namespace

Includes:
Config, Dataflow, FileUtils, FileUtils::Verbose, WEBrick

Defined Under Namespace

Modules: Dataflow, EY, Enumerable, Escape, Generator2BenchmarkCommon, GeneratorBenchmarkCommon, JSON, JSONGeneratorCommon, Kernel, Open4, Parser2BenchmarkCommon, ParserBenchmarkCommon, RDoc Classes: AnimalHouse, Class, Date, DateTime, Exception, File, Fuzzer, Generator2BenchmarkExt, Generator2BenchmarkPure, Generator2BenchmarkRails, Generator2BenchmarkYajl, GeneratorBenchmarkExt, GeneratorBenchmarkPure, GeneratorBenchmarkRails, GeneratorBenchmarkYajl, JSONServlet, MyState, Object, Parser2BenchmarkExt, Parser2BenchmarkPure, Parser2BenchmarkRails, Parser2BenchmarkYAML, Parser2BenchmarkYajl, ParserBenchmarkExt, ParserBenchmarkPure, ParserBenchmarkRails, ParserBenchmarkYAML, ParserBenchmarkYajl, Range, Regexp, String, Struct, Symbol, TC_JSON, TC_JSONAddition, TC_JSONEncoding, TC_JSONFixtures, TC_JSONGenerate, TC_JSONRails, TC_JSONUnicode, Thor, Time

Constant Summary collapse

ISO_8859_1_TO_UTF8 =
Iconv.new('utf-8', 'iso-8859-15')
N =

Send M messages each along a ring of N nodes

4
M =
2
Ping =
Actor.new {
  3.times {
    case receive
    when "Ping"
      puts "Ping"
      Pong.send "Pong"
    end
  }
}
Pong =
Actor.new {
  3.times {
    case receive
    when "Pong"
      puts "Pong"
      Ping.send "Ping"
    end
  }
}
RUBY_PATH =
File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
RAKE_PATH =
File.join(Config::CONFIG['bindir'], 'rake')

Constants included from Dataflow

Dataflow::UnificationError, Dataflow::VERSION

Instance Method Summary collapse

Methods included from Dataflow

#barrier, #by_need, #flow, included, #local, #need_later, #unify

Instance Method Details

#create_server(err, dir, port) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/vendor/json_pure/tools/server.rb', line 33

def create_server(err, dir, port)
  dir = File.expand_path(dir)
  err.puts "Surf to:", "http://#{Socket.gethostname}:#{port}"

  s = HTTPServer.new(
    :Port         => port,
    :DocumentRoot => dir,
    :Logger       => WEBrick::Log.new(err),
    :AccessLog    => [
      [ err, WEBrick::AccessLog::COMMON_LOG_FORMAT  ],
      [ err, WEBrick::AccessLog::REFERER_LOG_FORMAT ],
      [ err, WEBrick::AccessLog::AGENT_LOG_FORMAT   ]
    ]
  )
  s.mount("/json", JSONServlet)
  s
end

#go(s, args = ARGV) ⇒ Object

Parses the argument array args, according to the pattern s, to retrieve the single character command line options from it. If s is ‘xy:’ an option ‘-x’ without an option argument is searched, and an option ‘-y foo’ with an option argument (‘foo’).

An option hash is returned with all found options set to true or the found option argument.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/vendor/json_pure/bin/prettify_json.rb', line 14

def go(s, args = ARGV)
  b, v = s.scan(/(.)(:?)/).inject([{},{}]) { |t,(o,a)|
    t[a.empty? ? 0 : 1][o] = a.empty? ? false : nil
    t
  }
  while a = args.shift
    a !~ /\A-(.+)/ and args.unshift a and break
    p = $1
    until p == ''
      o = p.slice!(0, 1)
      if v.key?(o)
        v[o] = if p == '' then args.shift or break 1 else p end
        break
      elsif b.key?(o)
        b[o] = true
      else
        args.unshift a
        break 1
      end
    end and break
  end
  b.merge(v)
end

#open4(*cmd, &b) ⇒ Object



403
# File 'lib/vendor/open4/lib/open4.rb', line 403

def open4(*cmd, &b) cmd.size == 0 ? Open4 : Open4::popen4(*cmd, &b) end