garb 0.2.9 → 0.3.0

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.
@@ -4,16 +4,17 @@ module Garb
4
4
 
5
5
  URL = 'https://www.google.com/accounts/ClientLogin'
6
6
 
7
- def initialize(email, password)
7
+ def initialize(email, password, opts={})
8
8
  @email = email
9
9
  @password = password
10
+ @account_type = opts.fetch(:account_type, 'HOSTED_OR_GOOGLE')
10
11
  end
11
12
 
12
13
  def parameters
13
14
  {
14
15
  'Email' => @email,
15
16
  'Passwd' => @password,
16
- 'accountType' => 'HOSTED_OR_GOOGLE',
17
+ 'accountType' => @account_type,
17
18
  'service' => 'analytics',
18
19
  'source' => 'vigetLabs-garb-001'
19
20
  }
@@ -34,7 +34,7 @@ module Garb
34
34
  include HappyMapper
35
35
 
36
36
  tag 'metric'
37
- namespace 'http://schemas.google.com/dataexport/2009'
37
+ namespace 'http://schemas.google.com/analytics/2009'
38
38
 
39
39
  attribute :name, String
40
40
  attribute :value, String
@@ -44,7 +44,7 @@ module Garb
44
44
  include HappyMapper
45
45
 
46
46
  tag 'dimension'
47
- namespace 'http://schemas.google.com/dataexport/2009'
47
+ namespace 'http://schemas.google.com/analytics/2009'
48
48
 
49
49
  attribute :name, String
50
50
  attribute :value, String
@@ -2,8 +2,8 @@ module Garb
2
2
  module Version
3
3
 
4
4
  MAJOR = 0
5
- MINOR = 2
6
- TINY = 9
5
+ MINOR = 3
6
+ TINY = 0
7
7
 
8
8
  def self.to_s # :nodoc:
9
9
  [MAJOR, MINOR, TINY].join('.')
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <feed xmlns='http://www.w3.org/2005/Atom'
3
3
  xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
4
- xmlns:dxp='http://schemas.google.com/dataexport/2009'
4
+ xmlns:dxp='http://schemas.google.com/analytics/2009'
5
5
  xmlns:ga='http://schemas.google.com/analytics/2008'>
6
6
  <id>http://www.google.com/analytics/feeds/data?ids=ga:983247&amp;dimensions=ga:country,ga:city&amp;metrics=ga:pageViews&amp;start-date=2008-01-01&amp;end-date=2008-01-02</id>
7
7
  <updated>2008-01-02T15:59:59.999-08:00 </updated>
@@ -1,16 +1,18 @@
1
1
  $:.reject! { |e| e.include? 'TextMate' }
2
2
 
3
3
  require 'rubygems'
4
- require 'test/unit'
4
+ require 'minitest/unit'
5
5
  require 'shoulda'
6
6
  require 'mocha'
7
7
 
8
8
  require File.dirname(__FILE__) + '/../lib/garb'
9
9
 
10
- class Test::Unit::TestCase
10
+ class MiniTest::Unit::TestCase
11
11
 
12
12
  def read_fixture(filename)
13
13
  File.read(File.dirname(__FILE__) + "/fixtures/#{filename}")
14
14
  end
15
15
 
16
- end
16
+ end
17
+
18
+ MiniTest::Unit.autorun
@@ -1,7 +1,7 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
3
  module Garb
4
- class AccountTest < Test::Unit::TestCase
4
+ class AccountTest < MiniTest::Unit::TestCase
5
5
  context "The Account class" do
6
6
  should "have an array of accounts with all profiles" do
7
7
  p1 = stub(:account_id => '1111', :account_name => 'Blog 1')
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__), '..', '/test_helper')
3
3
  CA_CERT_FILE = File.join(File.dirname(__FILE__), '..', '/cacert.pem')
4
4
 
5
5
  module Garb
6
- class AuthenticationRequestTest < Test::Unit::TestCase
6
+ class AuthenticationRequestTest < MiniTest::Unit::TestCase
7
7
 
8
8
  context "An instance of the AuthenticationRequest class" do
9
9
 
@@ -108,7 +108,7 @@ module Garb
108
108
 
109
109
  Net::HTTP.stubs(:new).with('www.google.com', 443).returns(http)
110
110
 
111
- assert_raise(Garb::AuthenticationRequest::AuthError) do
111
+ assert_raises(Garb::AuthenticationRequest::AuthError) do
112
112
  @request.send_request(OpenSSL::SSL::VERIFY_NONE)
113
113
  end
114
114
  end
@@ -1,7 +1,7 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
3
  module Garb
4
- class DataRequestTest < Test::Unit::TestCase
4
+ class DataRequestTest < MiniTest::Unit::TestCase
5
5
 
6
6
  context "An instance of the DataRequest class" do
7
7
 
@@ -1,6 +1,6 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
- class GarbTest < Test::Unit::TestCase
3
+ class GarbTest < MiniTest::Unit::TestCase
4
4
  context "A green egg" do
5
5
  should "be served with ham" do
6
6
  assert true
@@ -1,7 +1,7 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
3
  module Garb
4
- class OAuthSessionTest < Test::Unit::TestCase
4
+ class OAuthSessionTest < MiniTest::Unit::TestCase
5
5
  context "An instance of OAuthSession" do
6
6
  should "have tests" do
7
7
  assert true
@@ -1,6 +1,6 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
- class OperatorTest < Test::Unit::TestCase
3
+ class OperatorTest < MiniTest::Unit::TestCase
4
4
  context "An instance of an Operator" do
5
5
  should "lower camelize the target" do
6
6
  assert_equal "ga:uniqueVisits=", Operator.new(:unique_visits, "=").to_ga
@@ -23,15 +23,15 @@ class OperatorTest < Test::Unit::TestCase
23
23
  should "not be equal to another operator if target, operator, or prefix is different" do
24
24
  op1 = Operator.new(:hello, "==")
25
25
  op2 = Operator.new(:hello, "==", true)
26
- assert_not_equal op1, op2
26
+ refute_equal op1, op2
27
27
 
28
28
  op1 = Operator.new(:hello1, "==")
29
29
  op2 = Operator.new(:hello2, "==")
30
- assert_not_equal op1, op2
30
+ refute_equal op1, op2
31
31
 
32
32
  op1 = Operator.new(:hello, "!=")
33
33
  op2 = Operator.new(:hello, "==")
34
- assert_not_equal op1, op2
34
+ refute_equal op1, op2
35
35
  end
36
36
  end
37
37
  end
@@ -1,7 +1,7 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
3
  module Garb
4
- class ProfileTest < Test::Unit::TestCase
4
+ class ProfileTest < MiniTest::Unit::TestCase
5
5
 
6
6
  context "The Profile class" do
7
7
 
@@ -1,7 +1,7 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
3
  module Garb
4
- class ReportParameterTest < Test::Unit::TestCase
4
+ class ReportParameterTest < MiniTest::Unit::TestCase
5
5
 
6
6
  context "An instance of the ReportParameter class" do
7
7
  setup do
@@ -1,7 +1,7 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
3
  module Garb
4
- class ReportResponseTest < Test::Unit::TestCase
4
+ class ReportResponseTest < MiniTest::Unit::TestCase
5
5
  context "An instance of the ReportResponse class" do
6
6
  setup do
7
7
  @xml = File.read(File.join(File.dirname(__FILE__), '..', "/fixtures/report_feed.xml"))
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
3
  module Garb
4
4
  # Also tests Garb::Resource, which is the basis for Garb::Report
5
- class ReportTest < Test::Unit::TestCase
5
+ class ReportTest < MiniTest::Unit::TestCase
6
6
  context "An instance of the Report class" do
7
7
  setup do
8
8
  @now = Time.now
@@ -5,7 +5,7 @@ class TestReport
5
5
  end
6
6
 
7
7
  # Most of the resource testing is done as a part of ReportTest
8
- class ResourceTest < Test::Unit::TestCase
8
+ class ResourceTest < MiniTest::Unit::TestCase
9
9
 
10
10
  context "A class with Garb::Resource mixed in" do
11
11
  should "get results from GA" do
@@ -1,7 +1,7 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
3
  module Garb
4
- class SessionTest < Test::Unit::TestCase
4
+ class SessionTest < MiniTest::Unit::TestCase
5
5
 
6
6
  context "The Session class" do
7
7
 
@@ -1,6 +1,6 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
- class StringTest < Test::Unit::TestCase
3
+ class StringTest < MiniTest::Unit::TestCase
4
4
  context "An instance of a String" do
5
5
  should 'prefix a string with ga: for GA' do
6
6
  assert_equal 'ga:bob', 'bob'.to_ga
@@ -1,6 +1,6 @@
1
1
  require File.join(File.dirname(__FILE__), '..', '/test_helper')
2
2
 
3
- class SymbolTest < Test::Unit::TestCase
3
+ class SymbolTest < MiniTest::Unit::TestCase
4
4
 
5
5
  context "An instance of the Symbol class" do
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: garb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Pitale
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-10-12 00:00:00 -04:00
13
+ date: 2009-10-26 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency