analytics-ruby 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.1.2 / 2013-3-11
2
+ ===========
3
+ * Fixing thrown exception on non-initialized tracks thanks to [sbellity](https://github.com/sbellity)
4
+
1
5
  0.1.1 / 2013-2-11
2
6
  ===========
3
7
  * Updating dependencies
data/README.md CHANGED
@@ -7,7 +7,7 @@ analytics-ruby is a ruby client for [Segment.io](https://segment.io)
7
7
 
8
8
  ## Documentation
9
9
 
10
- Documentation is available at [https://segment.io/libraries/ruby](https://segment.io/libraries/ruby).
10
+ Documentation is available at [segment.io/libraries/ruby](https://segment.io/libraries/ruby)
11
11
 
12
12
  ## License
13
13
 
@@ -26,7 +26,7 @@ WWWWWW||WWWWWW
26
26
 
27
27
  (The MIT License)
28
28
 
29
- Copyright (c) 2012 Segment.io Inc. <friends@segment.io>
29
+ Copyright (c) 2013 Segment.io Inc. <friends@segment.io>
30
30
 
31
31
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
32
32
 
@@ -1,18 +1,24 @@
1
-
2
- require 'forwardable'
3
1
  require 'analytics-ruby/version'
4
2
  require 'analytics-ruby/client'
5
3
 
6
4
  module AnalyticsRuby
7
- extend SingleForwardable
8
-
9
- def_delegators :@client, :track, :identify
10
5
 
11
6
  # By default use a single client for the module
12
7
  def self.init(options = {})
13
8
  @client = AnalyticsRuby::Client.new(options)
14
9
  end
15
10
 
11
+ def self.track(options)
12
+ return false unless @client
13
+ @client.track(options)
14
+ end
15
+
16
+ def self.identify(options)
17
+ return false unless @client
18
+ @client.identify(options)
19
+ end
20
+
21
+
16
22
  end
17
23
 
18
24
  # Alias for AnalyticsRuby
@@ -1,3 +1,3 @@
1
1
  module AnalyticsRuby
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
data/spec/module_spec.rb CHANGED
@@ -3,6 +3,24 @@ require 'spec_helper'
3
3
 
4
4
  describe Analytics do
5
5
 
6
+ describe '#not-initialized' do
7
+ it 'should ignore calls to track if not initialized' do
8
+ expect { Analytics.track({}) }.not_to raise_error
9
+ end
10
+
11
+ it 'should return false on track if not initialized' do
12
+ Analytics.track({}).should == false
13
+ end
14
+
15
+ it 'should ignore calls to identify if not initialized' do
16
+ expect { Analytics.identify({}) }.not_to raise_error
17
+ end
18
+
19
+ it 'should return false on identify if not initialized' do
20
+ Analytics.identify({}).should == false
21
+ end
22
+ end
23
+
6
24
  describe '#init' do
7
25
 
8
26
  it 'should successfully init' do
@@ -10,7 +28,6 @@ describe Analytics do
10
28
  end
11
29
  end
12
30
 
13
-
14
31
  describe '#track' do
15
32
 
16
33
  it 'should error without an event' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: analytics-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-11 00:00:00.000000000 Z
12
+ date: 2013-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
16
- requirement: &18295840 !ruby/object:Gem::Requirement
16
+ requirement: &19516920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -24,10 +24,10 @@ dependencies:
24
24
  version: '0.10'
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *18295840
27
+ version_requirements: *19516920
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: faraday_middleware
30
- requirement: &18294820 !ruby/object:Gem::Requirement
30
+ requirement: &19516040 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
33
  - - ~>
@@ -35,10 +35,10 @@ dependencies:
35
35
  version: 0.9.0
36
36
  type: :runtime
37
37
  prerelease: false
38
- version_requirements: *18294820
38
+ version_requirements: *19516040
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: multi_json
41
- requirement: &18294180 !ruby/object:Gem::Requirement
41
+ requirement: &19515380 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
44
  - - ~>
@@ -46,10 +46,10 @@ dependencies:
46
46
  version: '1.0'
47
47
  type: :runtime
48
48
  prerelease: false
49
- version_requirements: *18294180
49
+ version_requirements: *19515380
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: rake
52
- requirement: &18293720 !ruby/object:Gem::Requirement
52
+ requirement: &19514780 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
55
  - - ! '>='
@@ -57,10 +57,10 @@ dependencies:
57
57
  version: '0'
58
58
  type: :development
59
59
  prerelease: false
60
- version_requirements: *18293720
60
+ version_requirements: *19514780
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rspec
63
- requirement: &18308960 !ruby/object:Gem::Requirement
63
+ requirement: &19514080 !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
66
66
  - - ! '>='
@@ -68,7 +68,7 @@ dependencies:
68
68
  version: '0'
69
69
  type: :development
70
70
  prerelease: false
71
- version_requirements: *18308960
71
+ version_requirements: *19514080
72
72
  description: The Segment.io ruby analytics library
73
73
  email: friends@segment.io
74
74
  executables: []