Skip to content

Commit

Permalink
Merge pull request #20 from samdunne/2.0
Browse files Browse the repository at this point in the history
Version 2.0.1 Release
  • Loading branch information
samdunne committed May 12, 2014
2 parents f20cea9 + 4cd53a2 commit 47b66b8
Show file tree
Hide file tree
Showing 15 changed files with 293 additions and 151 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This is the configuration used to check the rubocop source code.

inherit_from: .rubocop_todo.yml
78 changes: 78 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
AllCops:
Include:
- 'Gemfile'
- 'Rakefile'
- 'omniauth-gplus.gemspec'

# Avoid long parameter lists
ParameterLists:
Max: 5
CountKeywordArgs: true

MethodLength:
CountComments: false
Max: 18

# Avoid more than `Max` levels of nesting.
BlockNesting:
Max: 2

# Align with the style guide.
CollectionMethods:
PreferredMethods:
map: 'collect'
reduce: 'inject'
find: 'detect'
find_all: 'select'

# Do not force public/protected/private keyword to be indented at the same
# level as the def keyword. My personal preference is to outdent these keywords
# because I think when scanning code it makes it easier to identify the
# sections of code and visually separate them. When the keyword is at the same
# level I think it sort of blends in with the def keywords and makes it harder
# to scan the code and see where the sections are.
AccessModifierIndentation:
Enabled: false

# Limit line length
LineLength:
Enabled: false

# Disable documentation checking until a class needs to be documented once
Documentation:
Enabled: false

# Enforce Ruby 1.8-compatible hash syntax
HashSyntax:
EnforcedStyle: hash_rockets

# No spaces inside hash literals
SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

# Allow dots at the end of lines
DotPosition:
Enabled: false

# Don't require magic comment at the top of every file
Encoding:
Enabled: false

EmptyLinesAroundAccessModifier:
Enabled: true

# Align ends correctly
EndAlignment:
AlignWith: variable

# Indentation of when/else
CaseIndentation:
IndentWhenRelativeTo: end
IndentOneStep: false

Lambda:
Enabled: false

FileName:
Exclude:
- 'lib/omniauth-gplus.rb'
23 changes: 21 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
before_install:
- gem update bundler
- bundle --version
- gem update --system 2.1.11
- gem --version
language: ruby
rvm:
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1
- jruby
- rbx
- rbx-2
- ruby-head
- rbx-19mode
- jruby-19mode
matrix:
include:
- rvm: jruby-19mode
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
- rvm: jruby-head
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
allow_failures:
- rvm: jruby-head
- rvm: ruby-head
- rvm: rbx
fast_finish: true
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Changelog
---------
**v2.0.0**

* Support for hybrid sign-in flow
* Conform to [ruby style guidelines](bbatsov/ruby-style-guide)
* Support for Ruby 2.1 & 2.0
* Ensure compatibility with Rails 4.1 and 4.0
* Squashed bugs
* Moved changelog to seperate file

**v1.1.1**

* Using the correct api scope

**v1.1.0**

* Fixed UID field always being nil

**v1.0.0**

* Initial release
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013 Kurtis Rainbolt-Greene
Copyright (c) 2014 Sam Dunne

MIT License

Expand Down
134 changes: 52 additions & 82 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
omniauth-gplus
=========

- [![Gem Version](https://badge.fury.io/rb/omniauth-gplus.png)](https://rubygems.org/gems/omniauth-gplus)
- [![Code Climate](https://codeclimate.com/github/krainboltgreene/omniauth-gplus.png)](https://codeclimate.com/github/krainboltgreene/omniauth-gplus)
- [![Build Status](https://travis-ci.org/krainboltgreene/omniauth-gplus.png)](https://travis-ci.org/krainboltgreene/omniauth-gplus)
- [![Dependency Status](https://gemnasium.com/krainboltgreene/omniauth-gplus.png)](https://gemnasium.com/krainboltgreene/omniauth-gplus)
- [![Coverage Status](https://coveralls.io/repos/krainboltgreene/omniauth-gplus/badge.png?branch=master)](https://coveralls.io/r/krainboltgreene/omniauth-gplus)
[![Gem Version](http://img.shields.io/gem/v/omniauth-gplus.svg)][gem]
[![Code Climate](http://img.shields.io/codeclimate/github/samdunne/omniauth-gplus.svg)][codeclimate]
[![Build Status](http://img.shields.io/travis/samdunne/omniauth-gplus.svg)][travis]
[![Dependency Status](http://img.shields.io/gemnasium/samdunne/omniauth-gplus.svg)][gemnasium]
[![Coverage Status](http://img.shields.io/coveralls/samdunne/omniauth-gplus.svg)][coveralls]

[gem]: https://rubygems.org/gems/omniauth-gplus
[codeclimate]: https://codeclimate.com/github/samdunne/omniauth-gplus
[travis]: https://travis-ci.org/samdunne/omniauth-gplus
[gemnasium]: https://gemnasium.com/samdunne/omniauth-gplus
[coveralls]: https://coveralls.io/r/samdunne/omniauth-gplus

`omniauth-gplus` is a Google+ strategy for OmniAuth.
It allows you to easily interact with the Google+ OAuth2 endpoint.


Installing
----------

**Requirements**:
A GPlus API key/secret

You can either install manually:

``` bash
$ gem install omniauth-gplus
```

Or put it in your `Gemfile`:

``` ruby
source 'https://rubygems.org'

gem 'omniauth-gplus', '~> 2.0'
```


Examples
--------

Expand Down Expand Up @@ -49,16 +76,21 @@ provider :gplus, ENV['GPLUS_KEY'], ENV['GPLUS_SECRET'], scope: 'plus.login', req

To see and learn about all of the available App Activity types, visit: https://developers.google.com/+/api/moment-types/

To get a refresh token please pass the following:

```ruby
provider :gplus, ENV['GPLUS_KEY'], ENV['GPLUS_SECRET'], scope: 'plus.login', request_visible_actions: 'AddActivity,BuyActivity', access_type: 'offline'
```

The information schema looks like this:

``` ruby
info do
{
'email' => 'kurtisrainboltgreene@gmail.com',
'name' => 'Kurtis Rainbolt-Greene',
'first_name' => 'Kurtis',
'last_name' => 'Rainbolt-Greene',
'email' => 'sam@sam-dunne.com',
'name' => 'Sam Dunne',
'first_name' => 'Sam',
'last_name' => 'Dunne',
'image' => 'http://somelongurl.png',
'urls' => {
"Google+" => 'http://urltouserprofile.com'
Expand All @@ -76,84 +108,22 @@ extra do
end
```


Installing
----------

**Requirements**:

1. Ruby 1.9 OR Rubinius 1.9 OR JRuby 1.9
2. A GPlus API key/secret

You can either install manually:

``` bash
$ gem install omniauth-gplus
```

Or put it in your `Gemfile`:

``` ruby
source 'https://rubygems.org'

gem 'omniauth-gplus', '~> 1.0'
```


Issues & Documentation
----------------------

* [Documentation](https://github.com/krainboltgreene/omniauth-gplus/wiki)
* [Issues](https://github.com/krainboltgreene/omniauth-gplus/issues)

Absolutely feel free to contribute, please!


Changelog
---------

**v1.1.1**

* Using the correct api scope

**v1.1.0**

* Fixed UID field always being nil

**v1.0.0**

* Initial release


Contributing
------------

* **Fork** the repository
* **Clone the repository** locally, or **edit via Github**
* Create a **new branch** using the [Git Flow Standard](http://yakiloo.com/getting-started-git-flow/) conventions
* Commit **often** and **when important**
* **DO NOT CHANGE** ANY OF THESE (without making a new branch for *that* change):
* `*.gemspec`
* `Rakefile`
* `.ruby-version`
* `.ruby-gemset`
* `.gitignore`
* Any part of the git history
* **Write tests** specifically for the changes you've made, if no test exist
* **Push** your feature or hotfix branch to Github.
* Make a **Pull Request**


Credits
-------

- [Sam Dunne](https://github.com/samdunne), for initial work and bug fixes
Supported Rubies
----------------
Actively tested with the following Ruby versions:
- MRI 2.1.0
- MRI 2.0.0
- MRI 1.9.3
- MRI 1.9.2
- JRuby HEAD
- JRuby 1.9
- Rubinius (latest stable)


License
-------

Copyright (c) 2013 Kurtis Rainbolt-Greene
Copyright (c) 2014 Sam Dunne

MIT License

Expand Down
19 changes: 13 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,31 @@ begin
Bundler.setup :default, :development
rescue Bundler::BundlerError => error
$stderr.puts error.message
$stderr.puts "Run `bundle install` to install missing gems"
$stderr.puts 'Run `bundle install` to install missing gems.'
exit error.status_code
end

Bundler::GemHelper.install_tasks

desc "Run all of the tests"
desc 'Run all of the tests'
Rake::TestTask.new do |config|
config.libs << 'test'
config.pattern = 'test/**/*_test*'
# config.verbose = true
# config.warning = true
end

desc "Generate all of the docs"
desc 'Generate all of the docs'
YARD::Rake::YardocTask.new do |config|
config.files = Dir['lib/**/*.rb']
end

begin
require 'rubocop/rake_task'
Rubocop::RakeTask.new
rescue LoadError
task :rubocop do
$stderr.puts 'Rubocop is disabled'
end
end

desc 'Default: run tests, and generate docs'
task :default => [ :test, :yard ]
task :default => [:test, :yard, :rubocop]
7 changes: 2 additions & 5 deletions lib/omniauth-gplus.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
require "omniauth-oauth2"
require_relative "omniauth/strategies/gplus"
require_relative "omniauth/gplus/version"

OmniAuth.config.add_camelization("gplus", "GPlus")
require 'omniauth/gplus'
OmniAuth.config.add_camelization('gplus', 'GPlus')
2 changes: 2 additions & 0 deletions lib/omniauth/gplus.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require 'omniauth/gplus/version'
require 'omniauth/strategies/gplus'
2 changes: 1 addition & 1 deletion lib/omniauth/gplus/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module OmniAuth
module GPlus
VERSION = "1.2.0"
VERSION = '2.0.1'
end
end
Loading

0 comments on commit 47b66b8

Please sign in to comment.