aranha-rails 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/aranha/address/scheduling.rb +1 -1
- data/app/models/aranha/processor_configuration.rb +2 -2
- data/app/models/aranha/start_point.rb +1 -1
- data/config/initializers/aranha.rb +1 -1
- data/config/initializers/menus.rb +4 -4
- data/config/routes.rb +1 -1
- data/lib/aranha/rails/engine.rb +2 -1
- data/lib/aranha/rails/fixtures_download.rb +4 -4
- data/lib/aranha/rails/manager.rb +1 -1
- data/lib/aranha/rails/patches/delayed_job.rb +1 -1
- data/lib/aranha/rails/process.rb +1 -1
- data/lib/aranha/rails/version.rb +1 -1
- data/lib/tasks/aranha.rake +8 -8
- metadata +29 -33
- data/.rspec +0 -1
- data/.rubocop.yml +0 -29
- data/Gemfile +0 -8
- data/spec/rubocop_spec.rb +0 -3
- data/spec/spec_helper.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5311f4c76e2e34f29307779f8098f9b75baa206b9c46e36ffdb27d117ad499d7
|
4
|
+
data.tar.gz: d00ec5fa42f86bf4e9c76e72753cdc0823163f49ffe9caa34e75ddbf1508dc18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d6ee9550a647dd0186efd2789844607bf7a422d26e4893ef18bf6c99017435af5ed67e61b4ae69144ddaa6c2cf8f62cfd2de7aceb3dc8f551b6d2093f6cf089
|
7
|
+
data.tar.gz: f55c4c3b3d4db0b2b625c6d93bc9b61df337b9e509b5ae37b9f39d967a2ddba715b521480e86337345b4c71ff382221d44f2c1a90c0f5d5d810cef0c245108fc
|
@@ -22,7 +22,7 @@ module Aranha
|
|
22
22
|
|
23
23
|
def check_scheduling
|
24
24
|
::ActiveRecord::Base.transaction do
|
25
|
-
return unless schedule?
|
25
|
+
return unless schedule? # rubocop:disable Rails/TransactionExitStatement
|
26
26
|
|
27
27
|
job = ::Delayed::Job.enqueue(
|
28
28
|
::Aranha::Address::DelayedJob.new(id),
|
@@ -10,12 +10,12 @@ module Aranha
|
|
10
10
|
# @return [Enumerator<String>]
|
11
11
|
def processor_class_list
|
12
12
|
::Set.new(processor_class_list_from_addresses + processor_class_list_from_start_points)
|
13
|
-
|
13
|
+
.to_enum.sort
|
14
14
|
end
|
15
15
|
|
16
16
|
# @return [Hash<String, String>]
|
17
17
|
def processor_class_options
|
18
|
-
processor_class_list.map { |e| [e, e] }.to_h
|
18
|
+
processor_class_list.map { |e| [e, e] }.to_h # rubocop:disable Style/MapToHash
|
19
19
|
end
|
20
20
|
|
21
21
|
private
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
g.action(:addresses).label(-> {
|
3
|
+
Rails.application.root_menu.group(:admin).group(:aranha, :aranha).within do |g|
|
4
|
+
g.action(:addresses).label(-> { Aranha::Address.plural_name })
|
5
5
|
g.action(:processor_configurations)
|
6
|
-
|
7
|
-
g.action(:start_points).label(-> {
|
6
|
+
.label(-> { Aranha::ProcessorConfiguration.plural_name })
|
7
|
+
g.action(:start_points).label(-> { Aranha::StartPoint.plural_name })
|
8
8
|
end
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
Aranha::Rails::Engine.routes.draw do
|
4
4
|
resources(:addresses, concerns: active_scaffold)
|
5
5
|
resources(:processor_configurations, concerns: active_scaffold)
|
6
6
|
resources(:start_points, concerns: active_scaffold)
|
data/lib/aranha/rails/engine.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'aranha/parsers/base'
|
4
4
|
require 'aranha/parsers/source_address'
|
5
|
-
require '
|
5
|
+
require 'eac_ruby_gem_support/source_target_fixtures'
|
6
6
|
require 'eac_ruby_utils/core_ext'
|
7
7
|
|
8
8
|
module Aranha
|
@@ -65,7 +65,7 @@ module Aranha
|
|
65
65
|
content = ::Aranha::Parsers::Base.new(url).content
|
66
66
|
raise "Content is blank for \"#{url}\"" if content.blank?
|
67
67
|
|
68
|
-
File.
|
68
|
+
File.binwrite(target, content)
|
69
69
|
end
|
70
70
|
|
71
71
|
def url(file)
|
@@ -73,7 +73,7 @@ module Aranha
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def target(file)
|
76
|
-
File.expand_path(File.basename(file, '.url') + '.source' + extension, File.dirname(file))
|
76
|
+
File.expand_path(File.basename(file, '.url') + '.source' + extension, File.dirname(file)) # rubocop:disable Style/StringConcatenation
|
77
77
|
end
|
78
78
|
|
79
79
|
def relative_path(path)
|
@@ -81,7 +81,7 @@ module Aranha
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def source_exist?(path)
|
84
|
-
stf = ::
|
84
|
+
stf = ::EacRubyGemSupport::SourceTargetFixtures.new(::File.dirname(path))
|
85
85
|
stf.source_file(::File.basename(path, '.url')).present?
|
86
86
|
end
|
87
87
|
end
|
data/lib/aranha/rails/manager.rb
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'delayed_job_active_record'
|
4
4
|
|
5
|
-
model =
|
5
|
+
model = Delayed::Backend::ActiveRecord::Job
|
6
6
|
model.has_one :aranha_address, class_name: 'Aranha::Address', foreign_key: :delayed_job_id,
|
7
7
|
dependent: :nullify, inverse_of: :delayed_job
|
data/lib/aranha/rails/process.rb
CHANGED
data/lib/aranha/rails/version.rb
CHANGED
data/lib/tasks/aranha.rake
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
namespace(:aranha) do
|
3
|
+
namespace(:aranha) do # rubocop:disable Metrics/BlockLength
|
4
4
|
desc 'Process Aranha\'s addresses.'
|
5
5
|
task :process, %i[limit] => :environment do |_t, args|
|
6
|
-
|
6
|
+
Aranha::Rails::Process.new(limit: args.limit).run
|
7
7
|
end
|
8
8
|
|
9
9
|
desc 'Remove all registered Aranha\'s addresses.'
|
10
10
|
task clear: :environment do
|
11
|
-
Rails.logger.info("Addresses deleted: #{
|
11
|
+
Rails.logger.info("Addresses deleted: #{Aranha::Address.destroy_all.count}")
|
12
12
|
end
|
13
13
|
|
14
14
|
namespace :address do
|
@@ -23,11 +23,11 @@ namespace(:aranha) do
|
|
23
23
|
task download: :environment do
|
24
24
|
require 'aranha/rails/fixtures_download'
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
Aranha::Rails::FixturesDownload.new(
|
27
|
+
Aranha::Rails::FixturesDownload::OPTION_EXTENSION => ENV.fetch('EXTENSION', nil),
|
28
|
+
Aranha::Rails::FixturesDownload::OPTION_PREFIX => ENV.fetch('PREFIX', nil),
|
29
|
+
Aranha::Rails::FixturesDownload::OPTION_DOWNLOAD => ENV['DOWNLOAD'].present?,
|
30
|
+
Aranha::Rails::FixturesDownload::OPTION_PENDING => ENV['PENDING'].present?
|
31
31
|
).run
|
32
32
|
end
|
33
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aranha-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Put here the authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.22'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.22'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: eac_active_scaffold
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
version: '0.5'
|
54
54
|
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.5.
|
56
|
+
version: 0.5.3
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -63,27 +63,27 @@ dependencies:
|
|
63
63
|
version: '0.5'
|
64
64
|
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: 0.5.
|
66
|
+
version: 0.5.3
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: eac_rails_delayed_job
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
71
|
- - "~>"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: '0.
|
73
|
+
version: '0.2'
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.1
|
76
|
+
version: 0.2.1
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '0.
|
83
|
+
version: '0.2'
|
84
84
|
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version: 0.1
|
86
|
+
version: 0.2.1
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
88
|
name: eac_rails_utils
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,6 +91,9 @@ dependencies:
|
|
91
91
|
- - "~>"
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0.22'
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.22.3
|
94
97
|
type: :runtime
|
95
98
|
prerelease: false
|
96
99
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -98,26 +101,23 @@ dependencies:
|
|
98
101
|
- - "~>"
|
99
102
|
- !ruby/object:Gem::Version
|
100
103
|
version: '0.22'
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 0.22.3
|
101
107
|
- !ruby/object:Gem::Dependency
|
102
108
|
name: eac_ruby_utils
|
103
109
|
requirement: !ruby/object:Gem::Requirement
|
104
110
|
requirements:
|
105
111
|
- - "~>"
|
106
112
|
- !ruby/object:Gem::Version
|
107
|
-
version: '0.
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 0.119.2
|
113
|
+
version: '0.121'
|
111
114
|
type: :runtime
|
112
115
|
prerelease: false
|
113
116
|
version_requirements: !ruby/object:Gem::Requirement
|
114
117
|
requirements:
|
115
118
|
- - "~>"
|
116
119
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0.
|
118
|
-
- - ">="
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
version: 0.119.2
|
120
|
+
version: '0.121'
|
121
121
|
- !ruby/object:Gem::Dependency
|
122
122
|
name: rails
|
123
123
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,28 +139,31 @@ dependencies:
|
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: '7'
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
|
-
name:
|
142
|
+
name: eac_rails_gem_support
|
143
143
|
requirement: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
145
|
- - "~>"
|
146
146
|
- !ruby/object:Gem::Version
|
147
|
-
version: '0.
|
147
|
+
version: '0.9'
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: 0.9.2
|
148
151
|
type: :development
|
149
152
|
prerelease: false
|
150
153
|
version_requirements: !ruby/object:Gem::Requirement
|
151
154
|
requirements:
|
152
155
|
- - "~>"
|
153
156
|
- !ruby/object:Gem::Version
|
154
|
-
version: '0.
|
157
|
+
version: '0.9'
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: 0.9.2
|
155
161
|
description:
|
156
162
|
email:
|
157
163
|
executables: []
|
158
164
|
extensions: []
|
159
165
|
extra_rdoc_files: []
|
160
166
|
files:
|
161
|
-
- ".rspec"
|
162
|
-
- ".rubocop.yml"
|
163
|
-
- Gemfile
|
164
167
|
- app/assets/javascripts/aranha/application.js
|
165
168
|
- app/assets/stylesheets/aranha/application.css
|
166
169
|
- app/controllers/aranha/addresses_controller.rb
|
@@ -194,8 +197,6 @@ files:
|
|
194
197
|
- lib/aranha/rails/process.rb
|
195
198
|
- lib/aranha/rails/version.rb
|
196
199
|
- lib/tasks/aranha.rake
|
197
|
-
- spec/rubocop_spec.rb
|
198
|
-
- spec/spec_helper.rb
|
199
200
|
homepage:
|
200
201
|
licenses: []
|
201
202
|
metadata: {}
|
@@ -207,7 +208,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
207
208
|
requirements:
|
208
209
|
- - ">="
|
209
210
|
- !ruby/object:Gem::Version
|
210
|
-
version: '2.
|
211
|
+
version: '2.7'
|
211
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
212
213
|
requirements:
|
213
214
|
- - ">="
|
@@ -218,9 +219,4 @@ rubygems_version: 3.1.6
|
|
218
219
|
signing_key:
|
219
220
|
specification_version: 4
|
220
221
|
summary: Put here de description.
|
221
|
-
test_files:
|
222
|
-
- spec/spec_helper.rb
|
223
|
-
- spec/rubocop_spec.rb
|
224
|
-
- ".rspec"
|
225
|
-
- Gemfile
|
226
|
-
- ".rubocop.yml"
|
222
|
+
test_files: []
|
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--require spec_helper
|
data/.rubocop.yml
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
require:
|
2
|
-
- rubocop-rails
|
3
|
-
- rubocop-rspec
|
4
|
-
|
5
|
-
AllCops:
|
6
|
-
TargetRubyVersion: 2.4
|
7
|
-
TargetRailsVersion: 5.1
|
8
|
-
|
9
|
-
Layout/LineLength:
|
10
|
-
Max: 100
|
11
|
-
|
12
|
-
Metrics/BlockLength:
|
13
|
-
Exclude:
|
14
|
-
- 'lib/tasks/**/*.rake'
|
15
|
-
|
16
|
-
Style/AsciiComments:
|
17
|
-
Enabled: false
|
18
|
-
|
19
|
-
Style/Documentation:
|
20
|
-
Enabled: false
|
21
|
-
|
22
|
-
Style/HashEachMethods:
|
23
|
-
Enabled: true
|
24
|
-
|
25
|
-
Style/HashTransformKeys:
|
26
|
-
Enabled: true
|
27
|
-
|
28
|
-
Style/HashTransformValues:
|
29
|
-
Enabled: true
|
data/Gemfile
DELETED
data/spec/rubocop_spec.rb
DELETED
data/spec/spec_helper.rb
DELETED