Skip to content

Commit

Permalink
Rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
joelind committed Sep 8, 2011
1 parent 442d936 commit 63dbd3a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 27 deletions.
24 changes: 17 additions & 7 deletions HealthGrapher.gemspec → BabyTooth.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = "HealthGrapher"
s.name = "BabyTooth"
s.version = "0.0.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Joe Lind"]
s.date = "2011-09-07"
s.date = "2011-09-08"
s.description = "A Ruby wrapper for the Health Graph API"
s.email = "[email protected]"
s.extra_rdoc_files = [
Expand All @@ -20,16 +20,14 @@ Gem::Specification.new do |s|
".document",
".rvmrc",
"Gemfile",
"HealthGrapher.gemspec",
"LICENSE.txt",
"README.rdoc",
"Rakefile",
"VERSION",
"lib/health_grapher.rb",
"test/helper.rb",
"test/test_health_grapher.rb"
"test/fixtures/vcr_cassettes/oauth/token_success.yml",
"test/helper.rb"
]
s.homepage = "http://github.com/terriblelabs/HealthGrapher"
s.homepage = "http://github.com/terriblelabs/BabyTooth"
s.licenses = ["MIT"]
s.require_paths = ["lib"]
s.rubygems_version = "1.8.10"
Expand All @@ -44,19 +42,31 @@ Gem::Specification.new do |s|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_development_dependency(%q<rcov>, [">= 0"])
s.add_development_dependency(%q<launchy>, [">= 0"])
s.add_development_dependency(%q<ruby-debug>, [">= 0"])
s.add_development_dependency(%q<webmock>, [">= 0"])
s.add_development_dependency(%q<vcr>, [">= 0"])
else
s.add_dependency(%q<oauth2>, ["~> 0.5.0"])
s.add_dependency(%q<shoulda>, [">= 0"])
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_dependency(%q<rcov>, [">= 0"])
s.add_dependency(%q<launchy>, [">= 0"])
s.add_dependency(%q<ruby-debug>, [">= 0"])
s.add_dependency(%q<webmock>, [">= 0"])
s.add_dependency(%q<vcr>, [">= 0"])
end
else
s.add_dependency(%q<oauth2>, ["~> 0.5.0"])
s.add_dependency(%q<shoulda>, [">= 0"])
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
s.add_dependency(%q<rcov>, [">= 0"])
s.add_dependency(%q<launchy>, [">= 0"])
s.add_dependency(%q<ruby-debug>, [">= 0"])
s.add_dependency(%q<webmock>, [">= 0"])
s.add_dependency(%q<vcr>, [">= 0"])
end
end

6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ require 'rake'
require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
gem.name = "HealthGrapher"
gem.homepage = "http://github.com/terriblelabs/HealthGrapher"
gem.name = "BabyTooth"
gem.homepage = "http://github.com/terriblelabs/BabyTooth"
gem.license = "MIT"
gem.summary = %Q{A Ruby wrapper for the Health Graph API}
gem.description = %Q{A Ruby wrapper for the Health Graph API}
Expand Down Expand Up @@ -47,7 +47,7 @@ Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "HealthGrapher #{version}"
rdoc.title = "BabyTooth #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
2 changes: 1 addition & 1 deletion lib/health_grapher.rb → lib/baby_tooth.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'oauth2'

module HealthGrapher
module BabyTooth
class << self
attr_accessor :configuration
end
Expand Down
2 changes: 1 addition & 1 deletion test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
config.default_cassette_options = { :record => :none }
end

require 'health_grapher'
require 'baby_tooth'

class Test::Unit::TestCase
end
30 changes: 15 additions & 15 deletions test/test_health_grapher.rb → test/test_baby_tooth.rb
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
require 'helper'

class TestHealthGrapher < Test::Unit::TestCase
class TestBabyTooth < Test::Unit::TestCase
context "configure" do
should "accept client_id" do
HealthGrapher.configure do |config|
BabyTooth.configure do |config|
config.client_id = "CLIENT_ID"
end

assert_equal "CLIENT_ID", HealthGrapher.configuration.client_id
assert_equal "CLIENT_ID", BabyTooth.configuration.client_id
end

should "accept client_secret" do
HealthGrapher.configure do |config|
BabyTooth.configure do |config|
config.client_secret = "CLIENT_SECRET"
end

assert_equal "CLIENT_SECRET", HealthGrapher.configuration.client_secret
assert_equal "CLIENT_SECRET", BabyTooth.configuration.client_secret
end

should "accept authorization_url" do
HealthGrapher.configure do |config|
BabyTooth.configure do |config|
config.authorization_url = "http://runkeeper.com/apps/authorize"
end

assert_equal "http://runkeeper.com/apps/authorize", HealthGrapher.configuration.authorization_url
assert_equal "http://runkeeper.com/apps/authorize", BabyTooth.configuration.authorization_url
end

should "accept access_token_url" do
HealthGrapher.configure do |config|
BabyTooth.configure do |config|
config.access_token_url = "http://runkeeper.com/apps/token"
end

assert_equal "http://runkeeper.com/apps/token", HealthGrapher.configuration.access_token_url
assert_equal "http://runkeeper.com/apps/token", BabyTooth.configuration.access_token_url
end

should "accept redirect_uri" do
HealthGrapher.configure do |config|
BabyTooth.configure do |config|
config.redirect_uri = "http://my.app/authorization"
end

assert_equal "http://my.app/authorization", HealthGrapher.configuration.redirect_uri
assert_equal "http://my.app/authorization", BabyTooth.configuration.redirect_uri
end
end

context "authorize_url" do
should "return a URL with the proper parameters" do
HealthGrapher.configure do |config|
BabyTooth.configure do |config|
config.access_token_url = "http://runkeeper.com/apps/token"
config.authorization_url = "http://runkeeper.com/apps/authorize"
config.client_secret = "SECRET"
Expand All @@ -54,14 +54,14 @@ class TestHealthGrapher < Test::Unit::TestCase
end

assert_equal "http://runkeeper.com/apps/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=http%3A%2F%2Fmy.app%2Fauthorization",
HealthGrapher.authorize_url
BabyTooth.authorize_url
end
end

context "get_token" do
setup do
VCR.insert_cassette 'oauth/token success', :record => :none
HealthGrapher.configure do |config|
BabyTooth.configure do |config|
config.access_token_url = "http://runkeeper.com/apps/token"
config.authorization_url = "http://runkeeper.com/apps/authorize"
config.client_secret = "SECRET"
Expand All @@ -75,7 +75,7 @@ class TestHealthGrapher < Test::Unit::TestCase
end

should "return an access token string" do
assert_equal "ACCESS_TOKEN", HealthGrapher.get_token("TOKEN")
assert_equal "ACCESS_TOKEN", BabyTooth.get_token("TOKEN")
end
end
end

0 comments on commit 63dbd3a

Please sign in to comment.