birdel 3.2.0 → 3.3.1
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 +4 -4
 - data/Gemfile +1 -3
 - data/lib/birdel/rona/rona_actor.rb +11 -11
 - data/lib/birdel/version.rb +1 -1
 - metadata +20 -7
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: c3808af54ae7c333e8b2ecd7b60223654e3f11c6d5103d4dc0e4f86a3ab28678
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 62ae9492e2490b43139c809a84900b8efe733509ecd4057622c8e6ffdf266dc0
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: fdc016be7f98c172d4daf314ca34889cab412a7bbeedf9663138a77293cd2e8bf6e23f4541620216c0e5a23fb3169b7689d8f78ccb7847e6edd06e2bc6245107
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: e653303588521976e0358e1fd41689dae9984b944988162cf15031ac7f5a6b5ad6c8cd5da7c2e2dad33b515a1e6957333238b750bdf9f1075396b22d2691d4c3
         
     | 
    
        data/Gemfile
    CHANGED
    
    
| 
         @@ -4,26 +4,26 @@ module Birdel 
     | 
|
| 
       4 
4 
     | 
    
         
             
                def actorThrough(data)
         
     | 
| 
       5 
5 
     | 
    
         
             
                  actor_name         = data.fetch("actor")
         
     | 
| 
       6 
6 
     | 
    
         
             
                  inputs             = data.fetch("inputs")
         
     | 
| 
       7 
     | 
    
         
            -
                  callback           = data.fetch("callback")
         
     | 
| 
      
 7 
     | 
    
         
            +
                  callback           = data.fetch("callback", false)
         
     | 
| 
       8 
8 
     | 
    
         
             
                  required_component = data.fetch("required_component")
         
     | 
| 
       9 
9 
     | 
    
         
             
                  method             = data.fetch("method")
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
                  actor_string = actor_name.split("__").map{|e| e.camelize}.join("::")
         
     | 
| 
       12 
     | 
    
         
            -
                  res_name 
     | 
| 
       13 
     | 
    
         
            -
                  actor 
     | 
| 
       14 
     | 
    
         
            -
                  method_res 
     | 
| 
      
 12 
     | 
    
         
            +
                  res_name     = actor_string << "::#{actor_string.split("::")[-1]}"
         
     | 
| 
      
 13 
     | 
    
         
            +
                  actor        = res_name.constantize.new()
         
     | 
| 
      
 14 
     | 
    
         
            +
                  method_res   = actor.public_send(method, inputs, self.current_user)
         
     | 
| 
       15 
15 
     | 
    
         
             
                  res = {
         
     | 
| 
       16 
     | 
    
         
            -
                    "ok": 
     | 
| 
       17 
     | 
    
         
            -
                    "message": 
     | 
| 
      
 16 
     | 
    
         
            +
                    "ok":        method_res[:ok],
         
     | 
| 
      
 17 
     | 
    
         
            +
                    "message":   method_res[:message],
         
     | 
| 
       18 
18 
     | 
    
         
             
                    "data": {
         
     | 
| 
       19 
     | 
    
         
            -
                      "actor": 
     | 
| 
       20 
     | 
    
         
            -
                      "method": 
     | 
| 
      
 19 
     | 
    
         
            +
                      "actor":   actor_name,
         
     | 
| 
      
 20 
     | 
    
         
            +
                      "method":  method,
         
     | 
| 
       21 
21 
     | 
    
         
             
                      "outputs": method_res[:outputs]
         
     | 
| 
       22 
22 
     | 
    
         
             
                    }
         
     | 
| 
       23 
23 
     | 
    
         
             
                  }
         
     | 
| 
       24 
24 
     | 
    
         
             
                  if required_component
         
     | 
| 
       25 
     | 
    
         
            -
                    component_name 
     | 
| 
       26 
     | 
    
         
            -
                    component 
     | 
| 
      
 25 
     | 
    
         
            +
                    component_name    = required_component.split('--').map{|i| i.gsub("-", "_").camelize}.join('::') + '::' + required_component.split('--').last.gsub("-", "_").camelize
         
     | 
| 
      
 26 
     | 
    
         
            +
                    component         = component_name.constantize.new(inputs: method_res[:outputs])
         
     | 
| 
       27 
27 
     | 
    
         
             
                    res[:data][:html] = ApplicationController.render(component, layout: false)
         
     | 
| 
       28 
28 
     | 
    
         
             
                  end
         
     | 
| 
       29 
29 
     | 
    
         
             
                  if callback
         
     | 
| 
         @@ -33,7 +33,7 @@ module Birdel 
     | 
|
| 
       33 
33 
     | 
    
         
             
                    if method_res[:resource_id].present?
         
     | 
| 
       34 
34 
     | 
    
         
             
                      res[:callback][:resourceId] = method_res[:resource_id]
         
     | 
| 
       35 
35 
     | 
    
         
             
                    else
         
     | 
| 
       36 
     | 
    
         
            -
                      res[:callback][:resourceId] = callback[ 
     | 
| 
      
 36 
     | 
    
         
            +
                      res[:callback][:resourceId] = callback["resourceId"].present? ? callback["resourceId"] : false
         
     | 
| 
       37 
37 
     | 
    
         
             
                    end
         
     | 
| 
       38 
38 
     | 
    
         
             
                    ActionCable.server.broadcast(self.first_stream, res)
         
     | 
| 
       39 
39 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/birdel/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,17 +1,30 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: birdel
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 3.3.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
     | 
    
         
            -
            -  
     | 
| 
      
 7 
     | 
    
         
            +
            - "@serhiijun"
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2023- 
     | 
| 
       12 
     | 
    
         
            -
            dependencies: 
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
               
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-08-01 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: colored
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '1.2'
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '1.2'
         
     | 
| 
      
 27 
     | 
    
         
            +
            description: Ruby/JS actors communication framework for Rails.
         
     | 
| 
       15 
28 
     | 
    
         
             
            email:
         
     | 
| 
       16 
29 
     | 
    
         
             
            - serhii.jun@gmail.com
         
     | 
| 
       17 
30 
     | 
    
         
             
            executables:
         
     | 
| 
         @@ -65,5 +78,5 @@ requirements: [] 
     | 
|
| 
       65 
78 
     | 
    
         
             
            rubygems_version: 3.4.6
         
     | 
| 
       66 
79 
     | 
    
         
             
            signing_key:
         
     | 
| 
       67 
80 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       68 
     | 
    
         
            -
            summary:  
     | 
| 
      
 81 
     | 
    
         
            +
            summary: Birdel actors framework for Rails.
         
     | 
| 
       69 
82 
     | 
    
         
             
            test_files: []
         
     |