Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
krsyoung committed Sep 3, 2016
0 parents commit 2783302
Show file tree
Hide file tree
Showing 11 changed files with 248 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

# Used by dotenv library to load environment variables.
# .env

## Specific to RubyMotion:
.dat*
.repl_history
build/
*.bridgesupport
build-iPhoneOS/
build-iPhoneSimulator/

## Specific to RubyMotion (use of CocoaPods):
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# vendor/Pods/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: ruby
rvm:
- 2.3.1
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in redoc-rails.gemspec
gemspec
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Christopher Young

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# ReDoc-Rails

A Ruby Gem wrapper for the ReDoc OpenAPI Specification dynamic documentation
project: https://github.com/Rebilly/ReDoc/


[![Gem Version](https://badge.fury.io/rb/redoc-rails.svg)](http://badge.fury.io/rb/redoc-rails)

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'redoc-rails'
```

And then execute:

$ bundle

Or install it yourself as:

$ gem install redoc-rails

## Usage

Add this line to your application's assets/javascripts/application.js:

```ruby
//= require ...
//= require redoc
//= require ...
```

Add the following to a web page:
```html
<redoc></redoc>
```

Add the following to the appropriate js/coffee file:

```
ready = ->
# initialize redoc from swagger.yaml
Redoc.init('/swagger.yml', {})
$(document).ready(ready)
$(document).on('page:load', ready)
```

If you want detailed information on it usage, you can refer to original documentation.

[https://github.com/almende/vis](https://github.com/almende/vis)

## Changelog

- v1.3.0 : initial version

## Contributing

1. Fork it ( https://github.com/[my-github-username]/redoc-rails/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require "bundler/gem_tasks"
6 changes: 6 additions & 0 deletions lib/redoc-rails.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module ReDoc
module Rails
require 'redoc/rails/engine'
require 'redoc/rails/version'
end
end
9 changes: 9 additions & 0 deletions lib/redoc/rails/engine.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module ReDoc
module Rails
class Engine < ::Rails::Engine
# initializer 'ReDoc precompile hook', :group => :all do |app|
# app.config.assets.precompile += ['redoc.js']
# end
end
end
end
5 changes: 5 additions & 0 deletions lib/redoc/rails/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module ReDoc
module Rails
VERSION = "1.3.0"
end
end
33 changes: 33 additions & 0 deletions redoc-rails.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# coding: utf-8
require File.expand_path('../lib/redoc/rails/version', __FILE__)

Gem::Specification.new do |spec|
spec.name = "redoc-rails"
spec.version = ReDoc::Rails::VERSION
spec.platform = Gem::Platform::RUBY
spec.authors = ["Christopher Young"]
spec.email = ["[email protected]"]

spec.summary = %q{Gemify redoc.js library for Rails assets pipeline}
spec.description = %q{Wrapping redoc.js library with ruby gem for easy use in Rails projects}
spec.homepage = "https://github.com/krsyoung/redoc-rails"
spec.license = "MIT"

# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
# delete this section to allow pushing this gem to any host.
if spec.respond_to?(:metadata)
spec.metadata['allowed_push_host'] = "https://rubygems.org"
else
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
end

spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_development_dependency "rails", ">= 3.1"

spec.add_development_dependency "bundler", "~> 1.9"
spec.add_development_dependency "rake", "~> 10.0"
end
50 changes: 50 additions & 0 deletions vendor/assets/javascripts/redoc.js

Large diffs are not rendered by default.

0 comments on commit 2783302

Please sign in to comment.