Commit 4bc1df40 by liyijie

Add route parser for simple route

parent c9288f48
......@@ -40,6 +40,11 @@ GEM
crass (1.0.3)
diff-lcs (1.3)
erubi (1.7.0)
factory_bot (4.8.2)
activesupport (>= 3.0.0)
factory_bot_rails (4.8.2)
factory_bot (~> 4.8.2)
railties (>= 3.0.0)
has_scope (0.7.1)
actionpack (>= 4.1, < 5.2)
activesupport (>= 4.1, < 5.2)
......@@ -108,6 +113,7 @@ PLATFORMS
DEPENDENCIES
bundler (~> 1.16)
factory_bot_rails
rake (~> 10.0)
rspec
simple_controller!
......
......@@ -9,7 +9,7 @@ class SimpleControllerGenerator < Rails::Generators::NamedBase
class_option 'no-swagger', type: :boolean, desc: "Do not generate swagger spec file"
def setup
@routes = RSpec::Rails::Swagger::RouteParser.new(controller_path).routes
@routes = RSpec::Rails::Swagger::RouteParser.new(controller_path.sub(/^\//, '')).routes
end
def create_controller_files
......
......@@ -38,4 +38,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", "~> 1.16"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec"
spec.add_development_dependency "factory_bot_rails"
end
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