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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ef473d4768fa4c8f4c030b5ce29f2e165aeaca2183b843730c0e7275b463688
4
- data.tar.gz: 8338e62d01cd6909d4c455705fe39b396388013ebc9e1044341aa3ad62128700
3
+ metadata.gz: 5311f4c76e2e34f29307779f8098f9b75baa206b9c46e36ffdb27d117ad499d7
4
+ data.tar.gz: d00ec5fa42f86bf4e9c76e72753cdc0823163f49ffe9caa34e75ddbf1508dc18
5
5
  SHA512:
6
- metadata.gz: c4d61b4c8d7609c1fea15af3e48c07fbe7dd919f9bcd3703a2233d710a31a173c472cff0411bbef1141fe10d9fdda7caf3fcfbbac3f4a978163601787eb66c1e
7
- data.tar.gz: 02e7029d9a3a0ff554fb9dfb8f793e11aa69148f578e50aee54d67885affc1ffafb9352583032133f2d9ddccffb911e5974f63d353e3e6325d8941d5b9dd812e
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
- .to_enum.sort
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
@@ -14,7 +14,7 @@ module Aranha
14
14
  end
15
15
 
16
16
  def processor_class_options
17
- processor_class_list.map { |e| [e, e] }.to_h
17
+ processor_class_list.map { |e| [e, e] }.to_h # rubocop:disable Style/MapToHash
18
18
  end
19
19
 
20
20
  private
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'aranha/rails/manager'
4
4
 
5
- ::Aranha::Manager.default = ::Aranha::Rails::Manager.instance
5
+ Aranha::Manager.default = Aranha::Rails::Manager.instance
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ::Rails.application.root_menu.group(:admin).group(:aranha, :aranha).within do |g|
4
- g.action(:addresses).label(-> { ::Aranha::Address.plural_name })
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
- .label(-> { ::Aranha::ProcessorConfiguration.plural_name })
7
- g.action(:start_points).label(-> { ::Aranha::StartPoint.plural_name })
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
- ::Aranha::Rails::Engine.routes.draw do
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)
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_active_scaffold'
3
+ require 'eac_active_scaffold/engine'
4
4
  require 'eac_rails_delayed_job/engine'
5
+ require 'eac_rails_utils/engine'
5
6
 
6
7
  module Aranha
7
8
  module Rails
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'aranha/parsers/base'
4
4
  require 'aranha/parsers/source_address'
5
- require 'aranha/parsers/source_target_fixtures'
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.open(target, 'wb') { |file| file.write(content) }
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 = ::Aranha::Parsers::SourceTargetFixtures.new(::File.dirname(path))
84
+ stf = ::EacRubyGemSupport::SourceTargetFixtures.new(::File.dirname(path))
85
85
  stf.source_file(::File.basename(path, '.url')).present?
86
86
  end
87
87
  end
@@ -37,7 +37,7 @@ module Aranha
37
37
 
38
38
  def start_points_to_addresses
39
39
  super
40
- ::Aranha::StartPoint.all.each do |sp|
40
+ ::Aranha::StartPoint.all.each do |sp| # rubocop:disable Rails/FindEach
41
41
  add_address(sp.uri, sp.processor_class, sp.extra_data)
42
42
  end
43
43
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  require 'delayed_job_active_record'
4
4
 
5
- model = ::Delayed::Backend::ActiveRecord::Job
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
@@ -34,7 +34,7 @@ module Aranha
34
34
 
35
35
  def run_init
36
36
  ::Aranha::Manager.default.init
37
- ::Aranha::Address.all.each(&:init_scheduling)
37
+ ::Aranha::Address.all.each(&:init_scheduling) # rubocop:disable Rails/FindEach
38
38
  end
39
39
 
40
40
  def run_jobs_workoff
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Aranha
4
4
  module Rails
5
- VERSION = '0.10.0'
5
+ VERSION = '0.10.1'
6
6
  end
7
7
  end
@@ -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
- ::Aranha::Rails::Process.new(limit: args.limit).run
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: #{::Aranha::Address.destroy_all.count}")
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
- ::Aranha::Rails::FixturesDownload.new(
27
- ::Aranha::Rails::FixturesDownload::OPTION_EXTENSION => ENV['EXTENSION'],
28
- ::Aranha::Rails::FixturesDownload::OPTION_PREFIX => ENV['PREFIX'],
29
- ::Aranha::Rails::FixturesDownload::OPTION_DOWNLOAD => ENV['DOWNLOAD'].present?,
30
- ::Aranha::Rails::FixturesDownload::OPTION_PENDING => ENV['PENDING'].present?
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.0
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: 2023-09-18 00:00:00.000000000 Z
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.21'
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.21'
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.1
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.1
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.1'
73
+ version: '0.2'
74
74
  - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: 0.1.4
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.1'
83
+ version: '0.2'
84
84
  - - ">="
85
85
  - !ruby/object:Gem::Version
86
- version: 0.1.4
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.119'
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.119'
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: eac_ruby_gem_support
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.4'
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.4'
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.4'
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
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
6
-
7
- local_gemfile = ::File.join(::File.dirname(__FILE__), 'Gemfile.local')
8
- eval_gemfile local_gemfile if ::File.exist?(local_gemfile)
data/spec/rubocop_spec.rb DELETED
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ::EacRubyUtils::Rspec.default_setup.describe_rubocop
data/spec/spec_helper.rb DELETED
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/rspec/default_setup'
4
- ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))