html_cs_run_parse 0.0.8 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75f61290e75acd7df13f3363cf932e53f8db0a5f9b0dccd0160941ad2f65d4ad
4
- data.tar.gz: af6678fafe7699aa40ef7d84a7fb37e070891169dbfae67ff3a18f8e06e008a5
3
+ metadata.gz: 4a0750c64fc312e38341c1b622eb7e14399c735727ad1756a46d101f5aa44151
4
+ data.tar.gz: 24c8084595d8094ddccccf7f409848f7d617554ec7a918c15cd9dc7db95fe287
5
5
  SHA512:
6
- metadata.gz: 85a11b4d7dd079f785532d1927bfc7e1fbcdb16cb80d163e039e184c8487e5ac61229ad826c9775977117c8b5184def079afea1ac3f9cd4d84fcfcd905b7f20e
7
- data.tar.gz: db47675fa6cbb476b86c65293bfcf6f91e96067cfc4714975161d3651d71ceaa054c0746f58bf796a5e02e3670ac23aac6ae192b5f58d6ed0677df07f922d213
6
+ metadata.gz: 43f459df89f1010ec5f9c8c166c284b506b97e07614f7913641e9b2c2638046bd484926a9af2d98663ffa97b86c2786b507f41fabc11f92a02b7335337a6d2de
7
+ data.tar.gz: 50a279b7625aec3d67146d98d84b96d5820167afa0931d049e63b6952659b697d5e1b95f9f7740f3cdd1e55a08a37ed4d3b0199999ca98f958d427d94f477e0c
@@ -18,14 +18,14 @@ class Setup
18
18
  @env = rt.retrieve_env
19
19
  end
20
20
 
21
- def main_setup(app, file_prefix = "./data/")
21
+ def main_setup(app, file_prefix = "./data")
22
22
  app_initial_setup(app)
23
23
  pages = page_initial_setup
24
24
  app_additional_setup(app, pages)
25
25
  pages.each_with_index do |page, index|
26
26
  rows = row_initial_setup(index)
27
- row_additional_setup(rows, file_prefix + "scores.yaml")
28
- page_additional_setup(app, page, rows, file_prefix + "suppressed_rules.yaml")
27
+ row_additional_setup(rows, file_prefix + "/scores.yaml")
28
+ page_additional_setup(app, page, rows, file_prefix + "/suppressed_rules.yaml")
29
29
  end
30
30
  end
31
31
 
@@ -0,0 +1,18 @@
1
+ $:.unshift File.dirname(__FILE__)
2
+ require 'classes/setup/setup.rb'
3
+ require 'classes/objects/app'
4
+ require 'classes/setup/conditioning.rb'
5
+ require 'classes/setup/output_generation.rb'
6
+ class Execution
7
+ def build(file_prefix = "./data")
8
+ app = Application.new
9
+
10
+ setup = Setup.new(file_prefix + "/input")
11
+ setup.main_setup(app, file_prefix)
12
+
13
+ conditioning = Conditioning.new
14
+ conditioning.main_condition(app, skip_value = false, ddl = file_prefix)
15
+
16
+ out = OutputGeneration.new(app, file_prefix + "/output/files/")
17
+ end
18
+ end
@@ -9,6 +9,27 @@ class HTMLCS
9
9
  output = browser.driver.manage.logs.get(:browser)
10
10
  parse = ParseMachine.new
11
11
  parse.htmlcs_parse(output, file_name)
12
+ browser.screenshot.save "#{file_name}.png"
13
+ File.open(file_name + ".txt", 'w+') { |file|
14
+ file.print(browser.url)
15
+ }
16
+ end
17
+
18
+ def self.create_empty_directories(root_directory_name)
19
+ html_input_location = root_directory_name + "/input"
20
+ html_output_location = root_directory_name + "/output"
21
+ html_file_location = root_directory_name + "/output/files"
22
+ if Dir.exist?(html_input_location) == false
23
+ Dir.mkdir(html_input_location)
24
+ Dir.mkdir(html_output_location)
25
+ Dir.mkdir(html_file_location)
26
+ end
27
+ [html_input_location, html_output_location, html_file_location].each { |location|
28
+ Dir.glob("#{location}/**").each { |file|
29
+ if file.include?('.txt') || file.include?('.png') || file.include?('.html') || file.include?('.csv')
30
+ File.delete(file)
31
+ end
32
+ } }
12
33
  end
13
34
 
14
35
  def self.compile_html_cs(data_location)
@@ -4,6 +4,7 @@ class ParseMachine
4
4
  def htmlcs_parse(violations, file_name)
5
5
  mod_output = iterate_violations(violations)
6
6
  write_csv(mod_output, file_name)
7
+
7
8
  end
8
9
 
9
10
  private
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html_cs_run_parse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerren Every
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-26 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2021-03-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: googlecharts
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
13
41
  description: ''
14
42
  email: jerren1122@hotmail.com
15
43
  executables: []
@@ -36,6 +64,7 @@ files:
36
64
  - lib/html_compilation/data/html_data/page_data.yaml
37
65
  - lib/html_compilation/data/html_data/row_data.yaml
38
66
  - lib/html_compilation/data/html_data/style_script.yaml
67
+ - lib/html_compilation/execution.rb
39
68
  - lib/html_compilation/modules/image_interaction.rb
40
69
  - lib/html_compilation/modules/yaml_interaction.rb
41
70
  - lib/html_cs_run_parse.rb