keen 0.3.0 → 0.4.1

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/.rvmrc DELETED
@@ -1,2 +0,0 @@
1
- rvm ruby-1.8.7
2
-
@@ -1,5 +0,0 @@
1
- ---
2
- :major: 0
3
- :minor: 3
4
- :patch: 0
5
- :build:
@@ -1,40 +0,0 @@
1
- require 'rubygems'
2
- require 'keen'
3
-
4
- # Get these from the keen.io website:
5
- project_id = 'asdfasldkfjalsdkfalskdfj'
6
- api_key = 'asldfjklj325tkl32jaskdlfjaf'
7
-
8
- # First you must setup the client:
9
- keen = Keen::Client.new(project_id, api_key, :storage_mode => :redis)
10
-
11
- # Then, you can use that client to send events.
12
-
13
- keen.add_event("purchases", {
14
- :quantity => @quantity,
15
- :user => @user.hashify,
16
- :item => @item.hashify,
17
- :session => @session.hashify,
18
- })
19
-
20
- keen.add_event("pageviews", {
21
- :user => @user.hashify,
22
- :route => @current_route,
23
- :session => @session.hashify,
24
- })
25
-
26
- keen.add_event("purchases", [{
27
- :quantity => @quantity1,
28
- :user => @user1.hashify,
29
- :item => @item1.hashify,
30
- :session => @session1.hashify,
31
- },{
32
- :quantity => @quantity2,
33
- :user => @user2.hashify,
34
- :item => @item2.hashify,
35
- :session => @session2.hashify,
36
- }])
37
-
38
-
39
- # (These examples pretend your important objects all have a method called
40
- # "hashify", and that method serializes state information you wish to track.)
@@ -1,15 +0,0 @@
1
- # Language: en
2
- Feature: AddEvent
3
- In order to send an event to Keen's servers
4
- As a developer
5
- I want to be able to post an event to the Keen Client as a Hash/Dictionary
6
-
7
- Scenario: Send Event directly to Keen
8
- Given a Keen Client in Direct Send mode
9
- When I post an event
10
- Then the response from the server should be good.
11
-
12
- Scenario: Send Multiple Event directly to Keen
13
- Given a Keen Client in Direct Send mode
14
- When I post mulitple events
15
- Then the response from the server should be good for each event
@@ -1,28 +0,0 @@
1
- begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
2
- require 'cucumber/formatter/unicode'
3
- $:.unshift(File.dirname(__FILE__) + '/../../lib')
4
- require 'keen'
5
-
6
- Given /^a Keen Client in Direct Send mode$/ do
7
- @client = Keen::Client.new(@project_id,
8
- @api_key,
9
- :logging => false )
10
- end
11
-
12
- When /^I post an event$/ do
13
- @result = @client.add_event("cucumber_events", {:hi_from => "cucumber!", :keen_version => Keen::VERSION})
14
- end
15
-
16
- Then /^the response from the server should be good\.$/ do
17
- response = @result
18
- response.should == {"created" => true}
19
- end
20
-
21
- When /^I post mulitple events$/ do
22
- @result = @client.add_event("cucumber_events", [{:hi_from => "cucumber 1!", :keen_version => Keen::VERSION},{:hi_from => "cucumber 2!", :keen_version => Keen::VERSION}])
23
- end
24
-
25
- Then /^the response from the server should be good for each event$/ do
26
- response = @result
27
- response.should == {"cucumber_events" => [{"success" => true},{"success" => true}]}
28
- end
@@ -1,4 +0,0 @@
1
- Before do |scenario|
2
- @project_id = Keen::TEST_PROJECT_ID
3
- @api_key = Keen::TEST_API_KEY
4
- end
@@ -1,15 +0,0 @@
1
- #require 'bundler'
2
- #begin
3
- #Bundler.setup(:default, :development)
4
- #rescue Bundler::BundlerError => e
5
- #$stderr.puts e.message
6
- #$stderr.puts "Run `bundle install` to install missing gems"
7
- #exit e.status_code
8
- #end
9
-
10
- #$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
11
- #require 'keen'
12
-
13
- #require 'test/unit/assertions'
14
-
15
- #World(Test::Unit::Assertions)
@@ -1,30 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "keen/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "keen"
7
- s.version = Keen::VERSION
8
- s.authors = ["Kyle Wild"]
9
- s.email = ["kyle@keen.io"]
10
- s.homepage = "https://github.com/keenlabs/KeenClient-Ruby"
11
- s.summary = "A library for batching and sending arbitrary events to the Keen API at http://keen.io"
12
- s.description = "See the github repo or examples.rb for usage information."
13
-
14
- s.rubyforge_project = "keen"
15
-
16
- s.files = `git ls-files`.split("\n")
17
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
- s.extensions = ["ext/mkrf_conf.rb"]
20
- s.require_paths = ["lib"]
21
-
22
- # specify any dependencies here; for example:
23
- # s.add_development_dependency "rspec"
24
- # s.add_runtime_dependency "rest-client"
25
-
26
-
27
- # This is no longer necessary, since we support several storage modes now:
28
- # s.add_dependency("redis", ">= 2.2.2")
29
-
30
- end
@@ -1,13 +0,0 @@
1
- module Keen
2
- class Event
3
-
4
- attr_accessor :event_collection, :properties, :timestamp
5
-
6
- def initialize(event_collection, properties, timestamp=nil)
7
- @event_collection = event_collection
8
- @properties = properties
9
- @timestamp = timestamp
10
- end
11
-
12
- end
13
- end
@@ -1,6 +0,0 @@
1
- module Keen
2
- TEST_PROJECT_ID = '4f5775ad163d666a6100000e'
3
- TEST_API_KEY = 'a5d4eaf432914823a94ecd7e0cb547b9'
4
- #TEST_PROJECT_ID = 'abc'
5
- #TEST_API_KEY = '123'
6
- end
@@ -1,12 +0,0 @@
1
-
2
- module Keen
3
-
4
- module Utils
5
-
6
- def self.symbolize_keys(hash)
7
- hash.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
8
- end
9
-
10
- end
11
- end
12
-