gitlab-experiment 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f89a48e8e15030981a25d71cfc86d9f92520e535b90381209861e698d47d646e
4
- data.tar.gz: 80c92e4817efd0b9f9c273bd6392548ef03352140c9d8e2cc9ce13cee90fb5b2
3
+ metadata.gz: ed3c0028563936ce8a3fbdfd1de9d64e499102c4ec71a21946b63c56cc2bebd5
4
+ data.tar.gz: 43389ef9b7b2a4b3e60b82b5ffefbe3635739cb9fafec21dd5e9d59586f942c2
5
5
  SHA512:
6
- metadata.gz: 9ff2aa5d59df1dac0d5c6efd5a592e98c5363ad59c209a46b84a722c231b674cdfaa7c9ca53eade02b180d99bce2c13c336fedc92cebd2f0bec1bb59c7b0f82a
7
- data.tar.gz: 3e94dd388343cddab5eef06dd3e3bfa756725a690f45f2143ef03d6c56e5b19f4b47d5757fcfbc9cde9ae415f74ec838c764ac59254d385368a2ab76d9d97a7b
6
+ metadata.gz: 30d0988d199f34eb60e3d56d8e7aec3a00222a5de482410c0294e15ce37a2a9dccbb2fb35b372c90b4425879938bec0d7e5b0ffadf5d842ee31abb0ea673aaeb
7
+ data.tar.gz: 3665443e1d937b77e12debaf3195423b3fad171b651573e58a328dfb5c1f618eb9a282eedcfde68376ae0e7207837b74ae60e4fda616c046caa329b4cc681e68
@@ -29,6 +29,7 @@ module Gitlab
29
29
 
30
30
  def from_param(id)
31
31
  %r{/?(?<name>.*):(?<key>.*)$} =~ id
32
+ name = CGI.unescape(name) if name
32
33
  constantize(name).new(name).tap { |e| e.context.key(key) }
33
34
  end
34
35
  end
@@ -61,16 +61,18 @@ module Gitlab
61
61
  private
62
62
 
63
63
  def process_migrations(value)
64
- add_migration(value.delete(:migrated_from))
65
- add_migration(value.delete(:migrated_with), merge: true)
64
+ add_unmerged_migration(value.delete(:migrated_from))
65
+ add_merged_migration(value.delete(:migrated_with))
66
66
 
67
67
  migrate_cookie(value, "#{@experiment.name}_id")
68
68
  end
69
69
 
70
- def add_migration(value, merge: false)
71
- return unless value.is_a?(Hash)
70
+ def add_unmerged_migration(value = {})
71
+ @migrations[:unmerged] << value if value.is_a?(Hash)
72
+ end
72
73
 
73
- @migrations[merge ? :merged : :unmerged] << value
74
+ def add_merged_migration(value = {})
75
+ @migrations[:merged] << value if value.is_a?(Hash)
74
76
  end
75
77
 
76
78
  def migration_keys
@@ -23,7 +23,7 @@ module Gitlab
23
23
  return hash if cookie.to_s.empty?
24
24
  return hash.merge(key => cookie) if hash[key].nil?
25
25
 
26
- add_migration(key => cookie)
26
+ add_unmerged_migration(key => cookie)
27
27
  cookie_jar.delete(cookie_name, domain: domain)
28
28
 
29
29
  hash
@@ -35,7 +35,10 @@ module Gitlab
35
35
  app.config.middleware.use(Middleware, mount_at)
36
36
  app.routes.append do
37
37
  mount Engine, at: mount_at, as: :experiment_engine
38
- direct(:experiment_redirect) { |ex, url:| "#{engine.url_helpers.experiment_url(ex)}?#{url}" }
38
+ direct(:experiment_redirect) do |ex, options|
39
+ url = options[:url]
40
+ "#{engine.url_helpers.experiment_url(ex)}?#{url}"
41
+ end
39
42
  end
40
43
  end
41
44
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  class Experiment
5
- VERSION = '0.6.3'
5
+ VERSION = '0.6.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-experiment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab