stathat 0.1.3 → 0.1.4
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 +4 -4
- data/Rakefile +0 -48
- data/VERSION +1 -1
- data/lib/stathat.rb +16 -13
- data/stathat.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f712632e447b4080112679ca7ec6e394b05e046
|
4
|
+
data.tar.gz: ddad787af0dac1b0767f31bbe49c3aa91a306d98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3796e60ca19835064c12ebbca110d24aecffb85b3832b9d9bd5cb0de4744cc11b3a869eb6010d9de4b3a59e734d506c7f5df2e21efebe50825afcf79f8bebe9
|
7
|
+
data.tar.gz: bb87774ba90be3a48291ffd28e5f7f0fd22fef49b0c875f3754a3923b99ce596e436e550604057f0b21b31a2b9aa4aeecfa21995e63cbafca720cbba07fa0109
|
data/Rakefile
CHANGED
@@ -1,31 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
#require 'bundler'
|
3
|
-
#begin
|
4
|
-
# Bundler.setup(:default, :development)
|
5
|
-
#rescue Bundler::BundlerError => e
|
6
|
-
# $stderr.puts e.message
|
7
|
-
# $stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
# exit e.status_code
|
9
|
-
#end
|
10
2
|
require 'rake'
|
11
3
|
|
12
|
-
#require 'jeweler'
|
13
|
-
#Jeweler::Tasks.new do |gem|
|
14
|
-
# # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
-
# gem.name = "stathat"
|
16
|
-
# gem.homepage = "http://github.com/patrickxb/stathat"
|
17
|
-
# gem.license = "MIT"
|
18
|
-
# gem.summary = %Q{gem to access StatHat api}
|
19
|
-
# gem.description = %Q{Easily post stats to your StatHat account using this gem. Encapsulates full API.}
|
20
|
-
# gem.email = "patrick@xblabs.com"
|
21
|
-
# gem.authors = ["Patrick Crosby"]
|
22
|
-
# # Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
-
# # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
-
# # gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
-
# # gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
|
-
#end
|
27
|
-
#Jeweler::RubygemsDotOrgTasks.new
|
28
|
-
|
29
4
|
require 'rake/testtask'
|
30
5
|
Rake::TestTask.new(:test) do |test|
|
31
6
|
test.libs << 'lib' << 'test'
|
@@ -33,29 +8,6 @@ Rake::TestTask.new(:test) do |test|
|
|
33
8
|
test.verbose = true
|
34
9
|
end
|
35
10
|
|
36
|
-
#require 'rcov/rcovtask'
|
37
|
-
#Rcov::RcovTask.new do |test|
|
38
|
-
# test.libs << 'test'
|
39
|
-
# test.pattern = 'test/**/test_*.rb'
|
40
|
-
# test.verbose = true
|
41
|
-
#end
|
42
|
-
|
43
11
|
task :default => :test
|
44
12
|
|
45
13
|
require 'rdoc/task'
|
46
|
-
#require 'rake/rdoctask'
|
47
|
-
#Rake::RDocTask.new do |rdoc|
|
48
|
-
# version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
49
|
-
#
|
50
|
-
# rdoc.rdoc_dir = 'rdoc'
|
51
|
-
# rdoc.title = "stathat #{version}"
|
52
|
-
# rdoc.rdoc_files.include('README*')
|
53
|
-
# rdoc.rdoc_files.include('lib/**/*.rb')
|
54
|
-
#end
|
55
|
-
|
56
|
-
#namespace :doc do
|
57
|
-
# desc "build literate documentation"
|
58
|
-
# task :build do
|
59
|
-
# sh "rocco -o doc lib/*.rb"
|
60
|
-
# end
|
61
|
-
#end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.1.3
|
data/lib/stathat.rb
CHANGED
@@ -7,20 +7,20 @@ require 'singleton'
|
|
7
7
|
module StatHat
|
8
8
|
class API
|
9
9
|
class << self
|
10
|
-
def ez_post_value(stat_name, ezkey, value, &block)
|
11
|
-
Reporter.instance.ez_post_value(stat_name, ezkey, value, block)
|
10
|
+
def ez_post_value(stat_name, ezkey, value, timestamp=nil, &block)
|
11
|
+
Reporter.instance.ez_post_value(stat_name, ezkey, value, timestamp, block)
|
12
12
|
end
|
13
13
|
|
14
|
-
def ez_post_count(stat_name, ezkey, count, &block)
|
15
|
-
Reporter.instance.ez_post_count(stat_name, ezkey, count, block)
|
14
|
+
def ez_post_count(stat_name, ezkey, count, timestamp=nil, &block)
|
15
|
+
Reporter.instance.ez_post_count(stat_name, ezkey, count, timestamp, block)
|
16
16
|
end
|
17
17
|
|
18
|
-
def post_count(stat_key, user_key, count, &block)
|
19
|
-
Reporter.instance.post_count(stat_key, user_key, count, block)
|
18
|
+
def post_count(stat_key, user_key, count, timestamp=nil, &block)
|
19
|
+
Reporter.instance.post_count(stat_key, user_key, count, timestamp, block)
|
20
20
|
end
|
21
21
|
|
22
|
-
def post_value(stat_key, user_key, value, &block)
|
23
|
-
Reporter.instance.post_value(stat_key, user_key, value, block)
|
22
|
+
def post_value(stat_key, user_key, value, timestamp=nil, &block)
|
23
|
+
Reporter.instance.post_value(stat_key, user_key, value, timestamp, block)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -32,7 +32,6 @@ module StatHat
|
|
32
32
|
CLASSIC_COUNT_URL = "http://api.stathat.com/c"
|
33
33
|
EZ_URL = "http://api.stathat.com/ez"
|
34
34
|
|
35
|
-
|
36
35
|
def initialize
|
37
36
|
@que = Queue.new
|
38
37
|
@runlock = Mutex.new
|
@@ -44,32 +43,36 @@ module StatHat
|
|
44
43
|
# XXX serialize queue?
|
45
44
|
end
|
46
45
|
|
47
|
-
def post_value(stat_key, user_key, value, cb)
|
46
|
+
def post_value(stat_key, user_key, value, timestamp, cb)
|
48
47
|
args = { :key => stat_key,
|
49
48
|
:ukey => user_key,
|
50
49
|
:value => value }
|
50
|
+
args[:t] = timestamp unless timestamp.nil?
|
51
51
|
enqueue(CLASSIC_VALUE_URL, args, cb)
|
52
52
|
end
|
53
53
|
|
54
|
-
def post_count(stat_key, user_key, count, cb)
|
54
|
+
def post_count(stat_key, user_key, count, timestamp, cb)
|
55
55
|
args = { :key => stat_key,
|
56
56
|
:ukey => user_key,
|
57
57
|
:count => count }
|
58
|
+
args[:t] = timestamp unless timestamp.nil?
|
58
59
|
enqueue(CLASSIC_COUNT_URL, args, cb)
|
59
60
|
end
|
60
61
|
|
61
|
-
def ez_post_value(stat_name, ezkey, value, cb)
|
62
|
+
def ez_post_value(stat_name, ezkey, value, timestamp, cb)
|
62
63
|
puts "ezval cb: #{cb}"
|
63
64
|
args = { :stat => stat_name,
|
64
65
|
:ezkey => ezkey,
|
65
66
|
:value => value }
|
67
|
+
args[:t] = timestamp unless timestamp.nil?
|
66
68
|
enqueue(EZ_URL, args, cb)
|
67
69
|
end
|
68
70
|
|
69
|
-
def ez_post_count(stat_name, ezkey, count, cb)
|
71
|
+
def ez_post_count(stat_name, ezkey, count, timestamp, cb)
|
70
72
|
args = { :stat => stat_name,
|
71
73
|
:ezkey => ezkey,
|
72
74
|
:count => count }
|
75
|
+
args[:t] = timestamp unless timestamp.nil?
|
73
76
|
enqueue(EZ_URL, args, cb)
|
74
77
|
end
|
75
78
|
|
data/stathat.gemspec
CHANGED