From 9427881029fb05f1017d934ebe232817f22c28f6 Mon Sep 17 00:00:00 2001 From: stve Date: Mon, 9 Feb 2015 22:09:29 -0500 Subject: [PATCH] rename User module to OAuth to match API methods --- lib/instapaper/api.rb | 4 ++-- lib/instapaper/api/{user.rb => oauth.rb} | 4 ++-- lib/instapaper/client.rb | 3 +-- spec/instapaper/api/{user_spec.rb => oauth_spec.rb} | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) rename lib/instapaper/api/{user.rb => oauth.rb} (89%) rename spec/instapaper/api/{user_spec.rb => oauth_spec.rb} (97%) diff --git a/lib/instapaper/api.rb b/lib/instapaper/api.rb index 377be7d..21fb752 100644 --- a/lib/instapaper/api.rb +++ b/lib/instapaper/api.rb @@ -2,7 +2,7 @@ require 'instapaper/api/account' require 'instapaper/api/bookmark' require 'instapaper/api/folder' require 'instapaper/api/highlight' -require 'instapaper/api/user' +require 'instapaper/api/oauth' module Instapaper module API @@ -10,6 +10,6 @@ module Instapaper include Instapaper::API::Bookmark include Instapaper::API::Folder include Instapaper::API::Highlight - include Instapaper::API::User + include Instapaper::API::OAuth end end diff --git a/lib/instapaper/api/user.rb b/lib/instapaper/api/oauth.rb similarity index 89% rename from lib/instapaper/api/user.rb rename to lib/instapaper/api/oauth.rb index 64dde2f..fea9d34 100644 --- a/lib/instapaper/api/user.rb +++ b/lib/instapaper/api/oauth.rb @@ -1,7 +1,7 @@ module Instapaper module API - # Defines methods related to users - module User + # Defines methods related to OAuth + module OAuth # Gets an OAuth access token for a user. def access_token(username, password) response = post('/api/1/oauth/access_token', {x_auth_username: username, x_auth_password: password, x_auth_mode: 'client_auth'}, true) diff --git a/lib/instapaper/client.rb b/lib/instapaper/client.rb index 5b8703f..7f7bf0f 100644 --- a/lib/instapaper/client.rb +++ b/lib/instapaper/client.rb @@ -60,8 +60,7 @@ module Instapaper attr_accessor :user_agent attr_accessor :connection_options - - # Creates a new API + # Creates a new Instapaper::Client def initialize(options = {}) reset options.keys.each do |key| diff --git a/spec/instapaper/api/user_spec.rb b/spec/instapaper/api/oauth_spec.rb similarity index 97% rename from spec/instapaper/api/user_spec.rb rename to spec/instapaper/api/oauth_spec.rb index 14c2212..7bef975 100644 --- a/spec/instapaper/api/user_spec.rb +++ b/spec/instapaper/api/oauth_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Instapaper::Client::User do +describe Instapaper::Client::OAuth do let(:client) { Instapaper::Client.new } describe '.access_token' do