rename 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +4 -14
- data/lib/generators/rename/app_to/USAGE +1 -0
- data/lib/generators/rename/app_to/app_to_generator.rb +7 -1
- data/lib/rename/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Rename
|
2
2
|
|
3
|
-
This
|
3
|
+
This Gem allows you to rename a Rails3 application by using a single command.
|
4
4
|
|
5
5
|
|
6
6
|
## Installation
|
@@ -12,22 +12,12 @@ Add this line to your application's Gemfile:
|
|
12
12
|
|
13
13
|
## Usage
|
14
14
|
|
15
|
-
<pre><code>rails g rename:app_to NewName
|
16
|
-
|
17
|
-
That will rename your application's name in the following files:
|
18
|
-
<pre><code>Rakefile
|
19
|
-
config.ru
|
20
|
-
config/routes.rb
|
21
|
-
config/application.rb
|
22
|
-
config/environment.rb
|
23
|
-
config/environments/development.rb
|
24
|
-
config/environments/test.rb
|
25
|
-
config/environments/production.rb
|
26
|
-
initializers/secret_token.rb
|
27
|
-
initializers/session_store.rb
|
15
|
+
<pre><code>rails g rename:app_to NewName
|
16
|
+
rails g rename:app_to "New-Name"
|
28
17
|
</code></pre>
|
29
18
|
|
30
19
|
|
20
|
+
|
31
21
|
## Contributing
|
32
22
|
|
33
23
|
1. Fork it
|
@@ -0,0 +1 @@
|
|
1
|
+
rails g rename:app_to NewName
|
@@ -17,7 +17,7 @@ module Rename
|
|
17
17
|
|
18
18
|
private
|
19
19
|
def new_module_name(new_name)
|
20
|
-
search_exp = /(#{Regexp.escape("#{Rails.application.class.parent}")})/
|
20
|
+
search_exp = /(#{Regexp.escape("#{Rails.application.class.parent}")})/m
|
21
21
|
|
22
22
|
in_root do
|
23
23
|
#Search and replace in to root
|
@@ -30,6 +30,12 @@ module Rename
|
|
30
30
|
Dir["config/**/**/*.rb"].each do |file|
|
31
31
|
replace_module_in_file(file, search_exp, new_name)
|
32
32
|
end
|
33
|
+
|
34
|
+
#Rename session key
|
35
|
+
session_key_file = 'config/initializers/session_store.rb'
|
36
|
+
search_exp = /((\'|\")_.*_session(\'|\"))/i
|
37
|
+
session_key = "'_#{new_name.gsub(/[^0-9A-Za-z_]/, '_').downcase}_session'"
|
38
|
+
replace_module_in_file(session_key_file, search_exp, session_key)
|
33
39
|
end
|
34
40
|
end
|
35
41
|
|
data/lib/rename/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rename
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|