activitypub 0.4.1 → 0.4.3

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: 422c4769d3efddf0251d5cb9f64f92b6f4c9c72c054bed80bd2e2e4d74fb6870
4
- data.tar.gz: 8d503eed716a1a54d62e654ba647415c6d9b89cfeb060bedc6dbc52a1735aaf5
3
+ metadata.gz: e07c19938d44be1b64a307808cce4aa7d75034fc3df547c2554164692ba423a8
4
+ data.tar.gz: 96671de06f1cb30a6b37529b985a4a8f82bb49136018f29919ed5e61df89021c
5
5
  SHA512:
6
- metadata.gz: 487e02cb6426a2ac76d3ccedcea22f9fe1693b697aea51969b16d0164a1e9fdbc8233c355182e2e695b04177a4bd2e81f05cb4e25090f972a36938f6cc4260b1
7
- data.tar.gz: 6ca2c9ca57226499972c51b6d9017a96ace046964d754e0a8eaa46ae5b0d6441d900c473cd16d6ed670eed3838b0181e1f7b31fb7b29d757b0324cb2d2ed066a
6
+ metadata.gz: '07290f328de7cf87742c570d345d790b0aefed8eac1b1de5d294b5f00c04fcc9f2f3865ea838aa7347fab0d1a23413cf4adf5dcfba697c463d710513d0b579bb'
7
+ data.tar.gz: 9077e1a93d5e442547b7ddb38e108d84a9d6141ffd0dc798babfa3b061b82885fbb37bfc10a1c7d02cd08d5ec0982da87252cfb5796cc2f1f3c5967de50883fb
data/README.md CHANGED
@@ -1,7 +1,12 @@
1
1
  # ActivityPub
2
2
 
3
- *Very* early start on a set of classes to serialize/deserialize
4
- ActivityPub/ActivityStream objects.
3
+ A Ruby gem to make it easy to retrieve and work with ActivityPub/
4
+ ActivityStreams objects, as used in Mastodon, Lemmy, Pixelfed and
5
+ similar.
6
+
7
+ CAUTION: This is early days and the API is likely to change quickly.
8
+ If you want to start using this, please follow the project and/or let
9
+ me know.
5
10
 
6
11
  ## Goals
7
12
 
@@ -28,7 +33,10 @@ If bundler is not being used to manage dependencies, install the gem by executin
28
33
 
29
34
  ## Usage
30
35
 
31
- TODO: Write usage instructions here
36
+ TODO: Write usage instructions here.
37
+
38
+ For now your best bet is to look at the examples/ dir and the unit
39
+ tests.
32
40
 
33
41
  ## Development
34
42
 
@@ -41,7 +41,7 @@ module ActivityPub
41
41
  end
42
42
 
43
43
  if t = klass.ap_types[attr]
44
- v = t.new(v) if v
44
+ v = t.new(v) if v && !v.kind_of?(ActivityPub::Base)
45
45
  end
46
46
  ob.instance_variable_set("@#{attr}", v) if !v.nil?
47
47
  end
@@ -25,7 +25,7 @@ module ActivityPub
25
25
  class Object < Base
26
26
  ap_attr :id
27
27
  ap_attr :attachment
28
- ap_attr :attributedTo
28
+ ap_attr :attributedTo, URI
29
29
  ap_attr :audience
30
30
  ap_attr :content
31
31
  ap_attr :context
@@ -71,6 +71,9 @@ module ActivityPub
71
71
  ap_attr :first, URI
72
72
  ap_attr :last, URI
73
73
  ap_attr :items
74
+
75
+ def each(...) = Array(items).each(...)
76
+ def map(...) = Array(items).map(...)
74
77
  end
75
78
 
76
79
  class OrderedCollection < Collection
@@ -81,6 +84,9 @@ module ActivityPub
81
84
  #
82
85
  # FIXME: Review/consider whether to marge orderedItems/items internally.
83
86
  ap_attr :orderedItems
87
+
88
+ def each(...) = Array(orderedItems).each(...)
89
+ def map(...) = Array(orderedItems).map(...)
84
90
  end
85
91
 
86
92
  class CollectionPage < Collection
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActivityPub
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activitypub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vidar Hokstad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-16 00:00:00.000000000 Z
11
+ date: 2024-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webfinger