myrails 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +74 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/myrails +3 -0
- data/bin/setup +8 -0
- data/lib/myrails/templates/assets/animate.scss +3340 -0
- data/lib/myrails/templates/assets/application.css.sass +6 -0
- data/lib/myrails/templates/assets/application.js +10 -0
- data/lib/myrails/templates/assets/bootstrap_themes/cerulean.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/cosmo.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/cyborg.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/darkly.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/flatly.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/journal.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/lumen.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/paper.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/readable.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/sandstone.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/simplex.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/slate.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/spacelab.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/superhero.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/united.scss +11 -0
- data/lib/myrails/templates/assets/bootstrap_themes/yeti.scss +11 -0
- data/lib/myrails/templates/assets/will_paginate.scss +104 -0
- data/lib/myrails/templates/db/mysql_database.yml +55 -0
- data/lib/myrails/templates/db/sqlite3_database.yml +28 -0
- data/lib/myrails/templates/heroku/Procfile +1 -0
- data/lib/myrails/templates/heroku/puma.rb +15 -0
- data/lib/myrails/templates/layout/_error_messages.html.haml +6 -0
- data/lib/myrails/templates/layout/_info_messages.html.haml +9 -0
- data/lib/myrails/templates/layout/_nav.html.haml +24 -0
- data/lib/myrails/templates/layout/_success_message.html.haml +3 -0
- data/lib/myrails/templates/layout/application.html.haml +14 -0
- data/lib/myrails/templates/layout/footers/css/footer-distributed-with-address-and-phones.scss +168 -0
- data/lib/myrails/templates/layout/footers/css/footer-distributed-with-contact-form.scss +200 -0
- data/lib/myrails/templates/layout/footers/css/footer-distributed-with-search.scss +140 -0
- data/lib/myrails/templates/layout/footers/css/footer-distributed.scss +74 -0
- data/lib/myrails/templates/layout/footers/footer-distributed-with-address-and-phones.html.haml +45 -0
- data/lib/myrails/templates/layout/footers/footer-distributed-with-contact-form.html.haml +33 -0
- data/lib/myrails/templates/layout/footers/footer-distributed-with-search.html.haml +19 -0
- data/lib/myrails/templates/layout/footers/footer-distributed.html.haml +24 -0
- data/lib/myrails/templates/mailer/dev_mail_interceptor.rb +27 -0
- data/lib/myrails/templates/mailer/sendgrid.rb +8 -0
- data/lib/myrails/templates/presenters/base.rb +33 -0
- data/lib/myrails/templates/presenters/presenter.rb +19 -0
- data/lib/myrails/templates/presenters/presenter_config.rb +4 -0
- data/lib/myrails/templates/presenters/presenter_spec.rb +17 -0
- data/lib/myrails/templates/rails/application_helper.rb +49 -0
- data/lib/myrails/templates/rails/controller.rb +12 -0
- data/lib/myrails/templates/rails/model.rb +2 -0
- data/lib/myrails/templates/rails/pundit.rb +26 -0
- data/lib/myrails/templates/rspec/controller.rb +98 -0
- data/lib/myrails/templates/rspec/database_cleaner.rb +18 -0
- data/lib/myrails/templates/rspec/devise.rb +38 -0
- data/lib/myrails/templates/rspec/factory.rb +5 -0
- data/lib/myrails/templates/rspec/factory_girl.rb +3 -0
- data/lib/myrails/templates/rspec/files.rb +3 -0
- data/lib/myrails/templates/rspec/javascript.rb +8 -0
- data/lib/myrails/templates/rspec/mailer.rb +7 -0
- data/lib/myrails/templates/rspec/model.rb +5 -0
- data/lib/myrails/templates/rspec/pundit.rb +28 -0
- data/lib/myrails/templates/rspec/pundit_matchers.rb +47 -0
- data/lib/myrails/templates/rspec/router.rb +7 -0
- data/lib/myrails/templates/rspec/shoulda_matchers.rb +16 -0
- data/lib/myrails/templates/rspec/silence_backtrace.rb +8 -0
- data/lib/myrails/templates/ui/index.html.haml +6 -0
- data/lib/myrails/templates/ui/ui_controller.rb +8 -0
- data/lib/myrails/version.rb +3 -0
- data/lib/myrails.rb +399 -0
- data/myrails.gemspec +37 -0
- data/spec/controllers/sam_controller_spec.rb +98 -0
- data/spec/myrails_spec.rb +11 -0
- data/spec/spec_helper.rb +2 -0
- metadata +197 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6a75716489e25fc8d363cf663ace31f4dd3bcc25
|
4
|
+
data.tar.gz: c8caefbe155aa0124c61f7714a5ed1425de8de79
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ddf82e17a0fcca19859b348c1acf6fc571e2773cd5d3a9987dd78dbd4b503ababcf95f08070ea69b036f90c2fc5efc21a22c532c658c8bc012d7ac0169076482
|
7
|
+
data.tar.gz: 3a60d7f8a67dd16f111552e267a81e4324df14dfa71edf78b2b65c580f594c71d9ee4be24e825e99d089fcb8b48ad3897aaccc6bc37570f85d59409280b00e16
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Vell
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Myrails
|
2
|
+
|
3
|
+
This gem was created to make generating rails related files and other rails gem files (that I use) a lot easier. It is a thor backed gem that was designed with rails 5 in mind but most of it "should" work with rails 4.
|
4
|
+
|
5
|
+
This gem is not endorsed by 37signals. I wrote it as a convenience for my style of development.
|
6
|
+
|
7
|
+
Here is an example of the gem in action:
|
8
|
+
|
9
|
+
For example, I use pundit. With this gem I am able to run the following:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
myrails policy --name=article
|
13
|
+
```
|
14
|
+
|
15
|
+
which outputs:
|
16
|
+
|
17
|
+
```
|
18
|
+
create app/policies/article_policy.rb
|
19
|
+
create spec/policies/article_policy_spec.rb
|
20
|
+
```
|
21
|
+
|
22
|
+
with corresponding files:
|
23
|
+
|
24
|
+
```
|
25
|
+
.
|
26
|
+
├── app
|
27
|
+
│ └── policies
|
28
|
+
│ └── article_policy.rb
|
29
|
+
|
30
|
+
└── spec
|
31
|
+
└── policies
|
32
|
+
└── article_policy_spec.rb
|
33
|
+
```
|
34
|
+
|
35
|
+
|
36
|
+
## Installation
|
37
|
+
|
38
|
+
In your terminal:
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
gem install myrails
|
42
|
+
```
|
43
|
+
|
44
|
+
## Usage
|
45
|
+
|
46
|
+
simple type `myrails` to see the help menu
|
47
|
+
|
48
|
+
```
|
49
|
+
# Example for generating a presenter class
|
50
|
+
myrails presenter --name=post
|
51
|
+
```
|
52
|
+
This generates a PostPresenter class in app/presenters that inherites from app/presenters/base_presenter.rb to be used in views. This also generates a spec/presenters/post_presenter_spec.rb file for testing.
|
53
|
+
|
54
|
+
## Development
|
55
|
+
|
56
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
57
|
+
|
58
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version,
|
59
|
+
* update the version number in `version.rb`
|
60
|
+
* tag the the code `git tag v1.0.0`
|
61
|
+
* puts the tag `git push --tags`
|
62
|
+
* then run `bundle exec rake build`
|
63
|
+
* `gem push pkg/myrails-verion`
|
64
|
+
|
65
|
+
Which will push the `.gem` file to [rubygems.org](https://rubygems.org).
|
66
|
+
|
67
|
+
## Contributing
|
68
|
+
|
69
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/vmcilwain/myrails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
70
|
+
|
71
|
+
|
72
|
+
## License
|
73
|
+
|
74
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "myrails"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/myrails
ADDED