myrails 1.1.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/lib/myrails/templates/rails/model.rb +1 -1
- data/lib/myrails/templates/rails/namespace_model.rb +1 -1
- data/lib/myrails/version.rb +1 -1
- data/lib/myrails.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e8ae426601800f104ff9add6cde3b77f5fe57f1
|
4
|
+
data.tar.gz: 59bc8d8912a1d803aab43ae2c4e9054c7b9ae1e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3158f8c9346297f252f51dd33e0c010e982d6389dc32e6cf5409be53f9d1e874bbcfc8e4b377135453b24a65b729e5e67f5dc81bc63ec14323e1aeb5dd97bad
|
7
|
+
data.tar.gz: 5e887dc829d04a035d05e892c005f5f985603fec235b04d244575166feb420d2f4f177e8accce3207450c1fc567ae3255388b85d1c3e46cd7d15e9ef71a4d9df
|
data/README.md
CHANGED
@@ -5,12 +5,14 @@ This gem was created to make generating rails related files and other rails gem
|
|
5
5
|
This gem is not endorsed by 37signals. I wrote it as a convenience for generating files that I would otherwise have written by hand.
|
6
6
|
|
7
7
|
## Disclaimer
|
8
|
-
|
9
8
|
This gem is not compatible with ruby 2.3 (yet).
|
10
9
|
|
10
|
+
## Notes
|
11
|
+
Use 1.1.1 if you are primarily developing in rails 3 & 4
|
11
12
|
|
12
|
-
|
13
|
+
Use 2.x.x if are primarily developing in rails 5
|
13
14
|
|
15
|
+
## Examples
|
14
16
|
Here is an example of the gem in action:
|
15
17
|
|
16
18
|
For example, I use pundit. With this gem I am able to run the following:
|
@@ -45,7 +47,13 @@ with corresponding files:
|
|
45
47
|
In your terminal:
|
46
48
|
|
47
49
|
```ruby
|
48
|
-
|
50
|
+
# For development in rails 3 & 4 primarily
|
51
|
+
|
52
|
+
gem install myrails -v 1.1.1
|
53
|
+
|
54
|
+
# For development in rails 5 primarily
|
55
|
+
|
56
|
+
gem install myrails
|
49
57
|
```
|
50
58
|
|
51
59
|
## Usage
|
@@ -1,2 +1,2 @@
|
|
1
|
-
class <%= options[:name].camelize %> <
|
1
|
+
class <%= options[:name].camelize %> < ApplicationRecord
|
2
2
|
end
|
data/lib/myrails/version.rb
CHANGED
data/lib/myrails.rb
CHANGED
@@ -9,7 +9,7 @@ module Myrails
|
|
9
9
|
TEMPLATES = source_root
|
10
10
|
ENVIRONMENTS = %w(development test production)
|
11
11
|
|
12
|
-
desc 'model', 'Generates and empty rails model with the given name and its related spec file
|
12
|
+
desc 'model', 'Generates and empty rails model with the given name and its related spec file Use --namespace=namespace to create a namespaced model'
|
13
13
|
option :name, required: true
|
14
14
|
option :namespace
|
15
15
|
def model
|
@@ -22,7 +22,7 @@ module Myrails
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
desc 'controller', 'Generate a rails controller with the given name along with boiler plate code and related spec file. Add --namespace=NAME to create namespaced controller'
|
25
|
+
desc 'controller', 'Generate a rails controller with the given name along with boiler plate code and related spec file. Add --namespace=NAME to create a namespaced controller'
|
26
26
|
option :name, required: true
|
27
27
|
option :namespace
|
28
28
|
def controller
|
@@ -112,7 +112,7 @@ gem 'rspec-rails', group: :test
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
desc 'config_env', 'Add code to environment files. Host refers to url options. Name option
|
115
|
+
desc 'config_env', 'Add code to environment files. Host refers to url options. Name option referes to controller and mailer default_url_options'
|
116
116
|
option :name, required: true
|
117
117
|
def config_env
|
118
118
|
ENVIRONMENTS.each do |environment|
|