model_renamer 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/README.md +3 -17
- data/lib/model_renamer.rb +2 -6
- data/lib/model_renamer/model_renamer_runner.rb +2 -1
- data/lib/model_renamer/version.rb +1 -1
- data/model_renamer.gemspec +4 -4
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1264cb5dea4b509ad96bd84a0f65b0f4fc811ae
|
4
|
+
data.tar.gz: 1143ce6e50660b5784778ee3d15c6854792ea312
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e254fc02698414ea7ff89df86773b3ddabf20e1d01570c0792c1006eaa7d2efb99d3e6de1b29b30eae0d05c319a39b4df2472586ea7b9340d04e2c5bada9f181
|
7
|
+
data.tar.gz: a3b6df001bdf0afa61b088a8a8b8b4cfe98a85b3d5237c0e7f8989e3774aba80a5329efe51cc9a6cac43749789795bf038e61cffb4a2275eb4e96358219a0a35
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# ModelRenamer
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
The model renamer gem allows you to rename any a model in your rails application. The gem looks for occurrences of any variation or pluralization of the old model name and changes it to the corresponding variation of the new name. It also generates database migrations that rename tables and foreign keys referencing the old name.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,18 +20,6 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
23
|
+
Simply type the following into the command line:
|
34
24
|
|
35
|
-
|
36
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
-
5. Create a new Pull Request
|
25
|
+
$ model_renamer OldName NewName
|
data/lib/model_renamer.rb
CHANGED
@@ -5,7 +5,9 @@ require "model_renamer/version"
|
|
5
5
|
require 'find'
|
6
6
|
require 'fileutils'
|
7
7
|
require 'active_support'
|
8
|
+
require 'active_support/inflector'
|
8
9
|
require 'active_record'
|
10
|
+
require 'rails/generators'
|
9
11
|
require 'model_renamer/migration_generator.rb'
|
10
12
|
require 'model_renamer/variations_generator.rb'
|
11
13
|
require 'model_renamer/model_renamer_runner.rb'
|
@@ -13,9 +15,3 @@ require 'model_renamer/model_renamer_runner.rb'
|
|
13
15
|
|
14
16
|
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
# ModelRenamer.new(ARGV[0], ARGV[1]).replace_and_generate_migration
|
21
|
-
|
@@ -10,7 +10,8 @@ class ModelRenamerRunner
|
|
10
10
|
|
11
11
|
def replace_and_generate_migration
|
12
12
|
replace_all_occurrences
|
13
|
-
|
13
|
+
# Taken out for initial release
|
14
|
+
# MigrationGenerator.new(@variations_generator.underscore_variations).create_migration_file
|
14
15
|
end
|
15
16
|
|
16
17
|
private
|
data/model_renamer.gemspec
CHANGED
@@ -8,8 +8,9 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = ModelRenamer::VERSION
|
9
9
|
spec.authors = ["Paul Gut"]
|
10
10
|
spec.email = ["pg@vts.com"]
|
11
|
-
|
12
|
-
spec.summary = "
|
11
|
+
spec.homepage = "https://rubygems.org/gems/model_renamer"
|
12
|
+
spec.summary = "Renames any model"
|
13
|
+
spec.description = "A gem that renames your ActiveRecord models and generates corresponding migrations"
|
13
14
|
spec.license = "MIT"
|
14
15
|
|
15
16
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
@@ -21,8 +22,7 @@ Gem::Specification.new do |spec|
|
|
21
22
|
end
|
22
23
|
|
23
24
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
-
spec.
|
25
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
|
+
spec.executables = ["model_renamer"]
|
26
26
|
spec.require_paths = ["lib"]
|
27
27
|
|
28
28
|
spec.add_development_dependency "bundler", "~> 1.9"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Gut
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,10 +38,12 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
description:
|
41
|
+
description: A gem that renames your ActiveRecord models and generates corresponding
|
42
|
+
migrations
|
42
43
|
email:
|
43
44
|
- pg@vts.com
|
44
|
-
executables:
|
45
|
+
executables:
|
46
|
+
- model_renamer
|
45
47
|
extensions: []
|
46
48
|
extra_rdoc_files: []
|
47
49
|
files:
|
@@ -56,7 +58,7 @@ files:
|
|
56
58
|
- lib/model_renamer/variations_generator.rb
|
57
59
|
- lib/model_renamer/version.rb
|
58
60
|
- model_renamer.gemspec
|
59
|
-
homepage:
|
61
|
+
homepage: https://rubygems.org/gems/model_renamer
|
60
62
|
licenses:
|
61
63
|
- MIT
|
62
64
|
metadata:
|
@@ -80,5 +82,5 @@ rubyforge_project:
|
|
80
82
|
rubygems_version: 2.2.2
|
81
83
|
signing_key:
|
82
84
|
specification_version: 4
|
83
|
-
summary:
|
85
|
+
summary: Renames any model
|
84
86
|
test_files: []
|