model_renamer 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +3 -3
- data/lib/model_renamer.rb +3 -3
- data/lib/model_renamer/{model_renamer.rb → rename.rb} +1 -1
- data/lib/model_renamer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 069e190d21b194a2d63b4e44b4bfac8d92e89aad
|
4
|
+
data.tar.gz: 9659a495baa7263643627c67551be29f3560e5e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 972da3171b8c765a22f35e6f4b34fe5c0da0fa454cb99f6630180d9e412ba4f869839fe790094513374d50d3b3e62153f8fdd0258071efd38205ebe32fe4bf01
|
7
|
+
data.tar.gz: ab59bae56dfdbf465f82490526b9520ed3172145c2b679f2eff828a039e0594bc24ca12229e2c14a344b4e0d0b94dfe6a528a3c837884f3d3d93e7f493c546e4
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -23,17 +23,17 @@ Or install it yourself as:
|
|
23
23
|
Run rails console and use the following command:
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
|
26
|
+
Rename.new("OldName", "NewName").rename_and_generate_migrations
|
27
27
|
```
|
28
28
|
|
29
29
|
This will rename everything in the codebase as well as generate the migrations. If you only want to rename in the codebase, run:
|
30
30
|
|
31
31
|
```ruby
|
32
|
-
|
32
|
+
Rename.new("OldName", "NewName").rename
|
33
33
|
```
|
34
34
|
|
35
35
|
To only generate migrations, you guessed it:
|
36
36
|
|
37
37
|
```ruby
|
38
|
-
|
38
|
+
Rename.new("OldName", "NewName").generate_migrations
|
39
39
|
```
|
data/lib/model_renamer.rb
CHANGED
@@ -8,9 +8,9 @@ require 'active_support'
|
|
8
8
|
require 'active_support/inflector'
|
9
9
|
require 'active_record'
|
10
10
|
require 'rails/generators'
|
11
|
-
require 'model_renamer/migration_generator
|
12
|
-
require 'model_renamer/variations_generator
|
13
|
-
require 'model_renamer/
|
11
|
+
require 'model_renamer/migration_generator'
|
12
|
+
require 'model_renamer/variations_generator'
|
13
|
+
require 'model_renamer/rename'
|
14
14
|
|
15
15
|
|
16
16
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# Uses VariationsGenerator output to first change all the occurences of the model name in the files,
|
3
3
|
# then to create new directories and rename files. Then uses MigrationGenerator to create a migration
|
4
4
|
#
|
5
|
-
class
|
5
|
+
class Rename
|
6
6
|
|
7
7
|
def initialize old_name, new_name
|
8
8
|
@variations_generator = VariationsGenerator.new(old_name, new_name)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: model_renamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Gut
|
@@ -52,7 +52,7 @@ files:
|
|
52
52
|
- README.md
|
53
53
|
- lib/model_renamer.rb
|
54
54
|
- lib/model_renamer/migration_generator.rb
|
55
|
-
- lib/model_renamer/
|
55
|
+
- lib/model_renamer/rename.rb
|
56
56
|
- lib/model_renamer/variations_generator.rb
|
57
57
|
- lib/model_renamer/version.rb
|
58
58
|
- model_renamer.gemspec
|