From 98e02c3fe769c9ac1c7fa81a64ae4e7b1049cf7c Mon Sep 17 00:00:00 2001 From: John Maddux Date: Wed, 8 May 2013 16:47:10 -0500 Subject: [PATCH 1/9] Update health_graph.gemspec --- health_graph.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/health_graph.gemspec b/health_graph.gemspec index 1a35bc8..537b86e 100644 --- a/health_graph.gemspec +++ b/health_graph.gemspec @@ -23,7 +23,6 @@ Gem::Specification.new do |s| "README.rdoc", "Rakefile", "VERSION", - "health_graph.gemspec", "lib/health_graph.rb", "lib/health_graph/api.rb", "lib/health_graph/authentication.rb", From de39cafcf6f5e2c4e9f9eb69a78b5599bf81fdc6 Mon Sep 17 00:00:00 2001 From: John Maddux Date: Wed, 8 May 2013 15:59:52 -0600 Subject: [PATCH 2/9] Revert "Update health_graph.gemspec" This reverts commit 98e02c3fe769c9ac1c7fa81a64ae4e7b1049cf7c. --- health_graph.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/health_graph.gemspec b/health_graph.gemspec index 537b86e..1a35bc8 100644 --- a/health_graph.gemspec +++ b/health_graph.gemspec @@ -23,6 +23,7 @@ Gem::Specification.new do |s| "README.rdoc", "Rakefile", "VERSION", + "health_graph.gemspec", "lib/health_graph.rb", "lib/health_graph/api.rb", "lib/health_graph/authentication.rb", From c8e2082f0c2d41a4b7811af9ab120430d68bbe92 Mon Sep 17 00:00:00 2001 From: John Maddux Date: Wed, 8 May 2013 16:02:21 -0600 Subject: [PATCH 3/9] Remove dependency on self -.^ --- .gitignore | 3 +++ health_graph.gemspec | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5c4cd64..d57becb 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,6 @@ pkg # For rubinius: #*.rbc + +# Don't commit gems +*.gem diff --git a/health_graph.gemspec b/health_graph.gemspec index 1a35bc8..d03ec24 100644 --- a/health_graph.gemspec +++ b/health_graph.gemspec @@ -71,7 +71,6 @@ Gem::Specification.new do |s| s.specification_version = 3 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, [">= 0"]) s.add_development_dependency(%q, [">= 0"]) s.add_development_dependency(%q, [">= 0"]) s.add_development_dependency(%q, [">= 0"]) From c9977509eebc93c205c86efad52fa2c542358ecb Mon Sep 17 00:00:00 2001 From: Endoze Date: Sun, 16 Jun 2013 16:06:35 -0400 Subject: [PATCH 4/9] Add travis ci file This commit adds a travis ci file for building and running tests. --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6c421eb --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: ruby +gemfile: + - test/support/Gemfile +rvm: + - 1.9.2 + - 1.9.3 +script: + - bundle exec rake test + + From 802dca98f2a2b589ac00a1621b1ccb3a0054f5dd Mon Sep 17 00:00:00 2001 From: Endoze Date: Sun, 16 Jun 2013 16:06:53 -0400 Subject: [PATCH 5/9] Add build status badge This commit adds a build status badge on the project readme. --- README.rdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rdoc b/README.rdoc index 052352e..4586255 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,5 +1,6 @@ = health_graph +[![Build Status](https://secure.travis-ci.org/kennyma/health_graph.png?branch=master)](http://travis-ci.org/kennyma/health_graph?branch=master) Ruby gem to work with RunKeeper Health Graph API. More information about RunKeeper Health Graph API http://developer.runkeeper.com/healthgraph. == Usage From 23ef77e47976fb88478c01c6ea3871e8f1b81e60 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 4 May 2015 12:10:45 -0400 Subject: [PATCH 6/9] Replace jeweler with bundler for building/releasing gem In order to fix an issue with a circular dependency, this commit removes jeweler from the project's development dependencies and instead uses the built in facilities in bundler for gem building and releasing. This commit also fixes a broken spec and adds a rake task for running specs. --- Rakefile | 44 +---------- health_graph.gemspec | 152 ++++++-------------------------------- test/helper.rb | 6 +- test/test_health_graph.rb | 73 +++++++++--------- 4 files changed, 67 insertions(+), 208 deletions(-) diff --git a/Rakefile b/Rakefile index 9e5a3c4..79b860a 100644 --- a/Rakefile +++ b/Rakefile @@ -1,42 +1,6 @@ -# encoding: utf-8 +require "bundler/gem_tasks" -task :default => :test - -require 'jeweler' -Jeweler::Tasks.new do |gem| - gem.name = "health_graph" - gem.homepage = "http://github.com/kennyma/health_graph" - gem.license = "MIT" - gem.summary = "Ruby gem for RunKeeper Health Graph API" - gem.description = "This is a wrapper for RunKeeper Health Graph RESTful API." - gem.email = "kenny@kennyma.me" - gem.authors = ["Kenny Ma"] - - gem.add_dependency "oauth2", ">= 0.5.2" - gem.add_dependency "faraday", ">= 0.7.4" - gem.add_dependency "faraday_middleware", ">= 0.7.8" - gem.add_dependency "hashie", ">= 1.2" - gem.add_dependency "webmock", ">= 1.7.6" - - gem.add_development_dependency "shoulda" - gem.add_development_dependency "simplecov" - gem.add_development_dependency "jeweler" -end -Jeweler::RubygemsDotOrgTasks.new - -require 'rake/testtask' -Rake::TestTask.new(:test) do |test| - test.libs << 'lib' << 'test' - test.pattern = 'test/**/test_*.rb' - test.verbose = true -end - -require 'rdoc/task' -Rake::RDocTask.new do |rdoc| - version = File.exist?('VERSION') ? File.read('VERSION') : "" - - rdoc.rdoc_dir = 'rdoc' - rdoc.title = "health_graph #{version}" - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') +desc "Run all tests" +task :test do + ruby("test/test_health_graph.rb") end diff --git a/health_graph.gemspec b/health_graph.gemspec index 1a35bc8..27e92bf 100644 --- a/health_graph.gemspec +++ b/health_graph.gemspec @@ -3,140 +3,34 @@ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' # -*- encoding: utf-8 -*- -Gem::Specification.new do |s| - s.name = "health_graph" - s.version = "0.6.0" +Gem::Specification.new do |spec| + spec.name = "health_graph" + spec.version = "0.6.0" + spec.authors = ["Kenny Ma"] + spec.email = "kenny@kennyma.me" + spec.date = "2012-07-17" + spec.description = "This is a wrapper for RunKeeper Health Graph RESTful API." + spec.summary = "Ruby gem for RunKeeper Health Graph API" + spec.homepage = "http://github.com/kennyma/health_graph" + spec.licenses = ["MIT"] - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["Kenny Ma"] - s.date = "2012-07-17" - s.description = "This is a wrapper for RunKeeper Health Graph RESTful API." - s.email = "kenny@kennyma.me" - s.extra_rdoc_files = [ + spec.extra_rdoc_files = [ "LICENSE.txt", "README.rdoc" ] - s.files = [ - ".document", - "Gemfile", - "LICENSE.txt", - "README.rdoc", - "Rakefile", - "VERSION", - "health_graph.gemspec", - "lib/health_graph.rb", - "lib/health_graph/api.rb", - "lib/health_graph/authentication.rb", - "lib/health_graph/configuration.rb", - "lib/health_graph/model.rb", - "lib/health_graph/models/fitness_activities_feed.rb", - "lib/health_graph/models/fitness_activity_delete.rb", - "lib/health_graph/models/fitness_activity_update.rb", - "lib/health_graph/models/new_fitness_activity.rb", - "lib/health_graph/models/profile.rb", - "lib/health_graph/models/settings.rb", - "lib/health_graph/models/sleep_feed.rb", - "lib/health_graph/models/strength_training_activities_feed.rb", - "lib/health_graph/models/strength_training_activity.rb", - "lib/health_graph/models/user.rb", - "lib/health_graph/models/weight_feed.rb", - "test/fixtures/background_activities_feed.json", - "test/fixtures/background_activity.json", - "test/fixtures/fitness_activities_feed.json", - "test/fixtures/fitness_activity.json", - "test/fixtures/new_fitness_activity_params.json", - "test/fixtures/profile_get.json", - "test/fixtures/records.json", - "test/fixtures/sleep_feed_get.json", - "test/fixtures/team_get_empty.json", - "test/fixtures/user_get.json", - "test/fixtures/weight_feed_get.json", - "test/fixtures/weight_get_empty.json", - "test/health_graph/test_fitness_activities_feed.rb", - "test/health_graph/test_new_fitness_activity.rb", - "test/health_graph/test_profile.rb", - "test/health_graph/test_sleep_feed.rb", - "test/health_graph/test_user.rb", - "test/health_graph/test_weight_feed.rb", - "test/helper.rb", - "test/test_health_graph.rb" - ] - s.homepage = "http://github.com/kennyma/health_graph" - s.licenses = ["MIT"] - s.require_paths = ["lib"] - s.rubygems_version = "1.8.13" - s.summary = "Ruby gem for RunKeeper Health Graph API" + spec.files = `git ls-files`.split($/) + spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } + spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) + spec.require_paths = ["lib"] - if s.respond_to? :specification_version then - s.specification_version = 3 + spec.add_dependency "oauth2", ">= 0.5.2" + spec.add_dependency "faraday", ">= 0.7.4" + spec.add_dependency "faraday_middleware", ">= 0.7.8" + spec.add_dependency "hashie", ">= 1.2" + spec.add_dependency "webmock", ">= 1.7.6" - if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_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"]) - 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"]) - s.add_development_dependency(%q, [">= 0"]) - s.add_development_dependency(%q, [">= 0"]) - s.add_development_dependency(%q, [">= 0"]) - s.add_runtime_dependency(%q, [">= 0.5.2"]) - s.add_runtime_dependency(%q, [">= 0.7.4"]) - s.add_runtime_dependency(%q, [">= 0.7.8"]) - s.add_runtime_dependency(%q, [">= 1.2"]) - s.add_runtime_dependency(%q, [">= 1.7.6"]) - s.add_development_dependency(%q, [">= 0"]) - s.add_development_dependency(%q, [">= 0"]) - s.add_development_dependency(%q, [">= 0"]) - else - 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"]) - 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"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0.5.2"]) - s.add_dependency(%q, [">= 0.7.4"]) - s.add_dependency(%q, [">= 0.7.8"]) - s.add_dependency(%q, [">= 1.2"]) - s.add_dependency(%q, [">= 1.7.6"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - end - else - 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"]) - 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"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0.5.2"]) - s.add_dependency(%q, [">= 0.7.4"]) - s.add_dependency(%q, [">= 0.7.8"]) - s.add_dependency(%q, [">= 1.2"]) - s.add_dependency(%q, [">= 1.7.6"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - end + spec.add_development_dependency "shoulda" + spec.add_development_dependency "simplecov" + spec.add_development_dependency "pry" end diff --git a/test/helper.rb b/test/helper.rb index 06aac99..e93106a 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -11,14 +11,14 @@ class Test::Unit::TestCase TEST_USER_TOKEN = "b9aaf2581480432a939a72f894bf".freeze - + def fixture(file) path = File.expand_path("../fixtures", __FILE__) File.new(path + '/' + file) end - + def json_fixture(file) file = fixture(file) - JSON.load(file) + JSON.load(file) end end diff --git a/test/test_health_graph.rb b/test/test_health_graph.rb index c9e1a2f..3c1b82e 100644 --- a/test/test_health_graph.rb +++ b/test/test_health_graph.rb @@ -1,102 +1,102 @@ -require 'helper' +require_relative 'helper' class TestHealthGraph < Test::Unit::TestCase - context "Health Graph" do - setup do + context "Health Graph" do + setup do HealthGraph.reset end - + should "get default client id" do assert_equal nil, HealthGraph.client_id end - + should "set client id" do client_id = "123456asdb" HealthGraph.client_id = client_id assert_equal client_id, HealthGraph.client_id end - + should "get default client secret" do assert_equal nil, HealthGraph.client_secret end - + should "set client secret" do secret = "supersecret" HealthGraph.client_secret = secret assert_equal secret, HealthGraph.client_secret end - + should "get default authorization url" do assert_equal "https://runkeeper.com/apps/authorize", HealthGraph.authorization_url end - + should "set authorization url" do url = "http://somesite.com/apps/authorize" HealthGraph.authorization_url = url assert_equal url, HealthGraph.authorization_url end - + should "get default access token url" do assert_equal "https://runkeeper.com/apps/token", HealthGraph.access_token_url end - + should "set access token url" do url = "http://somesite.com/apps/token" HealthGraph.access_token_url = url assert_equal url, HealthGraph.access_token_url end - + should "get default authorization redirect url" do assert_equal nil, HealthGraph.authorization_redirect_url end - + should "set authorization redirect url" do url = "http://somesite.com/runkeeper" HealthGraph.authorization_redirect_url = url assert_equal url, HealthGraph.authorization_redirect_url end - + should "get default api endpoint" do assert_equal "https://api.runkeeper.com", HealthGraph.endpoint end - + should "set api endpoont" do new_endpoint = "https://api.somesite.com" HealthGraph.endpoint = new_endpoint - assert_equal new_endpoint, HealthGraph.endpoint - end - + assert_equal new_endpoint, HealthGraph.endpoint + end + should "get default adapter" do assert_equal :net_http, HealthGraph.adapter end - + should "set adapter" do adapter = :typhoeus HealthGraph.adapter = adapter assert_equal adapter, HealthGraph.adapter end - + should "get default faraday options" do assert HealthGraph.faraday_options.empty?, "Expected empty hash but got #{HealthGraph.faraday_options.inspect}" end - + should "set faraday options" do options = {:new_option => "testing option", :another => "another option"} HealthGraph.faraday_options = options assert_equal options, HealthGraph.faraday_options end - + should "get default accept headers" do options = { :user => "application/vnd.com.runkeeper.User+json", :fitness_activity_feed => "application/vnd.com.runkeeper.FitnessActivityFeed+json", :fitness_activity => "application/vnd.com.runkeeper.FitnessActivity+json", - :new_fitness_activity => "application/vnd.com.runkeeper.NewFitnessActivity+json", + :new_fitness_activity => "application/vnd.com.runkeeper.NewFitnessActivity+json", :strength_training_activity_feed => "application/vnd.com.runkeeper.StrengthTrainingActivityFeed+json", - :strength_training_activity => "application/vnd.com.runkeeper.StrengthTrainingActivity+json", + :strength_training_activity => "application/vnd.com.runkeeper.StrengthTrainingActivity+json", :background_activity_feed => "application/vnd.com.runkeeper.BackgroundActivityFeed+json", :background_activity => "application/vnd.com.runkeeper.BackgroundActivity+json", - :sleep_feed => "application/vnd.com.runkeeper.SleepFeed+json", + :sleep_feed => "application/vnd.com.runkeeper.SleepFeed+json", :sleep => "application/vnd.com.runkeeper.Sleep+json", :nutrition_feed => "application/vnd.com.runkeeper.NutritionFeed+json", :nutrition => "application/vnd.com.runkeeper.Nutrition+json", @@ -105,33 +105,34 @@ class TestHealthGraph < Test::Unit::TestCase :general_measurement_feed => "application/vnd.com.runkeeper.GeneralMeasurementFeed+json", :general_measurement => "application/vnd.com.runkeeper.GeneralMeasurement+json", :diabetes_feed => "application/vnd.com.runkeeper.DiabetesFeed+json", - :diatetes_measurement => "application/vnd.com.runkeeper.DiabetesMeasurement+json", + :diatetes_measurement => "application/vnd.com.runkeeper.DiabetesMeasurement+json", :records => "application/vnd.com.runkeeper.Records+json", - :profile => "application/vnd.com.runkeeper.Profile+json" + :profile => "application/vnd.com.runkeeper.Profile+json", + :settings=>"application/vnd.com.runkeeper.Settings+json" } - + assert_equal options, HealthGraph.accept_headers - end - + end + should "set accept headers" do options = { :user => "application/vnd.com.runkeeper.User+json", - :fitness_activity_feed => "application/vnd.com.runkeeper.FitnessActivityFeed+json", + :fitness_activity_feed => "application/vnd.com.runkeeper.FitnessActivityFeed+json", } - + HealthGraph.accept_headers = options assert_equal options, HealthGraph.accept_headers end - - context "configure" do + + context "configure" do HealthGraph::Configuration::VALID_OPTIONS_KEYS.each do |k| should "set #{k}" do HealthGraph.configure do |config| - config.send("#{k}=", k) + config.send("#{k}=", k) end assert_equal k, HealthGraph.send(k) end - end + end end end end From 48b6cf01822fda8a2fbf93af8a1dce70a46afd10 Mon Sep 17 00:00:00 2001 From: Andy Brett Date: Thu, 31 Dec 2015 10:35:14 -0800 Subject: [PATCH 7/9] This is subsumed by the switch from Jeweler. Revert "Remove dependency on self -.^" This reverts commit c8e2082f0c2d41a4b7811af9ab120430d68bbe92. --- .gitignore | 3 --- health_graph.gemspec | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d57becb..5c4cd64 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,3 @@ pkg # For rubinius: #*.rbc - -# Don't commit gems -*.gem diff --git a/health_graph.gemspec b/health_graph.gemspec index d03ec24..1a35bc8 100644 --- a/health_graph.gemspec +++ b/health_graph.gemspec @@ -71,6 +71,7 @@ Gem::Specification.new do |s| s.specification_version = 3 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then + s.add_runtime_dependency(%q, [">= 0"]) s.add_development_dependency(%q, [">= 0"]) s.add_development_dependency(%q, [">= 0"]) s.add_development_dependency(%q, [">= 0"]) From 4b30d93d066a5805e87e68dda33b52c7b4e46430 Mon Sep 17 00:00:00 2001 From: Andy Brett Date: Thu, 31 Dec 2015 10:48:55 -0800 Subject: [PATCH 8/9] version bump --- health_graph.gemspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/health_graph.gemspec b/health_graph.gemspec index 27e92bf..9c06263 100644 --- a/health_graph.gemspec +++ b/health_graph.gemspec @@ -5,7 +5,7 @@ Gem::Specification.new do |spec| spec.name = "health_graph" - spec.version = "0.6.0" + spec.version = "0.7.0" spec.authors = ["Kenny Ma"] spec.email = "kenny@kennyma.me" spec.date = "2012-07-17" @@ -33,4 +33,3 @@ Gem::Specification.new do |spec| spec.add_development_dependency "simplecov" spec.add_development_dependency "pry" end - From 1e8686756bac9ad9c1fb358a3f13f60c7c96cebb Mon Sep 17 00:00:00 2001 From: Andy Brett Date: Thu, 31 Dec 2015 10:53:32 -0800 Subject: [PATCH 9/9] ignore gem --- .gitignore | 2 +- health_graph.gemspec | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5c4cd64..52c1f0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ Gemfile.lock -health-graph-*.gem +health_graph-*.gem # rcov generated coverage diff --git a/health_graph.gemspec b/health_graph.gemspec index 9c06263..c512ef7 100644 --- a/health_graph.gemspec +++ b/health_graph.gemspec @@ -5,10 +5,10 @@ Gem::Specification.new do |spec| spec.name = "health_graph" - spec.version = "0.7.0" + spec.version = "0.7.1" spec.authors = ["Kenny Ma"] spec.email = "kenny@kennyma.me" - spec.date = "2012-07-17" + spec.date = "2015-12-31" spec.description = "This is a wrapper for RunKeeper Health Graph RESTful API." spec.summary = "Ruby gem for RunKeeper Health Graph API" spec.homepage = "http://github.com/kennyma/health_graph"