chartbeat 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -15,7 +15,7 @@ real-time calls and options
15
15
  c.pages :path => '/'
16
16
  c.pathsummary :keys => 'n', :types => 'n'
17
17
  c.recent :limit => 2, :path => '/'
18
- c.summize :path => '/'
18
+ c.quickstats :path => '/'
19
19
  c.toppages :limit => 10
20
20
 
21
21
  historical calls and options
@@ -30,6 +30,10 @@ other calls and options
30
30
 
31
31
  c.histogram :keys => 'n', :breaks => 'n', :path => '/'
32
32
  c.summary :keys => 'n', :types => 'n', :path => '/'
33
+
34
+ Deprecated methods
35
+
36
+ c.summize #use quickstats instead
33
37
 
34
38
  ## Notes
35
39
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{chartbeat}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Al Shaw"]
12
- s.date = %q{2010-09-17}
12
+ s.date = %q{2010-10-11}
13
13
  s.description = %q{A Ruby wrapper for the Chartbeat API}
14
14
  s.email = %q{almshaw@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -4,12 +4,13 @@ require 'rest_client'
4
4
  class Chartbeat
5
5
  YESTERDAY = Time.now.to_i - 86400
6
6
  BASE_URI = 'chartbeat.com/api'
7
- METHODS = [:pages, :pathsummary, :recent, :summize, :toppages, :histogram, :summary]
7
+ METHODS = [:pages, :pathsummary, :recent, :summize, :quickstats, :toppages, :histogram, :summary]
8
8
  DASHAPI_METHODS = [:alerts, :snapshots, :stats, :data_series, :day_data_series]
9
9
  DEFAULT_ARG_VALS = {:path => '/', :keys => 'n', :types => 'n', :since => YESTERDAY,
10
10
  :timestamp => YESTERDAY, :days => 1, :minutes => 20, :type => 'path',
11
11
  :breaks => 'n', :limit => 10}
12
-
12
+ DEPRECATED_METHODS= [:summize]
13
+
13
14
  # c = Chartbeat.new :apikey => 'yourkey', :host => 'yourdomain.com'
14
15
  def initialize(opts = {})
15
16
  raise RuntimeError, "You must provide an API key and host" unless opts[:apikey] && opts[:host]
@@ -19,7 +20,11 @@ class Chartbeat
19
20
 
20
21
  def method_missing(m, *args)
21
22
  super unless METHODS.include?(m) || DASHAPI_METHODS.include?(m)
22
-
23
+
24
+ if DEPRECATED_METHODS.include?(m)
25
+ warn "#{m} is a deprecated method. Use with caution!"
26
+ end
27
+
23
28
  query = *args
24
29
  query_to_perform = {:apikey => @apikey, :host => @host}
25
30
  DEFAULT_ARG_VALS.each do |k,v|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chartbeat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Al Shaw
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-17 00:00:00 -04:00
18
+ date: 2010-10-11 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency