twilio_phone_verification 0.1.14 → 0.1.15

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 530804eca93a9fa91559e7f8d50cbdcc051f2594
4
- data.tar.gz: 49515a2e50d70aac1e4a14987ec38080e4da78e0
3
+ metadata.gz: 86123ac07f7b5af99b0f01b1750fb7356ea714d5
4
+ data.tar.gz: 2067898a62be13e827384fccf545300e35d9e847
5
5
  SHA512:
6
- metadata.gz: a37f43f1d5d8b3aa06d4967ec57f728f3220946a11c1e73bfeaf4b5481266fc2379cda372e673455b43feea5e73c16ce136883969c70b188f42f01e588e2e7f6
7
- data.tar.gz: 1d1f5ddbd1eb1609bb33b69952f32531158ef1bfaf57cb5380eae9881dd79e1fe20dadd833e0149b4136a743fc3efad791b8f679afd2f456c97ffc262ed5045d
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 ConfigGenerator < Rails::Generators::Base
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/twilio_phone_verifications.rb'
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
@@ -1,3 +1,3 @@
1
1
  module TwilioPhoneVerification
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.15"
3
3
  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.14
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