devise_sms_verifiable 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 3a330b82a0937df459478f753c1839589e05f4a3
4
- data.tar.gz: 843d5b2d3bcae3d0e77e290a91843b432e159d94
3
+ metadata.gz: 59c8562b238bec5ca2c4ccdbe6c480591281afef
4
+ data.tar.gz: ce56a5d722fa4ecbef2ac14d437cc76365c95640
5
5
  SHA512:
6
- metadata.gz: ce11300c143a21526927fe6744cf9d14beff1a1400ad4adc6af1a88234489f1fd1c1eb551986964edd618731b6843754efb3e5804d07cc31e5cb81829aed57b7
7
- data.tar.gz: 3dd04e8fa13faa8b9fce2e9a0248c0958b7079a4a6157ec81c4805238efab0ae83e73e34a907ff21c02ad6733376ec64bb2d298dd5ceda29205bf2c682dfc4c0
6
+ metadata.gz: 863560c35a3d532ec6ecdb842b7798027565b121de67463784e4b01e4cf29ce55b2783916e8d90f52332c68862c5203b8967e60deaa78717440a2e26081445e0
7
+ data.tar.gz: 672e43fc2867688e4fcb01c9cf70077c59930c8d21a3a62171be3b495538d521ddbae290b2746a1e0ca5c24dc38555cbda88b06594a14674fae1baccb183bb0e
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2014 YOURNAME
1
+ Copyright 2014 Kiselenko Roman
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -1,49 +1,83 @@
1
1
  = DeviseSmsVerifiable
2
2
 
3
- ===============================================================================
3
+ If the devise is installed, run the generator to add configuration settings:
4
+
5
+ rails generate devise_sms_verifiable:install
6
+
7
+ If devise not installed, run before generator:
8
+
9
+ rails generate devise:install
10
+
11
+ For generate views run:
12
+
13
+ rails generate devise_sms_verifiable:views
4
14
 
5
- Some setup you must do manually if you haven't yet(in config/initializers/devise.rb):
6
15
 
7
- 1. You need field in model for confirm phone(must be boolean).
16
+ Add sms_verifiable to model:
8
17
 
9
- config.phone_confirmation_field = :phone_confirm
18
+ class User < ActiveRecord::Base
19
+ # Include default devise modules. Others available are:
20
+ # :confirmable, :lockable, :timeoutable and :omniauthable
21
+ devise :database_authenticatable, :registerable,
22
+ :validatable,
23
+ :sms_verifiable,
24
+ :recoverable
25
+ end
10
26
 
11
- 2.You need define method for check sms confirmation. (in ApplicationController)
27
+ Define 2 methods in ApplicationController
12
28
 
13
- config.sms_confirmation_method = :sms_confirmation?
29
+ class ApplicationController < ActionController::Base
30
+ # Method for check need confirmation or no
31
+ def sms_confirmation?
32
+ return true if current_user && !current_user.phone_confirm? && current_user.phone
33
+ end
14
34
 
15
- 3. Need a method that generates, writes the word model, returns the secret word. (in ApplicationController)
35
+ # Method generate secret write to model and return secret
36
+ def sms_secret
37
+ answer = (10..48).to_a.shuffle.take(4).join
38
+ current_user.update(sms_answer: answer)
39
+ answer
40
+ end
41
+ end
16
42
 
17
- config.sms_secret_method = :sms_secret
43
+ Add field to model.
18
44
 
19
- 4. Field in the model which returns the correct answer
45
+ class AddFieldToUsers < ActiveRecord::Migration
46
+ def change
47
+ # Field in the model which phone number
48
+ add_column :users, :phone, :string
49
+ # Field in the model which returns the correct answer
50
+ add_column :users, :sms_answer, :string
51
+ # Field in the model which returns phone confirm or no
52
+ add_column :users, :phone_confirm, :boolean, default: false
53
+ end
54
+ end
20
55
 
21
- config.sms_answer_field = :sms_answer
22
56
 
23
- 6. Field in model which phone number
57
+ = Available options
24
58
 
25
- config.phone_field = :phone
59
+ phone_confirmation_field = :phone_confirm
26
60
 
27
- 5. SMS provider module(have default for STREAM-TELECOM) you can define own
28
- Provider module should be a method :send_sms
61
+ sms_confirmation_method = :sms_confirmation?
29
62
 
30
- config.sms_provider = DeviseSmsVerifiable::Provider
63
+ sms_secret_method = :sms_secret
31
64
 
32
- 7. Send sms silent for test
65
+ sms_answer_field = :sms_answer
33
66
 
34
- config.provider_silent = true
67
+ phone_field = :phone
35
68
 
36
- 8. SMS provider login
69
+ SMS provider module(have default for STREAM-TELECOM) you can define own
70
+ Provider module should be a method :send_sms
37
71
 
38
- config.provider_login = :provider_login
72
+ sms_provider = DeviseSmsVerifiable::Provider
39
73
 
40
- 9. SMS provider password
74
+ provider_silent = true
41
75
 
42
- config.provider_password :provider_password
76
+ provider_login = :provider_login
43
77
 
44
- 10. SMS provider from
78
+ provider_password :provider_password
45
79
 
46
- config.provider_from :provider_from
80
+ provider_from :provider_from
47
81
 
48
82
  ===============================================================================
49
83
 
@@ -1,3 +1,3 @@
1
1
  module DeviseSmsVerifiable
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_sms_verifiable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kiselenko Roman
@@ -14,126 +14,126 @@ dependencies:
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.0.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.0.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: devise
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rest_client
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec-rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: capybara
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: factory_girl_rails
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: ffaker
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: pry
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: sqlite3
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  description: |2
@@ -145,12 +145,8 @@ executables: []
145
145
  extensions: []
146
146
  extra_rdoc_files: []
147
147
  files:
148
- - MIT-LICENSE
149
- - README.rdoc
150
- - Rakefile
151
148
  - app/controllers/devise/sms_verifiable_controller.rb
152
149
  - app/views/devise/sms_verifiable/new.html.erb
153
- - lib/devise_sms_verifiable.rb
154
150
  - lib/devise_sms_verifiable/controllers/internal_helpers.rb
155
151
  - lib/devise_sms_verifiable/controllers/url_helpers.rb
156
152
  - lib/devise_sms_verifiable/engine.rb
@@ -159,10 +155,14 @@ files:
159
155
  - lib/devise_sms_verifiable/provider.rb
160
156
  - lib/devise_sms_verifiable/routes.rb
161
157
  - lib/devise_sms_verifiable/version.rb
158
+ - lib/devise_sms_verifiable.rb
162
159
  - lib/generators/devise_sms_verifiable/devise_sms_verifiable_generator.rb
163
160
  - lib/generators/devise_sms_verifiable/install_generator.rb
164
161
  - lib/generators/devise_sms_verifiable/templates/README
165
162
  - lib/generators/devise_sms_verifiable/views_generator.rb
163
+ - MIT-LICENSE
164
+ - Rakefile
165
+ - README.rdoc
166
166
  homepage: https://github.com/fishbullet/devise_sms_verifiable
167
167
  licenses: []
168
168
  metadata: {}
@@ -172,18 +172,19 @@ require_paths:
172
172
  - lib
173
173
  required_ruby_version: !ruby/object:Gem::Requirement
174
174
  requirements:
175
- - - ">="
175
+ - - '>='
176
176
  - !ruby/object:Gem::Version
177
177
  version: '0'
178
178
  required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  requirements:
180
- - - ">="
180
+ - - '>='
181
181
  - !ruby/object:Gem::Version
182
182
  version: '0'
183
183
  requirements: []
184
184
  rubyforge_project:
185
- rubygems_version: 2.2.2
185
+ rubygems_version: 2.1.11
186
186
  signing_key:
187
187
  specification_version: 4
188
188
  summary: DeviseSmsVerifiable it is simple fork devise_sms_activable for my project`s
189
189
  test_files: []
190
+ has_rdoc: