siteleaf 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/bin/siteleaf +29 -0
- data/lib/siteleaf/site.rb +5 -0
- data/lib/siteleaf/source_file.rb +1 -1
- data/lib/siteleaf/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 046b60a59a32c75e4294c753c2593933a1cc4c7f4bd631d063680810f9c9c4ac
|
4
|
+
data.tar.gz: d5d9312cab00db6b14ad706420649f008bd12382d1a54f3ef030fb90601c0024
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1c28c75af43d0c5472d721dc228c76c553d3f1aecc688c0911862b226ddacb080d09f7d3051fd3f9daa92b1bccb313006ea717dc5846ccdd0d632b89a84037e
|
7
|
+
data.tar.gz: d6a2293493b93183677f2e287adcdd5be234c7a2115fda7d78461722bd2537c0e4cb3adfba55a8caef5a3e344e5baf1f3ddb3ec272db69a854d05eaff0623746
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
<img alt="Siteleaf" src="https://learn.siteleaf.com/assets/images/logo.svg" width="10%">
|
2
|
+
|
1
3
|
Siteleaf v2 Gem
|
2
4
|
===============
|
3
5
|
|
6
|
+
- [Prerequisites](#prerequisites)
|
4
7
|
- [Installation](#installation)
|
5
8
|
- [Using the CLI](#using-the-cli)
|
6
9
|
- [Using this gem in your application](#using-this-gem-in-your-application)
|
@@ -8,10 +11,17 @@ Siteleaf v2 Gem
|
|
8
11
|
- [Troubleshooting](#troubleshooting)
|
9
12
|
- [Contributing](#contributing)
|
10
13
|
|
14
|
+
|
15
|
+
Prerequisites
|
16
|
+
-------------
|
17
|
+
|
18
|
+
Install Ruby and RubyGems: https://jekyllrb.com/docs/installation/
|
19
|
+
|
20
|
+
|
11
21
|
Installation
|
12
22
|
------------
|
13
23
|
|
14
|
-
The [Siteleaf](https://www.siteleaf.com) gem is available for installation on [
|
24
|
+
The [Siteleaf](https://www.siteleaf.com) gem is available for installation on [RubyGems](https://rubygems.org/gems/siteleaf). To install run:
|
15
25
|
|
16
26
|
gem install siteleaf
|
17
27
|
|
data/bin/siteleaf
CHANGED
@@ -19,6 +19,7 @@ Commands:
|
|
19
19
|
pull Pulls files for configured site from Siteleaf
|
20
20
|
push Pushes all files in dir to configured site
|
21
21
|
publish Publish website to hosting provider
|
22
|
+
preview Generate cloud preview
|
22
23
|
help Prints this help document
|
23
24
|
version Prints the siteleaf gem version
|
24
25
|
|
@@ -191,6 +192,24 @@ def publish(site_id, quiet = true)
|
|
191
192
|
end
|
192
193
|
end
|
193
194
|
|
195
|
+
def preview(site_id, quiet = true)
|
196
|
+
site = Siteleaf::Site.new(id: site_id)
|
197
|
+
job = site.preview
|
198
|
+
|
199
|
+
if quiet
|
200
|
+
puts "=> Preview queued.\n"
|
201
|
+
else
|
202
|
+
last_msg = nil
|
203
|
+
job.stream do |s|
|
204
|
+
if (msg = s["message"]) && (msg != last_msg)
|
205
|
+
puts msg
|
206
|
+
last_msg = msg
|
207
|
+
end
|
208
|
+
end
|
209
|
+
puts "=> Preview completed: https://#{site_id}.cloud-preview.siteleaf.com\n"
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
194
213
|
def config(site)
|
195
214
|
Siteleaf.save_settings({site_id: site.id}, '.siteleaf.yml')
|
196
215
|
puts "=> Site configured."
|
@@ -283,6 +302,16 @@ begin
|
|
283
302
|
raise "Site not configured, run `siteleaf config yoursite.com`.\n"
|
284
303
|
end
|
285
304
|
end
|
305
|
+
when 'preview'
|
306
|
+
site_id = get_site_id
|
307
|
+
if auth != false
|
308
|
+
quiet = %w[-q --quiet].include?(ARGV[1]) && ARGV[1]
|
309
|
+
if site_id
|
310
|
+
preview(site_id, quiet)
|
311
|
+
else
|
312
|
+
raise "Site not configured, run `siteleaf config yoursite.com`.\n"
|
313
|
+
end
|
314
|
+
end
|
286
315
|
when 'import'
|
287
316
|
site_id = get_site_id
|
288
317
|
if auth != false
|
data/lib/siteleaf/site.rb
CHANGED
@@ -42,6 +42,11 @@ module Siteleaf
|
|
42
42
|
result = Client.post "#{entity_endpoint}/publish", {}
|
43
43
|
Job.new(id: result["job_id"]) if result
|
44
44
|
end
|
45
|
+
|
46
|
+
def preview
|
47
|
+
result = Client.post "#{entity_endpoint}/preview", {}
|
48
|
+
Job.new(id: result["job_id"]) if result
|
49
|
+
end
|
45
50
|
|
46
51
|
def full_url
|
47
52
|
"http://#{domain}"
|
data/lib/siteleaf/source_file.rb
CHANGED
@@ -5,7 +5,7 @@ module Siteleaf
|
|
5
5
|
attr_reader :name, :url, :download_url, :type, :filesize, :sha, :created_at, :updated_at, :user_id
|
6
6
|
|
7
7
|
def create_endpoint
|
8
|
-
uri = URI.
|
8
|
+
uri = URI::Parser.new.escape(identifier)
|
9
9
|
uri = uri.gsub('[', '%5B').gsub(']', '%5D') # workaround for https://bugs.ruby-lang.org/issues/12235
|
10
10
|
::File.join('sites', site_id, 'source', uri)
|
11
11
|
end
|
data/lib/siteleaf/version.rb
CHANGED
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: 2.
|
4
|
+
version: 2.2.0
|
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-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -100,7 +100,7 @@ homepage: https://www.siteleaf.com
|
|
100
100
|
licenses:
|
101
101
|
- MIT
|
102
102
|
metadata: {}
|
103
|
-
post_install_message:
|
103
|
+
post_install_message:
|
104
104
|
rdoc_options: []
|
105
105
|
require_paths:
|
106
106
|
- lib
|
@@ -115,8 +115,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
119
|
-
signing_key:
|
118
|
+
rubygems_version: 3.2.32
|
119
|
+
signing_key:
|
120
120
|
specification_version: 4
|
121
121
|
summary: Siteleaf Ruby interface
|
122
122
|
test_files: []
|