rename 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1639c5917067e70fac97db3b66637cf571f13be880d3237d522aa3ddbe217f26
4
- data.tar.gz: 567d8ee3c28f6cd9db39e71a410f6669da4b2ca545c00e7d6f8800106790e2df
3
+ metadata.gz: cd9bfc9678104ffa45d1ed46dd77175ec9477dd8ac9d78e2b311312821e93e7c
4
+ data.tar.gz: 928bd83c721e29792092910a6f40b34215c43a1a7750be1eaf4e39a753a7de42
5
5
  SHA512:
6
- metadata.gz: a889d0c18954dc474161dbcdc75f6c4926834f52517b97f9463eed48e96d12fb96ff3bddb2fc8c212a37cde26764a56823500a5137925c6a9ce69cf526843dac
7
- data.tar.gz: a2350d8b99ed51207029c693dc5f42aa6de66e036facd69355efae190c0848dbad0ff262e99aaa4bd173cc2d69f82ee5499745a347858e05d17cda37c0a7c243
6
+ metadata.gz: 4cdb1e940a996bf0eddf75eaf12bad8542e2af9ced9f468761c72f8ec11dca3dc56b459b99074cb96b9f573df5384e223928a504d15e66db8e202d2810022efa
7
+ data.tar.gz: 892261fd19eb9228bd0f945c8c2ab035ac7842a20356334df1a6d20c3dc321b507e916e9474aeee90af6c3ddce06ae81c9512542d655071f4320f2baa1ae89c1
@@ -29,6 +29,7 @@ module CommonMethods
29
29
  def prepare_app_vars
30
30
  @new_key = new_name.gsub(/\W/, '_')
31
31
  @old_module_name = app_parent
32
+ @old_dir = File.basename(Dir.getwd)
32
33
  @new_module_name = @new_key.squeeze('_').camelize
33
34
  @new_dir = new_name.gsub(/[&%*@()!{}\[\]'\\\/"]+/, '')
34
35
  @new_path = Rails.root.to_s.split('/')[0...-1].push(@new_dir).join('/')
@@ -87,6 +88,7 @@ module CommonMethods
87
88
  # rename_app_to_new_app_directory
88
89
  def change_app_directory
89
90
  rename_references
91
+ remove_references
90
92
  rename_directory
91
93
  end
92
94
 
@@ -101,17 +103,23 @@ module CommonMethods
101
103
  end
102
104
 
103
105
  def rename_references
104
- puts 'Renaming references...'
105
- old_basename = File.basename(Dir.getwd)
106
+ print 'Renaming references...'
106
107
 
107
108
  in_root do
108
- Dir.glob('.idea/*', File::FNM_DOTMATCH).each do |file|
109
- replace_into_file(file, old_basename, @new_dir)
110
- end
111
-
112
109
  gem_set_file = '.ruby-gemset'
113
- replace_into_file(gem_set_file, old_basename, @new_dir) if file_exist?(gem_set_file)
110
+ replace_into_file(gem_set_file, @old_dir, @new_dir) if file_exist?(gem_set_file)
111
+ end
112
+ puts 'Done!'
113
+ end
114
+
115
+ def remove_references
116
+ print 'Removing references...'
117
+
118
+ begin
119
+ FileUtils.rm_r('.idea')
120
+ rescue Exception => ex
114
121
  end
122
+ puts 'Done!'
115
123
  end
116
124
 
117
125
  def rename_directory
@@ -1,3 +1,3 @@
1
1
  module Rename
2
- VERSION = '1.0.10'
2
+ VERSION = '1.0.11'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rename
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morshed Alam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-08 00:00:00.000000000 Z
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails