Почему у меня не скафолдит fdoc документы?
FDOC_SCAFFOLD=true bundle exec rspec spec/api
Fdoc:
https://github.com/square/fdoc
Grape:
https://github.com/intridea/grape
Папки docs/fdoc созданы!
app/api/my_api/base.rb
module Twitter
class API < Grape::API
version 'v1', using: :path, vendor: 'twitter'
format :json
get :ping do
{status: "ok"}
end
end
end
Gemfile
...
gem 'fdoc'
gem 'rspec'
gem 'rack-test', require: 'rack/test'
spec/spec_helper.rb
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
require 'rack/test'
require 'fdoc'
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.raise_errors_for_deprecations!
config.infer_base_class_for_anonymous_controllers = false
config.order = 'random'
end
Example:
https://github.com/square/fdoc/blob/master/docs/sc...
My:
spec/api/twiter_spec.rb
require 'spec_helper'
require 'fdoc/spec_watcher'
describe Twitter::API do
include Fdoc::SpecWatcher
describe "twitter", :fdoc => '/ping' do
it "test ping" do
get "twitter/v1/ping/"
response.status.should == 200
end
end
end
Если вы не хотите разбираться с этим, пожалуйста, предоставте ссылку на простой и РАБОЧИЙ пример использования fdoc.