html_cs_run_parse 0.0.3 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html_cs_run_parse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.8
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
11
+ date: 2021-02-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email: jerren1122@hotmail.com
@@ -17,6 +17,27 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/HTMLCS.js
20
+ - lib/html_compilation/classes/builders/app_html.rb
21
+ - lib/html_compilation/classes/builders/graph.rb
22
+ - lib/html_compilation/classes/builders/html_builder.rb
23
+ - lib/html_compilation/classes/builders/page_html.rb
24
+ - lib/html_compilation/classes/builders/row_html.rb
25
+ - lib/html_compilation/classes/objects/app.rb
26
+ - lib/html_compilation/classes/objects/base_object.rb
27
+ - lib/html_compilation/classes/objects/page.rb
28
+ - lib/html_compilation/classes/objects/row.rb
29
+ - lib/html_compilation/classes/setup/conditioning.rb
30
+ - lib/html_compilation/classes/setup/output_generation.rb
31
+ - lib/html_compilation/classes/setup/retrieval.rb
32
+ - lib/html_compilation/classes/setup/setup.rb
33
+ - lib/html_compilation/classes/struct_classes/score_collection.rb
34
+ - lib/html_compilation/classes/struct_classes/suppressed_page_rules.rb
35
+ - lib/html_compilation/data/html_data/app_data.yaml
36
+ - lib/html_compilation/data/html_data/page_data.yaml
37
+ - lib/html_compilation/data/html_data/row_data.yaml
38
+ - lib/html_compilation/data/html_data/style_script.yaml
39
+ - lib/html_compilation/modules/image_interaction.rb
40
+ - lib/html_compilation/modules/yaml_interaction.rb
20
41
  - lib/html_cs_run_parse.rb
21
42
  - lib/licence.txt
22
43
  - lib/utility/parse_machine.rb