Skip to content

Commit

Permalink
Merge pull request #53 from ignaciojonas/v2
Browse files Browse the repository at this point in the history
V2 - Rebased to Master
  • Loading branch information
ntotten committed Feb 12, 2016
2 parents eb3011f + 2f10dc6 commit f1dd4c4
Show file tree
Hide file tree
Showing 56 changed files with 2,743 additions and 267 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bin/
vendor/
doc/
.DS_Store
.ruby-version
coverage
Expand Down
19 changes: 12 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
language: ruby

sudo: false

cache: bundler

rvm:
- 2.1.0
- 2.2.1

script: ./build_travis.sh
- 2.1.0
- 2.2.1
script: "./build_travis.sh"
after_success: "./deploy_documentation.sh"
deploy:
provider: rubygems
api_key: ${RUBYGEMS_API_KEY}
gemspec: auth0.gemspec
on:
tags: true
repo: auth0/ruby-auth0
branch: master
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ group :development do
gem 'terminal-notifier-guard', require: false
gem 'coveralls', require: false
gem 'rubocop', require: false
gem 'yard', require: false
end
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,33 @@ gem 'auth0'

## Basic usage

Using [APIv1](https://auth0.com/docs/api)
Using [APIv2](https://auth0.com/docs/api/v2)

```ruby
require "auth0"

auth0 = Auth0Client.new(
:client_id => "YOUR CLIENT ID",
:client_secret => "YOUR CLIENT SECRET",
:token => "YOUR JWT HERE",
:domain => "<YOUR ACCOUNT>.auth0.com"
)

puts auth0.get_users
```

Using [APIv2](https://auth0.com/docs/apiv2)
Using [APIv1](https://auth0.com/docs/api/v1)

```ruby
require "auth0"

auth0 = Auth0Client.new(
:api_version => 2,
:token => "YOUR JWT HERE",
:client_id => "YOUR CLIENT ID",
:client_secret => "YOUR CLIENT SECRET",
:domain => "<YOUR ACCOUNT>.auth0.com"
)

puts auth0.get_users
```


## What is Auth0?

Auth0 helps you to:
Expand Down
26 changes: 25 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,34 @@ require 'bundler/gem_tasks'

begin
require 'rubocop/rake_task'
RuboCop::RakeTask.new

require 'rspec/core/rake_task'

desc 'Run Rubocop'
RuboCop::RakeTask.new(:rubocop)

require 'yard'
DOC_FILES = ['lib/auth0/api/v2/*.rb', 'lib/auth0/api/authentication_endpoints.rb']

desc 'Build Documentation'
YARD::Rake::YardocTask.new(:documentation) do |t|
t.files = DOC_FILES
t.options = ['-p', 'doc_config/templates']
end

desc 'Publish SDK documentation'
task :publish do
sh 'rake documentation'
sh 'cp -R doc /tmp/ruby-auth0-doc'
sh 'git checkout gh-pages'
sh 'cp -R /tmp/ruby-auth0-doc/* .'
sh 'rm -rf /tmp/ruby-auth0-doc'
sh 'git add .'
sh 'git commit -am "Rebuild documentation"'
sh 'git push origin gh-pages'
sh 'git checkout master'
end

desc 'Run Integration Tests'
RSpec::Core::RakeTask.new(:integration) do |t|
t.pattern = FileList["spec/integration/**/*#{ENV['PATTERN']}*_spec.rb"]
Expand Down
2 changes: 1 addition & 1 deletion auth0.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
s.require_paths = ['lib']

s.add_runtime_dependency 'httparty', '~> 0.13'
s.add_runtime_dependency 'httmultiparty', '~> 0.3.16'

s.add_development_dependency 'rake', '~> 10.4'
s.add_development_dependency 'fuubar', '~> 2.0'
Expand Down
29 changes: 29 additions & 0 deletions deploy_documentation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# exit with nonzero exit code if anything fails
set -e

# clear and re-create the out directory
rm -rf doc || exit 0;
mkdir doc;

# build documentation
bundle exec rake documentation

# go to the out directory and create a *new* Git repo
cd doc
git init

# inside this git repo we'll pretend to be a new user
git config user.name "Travis CI"
git config user.email "build-documentation@auth0.com"

# The first and only commit to this new Git repo contains all the
# files present with the commit message "Deploy to GitHub Pages".
git add .
git commit -m "Deploy to GitHub Pages"

# Force push from the current repo's master branch to the remote
# repo's gh-pages branch. (All previous history on the gh-pages branch
# will be lost, since we are overwriting it.) We redirect any output to
# /dev/null to hide any sensitive credential data that might otherwise be exposed.
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
79 changes: 79 additions & 0 deletions doc_config/templates/default/fulldoc/html/css/full_list.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
body {
padding: 0 20px;
font-size: 14px;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
font-family: "avenir-next-web", Avenir, "Helvetica Neue", Hevetica, sans-serif;
color: #4d4d4d;
}

h1, h2, h3, h4, h5 {
line-height: 1.5;
font-family: "avenir-next-web", Avenir, "Helvetica Neue", Hevetica, sans-serif;
color: #000;
font-weight: 400;
}
h1 {
font-size: 3rem;
}
h2 {
font-size: 2rem;
}
h3 {
font-size: 1.5rem;
}
h4 {
font-size: 1.3rem;
}
h5 {
font-size: 16px;
}

.clear { clear: both; }
#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; }
#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVA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AAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; }
#full_list { padding: 0; list-style: none; margin-left: 0; }
#full_list ul { padding: 0; }
#full_list li { padding: 5px; padding-left: 12px; margin: 0; font-size: 1.1em; list-style: none; }
#noresults { padding: 7px 12px; }
#content.insearch #noresults { margin-left: 7px; }
ul.collapsed ul, ul.collapsed li { display: none; }
ul.collapsed.search_uncollapsed { display: block; }
ul.collapsed.search_uncollapsed li { display: list-item; }
li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; }
li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; }
li { color: #888; cursor: pointer; }
li.deprecated { text-decoration: line-through; font-style: italic; }
/*li.r1 { background: #f0f0f0; }
li.r2 { background: #fafafa; }*/
li:hover { background: #ddd; }
li small:before { content: "("; }
li small:after { content: ")"; }
li small.search_info { display: none; }
a:link, a:visited { text-decoration: none; color: #777; }
li.clicked { background: #777; color: #ccc; }
li.clicked a:link, li.clicked a:visited { color: #eee; }
li.clicked a.toggle { opacity: 0.5; background-position: bottom right; }
li.collapsed.clicked a.toggle { background-position: top right; }
#search input { border: 1px solid #bbb; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
#nav { margin-left: 10px; font-size: 0.9em; display: none; color: #aaa; }
#nav a:link, #nav a:visited { color: #358; }
#nav a:hover { background: transparent; color: #5af; }
.frames #nav span:after { content: ' | '; }
.frames #nav span:last-child:after { content: ''; }

.frames #content h1 { margin-top: 0; }
.frames li { white-space: nowrap; cursor: normal; }
.frames li small { display: block; font-size: 0.8em; }
.frames li small:before { content: ""; }
.frames li small:after { content: ""; }
.frames li small.search_info { display: none; }
.frames #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; }
.frames #content.insearch #search { background-position: center right; }
.frames #search input { width: 110px; }
.frames #nav { display: block; }

#full_list.insearch li { display: none; }
#full_list.insearch li.found { display: list-item; padding-left: 10px; }
#full_list.insearch li a.toggle { display: none; }
#full_list.insearch li small.search_info { display: block; }
Loading

0 comments on commit f1dd4c4

Please sign in to comment.