arosa 0.1.2 → 0.1.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 +4 -4
- data/README.md +46 -0
- data/lib/arosa/schemas/article.rb +38 -0
- data/lib/arosa/version.rb +1 -1
- data/lib/arosa.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09bc174946a4518203e74962640aec60f2638e70070ee1051837fb5f4e60f56f'
|
|
4
|
+
data.tar.gz: 543c50c4ff514634ba95c163181266b37ae56fe92955f4197cbae82e3de4c030
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a1bb6dadc1e45b2fa8da0a7d66660b3c332e6c7664efdb7c5159b8e638e479a6bfc669b62c1a872f3fcb520ac7fe52cfed05922612abcff58d4320ca08fb706a
|
|
7
|
+
data.tar.gz: e577296fa561fde3aef4bbb87c9792f26a411812b5dc1abbfcb369b9c7333c61eec09b4448f653c1fcd536ab48ee454ca90d07370f9b51d60413b55db518506c
|
data/README.md
CHANGED
|
@@ -25,6 +25,7 @@ Then `bundle install`.
|
|
|
25
25
|
| [ListItem](#listitem) | [schema.org/ListItem](https://schema.org/ListItem) |
|
|
26
26
|
| [Language](#language) | [schema.org/Language](https://schema.org/Language) |
|
|
27
27
|
| [WebApplication](#webapplication) | [schema.org/WebApplication](https://schema.org/WebApplication) |
|
|
28
|
+
| [Article](#article) | [schema.org/Article](https://schema.org/Article) |
|
|
28
29
|
|
|
29
30
|
More types coming.
|
|
30
31
|
|
|
@@ -256,6 +257,51 @@ Arosa::Schemas::WebApplication.new(
|
|
|
256
257
|
)
|
|
257
258
|
```
|
|
258
259
|
|
|
260
|
+
### Article
|
|
261
|
+
|
|
262
|
+
| Property | Type |
|
|
263
|
+
|----------|------|
|
|
264
|
+
| name | String |
|
|
265
|
+
| url | String |
|
|
266
|
+
| image | String |
|
|
267
|
+
| same_as | Array of String |
|
|
268
|
+
| headline | String |
|
|
269
|
+
| alternative_headline | String |
|
|
270
|
+
| description | String |
|
|
271
|
+
| author | String |
|
|
272
|
+
| publisher | String |
|
|
273
|
+
| date_published | Date |
|
|
274
|
+
| date_modified | Date |
|
|
275
|
+
| date_created | Date |
|
|
276
|
+
| keywords | String |
|
|
277
|
+
| in_language | String |
|
|
278
|
+
| thumbnail_url | String |
|
|
279
|
+
| abstract | String |
|
|
280
|
+
| comment_count | Integer |
|
|
281
|
+
| copyright_holder | String |
|
|
282
|
+
| copyright_year | Integer |
|
|
283
|
+
| editor | String |
|
|
284
|
+
| genre | String |
|
|
285
|
+
| is_accessible_for_free | Boolean |
|
|
286
|
+
| license | String |
|
|
287
|
+
| article_section | String |
|
|
288
|
+
| word_count | Integer |
|
|
289
|
+
|
|
290
|
+
```ruby
|
|
291
|
+
Arosa::Schemas::Article.new(
|
|
292
|
+
headline: "How to Tie a Reef Knot",
|
|
293
|
+
author: "John Doe",
|
|
294
|
+
date_published: Date.new(2026, 2, 26),
|
|
295
|
+
description: "A step-by-step guide to tying the classic reef knot.",
|
|
296
|
+
article_section: "Outdoors",
|
|
297
|
+
word_count: 1200,
|
|
298
|
+
image: "https://example.com/images/reef-knot.jpg",
|
|
299
|
+
keywords: "knots, sailing, outdoors",
|
|
300
|
+
in_language: "en",
|
|
301
|
+
is_accessible_for_free: true
|
|
302
|
+
)
|
|
303
|
+
```
|
|
304
|
+
|
|
259
305
|
## Validation
|
|
260
306
|
|
|
261
307
|
Wrong types and unknown properties raise errors immediately:
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Arosa
|
|
4
|
+
module Schemas
|
|
5
|
+
# Schema.org Article type
|
|
6
|
+
#
|
|
7
|
+
# https://schema.org/Article
|
|
8
|
+
class Article < Schema
|
|
9
|
+
schema_type "Article"
|
|
10
|
+
|
|
11
|
+
property :name, type: String
|
|
12
|
+
property :url, type: String
|
|
13
|
+
property :image, type: String
|
|
14
|
+
property :same_as, type: [String]
|
|
15
|
+
property :headline, type: String
|
|
16
|
+
property :alternative_headline, type: String
|
|
17
|
+
property :description, type: String
|
|
18
|
+
property :author, type: String
|
|
19
|
+
property :publisher, type: String
|
|
20
|
+
property :date_published, type: Date
|
|
21
|
+
property :date_modified, type: Date
|
|
22
|
+
property :date_created, type: Date
|
|
23
|
+
property :keywords, type: String
|
|
24
|
+
property :in_language, type: String
|
|
25
|
+
property :thumbnail_url, type: String
|
|
26
|
+
property :abstract, type: String
|
|
27
|
+
property :comment_count, type: Integer
|
|
28
|
+
property :copyright_holder, type: String
|
|
29
|
+
property :copyright_year, type: Integer
|
|
30
|
+
property :editor, type: String
|
|
31
|
+
property :genre, type: String
|
|
32
|
+
property :is_accessible_for_free
|
|
33
|
+
property :license, type: String
|
|
34
|
+
property :article_section, type: String
|
|
35
|
+
property :word_count, type: Integer
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/arosa/version.rb
CHANGED
data/lib/arosa.rb
CHANGED
|
@@ -13,6 +13,7 @@ require_relative "arosa/schemas/organization"
|
|
|
13
13
|
require_relative "arosa/schemas/list_item"
|
|
14
14
|
require_relative "arosa/schemas/breadcrumb_list"
|
|
15
15
|
require_relative "arosa/schemas/web_application"
|
|
16
|
+
require_relative "arosa/schemas/article"
|
|
16
17
|
|
|
17
18
|
module Arosa
|
|
18
19
|
class Error < StandardError; end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: arosa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuenti
|
|
@@ -22,6 +22,7 @@ files:
|
|
|
22
22
|
- Rakefile
|
|
23
23
|
- lib/arosa.rb
|
|
24
24
|
- lib/arosa/schema.rb
|
|
25
|
+
- lib/arosa/schemas/article.rb
|
|
25
26
|
- lib/arosa/schemas/breadcrumb_list.rb
|
|
26
27
|
- lib/arosa/schemas/contact_point.rb
|
|
27
28
|
- lib/arosa/schemas/language.rb
|