html_cs_run_parse 0.0.4 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/lib/HTMLCS.js +33 -630
  3. data/lib/html_compilation/classes/builders/app_html.rb +62 -0
  4. data/lib/html_compilation/classes/builders/graph.rb +70 -0
  5. data/lib/html_compilation/classes/builders/html_builder.rb +27 -0
  6. data/lib/html_compilation/classes/builders/page_html.rb +91 -0
  7. data/lib/html_compilation/classes/builders/row_html.rb +13 -0
  8. data/lib/html_compilation/classes/objects/app.rb +28 -0
  9. data/lib/html_compilation/classes/objects/base_object.rb +12 -0
  10. data/lib/html_compilation/classes/objects/page.rb +99 -0
  11. data/lib/html_compilation/classes/objects/row.rb +22 -0
  12. data/lib/html_compilation/classes/setup/conditioning.rb +23 -0
  13. data/lib/html_compilation/classes/setup/output_generation.rb +21 -0
  14. data/lib/html_compilation/classes/setup/retrieval.rb +90 -0
  15. data/lib/html_compilation/classes/setup/setup.rb +83 -0
  16. data/lib/html_compilation/classes/struct_classes/score_collection.rb +33 -0
  17. data/lib/html_compilation/classes/struct_classes/suppressed_page_rules.rb +8 -0
  18. data/lib/html_compilation/data/html_data/app_data.yaml +39 -0
  19. data/lib/html_compilation/data/html_data/page_data.yaml +37 -0
  20. data/lib/html_compilation/data/html_data/row_data.yaml +4 -0
  21. data/lib/html_compilation/data/html_data/style_script.yaml +167 -0
  22. data/lib/html_compilation/execution.rb +18 -0
  23. data/lib/html_compilation/modules/image_interaction.rb +14 -0
  24. data/lib/html_compilation/modules/yaml_interaction.rb +26 -0
  25. data/lib/html_cs_run_parse.rb +7 -1
  26. metadata +53 -3
@@ -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
@@ -0,0 +1,14 @@
1
+ module ImageInteraction
2
+ #wonkavision
3
+ def retrieve_image_content(file_location)
4
+ File.read(file_location, mode: "rb")
5
+ end
6
+
7
+ def place_image_content(file_name, content, extension =".png")
8
+ File.write(file_name + extension, content, mode: "wb:ASCII-8BIT")
9
+ end
10
+
11
+ def return_all_files(current_location, file_type = '*', filter = '*')
12
+ Dir.glob("#{current_location}/#{filter}.#{file_type}")
13
+ end
14
+ end
@@ -0,0 +1,26 @@
1
+ module YAMLInteraction
2
+ require 'yaml'
3
+
4
+ def read_yaml(relative_location, data)
5
+ return_yaml(relative_location)[data.upcase.tr(' ', '_')]
6
+ end
7
+
8
+ def key_value_add(file_location, key, value)
9
+ hash = return_yaml(file_location)
10
+ hash.store(key.upcase.tr(' ', '_'), value.to_s)
11
+ yaml_dump(file_location, hash)
12
+ end
13
+
14
+ private
15
+
16
+ def return_yaml(relative_location)
17
+ YAML.load(File.read(relative_location))
18
+ end
19
+
20
+ def yaml_dump(file_location, hash)
21
+ File.open(file_location, 'w+') {
22
+ |file| YAML.dump(hash, file)}
23
+ end
24
+
25
+
26
+ end
@@ -1,12 +1,18 @@
1
1
  require 'utility/parse_machine'
2
+ require 'html_compilation/execution'
2
3
 
3
4
  #this gem is specifically for running HTMLCS
4
5
  class HTMLCS
5
6
  def self.run_html_cs(browser, file_name)
6
- browser.execute_script(File.read("HTMLCS.js"))
7
+ browser.execute_script(File.read(File.expand_path("../HTMLCS.js", __FILE__)))
7
8
  browser.execute_script("HTMLCS_RUNNER.run('WCAG2AA')")
8
9
  output = browser.driver.manage.logs.get(:browser)
9
10
  parse = ParseMachine.new
10
11
  parse.htmlcs_parse(output, file_name)
11
12
  end
13
+
14
+ def self.compile_html_cs(data_location)
15
+ exec = Execution.new
16
+ exec.build(data_location)
17
+ end
12
18
  end
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.4
4
+ version: 0.0.9
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-25 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2021-02-26 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: []
@@ -17,6 +45,28 @@ extensions: []
17
45
  extra_rdoc_files: []
18
46
  files:
19
47
  - lib/HTMLCS.js
48
+ - lib/html_compilation/classes/builders/app_html.rb
49
+ - lib/html_compilation/classes/builders/graph.rb
50
+ - lib/html_compilation/classes/builders/html_builder.rb
51
+ - lib/html_compilation/classes/builders/page_html.rb
52
+ - lib/html_compilation/classes/builders/row_html.rb
53
+ - lib/html_compilation/classes/objects/app.rb
54
+ - lib/html_compilation/classes/objects/base_object.rb
55
+ - lib/html_compilation/classes/objects/page.rb
56
+ - lib/html_compilation/classes/objects/row.rb
57
+ - lib/html_compilation/classes/setup/conditioning.rb
58
+ - lib/html_compilation/classes/setup/output_generation.rb
59
+ - lib/html_compilation/classes/setup/retrieval.rb
60
+ - lib/html_compilation/classes/setup/setup.rb
61
+ - lib/html_compilation/classes/struct_classes/score_collection.rb
62
+ - lib/html_compilation/classes/struct_classes/suppressed_page_rules.rb
63
+ - lib/html_compilation/data/html_data/app_data.yaml
64
+ - lib/html_compilation/data/html_data/page_data.yaml
65
+ - lib/html_compilation/data/html_data/row_data.yaml
66
+ - lib/html_compilation/data/html_data/style_script.yaml
67
+ - lib/html_compilation/execution.rb
68
+ - lib/html_compilation/modules/image_interaction.rb
69
+ - lib/html_compilation/modules/yaml_interaction.rb
20
70
  - lib/html_cs_run_parse.rb
21
71
  - lib/licence.txt
22
72
  - lib/utility/parse_machine.rb