Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Phonofy is a Ruby gem that simplifies phone number formatting in Rails applications using the Phonelib library. With Phonofy, you can easily parse and format phone number data according to international standards, ensuring that your phone number data is consistent and valid across your application.
Add this line to your application's Gemfile:
gem 'phonofy'
And then execute:
bundle
Or install it yourself as:
gem install phonofy
To use phonofy, simply call the phonofy method in your Rails model:
class User < ApplicationRecord
phonofy
end
This will add phone number validation and formatting to the phone_number attribute of the Driver model.
You can also specify a custom attribute name for the phone number:
class Contact < ApplicationRecord
phonofy :mobile_number
end
This will add phone number validation and formatting to the mobile_number attribute of the Contact model.
You can also pass additional options to phonofy to customize its behavior:
class User < ApplicationRecord
phonofy :phone, phonelib: { countries: [:us, :ca], types: [:mobile] }
end
This will add phone number validation and formatting to the phone attribute of the User model, and restrict it to US and Canada mobile phone numbers.
You can configure phonofy by creating an initializer file in your Rails application and setting the default options:
# config/initializers/phonofy.rb
Phonofy.configure do |config|
config.default_phonelib_options = { countries: [:us, :ca], types: [:mobile] }
config.default_twilio_options = { lookup: { type: :carrier_type } }
end
This will set the default options for phonofy to validate only US and Canada mobile phone numbers using the Phonelib library, and perform a Twilio lookup to get carrier information for the phone number.
Bug reports and pull requests are welcome on GitHub at https://github.com/shqear93/phonofy. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
phonofy was created by Khaled AbuShqear and is maintained by a community of contributors.
FAQs
Unknown package
We found that phonofy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.