old_sql 0.15.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,11 +14,7 @@ Old SQL works with devise. Checking for a current installation of devise!
14
14
  app_path.delete_at(-1)
15
15
  app_path = app_path.join("/")
16
16
 
17
- gsub_file app_path+'/db/schema.rb', /users/, :green do |match|
18
- puts "User model exists"
19
- end
20
-
21
- puts "User model at #{app_path+'/app/models/user.rb'} exists? #{File.exists?(app_path+'/app/models/user.rb')}"
17
+ puts "User model exists" unless open(app_path+'/db/schema.rb').grep(/users/).count<=0
22
18
 
23
19
  if defined?(Devise)
24
20
  check_for_devise_models
@@ -61,28 +57,23 @@ Old SQL works with devise. Checking for a current installation of devise!
61
57
  app_path.delete_at(-1)
62
58
  app_path = app_path.join("/")
63
59
 
64
- user_found = false
65
-
66
- gsub_file app_path+'/db/schema.rb', /users/, :green do |match|
67
- puts "User model exists"
68
- user_found = true
60
+ if open(app_path+'/db/schema.rb').grep(/users/).count<=0
61
+ return true
62
+ else
63
+ return false
69
64
  end
70
-
71
- user_found
72
65
  end
73
66
 
74
67
  def user_model_has_devise?
75
- devise_found = false
76
-
77
68
  app_path = Rails.public_path.split("/")
78
69
  app_path.delete_at(-1)
79
70
  app_path = app_path.join("/")
80
71
 
81
- gsub_file app_path+'/app/models/user.rb', /devise/, :green do |match|
82
- puts "User model already has devise"
83
- devise_found = true
72
+ if open(app_path+'/app/models/user.rb').grep(/devise/).count<=0
73
+ return true
74
+ else
75
+ return false
84
76
  end
85
- devise_found
86
77
  end
87
78
 
88
79
  def parse_route_files
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: old_sql
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.15.0
5
+ version: 0.16.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Eddie Gonzales
@@ -191,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
- hash: -142209455033418591
194
+ hash: -235958455247447896
195
195
  segments:
196
196
  - 0
197
197
  version: "0"