siteleaf 1.0.9 → 1.0.10

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
  SHA1:
3
- metadata.gz: d48d3315f5307eae531e4c9e8f22ff4227b218de
4
- data.tar.gz: 8b4f314e2b56b08ee97e3f5e7f7897313dc20927
3
+ metadata.gz: d8b486fbba3394631d5451785526552e3d9cd83a
4
+ data.tar.gz: 5ba7b39d6c040dcd61426bdd93f81f61bac3020f
5
5
  SHA512:
6
- metadata.gz: 86fe3c07e7d60fb795c0dc9ef48d53622c6b2a3b6d3bf460d1c8cf52817b05a4aee4164d41b40d175dd6dcdc35fb58dbd82f477e57bddac4febe151ed7ece61b
7
- data.tar.gz: 45fc982295fe95c5ef7742cfe99cd942e3af09e568fad1b44d1dd3a71fae9985af2828f6da36907b8c979c681f2c84dcadb506181b9a7199affa53828379f8f6
6
+ metadata.gz: 965f00e8bc082b645631038cdc059c150c938f437d60c7681c1db0362a1811040e38a2b442aed4eba8fb6f2f6675cbe9a9092b652e0fb7ca67703900d27dee38
7
+ data.tar.gz: 8ee18e1725439ccb4854c24cd63029a1f2360805b1c3ce621a33823e91cc8d3b63495c65a74d685604a34f525d165591203ed4a5d175ca1a4288a3304253f1bd
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
@@ -1,3 +1,3 @@
1
1
  module Siteleaf
2
- VERSION = "1.0.9"
2
+ VERSION = "1.0.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: siteleaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siteleaf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-25 00:00:00.000000000 Z
11
+ date: 2019-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  requirements: []
117
117
  rubyforge_project:
118
- rubygems_version: 2.5.1
118
+ rubygems_version: 2.6.13
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Siteleaf Ruby interface