wikidatum 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8f1ec02cd83bf3ea3e432868a8283474f810bfd55740b5759c820d880f95e31
4
- data.tar.gz: a5af62f917570a29ceceb6e420377154775d9820dec8abb02eb84e037f0bab89
3
+ metadata.gz: 78bb68e7872a77e0dc21f9904d0fd8306b4d4caa23329824d87257a91e503925
4
+ data.tar.gz: 84765a7d5f3cee85b0c6ad68953f1d6e9718d068037247f8e8e7e1c4b651c51b
5
5
  SHA512:
6
- metadata.gz: a6c46eacdb7d7455ee5e96d3cf7c0970bd85ffc3abd1dc09c856b0f92062beaede5d451c9587ab72afc14d3b3c3a4e800c9685b435fbb4074b7d5e0b77cda463
7
- data.tar.gz: bf4810fc7384b5b5cecf2db956758a1125a1664b62b8f7275d77347c7e0b78d64fbd76d011375914162c7a3a687bb4b679fd2ace7e8addcda2ad84775b88503f
6
+ metadata.gz: 24dd512b025f3e618b46ba9b5cc280c2ef500909b7f68c666f29914b5a64e1da63729ded4e321e37461f68f6fdc1f429ec87a71684b773eacb5f25f56ee5c212
7
+ data.tar.gz: e43e1b92d171667ce5af5028c56b7d5c28971ef3c3aed93f55a919088e6a990796889eb32293563191d857cf547ca685b6d571bc629a199cbbb6ab332283a731
data/CHANGELOG.md CHANGED
@@ -4,7 +4,20 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
 
7
- ## Unreleased
7
+ ## 0.3.0 - 2022-12-27
8
+ ### Added
9
+
10
+ - Add `allow_ip_edits` argument on `Wikidatum::Client.new`. This protects users from making IP address-exposing edits if they haven't explicitly opted-in to doing that. The argument defaults to false.
11
+ - Add code to raise errors when various types of invalid input are passed to `Wikidatum::Client#add_statement`.
12
+
13
+ ### Fixed
14
+
15
+ - Update the serializers and `add_statement` method to account for various changes that have been made upstream to the Wikibase REST API.
16
+
17
+ ## 0.2.1 - 2022-08-13
18
+ ### Fixed
19
+
20
+ - Fix a mistake that broke loading the gem.
8
21
 
9
22
  ## 0.2.0 - 2022-08-13
10
23
  ### Added
@@ -24,4 +37,3 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
24
37
  ### Added
25
38
 
26
39
  - Initial release, nothing is really usable yet.
27
-
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  This gem supports making requests to the [new Wikidata/Wikibase REST API](https://doc.wikimedia.org/Wikibase/master/js/rest-api/).
4
4
 
5
- **The gem is currently in very early development and is not ready for production usage**.
5
+ The [Wikimedia Docs on Wikibase's JSON format](https://doc.wikimedia.org/Wikibase/master/php/docs_topics_json.html) are also very useful for interacting with/contributing to this gem.
6
+
7
+ **The gem is currently in early development and is not ready for production usage**.
6
8
 
7
9
  ## Installation
8
10
 
@@ -24,7 +26,7 @@ Or install it yourself as:
24
26
 
25
27
  You can view the YARD docs on GitHub Pages [here](https://connorshea.github.io/wikidatum/index.html).
26
28
 
27
- Currently, the gem is able to hit a few GET endpoints, and currently has no way to provide authentication and perform POST/PUT/DELETE requests. The additional features will be added later.
29
+ Currently, the gem is able to hit a few of the basic endpoints, and currently has no way to provide authentication. The additional features will be added later.
28
30
 
29
31
  ```ruby
30
32
  require 'wikidatum'
@@ -57,6 +59,26 @@ item.label(lang: :en).value #=> "Earth"
57
59
 
58
60
  # Get the values for all English aliases on this item.
59
61
  item.aliases(langs: [:en]).map(&:value) #=> ["Planet Earth", "Pale Blue Dot"]
62
+
63
+ statement_id = 'Q123$4543523c-1d1d-1111-1e1e-11b11111b1f1'
64
+ statement = wikidatum_client.statement(id: statement_id) #=> Wikidatum::Statement
65
+
66
+ # Add a statement to Q193581 for P577 (publication date) that has a time value of November 16, 2004.
67
+ wikidatum_client.add_statement(
68
+ id: 'Q193581',
69
+ property: 'P577',
70
+ value: Wikidatum::DataType::Time.new(
71
+ time: '+2004-11-16T00:00:00Z',
72
+ precision: 11,
73
+ calendar_model: 'https://www.wikidata.org/entity/Q12138'
74
+ )
75
+ )
76
+
77
+ # Delete a statement and include an edit summary.
78
+ wikidatum_client.delete_statement(
79
+ id: 'Q123$4543523c-1d1d-1111-1e1e-11b11111b1f1',
80
+ comment: 'Deleting this statement because it is inaccurate.'
81
+ )
60
82
  ```
61
83
 
62
84
  ## Development
data/bin/console CHANGED
@@ -7,9 +7,5 @@ require "wikidatum"
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
9
9
 
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
10
  require "irb"
15
11
  IRB.start(__FILE__)