moonshot-rails 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,5 +33,27 @@ module Moonshot
33
33
 
34
34
  tag.div(data: options)
35
35
  end
36
+
37
+ def crisp_chat user: nil, enabled: true, wrapper: :div, api_key:
38
+ return unless enabled
39
+
40
+ options = {
41
+ controller: 'crisp',
42
+ crisp_website_id_value: api_key
43
+ }
44
+
45
+ if user
46
+ options.merge!({
47
+ crisp_identification_value: {
48
+ name: user.tracker_name,
49
+ email: user.tracker_email
50
+ }
51
+ })
52
+ end
53
+
54
+ tag.send(wrapper, data: options) do
55
+ yield if block_given?
56
+ end
57
+ end
36
58
  end
37
59
  end
@@ -8,14 +8,6 @@ module MoonshotRails
8
8
  #{root}/app/helpers
9
9
  ]
10
10
 
11
- initializer 'moonshot_rails.assets' do |app|
12
- if app.config.respond_to?(:assets)
13
- app.config.assets.precompile += %w[
14
- moonshot.js
15
- ]
16
- end
17
- end
18
-
19
11
  initializer 'moonshot_rails.helpers' do
20
12
  ActiveSupport.on_load(:action_controller_base) do
21
13
  helper Moonshot::MoonshotHelper
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MoonshotRails
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moonshot-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
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-12-19 00:00:00.000000000 Z
11
+ date: 2023-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -62,6 +62,7 @@ files:
62
62
  - LICENSE.txt
63
63
  - README.md
64
64
  - app/assets/javascripts/moonshot.js
65
+ - app/assets/javascripts/moonshot/crisp_controller.js
65
66
  - app/assets/javascripts/moonshot/index.js
66
67
  - app/assets/javascripts/moonshot/post_hog_controller.js
67
68
  - app/assets/javascripts/moonshot/shepherd_controller.js