diff --git a/HealthGrapher.gemspec b/BabyTooth.gemspec similarity index 68% rename from HealthGrapher.gemspec rename to BabyTooth.gemspec index 8f5401c..7b7ddcb 100644 --- a/HealthGrapher.gemspec +++ b/BabyTooth.gemspec @@ -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 = "joelind@gmail.com" s.extra_rdoc_files = [ @@ -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" @@ -44,12 +42,20 @@ Gem::Specification.new do |s| s.add_development_dependency(%q, ["~> 1.0.0"]) s.add_development_dependency(%q, ["~> 1.6.4"]) s.add_development_dependency(%q, [">= 0"]) + s.add_development_dependency(%q, [">= 0"]) + s.add_development_dependency(%q, [">= 0"]) + s.add_development_dependency(%q, [">= 0"]) + s.add_development_dependency(%q, [">= 0"]) else s.add_dependency(%q, ["~> 0.5.0"]) s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, ["~> 1.0.0"]) s.add_dependency(%q, ["~> 1.6.4"]) s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) end else s.add_dependency(%q, ["~> 0.5.0"]) @@ -57,6 +63,10 @@ Gem::Specification.new do |s| s.add_dependency(%q, ["~> 1.0.0"]) s.add_dependency(%q, ["~> 1.6.4"]) s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) + s.add_dependency(%q, [">= 0"]) end end diff --git a/Rakefile b/Rakefile index 66be2b9..909ab72 100644 --- a/Rakefile +++ b/Rakefile @@ -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} @@ -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 diff --git a/lib/health_grapher.rb b/lib/baby_tooth.rb similarity index 97% rename from lib/health_grapher.rb rename to lib/baby_tooth.rb index f3a8b95..4090d03 100644 --- a/lib/health_grapher.rb +++ b/lib/baby_tooth.rb @@ -1,6 +1,6 @@ require 'oauth2' -module HealthGrapher +module BabyTooth class << self attr_accessor :configuration end diff --git a/test/helper.rb b/test/helper.rb index 768c5e4..6028431 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -24,7 +24,7 @@ config.default_cassette_options = { :record => :none } end -require 'health_grapher' +require 'baby_tooth' class Test::Unit::TestCase end diff --git a/test/test_health_grapher.rb b/test/test_baby_tooth.rb similarity index 65% rename from test/test_health_grapher.rb rename to test/test_baby_tooth.rb index a2cfbb5..58d12d4 100644 --- a/test/test_health_grapher.rb +++ b/test/test_baby_tooth.rb @@ -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" @@ -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" @@ -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