intercom-rails 0.2.16 → 0.2.17
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.
- data/README.mdown +2 -0
- data/lib/intercom-rails/script_tag.rb +1 -1
- data/lib/intercom-rails/version.rb +1 -1
- data/test/intercom-rails/script_tag_test.rb +7 -0
- metadata +19 -8
data/README.mdown
CHANGED
@@ -25,6 +25,8 @@ rails generate intercom:config YOUR-APP-ID
|
|
25
25
|
|
26
26
|
To make installing Intercom as easy as possible, where possible a `<script>` tag **will be automatically inserted before the closing `</body>` tag**. For most Rails apps, **you won't need to do any extra config**. Having trouble? Check out troubleshooting below.
|
27
27
|
|
28
|
+
### Disabling automatic insertion
|
29
|
+
|
28
30
|
To disable automatic insertion for a particular controller or action you can:
|
29
31
|
|
30
32
|
```ruby
|
@@ -112,7 +112,7 @@ module IntercomRails
|
|
112
112
|
|
113
113
|
def convert_dates_to_unix_timestamps(object)
|
114
114
|
return Hash[object.map { |k, v| [k, convert_dates_to_unix_timestamps(v)] }] if object.is_a?(Hash)
|
115
|
-
return object.
|
115
|
+
return object.to_i if object.is_a?(Time) || object.is_a?(DateTime)
|
116
116
|
object
|
117
117
|
end
|
118
118
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'active_support/core_ext/string/output_safety'
|
2
|
+
require 'active_support/time'
|
2
3
|
require 'test_setup'
|
3
4
|
|
4
5
|
class ScriptTagTest < MiniTest::Unit::TestCase
|
@@ -23,6 +24,12 @@ class ScriptTagTest < MiniTest::Unit::TestCase
|
|
23
24
|
now = Time.now
|
24
25
|
nested_time = ScriptTag.new(:user_details => {:custom_data => {"something" => now}})
|
25
26
|
assert_equal now.to_i, nested_time.intercom_settings[:custom_data]["something"]
|
27
|
+
|
28
|
+
utc_time = Time.utc(2013,04,03)
|
29
|
+
time_zone = ActiveSupport::TimeZone.new('London')
|
30
|
+
time_with_zone = ActiveSupport::TimeWithZone.new(utc_time, time_zone)
|
31
|
+
time_from_time_with_zone = ScriptTag.new(:user_details => {:created_at => time_with_zone})
|
32
|
+
assert_equal utc_time.to_i, time_from_time_with_zone.intercom_settings[:created_at]
|
26
33
|
end
|
27
34
|
|
28
35
|
def test_strips_out_nil_entries_for_standard_attributes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intercom-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-04-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -125,6 +125,22 @@ dependencies:
|
|
125
125
|
- - ~>
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: 1.4.1
|
128
|
+
- !ruby/object:Gem::Dependency
|
129
|
+
name: tzinfo
|
130
|
+
requirement: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ! '>='
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
type: :development
|
137
|
+
prerelease: false
|
138
|
+
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ! '>='
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
128
144
|
description: Intercom (https://www.intercom.io) is a customer relationship management
|
129
145
|
and messaging tool for web app owners. This library makes it easier to use the correct
|
130
146
|
javascript tracking code in your rails applications.
|
@@ -178,18 +194,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
194
|
- - ! '>='
|
179
195
|
- !ruby/object:Gem::Version
|
180
196
|
version: '0'
|
181
|
-
segments:
|
182
|
-
- 0
|
183
|
-
hash: -1896068607384493882
|
184
197
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
198
|
none: false
|
186
199
|
requirements:
|
187
200
|
- - ! '>='
|
188
201
|
- !ruby/object:Gem::Version
|
189
202
|
version: '0'
|
190
|
-
segments:
|
191
|
-
- 0
|
192
|
-
hash: -1896068607384493882
|
193
203
|
requirements: []
|
194
204
|
rubyforge_project: intercom-rails
|
195
205
|
rubygems_version: 1.8.23
|
@@ -208,3 +218,4 @@ test_files:
|
|
208
218
|
- test/intercom-rails/script_tag_helper_test.rb
|
209
219
|
- test/intercom-rails/script_tag_test.rb
|
210
220
|
- test/test_setup.rb
|
221
|
+
has_rdoc:
|