statsmix 0.1.5 → 0.1.6
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/{README.rdoc → README.txt} +5 -3
- data/VERSION +1 -1
- data/lib/statsmix.rb +4 -13
- data/statsmix.gemspec +4 -4
- metadata +6 -6
data/{README.rdoc → README.txt}
RENAMED
@@ -1,5 +1,3 @@
|
|
1
|
-
= statsmix
|
2
|
-
|
3
1
|
A Ruby gem for the StatsMix API - http://www.statsmix.com/developers
|
4
2
|
|
5
3
|
WARNING: This is currently experimental and not recommend for production use.
|
@@ -8,10 +6,14 @@ StatsMix makes it easy to track, chart, and share application and business metri
|
|
8
6
|
|
9
7
|
To get started, you'll need a API key for StatsMix. You can get a free developer account here: http://www.statsmix.com/try?plan=developer
|
10
8
|
|
11
|
-
|
9
|
+
Full gem documentation is at http://www.statsmix.com/developers/ruby_gem
|
12
10
|
|
13
11
|
== Quick Start ==
|
14
12
|
|
13
|
+
#install the gem from the command line
|
14
|
+
gem install statsmix
|
15
|
+
|
16
|
+
#in your code
|
15
17
|
require "statsmix"
|
16
18
|
StatsMix.api_key = "YOUR API KEY"
|
17
19
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/lib/statsmix.rb
CHANGED
@@ -36,14 +36,15 @@ class StatsMix
|
|
36
36
|
# List stats (index)
|
37
37
|
#
|
38
38
|
# Required: metric_id
|
39
|
-
# Optional: limit
|
39
|
+
# Optional: limit, {:startdate => nil, :end_date => nil}
|
40
|
+
# Use start_date and end_date as has keys in the third param to scope the date range of stats based on the generated_at timestamp of a stat
|
40
41
|
# Returns: Net::HTTP object
|
41
|
-
def self.list_stats(metric_id, limit = nil)
|
42
|
+
def self.list_stats(metric_id, limit = nil, options = {})
|
42
43
|
self.connect('stats')
|
43
44
|
@request_uri = @url.path + '.' + @format
|
44
45
|
@request = Net::HTTP::Get.new(@request_uri)
|
45
46
|
@params[:metric_id] = metric_id
|
46
|
-
@params
|
47
|
+
@params.merge!(options)
|
47
48
|
return do_request
|
48
49
|
end
|
49
50
|
|
@@ -292,14 +293,4 @@ class StatsMix
|
|
292
293
|
end
|
293
294
|
end
|
294
295
|
|
295
|
-
#added to suppress ssl warnings per advice at http://www.5dollarwhitebox.org/drupal/node/64
|
296
|
-
class Net::HTTP
|
297
|
-
alias_method :old_initialize, :initialize
|
298
|
-
def initialize(*args)
|
299
|
-
old_initialize(*args)
|
300
|
-
@ssl_context = OpenSSL::SSL::SSLContext.new
|
301
|
-
@ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
302
|
-
end
|
303
|
-
end
|
304
|
-
|
305
296
|
StatsMix.api_from_env
|
data/statsmix.gemspec
CHANGED
@@ -5,23 +5,23 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{statsmix}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tom Markiewicz", "Derek Scruggs"]
|
12
|
-
s.date = %q{2011-07-
|
12
|
+
s.date = %q{2011-07-06}
|
13
13
|
s.description = %q{A Ruby gem for the StatsMix API - http://www.statsmix.com/developers}
|
14
14
|
s.email = ["tmarkiewicz@gmail.com", "me@derekscruggs.com"]
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
|
-
"README.
|
17
|
+
"README.txt"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
21
|
"Gemfile",
|
22
22
|
"Gemfile.lock",
|
23
23
|
"LICENSE.txt",
|
24
|
-
"README.
|
24
|
+
"README.txt",
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION",
|
27
27
|
"lib/statsmix.rb",
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statsmix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 6
|
10
|
+
version: 0.1.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tom Markiewicz
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-07-
|
19
|
+
date: 2011-07-06 00:00:00 -06:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -89,13 +89,13 @@ extensions: []
|
|
89
89
|
|
90
90
|
extra_rdoc_files:
|
91
91
|
- LICENSE.txt
|
92
|
-
- README.
|
92
|
+
- README.txt
|
93
93
|
files:
|
94
94
|
- .document
|
95
95
|
- Gemfile
|
96
96
|
- Gemfile.lock
|
97
97
|
- LICENSE.txt
|
98
|
-
- README.
|
98
|
+
- README.txt
|
99
99
|
- Rakefile
|
100
100
|
- VERSION
|
101
101
|
- lib/statsmix.rb
|