miteru 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bcc07aabe006f3107c410263f09c4580081933b7a7aebfa7344977f6fd05dc6
4
- data.tar.gz: 49cbc8f6efb26eb47ea776c46986bf949f77371a31109e6298bfd11fe7ca670f
3
+ metadata.gz: cbb47828d938e86289f845435bd9d342e18d7c50090e486b5681bf212dfcd84b
4
+ data.tar.gz: c416439bc1c80cfd4cf2de8bc9a7a6abb6ff46bb1af5d0a58ec0e71954584a4c
5
5
  SHA512:
6
- metadata.gz: 54b51311d0f982c2da7221c09384847d6bd526356158dc56948f1d898f3631ef22f3005a041ca0ebc31cfc22bcafc0d64047d95392857f79c8611dd2802bb366
7
- data.tar.gz: c61864c67eb49c79aaa180827610fab24e2fa3de7e14e8396c9ff6ca60439cbe271e313aff6618a8986c2a8eb8d889e018ef062aa92dd2c62afe7ea54bfd7f98
6
+ metadata.gz: f15f1770d870404e7b50cddb2e20d7e5d90adfab04283d5cb4364a2480f210b9c4869717d647bdc0174b5d0f0a9323903aac101f77d140ebad0c9523688b43d0
7
+ data.tar.gz: cb4a8e2c561aa53265362beec7e45445f6a6825bf991c7c4c559d40279dc84e138f54e300ab163f9db19dc891f2fe0a30c874d620d0464c9451c1e6c0e6e729e
@@ -10,6 +10,7 @@ require_relative "./feeds/urlscan_pro"
10
10
  module Miteru
11
11
  class Feeds
12
12
  IGNORE_EXTENSIONS = %w(.htm .html .php .asp .aspx .exe .txt).freeze
13
+ VALID_EXTENSIONS = [".zip", ".rar", ".7z", ".tar", ".gz"].freeze
13
14
 
14
15
  def initialize
15
16
  @feeds = [
@@ -48,7 +49,17 @@ module Miteru
48
49
  segments = uri.path.split("/")
49
50
  return [base] if segments.length.zero?
50
51
 
51
- urls = (0...segments.length).map { |idx| "#{base}#{segments[0..idx].join('/')}" }
52
+ urls = (0...segments.length).map do |idx|
53
+ breakdowned_url = "#{base}#{segments[0..idx].join('/')}"
54
+ breakdown = [breakdowned_url]
55
+ if idx > 0 && idx < segments.length - 1
56
+ VALID_EXTENSIONS.each do |ext|
57
+ breakdown << "#{base}#{segments[0..idx - 1].join('/')}/#{segments[idx]}#{ext}"
58
+ end
59
+ end
60
+ breakdown
61
+ end.flatten
62
+
52
63
  urls.reject do |breakdowned_url|
53
64
  # Reject a url which ends with specific extension names
54
65
  invalid_extension? breakdowned_url
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Miteru
4
- VERSION = "0.14.0"
4
+ VERSION = "0.14.1"
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency "glint", "~> 0.1"
30
30
  spec.add_development_dependency "rake", "~> 13.0"
31
31
  spec.add_development_dependency "rspec", "~> 3.9"
32
- spec.add_development_dependency "vcr", "~> 5.1"
32
+ spec.add_development_dependency "vcr", "~> 6.0"
33
33
  spec.add_development_dependency "webmock", "~> 3.8"
34
34
 
35
35
  spec.add_dependency "colorize", "~> 0.8"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miteru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-14 00:00:00.000000000 Z
11
+ date: 2020-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '5.1'
89
+ version: '6.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '5.1'
96
+ version: '6.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: webmock
99
99
  requirement: !ruby/object:Gem::Requirement