twilio_phone_verification 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/twilio_phone_verification/add_phone_to_users.rb.erb +16 -0
- data/lib/generators/twilio_phone_verification/config_generator.rb +2 -2
- data/lib/generators/twilio_phone_verification/install_generator.rb +25 -0
- data/lib/twilio_phone_verification/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86123ac07f7b5af99b0f01b1750fb7356ea714d5
|
4
|
+
data.tar.gz: 2067898a62be13e827384fccf545300e35d9e847
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c11505a9506e843c8e6c24d0eabc7a18e6346e25b256df391c91e993f98e4f86521d287990ff1fd4909ef828da5de55638123a2315a0533a1f862eea1544540
|
7
|
+
data.tar.gz: 179387eafcc442399eac718c03b2649b845c28eb85d8d45197991e0b8e09dd49ddb5b50fdf52e3531d9dca75c674ddbe86c76a3e119ef16e6131c45ed59c22a4
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class AddPhoneTo<%= user_class.pluralize %> < ActiveRecord::Migration[5.0]
|
2
|
+
def self.up
|
3
|
+
add_column :<%= user_class.pluralize.underscore %>, :phone, :string
|
4
|
+
add_column :<%= user_class.pluralize.underscore %>, :phone_confirmation_token, :string
|
5
|
+
add_column :<%= user_class.pluralize.underscore %>, :phone_confirmed_at, :datetime
|
6
|
+
add_column :<%= user_class.pluralize.underscore %>, :phone_confirmation_sent_at, :datetime
|
7
|
+
add_index :<%= user_class.pluralize.underscore %>, :phone, unique: true
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.down
|
11
|
+
remove_column :<%= user_class.pluralize.underscore %>, :phone
|
12
|
+
remove_column :<%= user_class.pluralize.underscore %>, :phone_confirmation_token
|
13
|
+
remove_column :<%= user_class.pluralize.underscore %>, :phone_confirmed_at
|
14
|
+
remove_column :<%= user_class.pluralize.underscore %>, :phone_confirmation_sent_at
|
15
|
+
end
|
16
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "rails/generators/base"
|
2
2
|
module TwilioPhoneVerification
|
3
3
|
module Generators
|
4
|
-
class
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
5
|
source_root(File.expand_path(File.dirname(__FILE__)))
|
6
6
|
def copy_initializer
|
7
|
-
copy_file 'templates/twilio_phone_verification.rb', 'config/initializers/
|
7
|
+
copy_file 'templates/twilio_phone_verification.rb', 'config/initializers/twilio_phone_verification.rb'
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "rails/generators/base"
|
2
|
+
module TwilioPhoneVerification
|
3
|
+
module Generators
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path('../templates', __FILE__)
|
6
|
+
|
7
|
+
argument :user_class, type: :string, default: "User"
|
8
|
+
|
9
|
+
def copy_initializer
|
10
|
+
copy_file 'twilio_phone_verification.rb', 'config/initializers/twilio_phone_verification.rb'
|
11
|
+
end
|
12
|
+
|
13
|
+
def copy_migrations
|
14
|
+
if self.class.migration_exists?("db/migrate", "add_phone_to_#{ user_class.underscore }")
|
15
|
+
say_status("skipped", "Migration 'add_phone_to_#{ user_class.underscore }' already exists")
|
16
|
+
else
|
17
|
+
migration_template(
|
18
|
+
"add_phone_to_users.rb.erb",
|
19
|
+
"db/migrate/add_phone_to_#{ user_class.underscore }.rb"
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio_phone_verification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vishgleb@mail.ru
|
@@ -82,7 +82,9 @@ files:
|
|
82
82
|
- Rakefile
|
83
83
|
- bin/console
|
84
84
|
- bin/setup
|
85
|
+
- lib/generators/twilio_phone_verification/add_phone_to_users.rb.erb
|
85
86
|
- lib/generators/twilio_phone_verification/config_generator.rb
|
87
|
+
- lib/generators/twilio_phone_verification/install_generator.rb
|
86
88
|
- lib/generators/twilio_phone_verification/templates/twilio_phone_verification.rb
|
87
89
|
- lib/twilio_phone_verification.rb
|
88
90
|
- lib/twilio_phone_verification/configuration.rb
|