This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'uri' | |
a = %{rubygems repository http://blahblah.net/, https://rubygems.org/} | |
b = a.split().inject([]) {|array, string| | |
begin | |
x = URI.parse(string).absolute? | |
array << string if x | |
rescue | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'wXf/wXfui' | |
begin | |
require 'rubygems' | |
require 'celluloid' | |
rescue LoadError | |
end | |
module WXf | |
module WXfassists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'celluloid' | |
require 'net/http' | |
class Fetcher | |
include Celluloid | |
def get(action, url) | |
puts "doing work.." | |
res = action.call(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'celluloid' | |
require 'net/http' | |
class Fetcher | |
include Celluloid | |
def get(url) | |
puts "requesting url #{url}" | |
response = Net::HTTP.get URI(url) |
NewerOlder