Skip to content

Commit

Permalink
Merge pull request #119 from digininja/updatedocker
Browse files Browse the repository at this point in the history
Fixed meta data and mailto
  • Loading branch information
digininja authored Jun 19, 2024
2 parents 8a86513 + 4597bf4 commit a76617a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 16 deletions.
20 changes: 11 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,26 @@ GEM
mime (0.4.4)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0305)
mime-types-data (3.2024.0604)
mini_exiftool (2.11.0)
nokogiri (1.16.4-aarch64-linux)
nokogiri (1.16.6-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.4-arm-linux)
nokogiri (1.16.6-arm-linux)
racc (~> 1.4)
nokogiri (1.16.4-arm64-darwin)
nokogiri (1.16.6-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.4-x86-linux)
nokogiri (1.16.6-x86-linux)
racc (~> 1.4)
nokogiri (1.16.4-x86_64-darwin)
nokogiri (1.16.6-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.4-x86_64-linux)
nokogiri (1.16.6-x86_64-linux)
racc (~> 1.4)
racc (1.7.3)
rexml (3.2.6)
racc (1.8.0)
rexml (3.3.0)
strscan
rubyzip (2.3.2)
spider (0.5.4)
strscan (3.1.0)

PLATFORMS
aarch64-linux
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Usage: cewl [OPTIONS] ... <url>

### Running CeWL in a Docker container


To quickly use CeWL with Docker, you can use the official `ghcr.io/digininja/cewl` image:

```sh
Expand Down
25 changes: 18 additions & 7 deletions cewl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def start! #:nodoc:

y = []
x.select do |a_url, parsed_url|
if (parsed_url.scheme == "http" or parsed_url.scheme == "https") then
if (parsed_url.scheme == "mailto" or parsed_url.scheme == "http" or parsed_url.scheme == "https") then
y << [a_url, parsed_url] if allowable_url?(a_url, parsed_url)
end
end
Expand Down Expand Up @@ -440,7 +440,7 @@ def pop

# Push an item onto the tree
def push(value)
puts "Pushing #{value}" if @debug
puts "Adding #{value} to the tree" if @debug
key = value.keys.first
value = value.values_at(key).first

Expand All @@ -454,10 +454,21 @@ def push(value)
@children << child
else
@children.each { |node|
if node.data.value == key && node.data.depth<@max_depth
child = Tree.new(key, value, node.data.depth + 1, @debug)
@children << child
end
# Ignore the max depth for mailto links.
# This is not a good way to do this, but it will work for now
# and we all know dirty hacks stay around forever so don't
# expect this to be fixed for a while.
if value =~ /^mailto:/ then
if node.data.value == key then
child = Tree.new(key, value, node.data.depth + 1, @debug)
@children << child
end
else
if node.data.value == key && node.data.depth<@max_depth then
child = Tree.new(key, value, node.data.depth + 1, @debug)
@children << child
end
end
}
end
end
Expand Down Expand Up @@ -760,7 +771,7 @@ def usage
email_outfile_file = outfile_file
end

if meta_outfile && email
if meta_outfile && meta
begin
meta_outfile_file = File.new(meta_outfile, "w")
rescue
Expand Down
4 changes: 4 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
cewl:
build: .
image: ghcr.io/digininja/cewl:latest

0 comments on commit a76617a

Please sign in to comment.