osuny_api 0.2.2 → 0.2.4

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: aa384d23e319961d074a82202f346b2d6dc652f98076c6fb2a07d60b913f00af
4
- data.tar.gz: 466248d32f23e6c958721981ef62e22dec07a56cd1024da3229a66274c150dd5
3
+ metadata.gz: 9013ec7cd58d18c931e61128f11b2d63a32c51cf71e741435b8be7e11e256535
4
+ data.tar.gz: edc6a1ddc13a4255e710da940bd0416be691aa959e70c5d4ea89ebdcd068ead3
5
5
  SHA512:
6
- metadata.gz: 90966cd42594866d5bd2d6e8857db3d9b571e8ae66a998fcc79dd896e2179e07513eb9ddfa1cbe5e8159cddd01558e9988b2dfc791eb50002b53b4c2fdc73de8
7
- data.tar.gz: 4ee584ea2031804795ed23d7c8be4cc861b4187ddd14b8a20fa3ab87c5d7dfceaaddb9998b9250b75741690535f4acbff64576e2fa441ead0f76c88feb64d5eb
6
+ metadata.gz: 6023621499ba35d0e7f69bc878adcd3d77fec36514e3c5bd8e75f67630b4419791434fd236e30f7acd696d4cf87d947915565213965a4cf24342baa3036d89c0
7
+ data.tar.gz: c57f20a733ca600cc816789514a4dbb491e201acc655d90f8159e3b5484b8c5363cce9c09b5253aabd19159decc3c7c5e8d5782e8e0e0185df9d86bce55ce2d3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- osuny_api (0.2.2)
4
+ osuny_api (0.2.4)
5
5
  httparty
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -16,14 +16,14 @@ If bundler is not being used to manage dependencies, install the gem by executin
16
16
  osuny = OsunyApi.new host: 'https://instance.osuny.org',
17
17
  token: 'real_token'
18
18
 
19
- migration_identifier = "identifiant-unique"
20
19
  post = {
20
+ migration_identifier: "identifiant-unique"
21
21
  title: 'Titre importé'
22
22
  }
23
23
  osuny.communication
24
24
  .website('real_website_id')
25
25
  .post
26
- .import(migration_identifier, post)
26
+ .import(post)
27
27
  ```
28
28
  ## License
29
29
 
@@ -0,0 +1,12 @@
1
+ module OsunyApi
2
+ class Communication::Website::Page < Resource
3
+
4
+ def path
5
+ 'pages/'
6
+ end
7
+
8
+ def import(page)
9
+ client.post "#{full_path}import", { page: page }
10
+ end
11
+ end
12
+ end
@@ -5,11 +5,8 @@ module OsunyApi
5
5
  'posts/'
6
6
  end
7
7
 
8
- def import(migration_identifier, data)
9
- client.post "#{full_path}import", {
10
- migration_identifier: migration_identifier,
11
- post: data
12
- }
8
+ def import(post)
9
+ client.post "#{full_path}import", { post: post }
13
10
  end
14
11
  end
15
12
  end
@@ -10,5 +10,9 @@ module OsunyApi
10
10
  def post
11
11
  @post ||= Post.new(client: client, parent: self)
12
12
  end
13
+
14
+ def page
15
+ @page ||= Page.new(client: client, parent: self)
16
+ end
13
17
  end
14
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OsunyApi
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osuny_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Levy
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-09-26 00:00:00.000000000 Z
12
+ date: 2023-10-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -42,6 +42,7 @@ files:
42
42
  - lib/osuny_api/client.rb
43
43
  - lib/osuny_api/communication.rb
44
44
  - lib/osuny_api/communication/website.rb
45
+ - lib/osuny_api/communication/website/page.rb
45
46
  - lib/osuny_api/communication/website/post.rb
46
47
  - lib/osuny_api/error.rb
47
48
  - lib/osuny_api/resource.rb
@@ -68,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
69
  - !ruby/object:Gem::Version
69
70
  version: '0'
70
71
  requirements: []
71
- rubygems_version: 3.4.13
72
+ rubygems_version: 3.4.6
72
73
  signing_key:
73
74
  specification_version: 4
74
75
  summary: Gem Ruby pour l'API Osuny