Skip to content

Commit

Permalink
Merge pull request #2 from dhienan/feature/2-versionist
Browse files Browse the repository at this point in the history
Gen v1 api by versionist
  • Loading branch information
Duong Hien An committed Sep 17, 2015
2 parents b5ac10c + 31d8ce7 commit aac6288
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/v1/base_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class V1::BaseController < ApplicationController
end
2 changes: 2 additions & 0 deletions app/presenters/v1/base_presenter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class V1::BasePresenter
end
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rails.application.routes.draw do

api_version(:module => "V1", :path => {:value => "v1"}) do
end
end
17 changes: 17 additions & 0 deletions public/docs/v1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Documentation for v1</title>
<link href="v1/style.css" media="screen" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
<div id="operations">
<h3>API Operations</h3>
</div>
<div id="content">
<h1>Documentation for v1</h1>
</div>
</div>
</body>
</html>
5 changes: 5 additions & 0 deletions public/docs/v1/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
body {margin: 0; background-color: #fff; color: #000; font-family: Arial,sans-serif;}
content {margin-left: 200px;}
content h1 {text-align: center;}
operations {float: left; width: 200px; border-right: 1px solid #ccc;}
operations h3 {text-align: center;}
8 changes: 8 additions & 0 deletions test/functional/v1/base_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'test_helper'

class V1::BaseControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
8 changes: 8 additions & 0 deletions test/integration/v1/base_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'test_helper'

class V1::BaseControllerTest < ActionDispatch::IntegrationTest
# Replace this with your real tests.
test "the truth" do
assert true
end
end
8 changes: 8 additions & 0 deletions test/presenters/v1/base_presenter_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'test_helper'

class V1::BasePresenterTest < Test::Unit::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

0 comments on commit aac6288

Please sign in to comment.