Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/wayback_machine_downloader/archive_api.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module ArchiveAPI
class WaybackMachineDownloader; end

module WaybackMachineDownloader::ArchiveAPI

def get_raw_list_from_api url, page_index
request_url = "http://web.archive.org/cdx/search/xd?url="
Expand Down
8 changes: 5 additions & 3 deletions lib/wayback_machine_downloader/tidy_bytes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module TibyBytes
class WaybackMachineDownloader; end

module WaybackMachineDownloader::TidyBytes

# CP-1252 decimal byte => UTF-8 approximation as an array of bytes
CP1252 = {
Expand Down Expand Up @@ -111,12 +113,12 @@ def tidy_bytes!(force = false)
private

def tidy_byte(byte)
byte < 160 ? TibyBytes::CP1252[byte] : byte < 192 ? [194, byte] : [195, byte - 64]
byte < 160 ? CP1252[byte] : byte < 192 ? [194, byte] : [195, byte - 64]
end

end
end

class String
include TibyBytes::StringMixin
include WaybackMachineDownloader::TidyBytes::StringMixin
end
6 changes: 4 additions & 2 deletions lib/wayback_machine_downloader/to_regex.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module ToRegex
class WaybackMachineDownloader; end

module WaybackMachineDownloader::ToRegex
module StringMixin
class << self
def literal?(str)
Expand Down Expand Up @@ -77,5 +79,5 @@ def as_regexp(options = {})
end

class String
include ToRegex::StringMixin
include WaybackMachineDownloader::ToRegex::StringMixin
end