-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from ignaciojonas/master
Release 4.1.0
- Loading branch information
Showing
92 changed files
with
1,914 additions
and
627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
# Configuration parameters: CountComments. | ||
Metrics/MethodLength: | ||
Max: 15 | ||
|
||
# Configuration parameters: AllowURI, URISchemes. | ||
Metrics/LineLength: | ||
Max: 121 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ source 'http://rubygems.org' | |
# gem "rails" | ||
gem 'sinatra', '~> 1.4' | ||
gem 'jwt', '~> 1.5' | ||
gem 'dotenv' | ||
gem 'dotenv' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
require './main' | ||
run Sinatra::Application | ||
run Sinatra::Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
examples/ruby-on-rails-api/app/controllers/application_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Application Controller | ||
class ApplicationController < ActionController::Base | ||
include Knock::Authenticable | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# Ping Controller | ||
class PingController < ApplicationController | ||
|
||
def ping | ||
render text: "All good. You don't need to be authenticated to call this" | ||
end | ||
|
||
end |
10 changes: 5 additions & 5 deletions
10
examples/ruby-on-rails-api/app/controllers/secured_ping_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# Secured ping Controller | ||
class SecuredPingController < ApplicationController | ||
before_action :authenticate | ||
|
||
def ping | ||
render :json => { | ||
:message => "All good. You only get this message if you're authenticated.", | ||
:user => @current_user | ||
} | ||
render json: { | ||
message: "All good. You only get this message if you're authenticated.", | ||
user: @current_user | ||
} | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# Application Helper | ||
module ApplicationHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This file is used by Rack-based servers to start the application. | ||
|
||
require ::File.expand_path('../config/environment', __FILE__) | ||
require ::File.expand_path('../config/environment', __FILE__) | ||
run Rails.application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/ruby-on-rails-api/config/initializers/cookies_serializer.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Be sure to restart your server when you modify this file. | ||
|
||
Rails.application.config.action_dispatch.cookies_serializer = :json | ||
Rails.application.config.action_dispatch.cookies_serializer = :json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
require 'test_helper' | ||
|
||
# Ping Controller Tests | ||
class PingControllerTest < ActionController::TestCase | ||
|
||
test 'responds with success' do | ||
get :ping | ||
assert_response :success | ||
end | ||
|
||
end |
3 changes: 1 addition & 2 deletions
3
examples/ruby-on-rails-api/test/secured_ping_controller_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
ENV['RAILS_ENV'] ||= 'test' | ||
require File.expand_path('../../config/environment', __FILE__) | ||
require 'rails/test_help' | ||
# Active Support | ||
class ActiveSupport | ||
# Test Case | ||
class TestCase | ||
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. | ||
# | ||
# Note: You'll currently still have to declare fixtures explicitly in integration tests | ||
# -- they do not yet inherit this setting | ||
fixtures :all | ||
|
||
class ActiveSupport::TestCase | ||
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. | ||
# | ||
# Note: You'll currently still have to declare fixtures explicitly in integration tests | ||
# -- they do not yet inherit this setting | ||
fixtures :all | ||
|
||
# Add more helper methods to be used by all tests here... | ||
# Add more helper methods to be used by all tests here... | ||
end | ||
end |
Oops, something went wrong.