action_smser 3.1.2 → 3.3.0
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 +5 -5
 - data/README.md +2 -4
 - data/app/assets/config/manifest.js +1 -0
 - data/app/controllers/action_smser/delivery_reports_controller.rb +7 -7
 - data/app/models/action_smser/delivery_report.rb +1 -1
 - data/app/views/action_smser/delivery_reports/index.html.erb +3 -3
 - data/db/migrate/20120102215215_create_action_smser_delivery_reports.rb +1 -1
 - data/lib/action_smser/base.rb +1 -1
 - data/lib/action_smser/delivery_methods/delayed_job.rb +2 -2
 - data/lib/action_smser/version.rb +1 -1
 - data/test/action_smser_test.rb +2 -1
 - data/test/dummy/app/assets/config/manifest.js +1 -0
 - data/test/dummy/config/application.rb +0 -7
 - data/test/dummy/config/environments/test.rb +2 -6
 - data/test/dummy/config/initializers/assets.rb +12 -0
 - data/test/dummy/config/initializers/secret_token.rb +1 -1
 - data/test/dummy/log/test.log +21061 -0
 - data/test/functional/action_smser/delivery_reports_controller_test.rb +13 -10
 - data/test/integration/navigation_test.rb +1 -1
 - data/test/test_helper.rb +2 -1
 - data/test/unit/action_smser/base_test.rb +1 -1
 - data/test/unit/action_smser/delivery_methods/delayed_job_test.rb +2 -2
 - data/test/unit/action_smser/delivery_methods/nexmo_test.rb +1 -1
 - data/test/unit/action_smser/delivery_methods/simple_http_test.rb +1 -1
 - data/test/unit/action_smser/delivery_methods/smstrade_test.rb +2 -2
 - data/test/unit/action_smser/delivery_methods/test_array_test.rb +1 -1
 - data/test/unit/action_smser/delivery_report_test.rb +3 -3
 - metadata +78 -48
 - data/test/dummy/db/tes +0 -0
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 2 
     | 
    
         
            +
            SHA256:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 8f18ea3906e275b9c2d5fc2eb19fa78a7e695e5fdfd7b39aa64b87984bd47465
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: a349ea35043ee41f61a22c31d1d091d530c6c3c723aa2b250b0a5446185b3a99
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 499f96f282125e32dc96c3cab6826c991a55ba2622bac3c2c2e1c3677c1aa8b5c7aad0500ff0d99ef8ac865264c27abb7db937f51da39387a3c0a5a69192fb32
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 9339fb23635714dee481cd65ef087d7476e7a7975a7bb1caaa8017df7be63069660618a55fde797e126ccaa607b7f032288ff50276d578703dd3857e3943e716
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -3,8 +3,6 @@ 
     | 
|
| 
       3 
3 
     | 
    
         
             
            ActionSmser == SMS && ActionMailer. Simple way to use SMS (Short Message Service) in the same way as ActionMailer.
         
     | 
| 
       4 
4 
     | 
    
         
             
            Includes also delivery reports and easy way to add custom gateways. See examples below.
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
            [<img src="https://secure.travis-ci.org/holli/action_smser.png" />](http://travis-ci.org/holli/action_smser)
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
6 
     | 
    
         
             
            # Install
         
     | 
| 
       9 
7 
     | 
    
         | 
| 
       10 
8 
     | 
    
         | 
| 
         @@ -231,9 +229,9 @@ end 
     | 
|
| 
       231 
229 
     | 
    
         | 
| 
       232 
230 
     | 
    
         
             
            Submit suggestions or feature requests as a GitHub Issue or Pull Request. Remember to update tests. Tests are quite extensive.
         
     | 
| 
       233 
231 
     | 
    
         | 
| 
       234 
     | 
    
         
            -
            Check  
     | 
| 
      
 232 
     | 
    
         
            +
            Check github actions for what environments are supported: https://github.com/holli/action_smser/blob/master/.github/workflows/ci.yaml and
         
     | 
| 
      
 233 
     | 
    
         
            +
            https://github.com/holli/action_smser/actions
         
     | 
| 
       235 
234 
     | 
    
         | 
| 
       236 
     | 
    
         
            -
            [<img src="https://secure.travis-ci.org/holli/action_smser.png" />](http://travis-ci.org/holli/action_smser)
         
     | 
| 
       237 
235 
     | 
    
         | 
| 
       238 
236 
     | 
    
         | 
| 
       239 
237 
     | 
    
         
             
            ### Similar gems
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            // Nothing used
         
     | 
| 
         @@ -1,11 +1,11 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module ActionSmser
         
     | 
| 
       2 
2 
     | 
    
         
             
              class DeliveryReportsController < ApplicationController
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                skip_forgery_protection only: :gateway_commit
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
      
 6 
     | 
    
         
            +
                def gateway_commit
         
     | 
| 
       6 
7 
     | 
    
         
             
                  updated_count = 0
         
     | 
| 
       7 
8 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
                  
         
     | 
| 
       9 
9 
     | 
    
         
             
                  if !ActionSmser.delivery_options[:gateway_commit].blank? &&
         
     | 
| 
       10 
10 
     | 
    
         
             
                      !ActionSmser.delivery_options[:gateway_commit][params['gateway']].blank?
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
         @@ -49,21 +49,21 @@ module ActionSmser 
     | 
|
| 
       49 
49 
     | 
    
         
             
                  end
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
51 
     | 
    
         
             
                  if updated_count > 0
         
     | 
| 
       52 
     | 
    
         
            -
                    render : 
     | 
| 
      
 52 
     | 
    
         
            +
                    render :plain => "Updated info for #{updated_count} items"
         
     | 
| 
       53 
53 
     | 
    
         
             
                  else
         
     | 
| 
       54 
     | 
    
         
            -
                    render : 
     | 
| 
      
 54 
     | 
    
         
            +
                    render :plain => "Not saved"
         
     | 
| 
       55 
55 
     | 
    
         
             
                  end
         
     | 
| 
       56 
56 
     | 
    
         
             
                end
         
     | 
| 
       57 
57 
     | 
    
         | 
| 
       58 
58 
     | 
    
         | 
| 
       59 
     | 
    
         
            -
                 
     | 
| 
      
 59 
     | 
    
         
            +
                before_action :admin_access_only, :except => :gateway_commit
         
     | 
| 
       60 
60 
     | 
    
         | 
| 
       61 
61 
     | 
    
         
             
                def index
         
     | 
| 
       62 
62 
     | 
    
         | 
| 
       63 
63 
     | 
    
         
             
                end
         
     | 
| 
       64 
64 
     | 
    
         | 
| 
       65 
65 
     | 
    
         
             
                def list
         
     | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
       67 
67 
     | 
    
         
             
                end
         
     | 
| 
       68 
68 
     | 
    
         | 
| 
       69 
69 
     | 
    
         | 
| 
         @@ -71,7 +71,7 @@ module ActionSmser 
     | 
|
| 
       71 
71 
     | 
    
         
             
                  if !ActionSmser.delivery_options[:admin_access].blank? && ActionSmser.delivery_options[:admin_access].send(:admin_access, self)
         
     | 
| 
       72 
72 
     | 
    
         
             
                    return true
         
     | 
| 
       73 
73 
     | 
    
         
             
                  else
         
     | 
| 
       74 
     | 
    
         
            -
                    render : 
     | 
| 
      
 74 
     | 
    
         
            +
                    render :plain => "Forbidden, only for admins", :status => 403
         
     | 
| 
       75 
75 
     | 
    
         
             
                    return false
         
     | 
| 
       76 
76 
     | 
    
         
             
                  end
         
     | 
| 
       77 
77 
     | 
    
         
             
                end
         
     | 
| 
         @@ -3,7 +3,7 @@ if defined?(ActiveRecord) 
     | 
|
| 
       3 
3 
     | 
    
         
             
                class DeliveryReport < ActiveRecord::Base
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
                  has_many :re_deliveries, :class_name => self.to_s, :foreign_key => :re_delivery_of_delivery_report_id
         
     | 
| 
       6 
     | 
    
         
            -
                  belongs_to :re_delivery_of, :class_name => self.to_s, :foreign_key => :re_delivery_of_delivery_report_id
         
     | 
| 
      
 6 
     | 
    
         
            +
                  belongs_to :re_delivery_of, :class_name => self.to_s, :foreign_key => :re_delivery_of_delivery_report_id, :optional => true
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
                  def self.build_from_sms(sms, to, msg_id)
         
     | 
| 
       9 
9 
     | 
    
         
             
                    @delivery_report = self.new
         
     | 
| 
         @@ -53,7 +53,7 @@ 
     | 
|
| 
       53 
53 
     | 
    
         | 
| 
       54 
54 
     | 
    
         
             
            <p class="selection_links">
         
     | 
| 
       55 
55 
     | 
    
         
             
              <strong>Redeliveries:</strong>
         
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
       57 
57 
     | 
    
         
             
              <% ['Include normally', 'Ignore redeliveries', 'Only redeliveries'].each do |key| %>
         
     | 
| 
       58 
58 
     | 
    
         
             
                <%= link_to key, dr_summary_url(:redeliveries => key), :class => (key == params['redeliveries'] ? 'selected' : 'not_selected') %>
         
     | 
| 
       59 
59 
     | 
    
         
             
              <% end %>
         
     | 
| 
         @@ -120,7 +120,7 @@ 
     | 
|
| 
       120 
120 
     | 
    
         
             
            <ul>
         
     | 
| 
       121 
121 
     | 
    
         
             
            <%
         
     | 
| 
       122 
122 
     | 
    
         
             
               total = ar_gateway.count
         
     | 
| 
       123 
     | 
    
         
            -
                
     | 
| 
      
 123 
     | 
    
         
            +
               ar_gateway.group(:status).count.each do |key, val| %>
         
     | 
| 
       124 
124 
     | 
    
         | 
| 
       125 
125 
     | 
    
         
             
                <li>
         
     | 
| 
       126 
126 
     | 
    
         
             
                  <strong><%= key %></strong>:
         
     | 
| 
         @@ -144,7 +144,7 @@ 
     | 
|
| 
       144 
144 
     | 
    
         | 
| 
       145 
145 
     | 
    
         
             
            <%
         
     | 
| 
       146 
146 
     | 
    
         
             
               total = ar_gateway.count
         
     | 
| 
       147 
     | 
    
         
            -
                
     | 
| 
      
 147 
     | 
    
         
            +
               ar_gateway.group(:sms_type).count.each do |key, val| %>
         
     | 
| 
       148 
148 
     | 
    
         
             
               <tr>
         
     | 
| 
       149 
149 
     | 
    
         
             
                 <td><strong><%= key %></strong></td>
         
     | 
| 
       150 
150 
     | 
    
         
             
                 <td><%= val %></td>
         
     | 
    
        data/lib/action_smser/base.rb
    CHANGED
    
    | 
         @@ -46,7 +46,7 @@ class ActionSmser::Base 
     | 
|
| 
       46 
46 
     | 
    
         | 
| 
       47 
47 
     | 
    
         
             
              # Delivery methods can use this to save data for debugging, e.g. http responses etc
         
     | 
| 
       48 
48 
     | 
    
         
             
              attr_accessor :delivery_info
         
     | 
| 
       49 
     | 
    
         
            -
              attr_accessor :delivery_reports
         
     | 
| 
      
 49 
     | 
    
         
            +
              # attr_accessor :delivery_reports
         
     | 
| 
       50 
50 
     | 
    
         
             
              def delivery_reports
         
     | 
| 
       51 
51 
     | 
    
         
             
                @delivery_reports ||= []
         
     | 
| 
       52 
52 
     | 
    
         
             
              end
         
     | 
    
        data/lib/action_smser/version.rb
    CHANGED
    
    
    
        data/test/action_smser_test.rb
    CHANGED
    
    
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            // Nothing used
         
     | 
| 
         @@ -35,13 +35,6 @@ module Dummy 
     | 
|
| 
       35 
35 
     | 
    
         
             
                # Configure sensitive parameters which will be filtered from the log file.
         
     | 
| 
       36 
36 
     | 
    
         
             
                config.filter_parameters += [:password]
         
     | 
| 
       37 
37 
     | 
    
         | 
| 
       38 
     | 
    
         
            -
                # Enable the asset pipeline
         
     | 
| 
       39 
     | 
    
         
            -
                config.assets.enabled = true
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
                # Version of your assets, change this if you want to expire all your assets
         
     | 
| 
       42 
     | 
    
         
            -
                config.assets.version = '1.0'
         
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
38 
     | 
    
         
             
              end
         
     | 
| 
       46 
39 
     | 
    
         
             
            end
         
     | 
| 
       47 
40 
     | 
    
         | 
| 
         @@ -8,12 +8,8 @@ Dummy::Application.configure do 
     | 
|
| 
       8 
8 
     | 
    
         
             
              config.cache_classes = true
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
              # Configure static asset server for tests with Cache-Control for performance
         
     | 
| 
       11 
     | 
    
         
            -
               
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
              else
         
     | 
| 
       14 
     | 
    
         
            -
                config.serve_static_files = false
         
     | 
| 
       15 
     | 
    
         
            -
              end
         
     | 
| 
       16 
     | 
    
         
            -
              config.static_cache_control = "public, max-age=3600"
         
     | 
| 
      
 11 
     | 
    
         
            +
              config.public_file_server.enabled = false
         
     | 
| 
      
 12 
     | 
    
         
            +
              config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
         
     | 
| 
       17 
13 
     | 
    
         | 
| 
       18 
14 
     | 
    
         
             
              # Log error messages when you accidentally call methods on nil
         
     | 
| 
       19 
15 
     | 
    
         
             
              config.whiny_nils = true
         
     | 
| 
         @@ -0,0 +1,12 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Be sure to restart your server when you modify this file.
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            # Version of your assets, change this if you want to expire all your assets.
         
     | 
| 
      
 4 
     | 
    
         
            +
            # Rails.application.config.assets.version = "1.0"
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            # Add additional assets to the asset load path.
         
     | 
| 
      
 7 
     | 
    
         
            +
            # Rails.application.config.assets.paths << Emoji.images_path
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            # Precompile additional assets.
         
     | 
| 
      
 10 
     | 
    
         
            +
            # application.js, application.css, and all non-JS/CSS in the app/assets
         
     | 
| 
      
 11 
     | 
    
         
            +
            # folder are already added.
         
     | 
| 
      
 12 
     | 
    
         
            +
            # Rails.application.config.assets.precompile += %w( admin.js admin.css )
         
     | 
| 
         @@ -4,4 +4,4 @@ 
     | 
|
| 
       4 
4 
     | 
    
         
             
            # If you change this key, all old signed cookies will become invalid!
         
     | 
| 
       5 
5 
     | 
    
         
             
            # Make sure the secret is at least 30 characters and all random,
         
     | 
| 
       6 
6 
     | 
    
         
             
            # no regular words or you'll be exposed to dictionary attacks.
         
     | 
| 
       7 
     | 
    
         
            -
            Dummy::Application.config.secret_token = '344386496a055c097c210dd2598d705e5544f1f3742d54b6413c8c937b33f484e9fdf5dec39ea1b27061e5383d45430ddb159cd7f3d0f5f8087b2288df853bba'
         
     | 
| 
      
 7 
     | 
    
         
            +
            # Dummy::Application.config.secret_token = '344386496a055c097c210dd2598d705e5544f1f3742d54b6413c8c937b33f484e9fdf5dec39ea1b27061e5383d45430ddb159cd7f3d0f5f8087b2288df853bba'
         
     |