stathat 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/stathat.rb +32 -32
- data/stathat.gemspec +64 -0
- metadata +21 -26
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.1
|
data/lib/stathat.rb
CHANGED
@@ -2,41 +2,41 @@ require 'net/http'
|
|
2
2
|
require 'uri'
|
3
3
|
|
4
4
|
module StatHat
|
5
|
+
class API
|
6
|
+
def self.post_value(stat_key, user_key, value)
|
7
|
+
args = { :key => stat_key,
|
8
|
+
:ukey => user_key,
|
9
|
+
:value => value }
|
10
|
+
resp = Net::HTTP.post_form(URI.parse("http://stathat.com/api/v"), args)
|
11
|
+
return self.response_valid?(resp)
|
12
|
+
end
|
5
13
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def post_count(stat_key, user_key, count)
|
15
|
-
args = { :key => stat_key,
|
16
|
-
:ukey => user_key,
|
17
|
-
:value => value }
|
18
|
-
resp = Net::HTTP.post_form(URI.parse("http://stathat.com/api/v"), args)
|
19
|
-
return response_valid?(resp)
|
20
|
-
end
|
14
|
+
def self.post_count(stat_key, user_key, count)
|
15
|
+
args = { :key => stat_key,
|
16
|
+
:ukey => user_key,
|
17
|
+
:value => value }
|
18
|
+
resp = Net::HTTP.post_form(URI.parse("http://stathat.com/api/c"), args)
|
19
|
+
return self.response_valid?(resp)
|
20
|
+
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
def self.ez_post_value(stat_name, account_email, value)
|
23
|
+
args = { :stat => stat_name,
|
24
|
+
:email => account_email,
|
25
|
+
:value => value }
|
26
|
+
resp = Net::HTTP.post_form(URI.parse("http://stathat.com/api/ez"), args)
|
27
|
+
return self.response_valid?(resp)
|
28
|
+
end
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
def self.ez_post_count(stat_name, account_email, count)
|
31
|
+
args = { :stat => stat_name,
|
32
|
+
:email => account_email,
|
33
|
+
:count => count }
|
34
|
+
resp = Net::HTTP.post_form(URI.parse("http://stathat.com/api/ez"), args)
|
35
|
+
return self.response_valid?(resp)
|
36
|
+
end
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
def self.response_valid?(response)
|
39
|
+
return response.body == "ok"
|
40
|
+
end
|
40
41
|
end
|
41
|
-
|
42
42
|
end
|
data/stathat.gemspec
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{stathat}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Patrick Crosby"]
|
12
|
+
s.date = %q{2011-01-12}
|
13
|
+
s.description = %q{Easily post stats to your StatHat account using this gem. Encapsulates full API.}
|
14
|
+
s.email = %q{patrick@xblabs.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
"Gemfile",
|
22
|
+
"Gemfile.lock",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"lib/stathat.rb",
|
28
|
+
"stathat.gemspec",
|
29
|
+
"test/helper.rb",
|
30
|
+
"test/test_stathat.rb"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://github.com/patrickxb/stathat}
|
33
|
+
s.licenses = ["MIT"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = %q{1.3.7}
|
36
|
+
s.summary = %q{gem to access StatHat api}
|
37
|
+
s.test_files = [
|
38
|
+
"test/helper.rb",
|
39
|
+
"test/test_stathat.rb"
|
40
|
+
]
|
41
|
+
|
42
|
+
if s.respond_to? :specification_version then
|
43
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_development_dependency(%q<minitest>, [">= 0"])
|
48
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
49
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
50
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
51
|
+
else
|
52
|
+
s.add_dependency(%q<minitest>, [">= 0"])
|
53
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
54
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
55
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
56
|
+
end
|
57
|
+
else
|
58
|
+
s.add_dependency(%q<minitest>, [">= 0"])
|
59
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
60
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
61
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stathat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 31
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Patrick Crosby
|
@@ -15,69 +14,65 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-12 00:00:00 -06:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
|
-
prerelease: false
|
23
|
-
type: :development
|
24
21
|
name: minitest
|
25
|
-
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
23
|
none: false
|
27
24
|
requirements:
|
28
25
|
- - ">="
|
29
26
|
- !ruby/object:Gem::Version
|
30
|
-
hash: 3
|
31
27
|
segments:
|
32
28
|
- 0
|
33
29
|
version: "0"
|
34
|
-
requirement: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
prerelease: false
|
37
30
|
type: :development
|
31
|
+
prerelease: false
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
38
34
|
name: bundler
|
39
|
-
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
36
|
none: false
|
41
37
|
requirements:
|
42
38
|
- - ~>
|
43
39
|
- !ruby/object:Gem::Version
|
44
|
-
hash: 23
|
45
40
|
segments:
|
46
41
|
- 1
|
47
42
|
- 0
|
48
43
|
- 0
|
49
44
|
version: 1.0.0
|
50
|
-
requirement: *id002
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
prerelease: false
|
53
45
|
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
54
49
|
name: jeweler
|
55
|
-
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
51
|
none: false
|
57
52
|
requirements:
|
58
53
|
- - ~>
|
59
54
|
- !ruby/object:Gem::Version
|
60
|
-
hash: 7
|
61
55
|
segments:
|
62
56
|
- 1
|
63
57
|
- 5
|
64
58
|
- 2
|
65
59
|
version: 1.5.2
|
66
|
-
requirement: *id003
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
prerelease: false
|
69
60
|
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
70
64
|
name: rcov
|
71
|
-
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
72
66
|
none: false
|
73
67
|
requirements:
|
74
68
|
- - ">="
|
75
69
|
- !ruby/object:Gem::Version
|
76
|
-
hash: 3
|
77
70
|
segments:
|
78
71
|
- 0
|
79
72
|
version: "0"
|
80
|
-
|
73
|
+
type: :development
|
74
|
+
prerelease: false
|
75
|
+
version_requirements: *id004
|
81
76
|
description: Easily post stats to your StatHat account using this gem. Encapsulates full API.
|
82
77
|
email: patrick@xblabs.com
|
83
78
|
executables: []
|
@@ -96,6 +91,7 @@ files:
|
|
96
91
|
- Rakefile
|
97
92
|
- VERSION
|
98
93
|
- lib/stathat.rb
|
94
|
+
- stathat.gemspec
|
99
95
|
- test/helper.rb
|
100
96
|
- test/test_stathat.rb
|
101
97
|
has_rdoc: true
|
@@ -112,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
108
|
requirements:
|
113
109
|
- - ">="
|
114
110
|
- !ruby/object:Gem::Version
|
115
|
-
hash:
|
111
|
+
hash: -2330930422993407053
|
116
112
|
segments:
|
117
113
|
- 0
|
118
114
|
version: "0"
|
@@ -121,7 +117,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
117
|
requirements:
|
122
118
|
- - ">="
|
123
119
|
- !ruby/object:Gem::Version
|
124
|
-
hash: 3
|
125
120
|
segments:
|
126
121
|
- 0
|
127
122
|
version: "0"
|