diffux_ci 0.4.0 → 0.4.1

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
  SHA1:
3
- metadata.gz: 17dabfe7fd58267914a299a9483ab949641d6257
4
- data.tar.gz: 2fc79ba700188b7aba82f43d34ab7962e78f65d9
3
+ metadata.gz: b4b7c2de4ab8683d94cba7d17e480431e4d0c727
4
+ data.tar.gz: 0e45a3e707cdb960112dc9f0f6ff37ed01169616
5
5
  SHA512:
6
- metadata.gz: 46723a8efa95283c6d95201f45a2075d7afa47f9ee2aeea3a7cfe85f6ccfe7904473ac0345d9c7132827dcb0009a8c3f1b0c4ea3b6811c79aa8fd53de2131baa
7
- data.tar.gz: 4ac1e9e47de90dae7dc9771b318a7c1c058555d05f8d3189423294d0e0fe224e18e0d06aa6625bee86832337bbc1c5b268fe6700e51ac0acf7acca5aa2425849
6
+ metadata.gz: 30a700e0bc8a120ce29fc7a634a740ce32d86cd0169ce2fdd1bb3e7feb70fcea916f7e297ad6bc812c0c0057e1d562a038dcc9df2656aec7b2d99e762823af18
7
+ data.tar.gz: 8654640c02c0ea6911ab04c3aa0b04b045f923872b4a7f6efa76370f4961b58b2b425c5d654b399a3896904ec6a77ee38ea0cb65c03fddc855ee05240cc04eb4
@@ -1,3 +1,4 @@
1
+ <% require 'rack' %>
1
2
  <!DOCTYPE html>
2
3
  <html>
3
4
  <head>
@@ -9,7 +10,7 @@
9
10
 
10
11
  <% diff_images.each do |diff| %>
11
12
  <h3>
12
- <%= diff[:description] %> @ <%= diff[:viewport] %>
13
+ <%= Rack::Utils.escape_html(diff[:description]) %> @ <%= diff[:viewport] %>
13
14
  </h3>
14
15
  <p><img src="<%= diff[:url] %>"></p>
15
16
  <% end %>
@@ -9,6 +9,12 @@ class DiffuxCIServer < Sinatra::Base
9
9
  set :port, DiffuxCIUtils.config['port']
10
10
  end
11
11
 
12
+ helpers do
13
+ def h(text)
14
+ Rack::Utils.escape_html(text)
15
+ end
16
+ end
17
+
12
18
  get '/' do
13
19
  @config = DiffuxCIUtils.config
14
20
  erb :index
@@ -1,6 +1,7 @@
1
1
  require 'yaml'
2
2
  require 'erb'
3
3
  require 'uri'
4
+ require 'base64'
4
5
 
5
6
  class DiffuxCIUtils
6
7
  def self.config
@@ -33,7 +34,7 @@ class DiffuxCIUtils
33
34
  end
34
35
 
35
36
  def self.normalize_description(description)
36
- description.gsub(/[^a-zA-Z0-9\-_]/, '_')
37
+ Base64.encode64(description)
37
38
  end
38
39
 
39
40
  def self.path_to(description, viewport_name, file_name)
@@ -59,7 +60,7 @@ class DiffuxCIUtils
59
60
  viewport_dir = File.expand_path('..', file)
60
61
  description_dir = File.expand_path('..', viewport_dir)
61
62
  {
62
- description: File.basename(description_dir),
63
+ description: Base64.decode64(File.basename(description_dir)),
63
64
  viewport: File.basename(viewport_dir).sub('@', ''),
64
65
  file: file
65
66
  }
@@ -1,4 +1,4 @@
1
1
  # Defines the gem version.
2
2
  module DiffuxCI
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'
4
4
  end
@@ -0,0 +1,5 @@
1
+ $(function() {
2
+ $('.js-diff').each(function(elem) {
3
+ var $elem = $(elem);
4
+ });
5
+ });
data/lib/views/review.erb CHANGED
@@ -9,7 +9,7 @@
9
9
  <h2>DIFFS</h2>
10
10
  <% @snapshots[:diffs].each do |diff| %>
11
11
  <h3>
12
- <%= diff[:description] %> @ <%= diff[:viewport] %>
12
+ <%= h diff[:description] %> @ <%= diff[:viewport] %>
13
13
  </h3>
14
14
  <p><img src="/resource?file=<%= ERB::Util.url_encode(diff[:file]) %>"></p>
15
15
  <form style="display: inline-block"
@@ -29,7 +29,7 @@
29
29
  <h2>BASELINES</h2>
30
30
  <% @snapshots[:baselines].each do |baseline| %>
31
31
  <h3>
32
- <%= baseline[:description] %> @ <%= baseline[:viewport] %>
32
+ <%= h baseline[:description] %> @ <%= baseline[:viewport] %>
33
33
  </h3>
34
34
  <p><img src="/resource?file=<%= ERB::Util.url_encode(baseline[:file]) %>"></p>
35
35
  <% end %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diffux_ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henric Trotzig
@@ -143,6 +143,7 @@ files:
143
143
  - lib/diffux_ci_utils.rb
144
144
  - lib/diffux_ci_version.rb
145
145
  - lib/public/diffux_ci-runner.js
146
+ - lib/public/diffux_ci-scripts.js
146
147
  - lib/public/diffux_ci-styles.css
147
148
  - lib/views/debug.erb
148
149
  - lib/views/index.erb
@@ -167,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
168
  version: '0'
168
169
  requirements: []
169
170
  rubyforge_project:
170
- rubygems_version: 2.4.5
171
+ rubygems_version: 2.4.5.1
171
172
  signing_key:
172
173
  specification_version: 4
173
174
  summary: Diffux-CI