pagiii 0.1.7 → 0.1.8

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/pagiii +23 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7aa9340a933f74515dbb3d5635e811436a1aa3766af46c4f62c8ca92064dca71
4
- data.tar.gz: ff53dd0bc074da3533e12d0267f586c9af5eb63e8ba95ce3a5863ce03f072369
3
+ metadata.gz: 7f37aeef991fbf5bb24fecf5cfbf683a9574a771ba28073783e4fca4619c6138
4
+ data.tar.gz: 016d49ce50a8bb01552ada12fe201474273f9e37f5a65446d690f6b69d53bc1c
5
5
  SHA512:
6
- metadata.gz: d67c111636765142508f33b9b18b6e0cc09bda32a6ff6f899069d1154edba5c9737bcc1ab42721dd78bcb20ceea5fabe44714851314b03af700b8253936c0317
7
- data.tar.gz: 1091c29196447d941dc838db81710ff02db6f2dfd24225c7c6df9b756ac7a1647b2cccf0fef4bb4d86953f95dacb4e47aa1b3a085a0dd42a64842c70e283b4e2
6
+ metadata.gz: 8e604cc4ec62de9f4e4742529ebda7a6a9ee2c62c8bd36dee6b6364cc6304d89e5bdcf43219b6d70e8dc7e53858cd92c37a26b6fb1fb058bb8c471e9f1ba0b5c
7
+ data.tar.gz: a025b10e79ea73b789a5749c3187140721c2b192bd141713d57949abbfab98f1085aff8b9caa8895a8b3e0f63614cdd891467fab95bd8b4a8f25ceb655bc5c89
data/bin/pagiii CHANGED
@@ -9,6 +9,9 @@ require 'commander/import'
9
9
  require 'cgi'
10
10
  require 'socket'
11
11
 
12
+ CMD_PAD = 30
13
+ VESRION = '0.1.8'
14
+
12
15
  def root_api
13
16
  return ENV['PAGIII_HOST'] if ENV['PAGIII_HOST']
14
17
  "https://pagiii.com"
@@ -17,8 +20,6 @@ end
17
20
  program :version, '0.1.7'
18
21
  program :description, 'Pagiii CLI'
19
22
 
20
-
21
-
22
23
  def get_current_site(token)
23
24
  conn = Faraday.new(
24
25
  url: "#{root_api}/api/v1/admin/sites/current",
@@ -60,7 +61,21 @@ end
60
61
 
61
62
  command :help do |c|
62
63
  c.action do |args, options|
63
- say "pagiii"
64
+ say 'Usage: pagiii <command>'
65
+ say "Available command"
66
+ say '-----------------'
67
+ say " #{'help'.ljust(CMD_PAD)}show this help"
68
+ say " #{'login'.ljust(CMD_PAD)}login to pagiii.com"
69
+ say " #{'site:list'.ljust(CMD_PAD)}show list sites"
70
+ say " #{'theme:sync'.ljust(CMD_PAD)}sync theme"
71
+ say " #{'theme:watch'.ljust(CMD_PAD)}watch theme"
72
+ say " #{'theme:create'.ljust(CMD_PAD)}create theme"
73
+ say " #{'theme:pull'.ljust(CMD_PAD)}pull theme"
74
+ say " #{'theme:list'.ljust(CMD_PAD)}list theme"
75
+ say " #{'theme:delete'.ljust(CMD_PAD)}delete theme"
76
+ say " #{'theme:set_current'.ljust(CMD_PAD)}set current theme"
77
+ say " #{'theme:request'.ljust(CMD_PAD)}request access to theme"
78
+ say " #{'version'.ljust(CMD_PAD)}show version info"
64
79
  end
65
80
  end
66
81
 
@@ -226,6 +241,10 @@ command 'theme:set_current' do |c|
226
241
  end
227
242
  end
228
243
 
244
+ command 'version' do |c|
245
+ say "pagiii version #{VESRION}"
246
+ end
247
+
229
248
  command 'theme:request' do |c|
230
249
  c.syntax = "theme:request [options]"
231
250
  c.description = "Create theme"
@@ -237,7 +256,7 @@ command 'theme:request' do |c|
237
256
  say "Site Request access #{options.site}"
238
257
  url = "#{root_api}/#{options.site}/oauth/authorize?client_id=#{client_id}&redirect_uri=#{CGI.escape(redirect_uri)}&response_type=code&scope=#{scope}"
239
258
  say url
240
- `open "#{url}"`
259
+ `open "#{url}"`
241
260
  server = TCPServer.new 7654
242
261
  say "please check browser"
243
262
  while session = server.accept
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagiii
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sugiarto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-13 00:00:00.000000000 Z
11
+ date: 2024-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday