Commit f891c534 by andrew morton

Add a rake task and railtie to load it

Fixes #2
parent 2edc9cee
...@@ -55,9 +55,8 @@ end ...@@ -55,9 +55,8 @@ end
## Generate the docs ## Generate the docs
Eventually [this will become a rake task](https://github.com/drewish/rspec-rails-swagger/issues/2):
``` ```
bundle exec rspec -f RSpec::Rails::Swagger::Formatter --order defined -t swagger_object bundle exec rake swagger
``` ```
## Running tests ## Running tests
......
...@@ -10,6 +10,14 @@ module RSpec ...@@ -10,6 +10,14 @@ module RSpec
module Rails module Rails
module Swagger module Swagger
initialize_configuration RSpec.configuration initialize_configuration RSpec.configuration
if defined?(::Rails)
class Railtie < ::Rails::Railtie
rake_tasks do
load 'rspec/rails/swagger/tasks/swagger.rake'
end
end
end
end end
end end
end end
......
require 'rspec/core/rake_task'
desc "Regenerate Swagger docs"
RSpec::Core::RakeTask.new(:swagger) do |t|
t.verbose = false
t.rspec_opts = "-f RSpec::Rails::Swagger::Formatter --order defined -t swagger_object"
end
...@@ -3,7 +3,7 @@ module RSpec ...@@ -3,7 +3,7 @@ module RSpec
# Version information for RSpec Swagger. # Version information for RSpec Swagger.
module Swagger module Swagger
module Version module Version
STRING = '0.1.0' STRING = '0.1.1'
end end
end end
end end
......
...@@ -17,6 +17,7 @@ Gem::Specification.new do |s| ...@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
'lib/rspec/rails/swagger/helpers.rb', 'lib/rspec/rails/swagger/helpers.rb',
'lib/rspec/rails/swagger/request_builder.rb', 'lib/rspec/rails/swagger/request_builder.rb',
'lib/rspec/rails/swagger/version.rb', 'lib/rspec/rails/swagger/version.rb',
'lib/rspec/rails/swagger/tasks/swagger.rake',
] ]
s.homepage = 'https://github.com/drewish/rspec-rails-swagger' s.homepage = 'https://github.com/drewish/rspec-rails-swagger'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment