simple_login 0.0.5 → 0.0.6

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.
@@ -3,6 +3,7 @@ module SimpleLogin
3
3
  class SimpleLoginGenerator < Rails::Generators::Base
4
4
  source_root File.expand_path('../templates', __FILE__)
5
5
 
6
+
6
7
  def generate_user
7
8
  # Copy the controllers for user, sessions and password_reset
8
9
  directory "controllers", "app/controllers/"
@@ -25,26 +26,21 @@ module SimpleLogin
25
26
  end
26
27
 
27
28
  def insert_routes
28
- insert_into_file "config/routes.rb", after: "Application.routes.draw do" do
29
- a = "\n\nmatch 'signup', to: 'users#new', as: 'signup'\n"
30
- b = "match 'login', to: 'sessions#new', as: 'login'\n"
31
- c = "match 'logout', to: 'sessions#destroy', as: 'logout'\n"
32
- d = "resources :users\n"
33
- e = "resources :sessions\n"
34
- f = "resources :password_resets\n"
35
- a+b+c+d+e+f
36
- end
29
+ route("match 'signup', to: 'users#new', as: 'signup'")
30
+ route("match 'login', to: 'sessions#new', as: 'login'")
31
+ route("match 'logout', to: 'sessions#destroy', as: 'logout'")
32
+ route("resources :users")
33
+ route("resources :sessions")
34
+ route("resources :password_resets")
37
35
  end
38
36
 
39
- def add_gems
40
- insert_into_file "Gemfile", after: "gem 'jquery-rails'" do
41
- a = "\n\ngem 'bcrypt-ruby', '~> 3.0.0'"
42
- a
43
- end
37
+ def create_user
38
+ generate("model", "users email:string password_digest:string auth_token:string password_reset_token:string password_reset_sent_at:datetime")
39
+ rake("db:migrate")
44
40
  end
45
41
 
46
- def create_migration_user
47
- copy_file "create_users.rb", "db/migrate/00_create_users.rb"
42
+ def add_gems
43
+ gem("bcrypt-ruby")
48
44
  end
49
45
 
50
46
 
@@ -1,3 +1,3 @@
1
1
  module SimpleLogin
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_login
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: