# Generated from mblox-0.6.2.gem by gem2rpm -*- rpm-spec -*- %global gem_name mblox Name: rubygem-%{gem_name} Version: 0.6.2 Release: 1%{?dist} Summary: # Mblox This gem is for subscribers to Mblox to send SMS messages. ## Installation Add this line to your application's Gemfile: gem 'mblox' And then execute: $ bundle Or install it yourself as: $ gem install mblox ## Usage Configuration Mblox.configure do |config| # Set all of these values, provided to you in your Mblox subscription config.outbound_url = ... config.profile_id = ... config.sender_id = ... config.password = ... config.partner_name = ... config.tariff = ... config.service_id = ... end # You can also configure some logging options via SmsValidation, a dependency of this gem. See https://github.com/betesh/sms_validation/blob/master/README.md for details SmsValidation.configure do |config| # In a Rails environment, config.logger will default to Rails.logger and config.log_at will default to :debug # config.log_at means the level at which Mblox will log. # For instance, if config.log_at == :debug, Mblox will log only if the logger's log level is :debug # Note that if config.log_at == :debug and your logger's log level is :info, # logging will be suppressed because it is below the log level of the logger. config.logger = Logger.new(STDOUT) config.log_at :info # What to do if messages are longer than 160 characters. Default is :raise_error # Other options are :truncate and :split config.on_message_too_long = :truncate end Once your application is configured, send messages: # The number to sending to must be a 10-digit number, including the area code. Can be a String or Fixnum. phone_number = 2225555555 # or: phone_number = "2225555555" responses = Mblox::Sms.new(phone_number, "your message").send # Returns an array of `Mblox::SmsResponse`'s responses.first.should be_ok # each Mblox::SmsResponse responds to #ok? and #unroutable? ## Testing Copy config.yml.example to config.yml and set all the values in that file. Run: rspec You should recieve 6 SMS messages to your phone within several seconds. ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request License: MIT URL: https://github.com/betesh/mblox/ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby # BuildRequires: rubygem(rspec) >= 3.0 # BuildRequires: rubygem(rspec) < 4 BuildArch: noarch %description Send SMS messages. %package doc Summary: Documentation for %{name} Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version} %build # Create the gem as gem install only works on a gem file gem build ../%{gem_name}-%{version}.gemspec # %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir # by default, so that we can move it into the buildroot in %%install %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ %check pushd .%{gem_instdir} # rspec spec popd %files %dir %{gem_instdir} %exclude %{gem_instdir}/.gitignore %license %{gem_instdir}/LICENSE.txt %{gem_instdir}/config.yml.example %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %exclude %{gem_instdir}/.rspec %doc %{gem_instdir}/CHANGELOG.md %{gem_instdir}/Gemfile %doc %{gem_instdir}/README.md %{gem_instdir}/Rakefile %{gem_instdir}/mblox.gemspec %{gem_instdir}/spec %changelog * Tue Sep 14 2021 mockbuilder - 0.6.2-1 - Initial package