Sha256: b61da1d1cb41e3e9a492e0c8d1a99d753c2438b8cc9efaf7a756a94596764273
Contents?: true
Size: 907 Bytes
Versions: 1
Compression:
Stored size: 907 Bytes
Contents
# -*- coding: utf-8 -*- require 'consadole_aggregator/nikkan_sports' require 'consadole_aggregator/live' if RUBY_VERSION < '1.9' # strptime は1.9 features なので、1.8 対応のモンキーパッチ class Time def Time.strptime(base, format) ary = base.split(/[^\d]/).delete_if{ |x| x.empty? } case ary.size when 3 Time.mktime(Time.now.year, Time.now.month, ary[0], ary[1], ary[2], 0, 0) when 5 Time.mktime(ary[0], ary[1], ary[2], ary[3], ary[4], 0, 0) else Time.now end end end end module ConsadoleAggregator Image = Struct.new :src, :alt do def to_html %Q{<image src="#{self.src}" alt="#{self.alt}">} end end end if __FILE__ == $0 DataMapper.setup(:default, 'sqlite3:db/test.sqlite3') DataMapper.auto_migrate! ConsadoleAggregator::NikkanSports.save print ConsadoleAggregator::NikkanSports.rss end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
consadole_aggregator-0.0.2 | lib/consadole_aggregator.rb |