shepherd-rails 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/shepherd_rails/tour_statuses_controller.rb +2 -1
- data/app/helpers/shepherd_rails/application_helper.rb +3 -2
- data/config/shepherd_rails_initializer.rb +1 -1
- data/lib/shepherd-rails/config.rb +1 -1
- data/lib/shepherd-rails/version.rb +1 -1
- metadata +2 -5
- data/app/controllers/shepherd_rails/application_controller.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4668b86f00cb27f826ddffac5f2689423ad56e3c8838ddd4070d45039787807b
|
4
|
+
data.tar.gz: e804d7c08d8e669609bf3a0711667830c6a067a69fc76d5d11a7e79358ad44c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44ae74b2caafaf70a82b85e776063df8819db3cef7bb83b74dafe380f3218cc3dddfaea65b1e6a52dccace9479afd105f9788a5d22010321e384fce0c35d2685
|
7
|
+
data.tar.gz: 748829ef790e1bfe6909616dbbb5a6f1f1104c653c0f5513c65daf9d050a9ab22445c9ecebc386eaeb71ffa8ec1628dfc8864cb8a764de4f596c9f7c65730621
|
@@ -2,9 +2,10 @@ module ShepherdRails
|
|
2
2
|
class TourStatusesController < ShepherdRails.configuration.base_controller.constantize
|
3
3
|
def create
|
4
4
|
tour_name = params.require(:tour)
|
5
|
+
context = params.to_unsafe_h[:context].to_h.with_indifferent_access
|
5
6
|
case params.require(:event)
|
6
7
|
when 'complete'
|
7
|
-
ShepherdRails.configuration.on_tour_complete.call(
|
8
|
+
ShepherdRails.configuration.on_tour_complete.call(context, tour_name)
|
8
9
|
end
|
9
10
|
|
10
11
|
head :ok
|
@@ -2,12 +2,13 @@
|
|
2
2
|
|
3
3
|
module ShepherdRails
|
4
4
|
module ApplicationHelper
|
5
|
-
def shepherd_tour tour:
|
5
|
+
def shepherd_tour tour:, context: {}
|
6
6
|
tag.div nil, data: {
|
7
7
|
controller: 'shepherd-rails',
|
8
8
|
'shepherd-rails-tour-name-value' => tour,
|
9
9
|
'shepherd-rails-endpoint-value' => shepherd_rails.tour_statuses_path,
|
10
|
-
'shepherd-rails-config-value' => I18n.t(tour, scope: 'shepherd_rails')
|
10
|
+
'shepherd-rails-config-value' => I18n.t(tour, scope: 'shepherd_rails'),
|
11
|
+
'shepherd-rails-context-value' => context
|
11
12
|
}
|
12
13
|
end
|
13
14
|
end
|
@@ -1,4 +1,4 @@
|
|
1
1
|
ShepherdRails.configure do |config|
|
2
|
-
# config.on_tour_complete = ->(
|
2
|
+
# config.on_tour_complete = ->(context, tour_name) { Model.find(context[:model_id].do_something tour_name }
|
3
3
|
# config.base_controller = 'ApplicationController'
|
4
4
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module ShepherdRails
|
2
2
|
class Config
|
3
|
-
cattr_accessor :on_tour_complete, default: ->(
|
3
|
+
cattr_accessor :on_tour_complete, default: ->(context, tour_name) { puts "Completed tour #{tour_name} - context: #{context.inspect}" }
|
4
4
|
cattr_accessor :base_controller, default: 'ActionController::Base'
|
5
5
|
end
|
6
6
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shepherd-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Catalin Ionescu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -36,7 +36,6 @@ files:
|
|
36
36
|
- Rakefile
|
37
37
|
- app/assets/config/sr_manifest.js
|
38
38
|
- app/assets/stylesheets/sr/application.css
|
39
|
-
- app/controllers/shepherd_rails/application_controller.rb
|
40
39
|
- app/controllers/shepherd_rails/tour_statuses_controller.rb
|
41
40
|
- app/helpers/shepherd_rails/application_helper.rb
|
42
41
|
- app/jobs/sr/application_job.rb
|
@@ -55,11 +54,9 @@ homepage: https://github.com/cionescu/shepherd-rails
|
|
55
54
|
licenses:
|
56
55
|
- MIT
|
57
56
|
metadata:
|
58
|
-
allowed_push_host: https://rubygems.org
|
59
57
|
homepage_uri: https://github.com/cionescu/shepherd-rails
|
60
58
|
source_code_uri: https://github.com/cionescu/shepherd-rails
|
61
59
|
changelog_uri: https://github.com/cionescu/shepherd-rails
|
62
|
-
rubygems_mfa_required: 'true'
|
63
60
|
post_install_message:
|
64
61
|
rdoc_options: []
|
65
62
|
require_paths:
|