heap 1.0.1 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d13ef266e73536e3f334d975408393051f3240f4
4
- data.tar.gz: fd288e976a5ac65d67495377491c2dfc493c658d
3
+ metadata.gz: 203ea7fd1cf0e4009192578cbfe85621d656d3b7
4
+ data.tar.gz: 19065660d5cbdbcac180e065ffc77e8fe6f554fb
5
5
  SHA512:
6
- metadata.gz: a9b4129ae78fcd15b1a75bd045464671b79ebb9856924f088ff2926e1f69eb228bff0d5e9c529fb782aac39fb55c1dac34b3c23ce27a381222894d8396944b1e
7
- data.tar.gz: 2eeee128759cd9438df09755827576264e7766e4bbd8308394aee20280b45bc886bec4b2861411bb79c908aed4206249e32953fb7e17366c9ede2d2f25505d7f
6
+ metadata.gz: 5d15f2bb878bf91c88ad3b4e2234c98b13b94567db6c80739432a05e35059f030c2624098b19fbed2102e9e1c2261bb5480da3b6ac025e4a5e5adf194c5e4487
7
+ data.tar.gz: ddc86045ea072a24f6c8a590639ec03ba0a59e4625da85e772a3640610f16c17a11d3e126428c0fc167c35150759166d2ea0d8cd5297c94237fe16717f3a824f
@@ -4,14 +4,20 @@ matrix:
4
4
  include:
5
5
  - rvm: 1.8.7
6
6
  gemfile: Gemfile187
7
+ - rvm: jruby-18mode
8
+ gemfile: Gemfile187
7
9
  - rvm: 1.9.3
8
10
  gemfile: Gemfile
11
+ - rvm: jruby-19mode
12
+ gemfile: Gemfile
9
13
  - rvm: 2.0.0
10
14
  gemfile: Gemfile
11
15
  - rvm: 2.1.8
12
16
  gemfile: Gemfile
13
17
  - rvm: 2.2.4
14
18
  gemfile: Gemfile
19
+ - rvm: jruby-9.0.5.0
20
+ gemfile: Gemfile
15
21
  - rvm: 2.3.0
16
22
  gemfile: Gemfile
17
23
  env: COVERAGE=1
data/Gemfile187 CHANGED
@@ -20,4 +20,5 @@ group :development do
20
20
  gem 'addressable', '~> 2.3.8'
21
21
  gem 'git', '~> 1.2.9'
22
22
  gem 'highline', '~> 1.6.21'
23
+ gem 'rake', '~> 10.5'
23
24
  end
data/README.md CHANGED
@@ -13,7 +13,8 @@ This is a [Ruby](https://www.ruby-lang.org/) client for the
13
13
 
14
14
  ## Prerequisites
15
15
 
16
- This gem is tested on Ruby 1.8.7 and above.
16
+ This gem is tested on [MRI](https://www.ruby-lang.org/en/downloads/) 1.8.7 and
17
+ above, and on [JRuby](http://jruby.org/) 1.7 and above.
17
18
 
18
19
 
19
20
  ## Installation
@@ -85,8 +86,8 @@ The properties are optional.
85
86
  Heap.track 'event-name', 'user-identity', property: 'value'
86
87
  ```
87
88
 
88
- [Add properties](https://heapanalytics.com/docs/server-side#identify) to a
89
- user.
89
+ [Add properties](https://heapanalytics.com/docs/server-side#add-user-properties)
90
+ to a user.
90
91
 
91
92
  ```ruby
92
93
  Heap.add_user_properties 'user-identity', plan: 'premium1'
@@ -101,6 +102,26 @@ heap_client.track 'user-identity', 'event-name', property: 'value'
101
102
  ```
102
103
 
103
104
 
105
+ ## Development
106
+
107
+ After cloning the repository, install the required gems.
108
+
109
+ ```bash
110
+ bundle install
111
+ ```
112
+
113
+ Make sure the tests pass after making a change.
114
+
115
+ ```bash
116
+ rake test
117
+ ```
118
+
119
+ If you submit a
120
+ [pull request](https://help.github.com/articles/using-pull-requests/),
121
+ [Travis CI](https://travis-ci.org/) will run the test suite against your code
122
+ on the Ruby VMs that we support. Please fix any errors that it reports.
123
+
124
+
104
125
  ## Legacy Gem Releases
105
126
 
106
127
  Gem versions below 1.0 come from
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: heap 1.0.1 ruby lib
5
+ # stub: heap 1.0.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "heap"
9
- s.version = "1.0.1"
9
+ s.version = "1.0.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Victor Costan"]
14
- s.date = "2016-03-08"
14
+ s.date = "2016-04-07"
15
15
  s.description = "Implements Heap's server-side API"
16
16
  s.email = "victor@heapanalytics.com"
17
17
  s.extra_rdoc_files = [
@@ -79,7 +79,7 @@ class HeapAPI::Client
79
79
  # associated with the event; each key must have fewer than 1024 characters;
80
80
  # each value must be a Number or String with fewer than 1024 characters
81
81
  # @return [HeapAPI::Client] self
82
- # @see https://heapanalytics.com/docs/server-side#identify
82
+ # @see https://heapanalytics.com/docs/server-side#add-user-properties
83
83
  def add_user_properties(identity, properties)
84
84
  ensure_valid_app_id!
85
85
  ensure_valid_identity! identity
@@ -90,7 +90,7 @@ class HeapAPI::Client
90
90
  :identity => identity.to_s,
91
91
  :properties => properties,
92
92
  }
93
- response = connection.post '/api/identify', body,
93
+ response = connection.post '/api/add_user_properties', body,
94
94
  'User-Agent' => user_agent
95
95
  raise HeapAPI::ApiError.new(response) unless response.success?
96
96
  self
@@ -172,7 +172,7 @@ class HeapAPI::Client
172
172
  # @return [Faraday::Connection] a Faraday connection object
173
173
  def stubbed_connection!
174
174
  stubs = Faraday::Adapter::Test::Stubs.new do |stub|
175
- stub.post('/api/identify') { |env| [204, {}, ''] }
175
+ stub.post('/api/add_user_properties') { |env| [204, {}, ''] }
176
176
  stub.post('/api/track') { |env| [204, {}, ''] }
177
177
  end
178
178
 
@@ -105,7 +105,7 @@ class ClientAddUserPropertiesTest < MiniTest::Test
105
105
  end
106
106
 
107
107
  def test_add_user_properties
108
- @stubs.post '/api/identify' do |env|
108
+ @stubs.post '/api/add_user_properties' do |env|
109
109
  golden_body = {
110
110
  'app_id' => 'test-app-id',
111
111
  'identity' => 'test-identity',
@@ -123,7 +123,7 @@ class ClientAddUserPropertiesTest < MiniTest::Test
123
123
  end
124
124
 
125
125
  def test_add_user_properties_with_integer_identity
126
- @stubs.post '/api/identify' do |env|
126
+ @stubs.post '/api/add_user_properties' do |env|
127
127
  golden_body = {
128
128
  'app_id' => 'test-app-id',
129
129
  'identity' => '123456789',
@@ -140,7 +140,7 @@ class ClientAddUserPropertiesTest < MiniTest::Test
140
140
  end
141
141
 
142
142
  def test_add_user_properties_error
143
- @stubs.post '/api/identify' do |env|
143
+ @stubs.post '/api/add_user_properties' do |env|
144
144
  [400, { 'Content-Type' => 'text/plain; encoding=utf8' }, 'Bad request']
145
145
  end
146
146
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-08 00:00:00.000000000 Z
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday