aranha 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aranha/fixtures/download.rb +13 -9
- data/lib/aranha/version.rb +1 -1
- data/lib/tasks/aranha_tasks.rake +5 -1
- metadata +28 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e0391fd8968a27fb7422b6311396ef730623740c0fa5f8d3bab0a520f3278fc
|
4
|
+
data.tar.gz: 0dae6f9c28a19145630482bc81ad131ac24a8285d1ff41276c7e900ff1769e01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 422311a8f9fc05d042eccdbe5c91742ab2e8802a2aad57ed45cbce9ac39ebee75d0dc1ba179e5b4499d54b51a41f7d85717defa8f906c8df3e6a1468c995ddca
|
7
|
+
data.tar.gz: 41eaaad6cd8d1ad9fe68b926b66bbbde692befc4bd465a0ff794f74f9454ae1851961af6525edd60f911bfa560703956b8d70739ac88b962ea6485b49aa2e050
|
@@ -3,10 +3,13 @@
|
|
3
3
|
module Aranha
|
4
4
|
module Fixtures
|
5
5
|
class Download
|
6
|
-
|
7
|
-
|
6
|
+
attr_reader :pending
|
7
|
+
|
8
|
+
def initialize(options)
|
9
|
+
@prefix = options.fetch(:prefix)
|
8
10
|
@prefix = '' if @prefix.blank?
|
9
|
-
@download = download
|
11
|
+
@download = options.fetch(:download)
|
12
|
+
@pending = options.fetch(:pending)
|
10
13
|
end
|
11
14
|
|
12
15
|
def run
|
@@ -19,14 +22,15 @@ module Aranha
|
|
19
22
|
private
|
20
23
|
|
21
24
|
def url_files
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
Dir["#{fixtures_root}/**/*.url"].select { |path| select_path?(path) }
|
26
|
+
end
|
27
|
+
|
28
|
+
def select_path?(path)
|
29
|
+
return false unless match_prefix_pattern(path)
|
30
|
+
!pending || !::File.exist?(target(path))
|
27
31
|
end
|
28
32
|
|
29
|
-
def
|
33
|
+
def match_prefix_pattern(path)
|
30
34
|
relative_path(path).start_with?(@prefix)
|
31
35
|
end
|
32
36
|
|
data/lib/aranha/version.rb
CHANGED
data/lib/tasks/aranha_tasks.rake
CHANGED
@@ -12,7 +12,11 @@ namespace(:aranha) do
|
|
12
12
|
namespace :fixtures do
|
13
13
|
desc 'Download remote content for fixtures.'
|
14
14
|
task download: :environment do
|
15
|
-
::Aranha::Fixtures::Download.new(
|
15
|
+
::Aranha::Fixtures::Download.new(
|
16
|
+
prefix: ENV['PREFIX'],
|
17
|
+
download: ENV['DOWNLOAD'].present?,
|
18
|
+
pending: ENV['PENDING'].present?
|
19
|
+
).run
|
16
20
|
end
|
17
21
|
end
|
18
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aranha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo H. Bogoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_scaffold
|
@@ -181,42 +181,42 @@ signing_key:
|
|
181
181
|
specification_version: 4
|
182
182
|
summary: Rails utilities for web crawling.
|
183
183
|
test_files:
|
184
|
-
- test/
|
185
|
-
- test/dummy/README.rdoc
|
186
|
-
- test/dummy/config.ru
|
187
|
-
- test/dummy/config/boot.rb
|
188
|
-
- test/dummy/config/database.yml
|
189
|
-
- test/dummy/config/secrets.yml
|
190
|
-
- test/dummy/config/locales/en.yml
|
191
|
-
- test/dummy/config/application.rb
|
192
|
-
- test/dummy/config/environments/development.rb
|
193
|
-
- test/dummy/config/environments/test.rb
|
194
|
-
- test/dummy/config/environments/production.rb
|
195
|
-
- test/dummy/config/environment.rb
|
184
|
+
- test/aranha_test.rb
|
196
185
|
- test/dummy/config/routes.rb
|
197
186
|
- test/dummy/config/initializers/assets.rb
|
198
187
|
- test/dummy/config/initializers/cookies_serializer.rb
|
199
|
-
- test/dummy/config/initializers/
|
188
|
+
- test/dummy/config/initializers/to_time_preserves_timezone.rb
|
200
189
|
- test/dummy/config/initializers/session_store.rb
|
190
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
201
191
|
- test/dummy/config/initializers/wrap_parameters.rb
|
202
|
-
- test/dummy/config/initializers/to_time_preserves_timezone.rb
|
203
192
|
- test/dummy/config/initializers/filter_parameter_logging.rb
|
204
|
-
- test/dummy/config/initializers/
|
193
|
+
- test/dummy/config/initializers/inflections.rb
|
205
194
|
- test/dummy/config/initializers/mime_types.rb
|
206
|
-
- test/dummy/
|
207
|
-
- test/dummy/
|
208
|
-
- test/dummy/
|
209
|
-
- test/dummy/
|
210
|
-
- test/dummy/
|
211
|
-
- test/dummy/
|
212
|
-
- test/dummy/
|
213
|
-
- test/dummy/
|
195
|
+
- test/dummy/config/database.yml
|
196
|
+
- test/dummy/config/secrets.yml
|
197
|
+
- test/dummy/config/locales/en.yml
|
198
|
+
- test/dummy/config/environment.rb
|
199
|
+
- test/dummy/config/boot.rb
|
200
|
+
- test/dummy/config/application.rb
|
201
|
+
- test/dummy/config/environments/production.rb
|
202
|
+
- test/dummy/config/environments/test.rb
|
203
|
+
- test/dummy/config/environments/development.rb
|
204
|
+
- test/dummy/Rakefile
|
214
205
|
- test/dummy/public/favicon.ico
|
206
|
+
- test/dummy/public/404.html
|
215
207
|
- test/dummy/public/500.html
|
216
|
-
- test/dummy/
|
208
|
+
- test/dummy/public/422.html
|
209
|
+
- test/dummy/config.ru
|
210
|
+
- test/dummy/app/assets/stylesheets/application.css
|
211
|
+
- test/dummy/app/assets/javascripts/application.js
|
212
|
+
- test/dummy/app/helpers/application_helper.rb
|
213
|
+
- test/dummy/app/views/layouts/application.html.erb
|
214
|
+
- test/dummy/app/controllers/application_controller.rb
|
217
215
|
- test/dummy/bin/setup
|
216
|
+
- test/dummy/bin/bundle
|
218
217
|
- test/dummy/bin/rails
|
219
218
|
- test/dummy/bin/rake
|
220
|
-
- test/
|
221
|
-
- test/
|
219
|
+
- test/dummy/db/schema.rb
|
220
|
+
- test/dummy/README.rdoc
|
222
221
|
- test/integration/navigation_test.rb
|
222
|
+
- test/test_helper.rb
|