stathat 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -48
  3. data/VERSION +1 -1
  4. data/lib/stathat.rb +16 -13
  5. data/stathat.gemspec +1 -1
  6. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f30db6432405ab6b55e2dfc910ec9118cbbc30e
4
- data.tar.gz: 7958f0d0103b5ec08d022de500236fc95525efdf
3
+ metadata.gz: 7f712632e447b4080112679ca7ec6e394b05e046
4
+ data.tar.gz: ddad787af0dac1b0767f31bbe49c3aa91a306d98
5
5
  SHA512:
6
- metadata.gz: e40080c4d45e90ee6858f1b9d5e2c1b07bc215009b884819281c874e32092feb03f5337379de8d69f041bab7c539b17436a7700d8df10f28b230fe8b6321cb70
7
- data.tar.gz: 72ef316598460e8cdb2acf0f425809154d7bfe122211de190980ea1ce8d84a246ae2be64577bb17b56b90bb100c9ab38c5b2968ae63425812d5c5b37a1bcd713
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.0.4
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{stathat}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
  s.authors = ["StatHat"]
7
7
  s.description = %q{Easily post stats to your StatHat account using this gem. Encapsulates full API.}
8
8
  s.email = %q{info@stathat.com}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stathat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - StatHat