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
# encoding: UTF-8 | |
require 'nokogiri' | |
require 'open-uri' | |
require 'colorize' | |
doc = Nokogiri::HTML(open('http://www.peoplescinema.ru/cgi-bin/i10.cgi')) | |
puts "Peoples Park\n".colorize(:blue) |
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
# encoding: UTF-8 | |
require 'builder' | |
require 'spreadsheet' | |
Spreadsheet.client_encoding = 'UTF-8' | |
class Person | |
attr_accessor :fam, :im, :ot, :w, :dr | |
attr_accessor :s_pol, :n_pol, :enp, :dp |
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
Hash[*a.map{|x| [x.text, x]}].values | |
a = [Thing.new('a'), Thing.new('b'), Thing.new('c'), Thing.new('c')] | |
# => [#<Thing a>, #<Thing b>, #<Thing c>, #<Thing c>] | |
Hash[a.map{|x| [x.text, x]}].values | |
# => [#<Thing a>, #<Thing b>, #<Thing c>] | |
class Thing | |
attr_reader :text |
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
# encoding: UTF-8 | |
require 'hpricot' | |
class Reporter | |
attr_accessor :path | |
attr_accessor :documents | |
def initialize(path) | |
@path = path |
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
1 require 'spreadsheet' | |
# Open workbooks | |
current_workbook = Spreadsheet.open('jan.xls') | |
total_workbook = Spreadsheet.open('output.xls') | |
# Process xls | |
# Iterate through workbook spreadsheets | |
current_workbook.worksheets.each_with_index do |current_spreadsheet, spreadsheet_index| | |
NewerOlder