Commit ba5b1e76 by ivan Lan

Fix the target path for factory files in controller generator

parent 66bbe9ce
......@@ -21,12 +21,12 @@ Or install it yourself as:
$ gem install shotengai
## Rails Generators
# Migration Generator
### Migration Generator
```shell
$ rails g shotengai:migrations
```
# Model Generator:
### Model Generator:
```ruby
# options:
# --product custom your own product class
......@@ -43,7 +43,7 @@ For example:
create app/models/my_order.rb
create app/models/my_catalog.rb
# Controller & Routes Generator:
### Controller & Routes Generator:
```ruby
# attr:
# role ( merchant | customer )
......@@ -66,18 +66,12 @@ This will create serveral controller classes inherited from merchant product and
content...
end
# Views Generator:
### Views Generator:
```shell
$ rails g shotengai:views -f
```
This will copy shotengai example views to your application under 'app/views/shotengai/'.
# Spec Generator:
```shell
$ rails g shotengai:spec --customer User --merchant Merchant --product MyProduct --order Myorder
```
This will create all request swagger spec & factory files to your application under 'app/spec/shotengai/'.
## Development
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
......
......@@ -57,7 +57,6 @@ module Shotengai
end
create_routes
create_factory
create_request_spec
end
......@@ -67,7 +66,7 @@ module Shotengai
def create_factory
Dir["#{self.class.source_root}/../spec/factories/*.rb"].each do |path|
template path, "spec/shotengai/#{path.match(/(.*)\/spec\/(.*)/)[2]}"
template path, "spec/#{path.match(/(.*)\/spec\/(.*)/)[2]}"
end
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