trailguide 0.1.4 → 0.1.5

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: 1168244069ee4cc060d0e55a08c80bbccff498fa545105604902acc15a750386
4
- data.tar.gz: b84fd9db3485005545dae5c0a8d52d5b30b85eb6bd09da83c690db85adb179d7
3
+ metadata.gz: f039c1544c6c7838e9cbfcbed1c055695c9858410c4691e4610c0d01a3f4641a
4
+ data.tar.gz: 0352f018c0b28e12ab7ad1240601d30efbc3128060ddff71a0bb71ab62f0bcbb
5
5
  SHA512:
6
- metadata.gz: 203c6d29fe77bc8e5ef5f4ffbe11f93bbc14c9d8923228285c4fe03c03f59b16c2a1aebcf617443fcc21b420cd51d8dbfe77ac8b983a430a3a1f6b0ec0f386a8
7
- data.tar.gz: 9508e5301cc1b3dc9aef23e2fe0199b50f2ea29bdc704662de63f002bec1adade251111afbf2e374410f0dd33a69f5bc8509a1a2d334095c2d67ca25a049885d
6
+ metadata.gz: f98583d74689f359af53deaacc3ec9423724353207c18051a3502b7b247acda71f74c44020b7cf99995cd64bdfa0063b6f4737d2c38f0aa96eec50bed62a7e8d
7
+ data.tar.gz: 0e3905af90fee8378ced8c729da4a5d2f127208b4fb6e26cdfc1a07b6376486373ec36ca825fb9fad52056b72e0d4f0b40b30c185681280b060ff14553f11b74
@@ -1,6 +1,6 @@
1
1
  module TrailGuide
2
2
  module Admin
3
- class ExperimentsController < TrailGuide::Admin::ApplicationController
3
+ class ExperimentsController < ApplicationController
4
4
  before_action except: [:index] do
5
5
  (redirect_to :back rescue redirect_to trail_guide_admin.experiments_path) and return unless experiment.present?
6
6
  end
@@ -29,7 +29,7 @@ module TrailGuide
29
29
  end
30
30
 
31
31
  def winner
32
- experiment.declare_winner!(params[:winner])
32
+ experiment.declare_winner!(params[:variant])
33
33
  redirect_to :back rescue redirect_to trail_guide_admin.experiments_path
34
34
  end
35
35
 
@@ -1,5 +1,5 @@
1
1
  module TrailGuide
2
- class ApplicationController < ::ApplicationController
2
+ class ExperimentsController < ::ApplicationController
3
3
  before_action do
4
4
  render json: { error: "Experiment does not exist" }, status: 404 and return unless experiment.present?
5
5
  end
data/config/routes.rb CHANGED
@@ -1,10 +1,24 @@
1
1
  TrailGuide::Engine.routes.draw do
2
- get '/:experiment_name' => 'application#choose',
2
+ get '/:experiment_name' => 'experiments#choose',
3
3
  defaults: { format: :json }
4
- match '/:experiment_name' => 'application#convert',
4
+ match '/:experiment_name' => 'experiments#convert',
5
5
  defaults: { format: :json },
6
6
  via: [:put, :post]
7
- match '/:experiment_name/:checkpoint' => 'application#convert',
7
+ match '/:experiment_name/:checkpoint' => 'experiments#convert',
8
8
  defaults: { format: :json },
9
9
  via: [:put, :post]
10
10
  end
11
+
12
+ if defined?(TrailGuide::Admin::Engine)
13
+ TrailGuide::Admin::Engine.routes.draw do
14
+ resources :experiments, path: '/', only: [:index] do
15
+ member do
16
+ match :start, via: [:put, :post, :get]
17
+ match :stop, via: [:put, :post, :get]
18
+ match :reset, via: [:put, :post, :get]
19
+ match :restart, via: [:put, :post, :get]
20
+ match :winner, via: [:put, :post, :get], path: 'winner/:variant'
21
+ end
22
+ end
23
+ end
24
+ end
@@ -9,5 +9,3 @@ module TrailGuide
9
9
  end
10
10
  end
11
11
  end
12
-
13
- load TrailGuide::Admin::Engine.root.join("config/admin/routes.rb")
@@ -2,7 +2,7 @@ module TrailGuide
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 4
5
+ PATCH = 5
6
6
  VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
 
8
8
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailguide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec
@@ -108,11 +108,10 @@ files:
108
108
  - app/assets/stylesheets/trail_guide/admin/application.css
109
109
  - app/controllers/trail_guide/admin/application_controller.rb
110
110
  - app/controllers/trail_guide/admin/experiments_controller.rb
111
- - app/controllers/trail_guide/application_controller.rb
111
+ - app/controllers/trail_guide/experiments_controller.rb
112
112
  - app/views/layouts/trail_guide/admin/application.html.erb
113
113
  - app/views/trail_guide/admin/experiments/_experiment.html.erb
114
114
  - app/views/trail_guide/admin/experiments/index.html.erb
115
- - config/admin/routes.rb
116
115
  - config/routes.rb
117
116
  - lib/trail_guide/adapters.rb
118
117
  - lib/trail_guide/adapters/participants.rb
@@ -1,11 +0,0 @@
1
- TrailGuide::Admin::Engine.routes.draw do
2
- resources :experiments, path: '/', only: [:index] do
3
- member do
4
- match :start, via: [:put, :post, :get]
5
- match :stop, via: [:put, :post, :get]
6
- match :reset, via: [:put, :post, :get]
7
- match :restart, via: [:put, :post, :get]
8
- match 'winner/:winner', action: :winner, as: :winner, via: [:put, :post, :get]
9
- end
10
- end
11
- end