eac_tools 0.69.1 → 0.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +28 -33
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +1 -1
- data/sub/avm/lib/avm/entries/base/uri_components_entries_values/generic_component.rb +32 -6
- data/sub/avm/lib/avm/entries/base/uri_components_entries_values/url_component.rb +2 -2
- data/sub/avm/lib/avm/instances/base/processes.rb +27 -0
- data/sub/avm/lib/avm/instances/data/package.rb +4 -0
- data/sub/avm/lib/avm/instances/data/unit.rb +4 -0
- data/sub/avm/lib/avm/instances/process.rb +21 -0
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +4 -4
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb +6 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes/daemon.rb +35 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes/tasks_scheduler.rb +27 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes.rb +13 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
- data/sub/avm-eac_ubuntu_base0/avm-eac_ubuntu_base0.gemspec +2 -2
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances/base.rb +6 -0
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/version.rb +1 -1
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +3 -3
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_base.rb +28 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_host.rb +2 -10
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_path.rb +2 -10
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/install.rb +22 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +15 -1
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/processes/web_server.rb +33 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/processes.rb +13 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/instances/base_spec.rb +11 -0
- data/sub/avm-eac_webapp_base0/spec/spec_helper.rb +1 -1
- metadata +18 -71
- data/sub/aranha-parsers/Gemfile +0 -8
- data/sub/aranha-parsers/aranha-parsers.gemspec +0 -23
- data/sub/aranha-parsers/lib/aranha/parsers/base.rb +0 -86
- data/sub/aranha-parsers/lib/aranha/parsers/html/base.rb +0 -61
- data/sub/aranha-parsers/lib/aranha/parsers/html/item.rb +0 -24
- data/sub/aranha-parsers/lib/aranha/parsers/html/item_list.rb +0 -33
- data/sub/aranha-parsers/lib/aranha/parsers/html/node/base.rb +0 -34
- data/sub/aranha-parsers/lib/aranha/parsers/html/node/default/numeric_support.rb +0 -129
- data/sub/aranha-parsers/lib/aranha/parsers/html/node/default/string_support.rb +0 -77
- data/sub/aranha-parsers/lib/aranha/parsers/html/node/default.rb +0 -43
- data/sub/aranha-parsers/lib/aranha/parsers/html/node.rb +0 -13
- data/sub/aranha-parsers/lib/aranha/parsers/html.rb +0 -11
- data/sub/aranha-parsers/lib/aranha/parsers/invalid_state_exception.rb +0 -8
- data/sub/aranha-parsers/lib/aranha/parsers/json/base.rb +0 -20
- data/sub/aranha-parsers/lib/aranha/parsers/json.rb +0 -11
- data/sub/aranha-parsers/lib/aranha/parsers/patches/ofx_parser.rb +0 -38
- data/sub/aranha-parsers/lib/aranha/parsers/patches.rb +0 -11
- data/sub/aranha-parsers/lib/aranha/parsers/rspec/setup.rb +0 -15
- data/sub/aranha-parsers/lib/aranha/parsers/rspec/shared_examples/source_target_fixtures.rb +0 -74
- data/sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb +0 -39
- data/sub/aranha-parsers/lib/aranha/parsers/rspec.rb +0 -11
- data/sub/aranha-parsers/lib/aranha/parsers/source_address/fetch_content_error.rb +0 -16
- data/sub/aranha-parsers/lib/aranha/parsers/source_address/file.rb +0 -31
- data/sub/aranha-parsers/lib/aranha/parsers/source_address/hash_http_base.rb +0 -85
- data/sub/aranha-parsers/lib/aranha/parsers/source_address/hash_http_get.rb +0 -13
- data/sub/aranha-parsers/lib/aranha/parsers/source_address/hash_http_post.rb +0 -13
- data/sub/aranha-parsers/lib/aranha/parsers/source_address/http_get.rb +0 -54
- data/sub/aranha-parsers/lib/aranha/parsers/source_address.rb +0 -57
- data/sub/aranha-parsers/lib/aranha/parsers/source_target_fixtures/source_target_file.rb +0 -19
- data/sub/aranha-parsers/lib/aranha/parsers/source_target_fixtures.rb +0 -78
- data/sub/aranha-parsers/lib/aranha/parsers/version.rb +0 -7
- data/sub/aranha-parsers/lib/aranha/parsers.rb +0 -9
- data/sub/aranha-parsers/spec/lib/aranha/parsers/rspec/shared_examples/source_target_fixtures_spec.rb +0 -9
- data/sub/aranha-parsers/spec/lib/aranha/parsers/rspec/shared_examples/source_target_fixtures_spec_files/fixture1.source.txt +0 -1
- data/sub/aranha-parsers/spec/lib/aranha/parsers/rspec/shared_examples/source_target_fixtures_spec_files/fixture1.target.yaml +0 -3
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec.rb +0 -32
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_get.source.yml +0 -6
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_get.target.yaml +0 -10
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_post.source.yml +0 -5
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_post.target.yaml +0 -12
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/http_get.source.yml +0 -1
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/http_get.target.yaml +0 -10
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/http_get_spec.rb +0 -21
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address_spec.rb +0 -74
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb +0 -27
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub1.source.txt +0 -1
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub1.target.html +0 -1
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub2.source.html +0 -1
- data/sub/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub3.target.yaml +0 -1
- data/sub/aranha-parsers/spec/lib/rubocop_check_spec.rb +0 -3
- data/sub/aranha-parsers/spec/spec_helper.rb +0 -4
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'avm/instances/process'
|
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
|
5
|
+
|
|
6
|
+
module Avm
|
|
7
|
+
module EacWebappBase0
|
|
8
|
+
module Instances
|
|
9
|
+
module Processes
|
|
10
|
+
class WebServer < ::Avm::Instances::Process
|
|
11
|
+
def available?
|
|
12
|
+
instance.apache_resource.present?
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def enable
|
|
16
|
+
apache_resource_change(__method__)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def disable
|
|
20
|
+
apache_resource_change(__method__)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
def apache_resource_change(action)
|
|
26
|
+
instance.apache_resource.send(action)
|
|
27
|
+
instance.platform_instance.apache.service(:reload)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'avm/eac_webapp_base0/instances/base'
|
|
4
|
+
|
|
5
|
+
::RSpec.describe ::Avm::EacWebappBase0::Instances::Base do
|
|
6
|
+
let(:instance) { described_class.by_id('the-app_0') }
|
|
7
|
+
|
|
8
|
+
describe '#install_apache_resource_name' do
|
|
9
|
+
it { expect(instance.install_apache_resource_name).to eq(instance.id) }
|
|
10
|
+
end
|
|
11
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eac_tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.70.0
|
|
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-
|
|
11
|
+
date: 2023-06-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: avm
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0.
|
|
19
|
+
version: '0.77'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0.
|
|
26
|
+
version: '0.77'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: avm-eac_asciidoctor_base0
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -158,20 +158,14 @@ dependencies:
|
|
|
158
158
|
requirements:
|
|
159
159
|
- - "~>"
|
|
160
160
|
- !ruby/object:Gem::Version
|
|
161
|
-
version: '0.
|
|
162
|
-
- - ">="
|
|
163
|
-
- !ruby/object:Gem::Version
|
|
164
|
-
version: 0.8.4
|
|
161
|
+
version: '0.9'
|
|
165
162
|
type: :runtime
|
|
166
163
|
prerelease: false
|
|
167
164
|
version_requirements: !ruby/object:Gem::Requirement
|
|
168
165
|
requirements:
|
|
169
166
|
- - "~>"
|
|
170
167
|
- !ruby/object:Gem::Version
|
|
171
|
-
version: '0.
|
|
172
|
-
- - ">="
|
|
173
|
-
- !ruby/object:Gem::Version
|
|
174
|
-
version: 0.8.4
|
|
168
|
+
version: '0.9'
|
|
175
169
|
- !ruby/object:Gem::Dependency
|
|
176
170
|
name: avm-eac_redmine_base0
|
|
177
171
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -232,20 +226,14 @@ dependencies:
|
|
|
232
226
|
requirements:
|
|
233
227
|
- - "~>"
|
|
234
228
|
- !ruby/object:Gem::Version
|
|
235
|
-
version: '0.
|
|
236
|
-
- - ">="
|
|
237
|
-
- !ruby/object:Gem::Version
|
|
238
|
-
version: 0.17.2
|
|
229
|
+
version: '0.18'
|
|
239
230
|
type: :runtime
|
|
240
231
|
prerelease: false
|
|
241
232
|
version_requirements: !ruby/object:Gem::Requirement
|
|
242
233
|
requirements:
|
|
243
234
|
- - "~>"
|
|
244
235
|
- !ruby/object:Gem::Version
|
|
245
|
-
version: '0.
|
|
246
|
-
- - ">="
|
|
247
|
-
- !ruby/object:Gem::Version
|
|
248
|
-
version: 0.17.2
|
|
236
|
+
version: '0.18'
|
|
249
237
|
- !ruby/object:Gem::Dependency
|
|
250
238
|
name: avm-eac_wordpress_base0
|
|
251
239
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -350,57 +338,6 @@ files:
|
|
|
350
338
|
- Gemfile.lock
|
|
351
339
|
- lib/eac_tools.rb
|
|
352
340
|
- lib/eac_tools/version.rb
|
|
353
|
-
- sub/aranha-parsers/Gemfile
|
|
354
|
-
- sub/aranha-parsers/aranha-parsers.gemspec
|
|
355
|
-
- sub/aranha-parsers/lib/aranha/parsers.rb
|
|
356
|
-
- sub/aranha-parsers/lib/aranha/parsers/base.rb
|
|
357
|
-
- sub/aranha-parsers/lib/aranha/parsers/html.rb
|
|
358
|
-
- sub/aranha-parsers/lib/aranha/parsers/html/base.rb
|
|
359
|
-
- sub/aranha-parsers/lib/aranha/parsers/html/item.rb
|
|
360
|
-
- sub/aranha-parsers/lib/aranha/parsers/html/item_list.rb
|
|
361
|
-
- sub/aranha-parsers/lib/aranha/parsers/html/node.rb
|
|
362
|
-
- sub/aranha-parsers/lib/aranha/parsers/html/node/base.rb
|
|
363
|
-
- sub/aranha-parsers/lib/aranha/parsers/html/node/default.rb
|
|
364
|
-
- sub/aranha-parsers/lib/aranha/parsers/html/node/default/numeric_support.rb
|
|
365
|
-
- sub/aranha-parsers/lib/aranha/parsers/html/node/default/string_support.rb
|
|
366
|
-
- sub/aranha-parsers/lib/aranha/parsers/invalid_state_exception.rb
|
|
367
|
-
- sub/aranha-parsers/lib/aranha/parsers/json.rb
|
|
368
|
-
- sub/aranha-parsers/lib/aranha/parsers/json/base.rb
|
|
369
|
-
- sub/aranha-parsers/lib/aranha/parsers/patches.rb
|
|
370
|
-
- sub/aranha-parsers/lib/aranha/parsers/patches/ofx_parser.rb
|
|
371
|
-
- sub/aranha-parsers/lib/aranha/parsers/rspec.rb
|
|
372
|
-
- sub/aranha-parsers/lib/aranha/parsers/rspec/setup.rb
|
|
373
|
-
- sub/aranha-parsers/lib/aranha/parsers/rspec/shared_examples/source_target_fixtures.rb
|
|
374
|
-
- sub/aranha-parsers/lib/aranha/parsers/rspec/source_target_fixtures_controller.rb
|
|
375
|
-
- sub/aranha-parsers/lib/aranha/parsers/source_address.rb
|
|
376
|
-
- sub/aranha-parsers/lib/aranha/parsers/source_address/fetch_content_error.rb
|
|
377
|
-
- sub/aranha-parsers/lib/aranha/parsers/source_address/file.rb
|
|
378
|
-
- sub/aranha-parsers/lib/aranha/parsers/source_address/hash_http_base.rb
|
|
379
|
-
- sub/aranha-parsers/lib/aranha/parsers/source_address/hash_http_get.rb
|
|
380
|
-
- sub/aranha-parsers/lib/aranha/parsers/source_address/hash_http_post.rb
|
|
381
|
-
- sub/aranha-parsers/lib/aranha/parsers/source_address/http_get.rb
|
|
382
|
-
- sub/aranha-parsers/lib/aranha/parsers/source_target_fixtures.rb
|
|
383
|
-
- sub/aranha-parsers/lib/aranha/parsers/source_target_fixtures/source_target_file.rb
|
|
384
|
-
- sub/aranha-parsers/lib/aranha/parsers/version.rb
|
|
385
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/rspec/shared_examples/source_target_fixtures_spec.rb
|
|
386
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/rspec/shared_examples/source_target_fixtures_spec_files/fixture1.source.txt
|
|
387
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/rspec/shared_examples/source_target_fixtures_spec_files/fixture1.target.yaml
|
|
388
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec.rb
|
|
389
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_get.source.yml
|
|
390
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_get.target.yaml
|
|
391
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_post.source.yml
|
|
392
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_post.target.yaml
|
|
393
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/http_get.source.yml
|
|
394
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/http_get.target.yaml
|
|
395
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_address/http_get_spec.rb
|
|
396
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_address_spec.rb
|
|
397
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec.rb
|
|
398
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub1.source.txt
|
|
399
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub1.target.html
|
|
400
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub2.source.html
|
|
401
|
-
- sub/aranha-parsers/spec/lib/aranha/parsers/source_target_fixtures_spec_files/stub3.target.yaml
|
|
402
|
-
- sub/aranha-parsers/spec/lib/rubocop_check_spec.rb
|
|
403
|
-
- sub/aranha-parsers/spec/spec_helper.rb
|
|
404
341
|
- sub/avm-eac_asciidoctor_base0/Gemfile
|
|
405
342
|
- sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec
|
|
406
343
|
- sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0.rb
|
|
@@ -626,6 +563,9 @@ files:
|
|
|
626
563
|
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances.rb
|
|
627
564
|
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/apache_host.rb
|
|
628
565
|
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb
|
|
566
|
+
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes.rb
|
|
567
|
+
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes/daemon.rb
|
|
568
|
+
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes/tasks_scheduler.rb
|
|
629
569
|
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners.rb
|
|
630
570
|
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/bundle.rb
|
|
631
571
|
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/code_runner.rb
|
|
@@ -880,9 +820,11 @@ files:
|
|
|
880
820
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/json.rb
|
|
881
821
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/provider.rb
|
|
882
822
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/xml.rb
|
|
823
|
+
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_base.rb
|
|
883
824
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_host.rb
|
|
884
825
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_path.rb
|
|
885
826
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
|
|
827
|
+
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/install.rb
|
|
886
828
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy.rb
|
|
887
829
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/appended_directories.rb
|
|
888
830
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/build.rb
|
|
@@ -890,6 +832,8 @@ files:
|
|
|
890
832
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb
|
|
891
833
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/version.rb
|
|
892
834
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/write_on_target.rb
|
|
835
|
+
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/processes.rb
|
|
836
|
+
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/processes/web_server.rb
|
|
893
837
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners.rb
|
|
894
838
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/apache_host.rb
|
|
895
839
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/apache_path.rb
|
|
@@ -915,6 +859,7 @@ files:
|
|
|
915
859
|
- sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/xml_spec.rb
|
|
916
860
|
- sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/xml_spec_files/xml_code.xml.source
|
|
917
861
|
- sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/xml_spec_files/xml_code.xml.target
|
|
862
|
+
- sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/instances/base_spec.rb
|
|
918
863
|
- sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/sources/base_spec.rb
|
|
919
864
|
- sub/avm-eac_webapp_base0/spec/rubocop_spec.rb
|
|
920
865
|
- sub/avm-eac_webapp_base0/spec/spec_helper.rb
|
|
@@ -1207,6 +1152,7 @@ files:
|
|
|
1207
1152
|
- sub/avm/lib/avm/instances/base/dockerizable.rb
|
|
1208
1153
|
- sub/avm/lib/avm/instances/base/entry_keys.rb
|
|
1209
1154
|
- sub/avm/lib/avm/instances/base/install.rb
|
|
1155
|
+
- sub/avm/lib/avm/instances/base/processes.rb
|
|
1210
1156
|
- sub/avm/lib/avm/instances/base/subcommand_parent.rb
|
|
1211
1157
|
- sub/avm/lib/avm/instances/base/web.rb
|
|
1212
1158
|
- sub/avm/lib/avm/instances/data.rb
|
|
@@ -1216,6 +1162,7 @@ files:
|
|
|
1216
1162
|
- sub/avm/lib/avm/instances/docker_image.rb
|
|
1217
1163
|
- sub/avm/lib/avm/instances/entry_keys.rb
|
|
1218
1164
|
- sub/avm/lib/avm/instances/ids.rb
|
|
1165
|
+
- sub/avm/lib/avm/instances/process.rb
|
|
1219
1166
|
- sub/avm/lib/avm/instances/runner.rb
|
|
1220
1167
|
- sub/avm/lib/avm/launcher.rb
|
|
1221
1168
|
- sub/avm/lib/avm/launcher/context.rb
|
data/sub/aranha-parsers/Gemfile
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
|
4
|
-
|
|
5
|
-
require 'aranha/parsers/version'
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |s|
|
|
8
|
-
s.name = 'aranha-parsers'
|
|
9
|
-
s.version = ::Aranha::Parsers::VERSION
|
|
10
|
-
s.authors = ['Esquilo Azul Company']
|
|
11
|
-
s.summary = 'Parsers\' utilities for Ruby.'
|
|
12
|
-
|
|
13
|
-
s.files = Dir['{lib}/**/*']
|
|
14
|
-
|
|
15
|
-
s.add_dependency 'activesupport', '>= 4.0.0'
|
|
16
|
-
s.add_dependency 'addressable', '~> 2.8', '>= 2.8.4'
|
|
17
|
-
s.add_dependency 'eac_envs-http', '~> 0.3', '>= 0.3.2'
|
|
18
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.117'
|
|
19
|
-
s.add_dependency 'nokogiri', '~> 1.15', '>= 1.15.1'
|
|
20
|
-
s.add_dependency 'ofx-parser', '~> 1.1'
|
|
21
|
-
|
|
22
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
|
23
|
-
end
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'open-uri'
|
|
4
|
-
require 'fileutils'
|
|
5
|
-
require 'aranha/parsers/source_address'
|
|
6
|
-
require 'eac_ruby_utils/fs/temp'
|
|
7
|
-
|
|
8
|
-
module Aranha
|
|
9
|
-
module Parsers
|
|
10
|
-
class Base
|
|
11
|
-
class << self
|
|
12
|
-
# @deprecated Use {#from_string} instead.
|
|
13
|
-
# @param content [String]
|
|
14
|
-
# @return [Aranha::Parsers::Base]
|
|
15
|
-
def from_content(content)
|
|
16
|
-
from_string(content)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# @param string [String]
|
|
20
|
-
# @return [Aranha::Parsers::Base]
|
|
21
|
-
def from_string(string)
|
|
22
|
-
::EacRubyUtils::Fs::Temp.on_file do |path|
|
|
23
|
-
::File.open(path.to_s, 'w:UTF-8') do |f|
|
|
24
|
-
f.write string.dup.force_encoding('UTF-8')
|
|
25
|
-
end
|
|
26
|
-
r = new(path.to_path)
|
|
27
|
-
r.content
|
|
28
|
-
r
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
LOG_DIR_ENVVAR = 'ARANHA_PARSERS_LOG_DIR'
|
|
34
|
-
|
|
35
|
-
attr_reader :source_address
|
|
36
|
-
|
|
37
|
-
def initialize(url)
|
|
38
|
-
@source_address = ::Aranha::Parsers::SourceAddress.new(url)
|
|
39
|
-
log_content(source_address.serialize, '-source-address')
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
delegate :url, to: :source_address
|
|
43
|
-
|
|
44
|
-
def content
|
|
45
|
-
@content ||= log_content(source_address_content)
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# @return [String]
|
|
49
|
-
delegate :content, to: :source_address, prefix: true
|
|
50
|
-
|
|
51
|
-
private
|
|
52
|
-
|
|
53
|
-
# @return [String]
|
|
54
|
-
def log_content(content, suffix = '')
|
|
55
|
-
path = log_file(suffix)
|
|
56
|
-
|
|
57
|
-
File.open(path, 'wb') { |file| file.write(content) } if path
|
|
58
|
-
|
|
59
|
-
content
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def log_file(suffix)
|
|
63
|
-
dir = log_parsers_dir
|
|
64
|
-
return nil unless dir
|
|
65
|
-
|
|
66
|
-
f = ::File.join(dir, "#{self.class.name.parameterize}#{suffix}.log")
|
|
67
|
-
FileUtils.mkdir_p(File.dirname(f))
|
|
68
|
-
f
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def log_parsers_dir
|
|
72
|
-
return ENV[LOG_DIR_ENVVAR] if ENV[LOG_DIR_ENVVAR]
|
|
73
|
-
return ::Rails.root.join('log', 'parsers') if rails_root_exist?
|
|
74
|
-
|
|
75
|
-
nil
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def rails_root_exist?
|
|
79
|
-
::Rails.root
|
|
80
|
-
true
|
|
81
|
-
rescue NameError
|
|
82
|
-
false
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
end
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'nokogiri'
|
|
4
|
-
require 'aranha/parsers/base'
|
|
5
|
-
require 'aranha/parsers/html/node/default'
|
|
6
|
-
|
|
7
|
-
module Aranha
|
|
8
|
-
module Parsers
|
|
9
|
-
module Html
|
|
10
|
-
class Base < ::Aranha::Parsers::Base
|
|
11
|
-
class << self
|
|
12
|
-
def fields
|
|
13
|
-
@fields ||= []
|
|
14
|
-
@fields.dup
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def field(name, type, xpath)
|
|
18
|
-
@fields ||= []
|
|
19
|
-
@fields << Field.new(name, type, xpath)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
# @param node [Nokogiri::XML::Node]
|
|
23
|
-
# @return [Aranha::Parsers::Html::Base]
|
|
24
|
-
def from_node(node)
|
|
25
|
-
from_string(node.to_html)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# @param haystack [String]
|
|
29
|
-
# @param needle [String]
|
|
30
|
-
# @return [String]
|
|
31
|
-
def xpath_ends_with(haystack, needle)
|
|
32
|
-
"substring(#{haystack}, string-length(#{haystack}) - string-length(#{needle}) + 1) " \
|
|
33
|
-
"= #{needle}"
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
Field = Struct.new(:name, :type, :xpath)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def nokogiri
|
|
40
|
-
@nokogiri ||= Nokogiri::HTML(content, &:noblanks)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
protected
|
|
44
|
-
|
|
45
|
-
def node_parser_class
|
|
46
|
-
::Aranha::Parsers::Html::Node::Default
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
private
|
|
50
|
-
|
|
51
|
-
def node_parser
|
|
52
|
-
@node_parser ||= node_parser_class.new(fields)
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def fields
|
|
56
|
-
self.class.fields.map { |f| [f.name, f.type, f.xpath] }
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'aranha/parsers/html/base'
|
|
4
|
-
|
|
5
|
-
module Aranha
|
|
6
|
-
module Parsers
|
|
7
|
-
module Html
|
|
8
|
-
class Item < Base
|
|
9
|
-
def data
|
|
10
|
-
@data ||= node_parser.parse(item_node)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def item_node
|
|
14
|
-
@item_node ||= begin
|
|
15
|
-
r = item_xpath ? nokogiri.at_xpath(item_xpath) : nokogiri
|
|
16
|
-
raise "Item node not found (Item xpath: #{item_xpath})" unless r
|
|
17
|
-
|
|
18
|
-
r
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'aranha/parsers/html/base'
|
|
4
|
-
|
|
5
|
-
module Aranha
|
|
6
|
-
module Parsers
|
|
7
|
-
module Html
|
|
8
|
-
class ItemList < Base
|
|
9
|
-
def data
|
|
10
|
-
items_data
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def item_data(item)
|
|
14
|
-
item
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def items_data
|
|
18
|
-
count = 0
|
|
19
|
-
@data ||= nokogiri.xpath(items_xpath).map do |m|
|
|
20
|
-
count += 1
|
|
21
|
-
item_data(node_parser.parse(m))
|
|
22
|
-
end
|
|
23
|
-
rescue StandardError => e
|
|
24
|
-
raise StandardError, "#{e.message} (Count: #{count})"
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def items_xpath
|
|
28
|
-
raise "Class #{self.class} has no method \"#{__method__}\". Implement it"
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Aranha
|
|
4
|
-
module Parsers
|
|
5
|
-
module Html
|
|
6
|
-
module Node
|
|
7
|
-
class Base
|
|
8
|
-
attr_reader :fields
|
|
9
|
-
|
|
10
|
-
def initialize(fields)
|
|
11
|
-
@fields = fields
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def parse(node)
|
|
15
|
-
fields.map do |f|
|
|
16
|
-
[f[0], parse_field(node, f[2], f[1])]
|
|
17
|
-
rescue StandardError => e
|
|
18
|
-
raise StandardError, "#{e.message}\nFields: #{f}"
|
|
19
|
-
end.to_h
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
private
|
|
23
|
-
|
|
24
|
-
def parse_field(node, xpath, parser_method)
|
|
25
|
-
value_method = "#{parser_method}_value"
|
|
26
|
-
return send(value_method, node, xpath) if respond_to?(value_method)
|
|
27
|
-
|
|
28
|
-
raise "Method \"#{value_method}\" not found in #{self.class}"
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'aranha/parsers/html/node/base'
|
|
4
|
-
require 'eac_ruby_utils/core_ext'
|
|
5
|
-
|
|
6
|
-
module Aranha
|
|
7
|
-
module Parsers
|
|
8
|
-
module Html
|
|
9
|
-
module Node
|
|
10
|
-
class Default < ::Aranha::Parsers::Html::Node::Base
|
|
11
|
-
module NumericSupport
|
|
12
|
-
# @param node [Nokogiri::XML::Element]
|
|
13
|
-
# @param xpath [String]
|
|
14
|
-
# @return [Float]
|
|
15
|
-
def decimal_comma_value(node, xpath)
|
|
16
|
-
parse_decimal_comma(node, xpath, true)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# @param node [Nokogiri::XML::Element]
|
|
20
|
-
# @param xpath [String]
|
|
21
|
-
# @return [Float, nil]
|
|
22
|
-
def decimal_comma_optional_value(node, xpath)
|
|
23
|
-
parse_decimal_comma(node, xpath, false)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
# @param node [Nokogiri::XML::Element]
|
|
27
|
-
# @param xpath [String]
|
|
28
|
-
# @return [Float]
|
|
29
|
-
def decimal_dot_value(node, xpath)
|
|
30
|
-
parse_decimal_dot(node, xpath, true)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# @param node [Nokogiri::XML::Element]
|
|
34
|
-
# @param xpath [String]
|
|
35
|
-
# @return [Float, nil]
|
|
36
|
-
def decimal_dot_optional_value(node, xpath)
|
|
37
|
-
parse_decimal_dot(node, xpath, false)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def integer_value(node, xpath)
|
|
41
|
-
r = string_value(node, xpath)
|
|
42
|
-
return nil if r.blank?
|
|
43
|
-
|
|
44
|
-
m = /\d+/.match(r)
|
|
45
|
-
raise "Integer not found in \"#{r}\"" unless m
|
|
46
|
-
|
|
47
|
-
m[0].to_i
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def integer_optional_value(node, xpath)
|
|
51
|
-
r = string_value(node, xpath)
|
|
52
|
-
m = /\d+/.match(r)
|
|
53
|
-
m ? m[0].to_i : nil
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def float_value(node, xpath)
|
|
57
|
-
parse_float(node, xpath, true)
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def float_optional_value(node, xpath)
|
|
61
|
-
parse_float(node, xpath, false)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
# @deprecated Use {#decimal_dot_value} instead.
|
|
65
|
-
# @param node [Nokogiri::XML::Element]
|
|
66
|
-
# @param xpath [String]
|
|
67
|
-
# @return [Float]
|
|
68
|
-
def us_decimal_value(node, xpath)
|
|
69
|
-
decimal_dot_value(node, xpath)
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
# @deprecated Use {#decimal_dot_optional_value} instead.
|
|
73
|
-
# @param node [Nokogiri::XML::Element]
|
|
74
|
-
# @param xpath [String]
|
|
75
|
-
# @return [Float, nil]
|
|
76
|
-
def us_decimal_optional_value(node, xpath)
|
|
77
|
-
decimal_dot_optional_value(node, xpath)
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
private
|
|
81
|
-
|
|
82
|
-
def parse_float(node, xpath, required)
|
|
83
|
-
s = string_value(node, xpath)
|
|
84
|
-
m = /\d+(?:[\.\,](\d+))?/.match(s)
|
|
85
|
-
if m
|
|
86
|
-
m[0].delete('.').tr(',', '.').to_f
|
|
87
|
-
elsif required
|
|
88
|
-
raise "Float value not found in \"#{s}\""
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
# @param node [Nokogiri::XML::Element]
|
|
93
|
-
# @param xpath [String]
|
|
94
|
-
# @param required [Boolean]
|
|
95
|
-
# @param separator [String]
|
|
96
|
-
# @param delimiter [String]
|
|
97
|
-
# @return [Float, nil]
|
|
98
|
-
def parse_decimal(node, xpath, required, separator, delimiter)
|
|
99
|
-
s = string_value(node, xpath)
|
|
100
|
-
m = /\d+(?:[#{::Regexp.quote(separator + delimiter)}](\d+))?/.match(s)
|
|
101
|
-
if m
|
|
102
|
-
m[0].delete(delimiter).to_f
|
|
103
|
-
elsif required
|
|
104
|
-
raise "decimal [Separator=\"#{separator}, Delimiter=\"#{delimiter}\"] value not " \
|
|
105
|
-
"found in \"#{s}\""
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
# @param node [Nokogiri::XML::Element]
|
|
110
|
-
# @param xpath [String]
|
|
111
|
-
# @param required [Boolean]
|
|
112
|
-
# @return [Float, nil]
|
|
113
|
-
def parse_decimal_dot(node, xpath, required)
|
|
114
|
-
parse_decimal(node, xpath, required, '.', ',')
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
# @param node [Nokogiri::XML::Element]
|
|
118
|
-
# @param xpath [String]
|
|
119
|
-
# @param required [Boolean]
|
|
120
|
-
# @return [Float, nil]
|
|
121
|
-
def parse_decimal_comma(node, xpath, required)
|
|
122
|
-
parse_decimal(node, xpath, required, ',', '.')
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
end
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
end
|