siteleaf 2.1.1 → 2.1.2

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
  SHA256:
3
- metadata.gz: 1ec284cc046f9c5e51dfbba051755160066b078f14301e874b4196b2fe046d96
4
- data.tar.gz: 964a33326bb9753b4676dc1754345b6de1dc8fc7786c75675faea4f178681fd9
3
+ metadata.gz: 7632e9291c8a7111f572ac0380262e85d8ed86791fad2baa9ac7ef4bdea37973
4
+ data.tar.gz: 280efe8fe737f575fee142871d0b77334f5ee03e84e3d1613b42b5daa65c08c3
5
5
  SHA512:
6
- metadata.gz: 95c90c707c9cc8f90ee16d9d07a2b00756a440d5c4201aeedda7d2d9511b70be421be8d7175be69ee8a3f810b864d634f3c3d3e6dc58291253fff205964b5b3c
7
- data.tar.gz: aad52462704662408a6adbe07b39bd78ac1f125267a01bf34feb6cdc8e078208498dcfa28bbbb97b7eab755f3e95ea9ca8e19523760688abfcfb4cde33c26584
6
+ metadata.gz: 6d641ff9b139f5ea7c49beb1bcab152fe19dde0996e3043cf3e137d0ba41488ff4f8250e47bd41042d0e5d35c36b9df11df845981cfc55438ba4d90e35a4c260
7
+ data.tar.gz: fe6f49d7ad52adce8522b35c77775e85b2170e327dd442fba6a043cf2b0f4482008643a3be544641e1480ae47293fec544e316feeb928bb503f00d94814d06f6
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 [Rubygems](https://rubygems.org/gems/siteleaf). To install run:
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}"
@@ -1,3 +1,3 @@
1
1
  module Siteleaf
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
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: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siteleaf
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-15 00:00:00.000000000 Z
11
+ date: 2021-06-24 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.1.2
119
- signing_key:
118
+ rubygems_version: 3.1.4
119
+ signing_key:
120
120
  specification_version: 4
121
121
  summary: Siteleaf Ruby interface
122
122
  test_files: []