plug 0.1.18 → 0.1.19
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 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: a3e56677db5277835599245727b8f5a1ddc7b089a9261f788971c6de539279cd
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 619eb3d58765d7fe2ae88e0d4cc784ce0df8cea15e2e580ce0228f335da1f175
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 3993e47bb2626186d6057b0aed81651a3ae46d7daec51b56dfe9a8cfbe0a46c242edfc95a6080cefe651d641092b3e157746df03c2a6595a72e96b9b32bc0a56
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 210f55299e22933f46c48d469fc423ec3b7c85cd8be76d7eddeee93ce96efab89f50f11ed2598d530911eb208057c9c6691114d38beba6ff9425fc6b3fc60386
         
     | 
| 
         @@ -54,10 +54,7 @@ module Plug 
     | 
|
| 
       54 
54 
     | 
    
         
             
                # TODO: Move this to a separate controller e.g. `tasks_controller.rb`
         
     | 
| 
       55 
55 
     | 
    
         
             
                def task_execution
         
     | 
| 
       56 
56 
     | 
    
         
             
                  begin
         
     | 
| 
       57 
     | 
    
         
            -
                     
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
                    Rails.application.load_tasks
         
     | 
| 
       60 
     | 
    
         
            -
                    ::Rake::Task[params[:task]].execute
         
     | 
| 
      
 57 
     | 
    
         
            +
                    Plug::TaskExecutionService.new(name: params[:task]).call
         
     | 
| 
       61 
58 
     | 
    
         
             
                  rescue StandardError => e
         
     | 
| 
       62 
59 
     | 
    
         
             
                    flash[:alert] = e.message
         
     | 
| 
       63 
60 
     | 
    
         
             
                  else
         
     | 
| 
         @@ -0,0 +1,18 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'rake'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Plug
         
     | 
| 
      
 4 
     | 
    
         
            +
              class TaskExecutionService
         
     | 
| 
      
 5 
     | 
    
         
            +
                attr_reader :name
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                def initialize(name: nil)
         
     | 
| 
      
 8 
     | 
    
         
            +
                  raise 'Task name is required' if name.nil?
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
                  @name = name
         
     | 
| 
      
 11 
     | 
    
         
            +
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                def call
         
     | 
| 
      
 14 
     | 
    
         
            +
                  Rails.application.load_tasks
         
     | 
| 
      
 15 
     | 
    
         
            +
                  Rake::Task[name].execute
         
     | 
| 
      
 16 
     | 
    
         
            +
                end
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/plug/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: plug
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.19
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ben
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2020- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2020-06-04 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: rails
         
     | 
| 
         @@ -237,6 +237,7 @@ files: 
     | 
|
| 
       237 
237 
     | 
    
         
             
            - app/models/plug/feature.rb
         
     | 
| 
       238 
238 
     | 
    
         
             
            - app/models/plug/resources/site_notice.rb
         
     | 
| 
       239 
239 
     | 
    
         
             
            - app/models/plug/site_notice.rb
         
     | 
| 
      
 240 
     | 
    
         
            +
            - app/services/plug/task_execution_service.rb
         
     | 
| 
       240 
241 
     | 
    
         
             
            - app/views/layouts/plug/application.html.haml
         
     | 
| 
       241 
242 
     | 
    
         
             
            - app/views/plug/features/_form.html.haml
         
     | 
| 
       242 
243 
     | 
    
         
             
            - app/views/plug/features/_task.html.haml
         
     |