activitypub 0.3.1 → 0.3.2
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/lib/activitypub/base.rb +9 -1
- data/lib/activitypub/types.rb +5 -0
- data/lib/activitypub/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 112ee8d199c09e5d9ff788e2bdf02b80e745513a8812d01cfbf377fb56daac3b
         | 
| 4 | 
            +
              data.tar.gz: 7132a7c5d296315c29dad6672a511841a0557640d2b43139d1d4399c71e10487
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b3f3d2e3788239c080ac7354fa5a02e27ac242911374d86b579473c0ae451f1d46eff8033b7ae91abb8cda24e865cf9c58ebfd2fbc2c86257b4ed01e3856f0a4
         | 
| 7 | 
            +
              data.tar.gz: 8c7b248e72822ca739272b4315fc3256aefe96a333b81ca0676a5717162fd345a6ff2e3eef2ff3d989172abbad8124a652c5aa6cf105c1a7880643aa20c03c53
         | 
    
        data/lib/activitypub/base.rb
    CHANGED
    
    | @@ -13,7 +13,15 @@ module ActivityPub | |
| 13 13 |  | 
| 14 14 | 
             
                klass = ActivityPub.const_get(type)
         | 
| 15 15 |  | 
| 16 | 
            -
                klass ? klass.new : nil
         | 
| 16 | 
            +
                ob = klass ? klass.new : nil
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                if ob
         | 
| 19 | 
            +
                  klass.ap_attributes.each do |attr|
         | 
| 20 | 
            +
                    ob.instance_variable_set("@#{attr}", h.dig(attr.to_s))
         | 
| 21 | 
            +
                  end
         | 
| 22 | 
            +
                end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                ob
         | 
| 17 25 | 
             
              end
         | 
| 18 26 |  | 
| 19 27 | 
             
              # This is not part of ActivityPub, but provides basic mechanisms
         | 
    
        data/lib/activitypub/types.rb
    CHANGED
    
    | @@ -10,6 +10,7 @@ module ActivityPub | |
| 10 10 | 
             
              end
         | 
| 11 11 |  | 
| 12 12 | 
             
              class Object < Base
         | 
| 13 | 
            +
                ap_attr :id
         | 
| 13 14 | 
             
                ap_attr :attachment, :attributedTo, :audience, :content, :context,
         | 
| 14 15 | 
             
                  :name, :endTime, :generator, :icon, :image, :inReplyTo, :location,
         | 
| 15 16 | 
             
                  :preview, :published, :replies, :startTime, :summary, :tag, :updated,
         | 
| @@ -161,6 +162,10 @@ module ActivityPub | |
| 161 162 | 
             
              end
         | 
| 162 163 |  | 
| 163 164 | 
             
              class Person < Actor
         | 
| 165 | 
            +
             | 
| 166 | 
            +
                # Mastodon extension per
         | 
| 167 | 
            +
                # https://docs-p.joinmastodon.org/spec/activitypub/#extensions
         | 
| 168 | 
            +
                ap_attr :likes, :bookmarks, :manuallyApprovesFollowers
         | 
| 164 169 | 
             
              end
         | 
| 165 170 |  | 
| 166 171 | 
             
              class Service < Actor
         | 
    
        data/lib/activitypub/version.rb
    CHANGED