siteleaf 1.0.9 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/siteleaf/page.rb +6 -1
- data/lib/siteleaf/site.rb +3 -3
- data/lib/siteleaf/version.rb +1 -1
- data/siteleaf.gemspec +2 -2
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 604b56cb0dff227c9d9b9b75d296a3d68b2f968e95ed5ba60a291f9a1061b62b
|
4
|
+
data.tar.gz: 851c9369253d2fadff92b916eaf01366e8666055957a1942da2b73fd33d24479
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3160b2d25a4d6a6b1686bb7138c0843315addaa012dbe17dbc130278e88b5825a04ceee29c5870234cf0514c297e4bd53b3885cbcfd67ce3221b304bd79b839d
|
7
|
+
data.tar.gz: 3983bcdb3ddcd45282b857233c0163d52d58b51c0d2b4e92938ddaf897e60f8088e9ccfff3208a1e45ed996b2e68e893fcbeb4b6856e137da351dce5959340ed
|
data/lib/siteleaf/page.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
module Siteleaf
|
2
2
|
class Page < Entity
|
3
3
|
|
4
|
-
attr_accessor :title, :custom_slug, :body, :visibility, :published_at, :user_id, :site_id, :parent_id, :meta
|
4
|
+
attr_accessor :title, :custom_slug, :body, :visibility, :published_at, :user_id, :site_id, :parent_id, :meta, :user
|
5
5
|
attr_reader :id, :slug, :url, :created_at, :updated_at, :assets
|
6
|
+
|
7
|
+
def self.find(id)
|
8
|
+
super "#{id}?include=user"
|
9
|
+
end
|
6
10
|
|
7
11
|
def create_endpoint
|
8
12
|
"sites/#{self.site_id}/pages"
|
@@ -48,6 +52,7 @@ module Siteleaf
|
|
48
52
|
attrs['title'] = title
|
49
53
|
attrs['date'] = Time.parse(published_at).utc if published_at
|
50
54
|
attrs['published'] = false if !published?
|
55
|
+
attrs['author'] = user['fullname'] if user && user['fullname']
|
51
56
|
|
52
57
|
meta.each{|m| attrs[m['key'].to_s.downcase] = m['value'].to_s == '' ? nil : m['value'].to_s.gsub("\r\n","\n")} unless meta.nil?
|
53
58
|
|
data/lib/siteleaf/site.rb
CHANGED
@@ -23,12 +23,12 @@ module Siteleaf
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def pages
|
26
|
-
result = Client.get "sites/#{self.id}/pages"
|
26
|
+
result = Client.get "sites/#{self.id}/pages?include=user"
|
27
27
|
result.map { |r| Page.new(r) } if result
|
28
28
|
end
|
29
29
|
|
30
30
|
def posts
|
31
|
-
result = Client.get "sites/#{self.id}/posts"
|
31
|
+
result = Client.get "sites/#{self.id}/posts?include=user"
|
32
32
|
result.map { |r| Post.new(r) } if result
|
33
33
|
end
|
34
34
|
|
@@ -105,4 +105,4 @@ module Siteleaf
|
|
105
105
|
end
|
106
106
|
|
107
107
|
end
|
108
|
-
end
|
108
|
+
end
|
data/lib/siteleaf/version.rb
CHANGED
data/siteleaf.gemspec
CHANGED
@@ -15,8 +15,8 @@ Gem::Specification.new do |gem|
|
|
15
15
|
|
16
16
|
gem.required_ruby_version = '>= 1.9.3'
|
17
17
|
|
18
|
-
gem.add_dependency 'httparty', '
|
19
|
-
gem.add_dependency 'httmultiparty', '
|
18
|
+
gem.add_dependency 'httparty', '>= 0.14.0'
|
19
|
+
gem.add_dependency 'httmultiparty', '>= 0.3.13'
|
20
20
|
gem.add_dependency 'psych', '>= 2.0.17'
|
21
21
|
gem.add_dependency 'rack'
|
22
22
|
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: siteleaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siteleaf
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.14.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.14.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: httmultiparty
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.3.13
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.3.13
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -99,7 +99,7 @@ homepage: http://siteleaf.com
|
|
99
99
|
licenses:
|
100
100
|
- MIT
|
101
101
|
metadata: {}
|
102
|
-
post_install_message:
|
102
|
+
post_install_message:
|
103
103
|
rdoc_options: []
|
104
104
|
require_paths:
|
105
105
|
- lib
|
@@ -114,9 +114,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
|
-
|
118
|
-
|
119
|
-
signing_key:
|
117
|
+
rubygems_version: 3.1.6
|
118
|
+
signing_key:
|
120
119
|
specification_version: 4
|
121
120
|
summary: Siteleaf Ruby interface
|
122
121
|
test_files: []
|