tinycms 0.1.0 → 0.1.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/tinycms/base_api.rb +2 -10
- data/lib/tinycms/blogs/api.rb +2 -2
- data/lib/tinycms/client.rb +1 -7
- data/lib/tinycms/posts/api.rb +1 -1
- data/lib/tinycms/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdd5cf1971654d77aaada66531c63ac18fe23948ec73f053cf5c19a35e3b840a
|
4
|
+
data.tar.gz: f8f7de1c8b76e74a926591040ade5203dc26d201c245a8a8f2559f5c2f103a75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a44c794d7bc4601b503466defcaec869f328460b02f089635a5c9a771f408889aa29bed8ae6efffcfec907f0b9d0f0ec1285db45f0f183750a68c260c59b0ba
|
7
|
+
data.tar.gz: a56c2f34dd3fe6aa1683ae27ec99c99e1e2e6d9d88a448094bcce547d248990a2fab9fb714c75afd0949b17cea90c20418ddf4c072b120c3a4dee2dad46f2061
|
data/lib/tinycms/base_api.rb
CHANGED
@@ -2,16 +2,8 @@
|
|
2
2
|
|
3
3
|
module Tinycms
|
4
4
|
class BaseApi
|
5
|
-
def
|
6
|
-
|
7
|
-
end
|
8
|
-
|
9
|
-
protected
|
10
|
-
|
11
|
-
attr_reader :api_key
|
12
|
-
|
13
|
-
def client
|
14
|
-
@client ||= Tinycms::Client.new(api_key).client
|
5
|
+
def self.client
|
6
|
+
Tinycms::Client.new.client
|
15
7
|
end
|
16
8
|
end
|
17
9
|
end
|
data/lib/tinycms/blogs/api.rb
CHANGED
@@ -5,7 +5,7 @@ require "retriable"
|
|
5
5
|
module Tinycms
|
6
6
|
module Blogs
|
7
7
|
class Api < BaseApi
|
8
|
-
def get_all
|
8
|
+
def self.get_all
|
9
9
|
Retriable.retriable do
|
10
10
|
response = client.get("/api/blogs")
|
11
11
|
blogs = response.body
|
@@ -15,7 +15,7 @@ module Tinycms
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
def get(blog_id)
|
18
|
+
def self.get(blog_id)
|
19
19
|
Retriable.retriable do
|
20
20
|
response = client.get("/api/blogs/#{blog_id}")
|
21
21
|
Tinycms::Blogs::Mapper.map(response.body)
|
data/lib/tinycms/client.rb
CHANGED
@@ -6,16 +6,10 @@ module Tinycms
|
|
6
6
|
class Client
|
7
7
|
BASE_URL = "https://www.tinycms.app"
|
8
8
|
|
9
|
-
def initialize(api_key)
|
10
|
-
@api_key = api_key
|
11
|
-
end
|
12
|
-
|
13
|
-
attr_reader :api_key
|
14
|
-
|
15
9
|
def client
|
16
10
|
@client ||= Faraday.new(
|
17
11
|
url: BASE_URL,
|
18
|
-
headers: { "Content-Type": "application/json", "API-Key": api_key }
|
12
|
+
headers: { "Content-Type": "application/json", "API-Key": Tinycms.config.api_key }
|
19
13
|
) do |conn|
|
20
14
|
conn.request :json
|
21
15
|
conn.response :json
|
data/lib/tinycms/posts/api.rb
CHANGED
data/lib/tinycms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinycms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Jeon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.5.
|
106
|
+
rubygems_version: 3.5.17
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: TinyCMS API Gem
|