domreactor-redglass 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. data/lib/domreactor-redglass.rb +14 -1
  2. metadata +2 -2
@@ -75,13 +75,26 @@ module DomReactorRedGlass
75
75
  found_archive
76
76
  end
77
77
 
78
+ def archive_metadata(archive_location)
79
+ metadata = []
80
+ Dir.foreach(archive_location) do |file|
81
+ next if file == '.' or file == '..'
82
+ path = "#{archive_location}/#{file}"
83
+ if is_valid_page_archive? path
84
+ metadata << parse_json_file("#{path}/metadata.json")
85
+ end
86
+ end
87
+ metadata
88
+ end
89
+
78
90
  def init_chain_reaction(api_token, archive_location, config)
79
91
  payload = {
80
92
  auth_token: api_token,
81
93
  analysis_only: true,
82
94
  threshold: config[:threshold] || 0.04,
83
95
  baseline_browser: config[:baseline_browser],
84
- archive_count: sum_archive_count(archive_location)
96
+ archive_count: sum_archive_count(archive_location),
97
+ metadata: archive_metadata(archive_location)
85
98
  }.to_json
86
99
  api_url = config[:api_url] || DOMREACTOR_INIT_CHAIN_REACTION_URL
87
100
  response = RestClient.post(api_url, payload, content_type: 'application/json') do |response|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domreactor-redglass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-27 00:00:00.000000000 Z
12
+ date: 2013-05-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client