neocities-red 1.2.0 → 1.2.2
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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +3 -3
- data/.gitignore +5 -0
- data/.rubocop.yml +1 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +48 -38
- data/README.md +181 -20
- data/lib/neocities_red/version.rb +1 -1
- data/neocities-red.gemspec +2 -2
- data/spec/neocities_red/cli_spec.rb +1 -0
- data/spec/neocities_red/services/site/differencer_spec.rb +1 -2
- metadata +10 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 05f5a58cf28a34e2722bff32a93a220f0c4fdc38bcf0819d12c88be27bebabcd
|
|
4
|
+
data.tar.gz: e622118526fbff4f5b837ba6cf6c3995670d6e99be98800a20ed723f8668b339
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5cda32aab048dd5471267a6ae9cde52ebfab9c08c8dcc53cf39a57f4147e2c3cbf3a7e5affcbdde9dbb8301e973a7e5ebb75f98f710a4d3a268f067b1b88f980
|
|
7
|
+
data.tar.gz: 0ad66756dd87420530d21e8005cc806deb5fbbd29875e252cc9a2f72cb1bd3a08c09e590de797d5924587fb6597389afa111e33a6327dc9c4033e567ef433812
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -13,7 +13,7 @@ jobs:
|
|
|
13
13
|
strategy:
|
|
14
14
|
fail-fast: false
|
|
15
15
|
matrix:
|
|
16
|
-
ruby-version: ['3.4', '
|
|
16
|
+
ruby-version: ['3.4', '4.0']
|
|
17
17
|
|
|
18
18
|
steps:
|
|
19
19
|
- name: Checkout repository
|
|
@@ -40,7 +40,7 @@ jobs:
|
|
|
40
40
|
strategy:
|
|
41
41
|
fail-fast: false
|
|
42
42
|
matrix:
|
|
43
|
-
ruby-version: ['3.4', '
|
|
43
|
+
ruby-version: ['3.4', '4.0']
|
|
44
44
|
|
|
45
45
|
steps:
|
|
46
46
|
- name: Checkout repository
|
|
@@ -138,7 +138,7 @@ jobs:
|
|
|
138
138
|
usesh: true
|
|
139
139
|
prepare: |
|
|
140
140
|
pkg install -y ca_root_nss git rubygem-bundler
|
|
141
|
-
pkg install -y
|
|
141
|
+
pkg install -y ruby
|
|
142
142
|
run: |
|
|
143
143
|
RUBY_BIN="$(command -v ruby34 || command -v ruby)"
|
|
144
144
|
"$RUBY_BIN" -v
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
neocities-red (1.2.
|
|
5
|
-
faraday (
|
|
4
|
+
neocities-red (1.2.2)
|
|
5
|
+
faraday (>= 2.14.3, < 2.16.0)
|
|
6
6
|
faraday-follow_redirects
|
|
7
7
|
faraday-multipart
|
|
8
8
|
faraday-retry
|
|
@@ -17,47 +17,51 @@ PATH
|
|
|
17
17
|
GEM
|
|
18
18
|
remote: https://rubygems.org/
|
|
19
19
|
specs:
|
|
20
|
-
addressable (2.9.
|
|
20
|
+
addressable (2.9.2)
|
|
21
21
|
public_suffix (>= 2.0.2, < 8.0)
|
|
22
22
|
ast (2.4.3)
|
|
23
|
-
bigdecimal (4.1.
|
|
23
|
+
bigdecimal (4.1.3)
|
|
24
24
|
crack (1.0.1)
|
|
25
25
|
bigdecimal
|
|
26
26
|
rexml
|
|
27
27
|
diff-lcs (1.6.2)
|
|
28
|
-
faraday (2.
|
|
29
|
-
faraday-net_http (>= 2.0, < 3.
|
|
28
|
+
faraday (2.15.1)
|
|
29
|
+
faraday-net_http (>= 2.0, < 3.6)
|
|
30
30
|
json
|
|
31
31
|
logger
|
|
32
32
|
faraday-follow_redirects (0.5.0)
|
|
33
33
|
faraday (>= 1, < 3)
|
|
34
34
|
faraday-multipart (1.2.0)
|
|
35
35
|
multipart-post (~> 2.0)
|
|
36
|
-
faraday-net_http (3.
|
|
36
|
+
faraday-net_http (3.5.0)
|
|
37
37
|
net-http (~> 0.5)
|
|
38
38
|
faraday-retry (2.4.0)
|
|
39
39
|
faraday (~> 2.0)
|
|
40
40
|
fiddle (1.1.8)
|
|
41
|
-
hashdiff (1.2.
|
|
42
|
-
json (
|
|
41
|
+
hashdiff (1.2.2)
|
|
42
|
+
json (3.1.0)
|
|
43
43
|
language_server-protocol (3.17.0.6)
|
|
44
44
|
lint_roller (1.1.0)
|
|
45
45
|
logger (1.7.0)
|
|
46
46
|
multipart-post (2.4.1)
|
|
47
|
-
net-http (0.
|
|
47
|
+
net-http (0.10.0)
|
|
48
|
+
net-protocol (>= 0.3.0)
|
|
48
49
|
uri (>= 0.11.1)
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
net-protocol (0.4.0)
|
|
51
|
+
timeout
|
|
52
|
+
parallel (2.3.0)
|
|
53
|
+
parser (3.3.14.0)
|
|
51
54
|
ast (~> 2.4.1)
|
|
52
55
|
racc
|
|
53
56
|
pastel (0.8.0)
|
|
54
57
|
tty-color (~> 0.5)
|
|
55
|
-
prism (1.
|
|
58
|
+
prism (2.1.0)
|
|
59
|
+
prism (2.1.0-x86_64-linux-gnu)
|
|
56
60
|
public_suffix (7.0.5)
|
|
57
61
|
racc (1.8.1)
|
|
58
62
|
rainbow (3.1.1)
|
|
59
63
|
rake (13.4.2)
|
|
60
|
-
regexp_parser (2.
|
|
64
|
+
regexp_parser (2.13.4)
|
|
61
65
|
rexml (3.4.4)
|
|
62
66
|
rspec (3.13.2)
|
|
63
67
|
rspec-core (~> 3.13.0)
|
|
@@ -72,20 +76,22 @@ GEM
|
|
|
72
76
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
73
77
|
rspec-support (~> 3.13.0)
|
|
74
78
|
rspec-support (3.13.7)
|
|
75
|
-
rubocop (1.
|
|
76
|
-
json (
|
|
79
|
+
rubocop (1.92.3)
|
|
80
|
+
json (>= 2.3)
|
|
77
81
|
language_server-protocol (~> 3.17.0.2)
|
|
78
82
|
lint_roller (~> 1.1.0)
|
|
79
83
|
parallel (>= 1.10)
|
|
80
84
|
parser (>= 3.3.0.2)
|
|
81
85
|
rainbow (>= 2.2.2, < 4.0)
|
|
82
|
-
regexp_parser (>= 2.
|
|
86
|
+
regexp_parser (>= 2.11.3, < 3.0)
|
|
83
87
|
rubocop-ast (>= 1.49.0, < 2.0)
|
|
84
88
|
ruby-progressbar (~> 1.7)
|
|
85
89
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
86
|
-
rubocop-ast (1.
|
|
90
|
+
rubocop-ast (1.53.0)
|
|
91
|
+
ast (~> 2.4)
|
|
87
92
|
parser (>= 3.3.7.2)
|
|
88
|
-
prism (
|
|
93
|
+
prism (>= 1.7)
|
|
94
|
+
racc
|
|
89
95
|
rubocop-rspec (3.10.2)
|
|
90
96
|
lint_roller (~> 1.1)
|
|
91
97
|
regexp_parser (>= 2.0)
|
|
@@ -97,6 +103,7 @@ GEM
|
|
|
97
103
|
unicode_utils (~> 1.4)
|
|
98
104
|
strings-ansi (0.2.0)
|
|
99
105
|
thor (1.5.0)
|
|
106
|
+
timeout (0.6.1)
|
|
100
107
|
tty-color (0.6.0)
|
|
101
108
|
tty-cursor (0.7.1)
|
|
102
109
|
tty-prompt (0.23.1)
|
|
@@ -113,8 +120,8 @@ GEM
|
|
|
113
120
|
tty-screen (~> 0.8)
|
|
114
121
|
unicode-display_width (2.6.0)
|
|
115
122
|
unicode_utils (1.4.0)
|
|
116
|
-
uri (1.1.
|
|
117
|
-
webmock (3.
|
|
123
|
+
uri (1.1.2)
|
|
124
|
+
webmock (3.35.0)
|
|
118
125
|
addressable (>= 2.8.0)
|
|
119
126
|
crack (>= 0.3.2)
|
|
120
127
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
@@ -131,54 +138,57 @@ PLATFORMS
|
|
|
131
138
|
DEPENDENCIES
|
|
132
139
|
neocities-red!
|
|
133
140
|
rspec
|
|
134
|
-
rubocop (~> 1.
|
|
141
|
+
rubocop (~> 1.92.3)
|
|
135
142
|
rubocop-rspec (~> 3.10.2)
|
|
136
143
|
webmock
|
|
137
144
|
yard
|
|
138
145
|
|
|
139
146
|
CHECKSUMS
|
|
140
|
-
addressable (2.9.
|
|
147
|
+
addressable (2.9.2) sha256=9117c7e7d6ee07230e75ce41fb9401ae55354dc654fcd0e862ba41d539e9a610
|
|
141
148
|
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
142
|
-
bigdecimal (4.1.
|
|
149
|
+
bigdecimal (4.1.3) sha256=61ebe1e5e559bdc3cc6f2c0ee7f427321fc838f59611c294356eb04d6e21cf66
|
|
143
150
|
bundler (4.0.17) sha256=214e21431b5665dd2f99df8a5511c6b151d7a72e8015c8b38f8b775b61cbb6c1
|
|
144
151
|
crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e
|
|
145
152
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
146
|
-
faraday (2.
|
|
153
|
+
faraday (2.15.1) sha256=8708154deda739c5e86cc42b74960e23e8491fce0eba9e11639a6a34b1ac288f
|
|
147
154
|
faraday-follow_redirects (0.5.0) sha256=5cde93c894b30943a5d2b93c2fe9284216a6b756f7af406a1e55f211d97d10ad
|
|
148
155
|
faraday-multipart (1.2.0) sha256=7d89a949693714176f612323ca13746a2ded204031a6ba528adee788694ef757
|
|
149
|
-
faraday-net_http (3.
|
|
156
|
+
faraday-net_http (3.5.0) sha256=2e7094c34e38754ee048cc3df47376f8657005d9375f8473bce1c3b526a22e36
|
|
150
157
|
faraday-retry (2.4.0) sha256=7b79c48fb7e56526faf247b12d94a680071ff40c9fda7cf1ec1549439ad11ebe
|
|
151
158
|
fiddle (1.1.8) sha256=7fa8ee3627271497f3add5503acdbc3f40b32f610fc1cf49634f083ef3f32eee
|
|
152
|
-
hashdiff (1.2.
|
|
153
|
-
json (
|
|
159
|
+
hashdiff (1.2.2) sha256=e2e287452b42f18d2a8d82dd48c435e214a81dbadccf49344b956842a3b9127f
|
|
160
|
+
json (3.1.0) sha256=3ce7ccf8fde58960177a3a756c31f292a4c1e1dedee884547096a5b0604e3bd8
|
|
154
161
|
language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
|
|
155
162
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
156
163
|
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
157
164
|
multipart-post (2.4.1) sha256=9872d03a8e552020ca096adadbf5e3cb1cd1cdd6acd3c161136b8a5737cdb4a8
|
|
158
|
-
neocities-red (1.2.
|
|
159
|
-
net-http (0.
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
neocities-red (1.2.2)
|
|
166
|
+
net-http (0.10.0) sha256=1a2ff6e37a05724973c43f2bf7bf105f59c36a4cd0a7e9b1c021a0a566987c27
|
|
167
|
+
net-protocol (0.4.0) sha256=f9f90c8c6f64794a45160bf422177a336db12809de3beeeaa26b88fcd2e8c853
|
|
168
|
+
parallel (2.3.0) sha256=f75a3e904101ce6a1ccb6b8dc800cbafd42166d83330192438dcf29395167a6f
|
|
169
|
+
parser (3.3.14.0) sha256=62f8f76af7b919425ee2d811880e9dcb8011ab40bfd59970dfb583141697e58f
|
|
162
170
|
pastel (0.8.0) sha256=481da9fb7d2f6e6b1a08faf11fa10363172dc40fd47848f096ae21209f805a75
|
|
163
|
-
prism (1.
|
|
171
|
+
prism (2.1.0) sha256=1c0a7c6dea0e93183390fb123f007564dbe663198e2f86ad87204151147601f3
|
|
172
|
+
prism (2.1.0-x86_64-linux-gnu) sha256=b2b647afce09551e650b8bb3e2fc91d7d73d392a09534ca307ec0d619c33bfd4
|
|
164
173
|
public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
|
|
165
174
|
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
166
175
|
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
167
176
|
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
168
|
-
regexp_parser (2.
|
|
177
|
+
regexp_parser (2.13.4) sha256=1d0547814f57e6f00946957bd0ca201bc42f42cfb08eee89df60998aedcd8a3b
|
|
169
178
|
rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
|
|
170
179
|
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
|
|
171
180
|
rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
|
|
172
181
|
rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
|
|
173
182
|
rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
|
|
174
183
|
rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
|
|
175
|
-
rubocop (1.
|
|
176
|
-
rubocop-ast (1.
|
|
184
|
+
rubocop (1.92.3) sha256=fd77feac46e8e91c3a534f868a1702c59f5bf8173515fd00a3c6ce1198672ff6
|
|
185
|
+
rubocop-ast (1.53.0) sha256=027984d28485d6502ae4c72f9341080f54f538599f5dbb54f81875a4ddcad574
|
|
177
186
|
rubocop-rspec (3.10.2) sha256=0b3e2ecc592cd10ecbf0095bb58d1e357905276e069643523cc19eb7495f65e2
|
|
178
187
|
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
|
179
188
|
strings (0.2.1) sha256=933293b3c95cf85b81eb44b3cf673e3087661ba739bbadfeadf442083158d6fb
|
|
180
189
|
strings-ansi (0.2.0) sha256=90262d760ea4a94cc2ae8d58205277a343409c288cbe7c29416b1826bd511c88
|
|
181
190
|
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
|
|
191
|
+
timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb
|
|
182
192
|
tty-color (0.6.0) sha256=6f9c37ca3a4e2367fb2e6d09722762647d6f455c111f05b59f35730eeb24332a
|
|
183
193
|
tty-cursor (0.7.1) sha256=79534185e6a777888d88628b14b6a1fdf5154a603f285f80b1753e1908e0bf48
|
|
184
194
|
tty-prompt (0.23.1) sha256=fcdbce905238993f27eecfdf67597a636bc839d92192f6a0eef22b8166449ec8
|
|
@@ -187,8 +197,8 @@ CHECKSUMS
|
|
|
187
197
|
tty-table (0.12.0) sha256=fdc27a4750835c1a16efe19a0b857e3ced3652cc7aceafe6dca94908965b9939
|
|
188
198
|
unicode-display_width (2.6.0) sha256=12279874bba6d5e4d2728cef814b19197dbb10d7a7837a869bab65da943b7f5a
|
|
189
199
|
unicode_utils (1.4.0) sha256=b922d0cf2313b6b7136ada6645ce7154ffc86418ca07d53b058efe9eb72f2a40
|
|
190
|
-
uri (1.1.
|
|
191
|
-
webmock (3.
|
|
200
|
+
uri (1.1.2) sha256=89292e98eabbef6248b0a0ed5e7e398e152f83f17560023a6d94a7f492b169fb
|
|
201
|
+
webmock (3.35.0) sha256=cb9f61718a0004f5d0c65f8dc36764b714213902599fbd3ae63a7a08f22a78b3
|
|
192
202
|
whirly (0.4.0) sha256=3ffdf9097e711097442f6d83c91b8fc431d73224863f75b48f06fb850b3e596e
|
|
193
203
|
wisper (2.0.1) sha256=ce17bc5c3a166f241a2e6613848b025c8146fce2defba505920c1d1f3f88fae6
|
|
194
204
|
yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51
|
data/README.md
CHANGED
|
@@ -24,14 +24,14 @@ Built for performance, reliability, and real-world workflows (especially static
|
|
|
24
24
|
- **Recursive uploads** out of the box
|
|
25
25
|
- **SSG-friendly** (Jekyll, Hugo, Eleventy, etc.)
|
|
26
26
|
- **Namespaced services** grouped by domain (`file/`, `site/`, `common/`)
|
|
27
|
+
- **Incremental `pull`** — skips files unchanged since your last pull
|
|
28
|
+
- **`.gitignore`-aware `push`** — respects your ignore rules by default
|
|
27
29
|
|
|
28
30
|
---
|
|
29
31
|
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
### Requirements
|
|
32
|
+
## Requirements
|
|
33
33
|
|
|
34
|
-
- **Ruby 3.4+** (tested
|
|
34
|
+
- **Ruby 3.4+** (CI-tested against 3.4 and 4.0 on Linux, macOS, Windows, and FreeBSD)
|
|
35
35
|
|
|
36
36
|
Not a programmer?
|
|
37
37
|
|
|
@@ -40,7 +40,7 @@ Not a programmer?
|
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
## Installation
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
46
|
gem install neocities-red
|
|
@@ -55,6 +55,47 @@ neocities-red help
|
|
|
55
55
|
neocities-red help push
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
On first authenticated command you'll be prompted for your sitename/username and
|
|
59
|
+
password — the resulting API key is stored locally for future runs.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
neocities-red push .
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Authentication
|
|
68
|
+
|
|
69
|
+
The CLI resolves credentials in this order:
|
|
70
|
+
|
|
71
|
+
1. **`--api-key` flag** — `neocities-red --api-key <key> push .`
|
|
72
|
+
2. **`NEOCITIES_API_KEY` environment variable**
|
|
73
|
+
3. **Stored config** — the API key saved by a previous interactive login
|
|
74
|
+
4. **Interactive login** — prompts for sitename/username and password
|
|
75
|
+
|
|
76
|
+
For non-interactive logins you can also set:
|
|
77
|
+
|
|
78
|
+
| Variable | Purpose |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `NEOCITIES_API_KEY` | API key used as a Bearer token |
|
|
81
|
+
| `NEOCITIES_SITENAME` | Default sitename/username for the login prompt |
|
|
82
|
+
| `NEOCITIES_PASSWORD` | Default password for the login prompt |
|
|
83
|
+
|
|
84
|
+
The config file is stored per platform:
|
|
85
|
+
|
|
86
|
+
| Platform | Location |
|
|
87
|
+
| --- | --- |
|
|
88
|
+
| Linux | `$XDG_CONFIG_HOME/neocities/config.json` (defaults to `~/.config/neocities/config.json`) |
|
|
89
|
+
| macOS | `~/Library/Application Support/neocities/config.json` |
|
|
90
|
+
| Windows | `%LOCALAPPDATA%\neocities\config.json` |
|
|
91
|
+
| FreeBSD / other | `~/.neocities/config.json` |
|
|
92
|
+
|
|
93
|
+
Remove the stored key with:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
neocities-red logout -y
|
|
97
|
+
```
|
|
98
|
+
|
|
58
99
|
---
|
|
59
100
|
|
|
60
101
|
## CLI Commands
|
|
@@ -62,36 +103,142 @@ neocities-red help push
|
|
|
62
103
|
```text
|
|
63
104
|
push Recursively upload a local directory to your site
|
|
64
105
|
upload Upload individual files/folders to your site
|
|
65
|
-
delete Delete
|
|
66
|
-
diff Compare local directory with
|
|
67
|
-
list List
|
|
68
|
-
info Show site
|
|
69
|
-
pull
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
106
|
+
delete Delete files from your site
|
|
107
|
+
diff Compare your local directory with your site
|
|
108
|
+
list List files from your site
|
|
109
|
+
info Show information and stats for your site
|
|
110
|
+
pull Get the most recent version of files from your site
|
|
111
|
+
purge Remove all files from your site (development only)
|
|
112
|
+
logout Remove the stored API key from the config
|
|
113
|
+
version Print the gem version
|
|
114
|
+
pizza Order a free pizza
|
|
115
|
+
help Show help for a command
|
|
73
116
|
```
|
|
74
117
|
|
|
75
|
-
### `push`
|
|
118
|
+
### `push`
|
|
119
|
+
|
|
120
|
+
Recursively upload a local directory to your Neocities site. Respects
|
|
121
|
+
`.gitignore` rules by default.
|
|
76
122
|
|
|
77
123
|
| Flag | Description |
|
|
78
124
|
| --- | --- |
|
|
79
125
|
| `--no-gitignore` | Ignore `.gitignore` filtering and upload matching files |
|
|
80
126
|
| `--ignore-dotfiles` | Skip dotfiles/dot-directories |
|
|
81
|
-
| `-e`, `--exclude` | Exclude file/directory paths |
|
|
127
|
+
| `-e`, `--exclude` | Exclude file/directory paths (repeatable) |
|
|
82
128
|
| `--dry-run` | Show intended actions without mutating remote |
|
|
83
|
-
| `--optimized` | Skip files
|
|
129
|
+
| `--optimized` | Skip files whose SHA1 hash already matches the server |
|
|
84
130
|
| `--prune` | Delete remote files that do not exist locally |
|
|
85
131
|
|
|
86
|
-
Examples:
|
|
87
|
-
|
|
88
132
|
```bash
|
|
89
133
|
neocities-red push .
|
|
90
134
|
neocities-red push . --optimized --ignore-dotfiles
|
|
91
135
|
neocities-red push . -e node_modules -e .git
|
|
136
|
+
neocities-red push . --dry-run
|
|
137
|
+
neocities-red push . --prune
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### `diff`
|
|
141
|
+
|
|
142
|
+
Compare a local directory with the remote site and show added, modified, and
|
|
143
|
+
removed files.
|
|
144
|
+
|
|
145
|
+
| Flag | Description |
|
|
146
|
+
| --- | --- |
|
|
147
|
+
| `--ignore-dotfiles` | Skip dotfiles/dot-directories |
|
|
148
|
+
| `-e`, `--exclude` | Exclude file/directory paths (repeatable) |
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
neocities-red diff .
|
|
152
|
+
neocities-red diff ./my-website --ignore-dotfiles
|
|
92
153
|
neocities-red diff . -e secret.txt
|
|
93
154
|
```
|
|
94
155
|
|
|
156
|
+
### `upload`
|
|
157
|
+
|
|
158
|
+
Upload an individual file or folder to your site.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
neocities-red upload index.html
|
|
162
|
+
neocities-red upload assets/ images/assets
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### `list`
|
|
166
|
+
|
|
167
|
+
List files from your Neocities site.
|
|
168
|
+
|
|
169
|
+
| Flag | Description |
|
|
170
|
+
| --- | --- |
|
|
171
|
+
| `-d`, `--detail` | Show a detailed table with size, SHA1 hash, and last-updated timestamp |
|
|
172
|
+
| `-a`, `--all` | List the entire site (ignore the path argument) |
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
neocities-red list
|
|
176
|
+
neocities-red list images -d
|
|
177
|
+
neocities-red list -a
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### `info`
|
|
181
|
+
|
|
182
|
+
Show information and statistics for a site (defaults to your own site).
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
neocities-red info
|
|
186
|
+
neocities-red info fauux
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### `pull`
|
|
190
|
+
|
|
191
|
+
Download the most recent version of files from your site. Skips files that
|
|
192
|
+
haven't changed since your last pull.
|
|
193
|
+
|
|
194
|
+
| Flag | Description |
|
|
195
|
+
| --- | --- |
|
|
196
|
+
| `-q`, `--quiet` | Show a spinner instead of per-file output |
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
neocities-red pull
|
|
200
|
+
neocities-red pull --quiet
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### `delete`
|
|
204
|
+
|
|
205
|
+
Delete one or more files from your site.
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
neocities-red delete old.html
|
|
209
|
+
neocities-red delete old.html archived/old.css
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### `purge`
|
|
213
|
+
|
|
214
|
+
Delete **everything** from your site. Intended for development sites only —
|
|
215
|
+
use with care.
|
|
216
|
+
|
|
217
|
+
| Flag | Description |
|
|
218
|
+
| --- | --- |
|
|
219
|
+
| `-y`, `--yes` | Confirm the destructive action (required) |
|
|
220
|
+
| `--dry-run` | Show what would be deleted without deleting |
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
neocities-red purge -y
|
|
224
|
+
neocities-red purge -y --dry-run
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### `logout`
|
|
228
|
+
|
|
229
|
+
Remove the stored API key from the config. Requires confirmation.
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
neocities-red logout -y
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### `version` & `pizza`
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
neocities-red version # print the gem version
|
|
239
|
+
neocities-red pizza # order a free pizza (easter egg)
|
|
240
|
+
```
|
|
241
|
+
|
|
95
242
|
---
|
|
96
243
|
|
|
97
244
|
## Library Usage
|
|
@@ -109,7 +256,10 @@ client.list(remote_path)
|
|
|
109
256
|
client.info(sitename)
|
|
110
257
|
```
|
|
111
258
|
|
|
112
|
-
|
|
259
|
+
The client supports both API-key (`api_key:`) and basic-auth
|
|
260
|
+
(`sitename:`/`password:`) authentication, retries transient failures (429/5xx)
|
|
261
|
+
automatically, and exposes low-level helpers like `upload_hash`,
|
|
262
|
+
`delete_wrapper_with_dry_run`, `key`, and `download`.
|
|
113
263
|
|
|
114
264
|
### Advanced: Services
|
|
115
265
|
|
|
@@ -132,7 +282,18 @@ Current service namespaces:
|
|
|
132
282
|
|
|
133
283
|
- `NeocitiesRed::Services::File` (`Uploader`, `FolderUploader`, `List`, `Remover`)
|
|
134
284
|
- `NeocitiesRed::Services::Site` (`Pusher`, `Differencer`, `Exporter`, `Informer`)
|
|
135
|
-
- `NeocitiesRed::Services::Common` (`Pizza`)
|
|
285
|
+
- `NeocitiesRed::Services::Common` (`Exclusions`, `WorkerPool`, `Pizza`)
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Development
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
bundle install
|
|
293
|
+
bundle exec rspec # run the test suite
|
|
294
|
+
bundle exec rubocop # run the linter
|
|
295
|
+
bundle exec ruby bin/neocities-red # run the CLI from source
|
|
296
|
+
```
|
|
136
297
|
|
|
137
298
|
---
|
|
138
299
|
|
data/neocities-red.gemspec
CHANGED
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
|
15
15
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
16
16
|
files = begin
|
|
17
17
|
if system("git", "rev-parse", "--is-inside-work-tree", out: File::NULL, err: File::NULL)
|
|
18
|
-
`git ls-files -z`.split("\x0").reject { |f| f == ".yardopts" }
|
|
18
|
+
`git ls-files -z`.split("\x0").reject { |f| f == ".yardopts" || f.start_with?("docs/") }
|
|
19
19
|
else
|
|
20
20
|
[]
|
|
21
21
|
end
|
|
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
|
|
|
39
39
|
spec.extensions = ["ext/mkrf_conf.rb"]
|
|
40
40
|
spec.required_ruby_version = ">= 3.4.0"
|
|
41
41
|
|
|
42
|
-
spec.add_dependency "faraday", "
|
|
42
|
+
spec.add_dependency "faraday", ">= 2.14.3", "< 2.16.0"
|
|
43
43
|
spec.add_dependency "faraday-follow_redirects"
|
|
44
44
|
spec.add_dependency "faraday-multipart"
|
|
45
45
|
spec.add_dependency "faraday-retry"
|
|
@@ -87,6 +87,7 @@ RSpec.describe NeocitiesRed::CLI do
|
|
|
87
87
|
cli.send(:persist_config, API_KEY: "secret", SITENAME: "test-site")
|
|
88
88
|
|
|
89
89
|
expect(File.read(config_path)).to eq('{"API_KEY":"secret","SITENAME":"test-site"}')
|
|
90
|
+
skip "chmod is a no-op on Windows" if Gem.win_platform?
|
|
90
91
|
expect(File.stat(config_path).mode & 0o777).to eq(0o600)
|
|
91
92
|
end
|
|
92
93
|
end
|
|
@@ -23,9 +23,8 @@ RSpec.describe NeocitiesRed::Services::Site::Differencer do
|
|
|
23
23
|
let(:ignore_dotfiles) { false }
|
|
24
24
|
let(:exclude) { [] }
|
|
25
25
|
|
|
26
|
-
# rubocop:disable RSpec/VerifiedDoubles
|
|
26
|
+
# rubocop:disable-next RSpec/VerifiedDoubles
|
|
27
27
|
let(:pastel) { double("Pastel") }
|
|
28
|
-
# rubocop:enable RSpec/VerifiedDoubles
|
|
29
28
|
|
|
30
29
|
let(:file_list_service) do
|
|
31
30
|
instance_double(
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: neocities-red
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kyle Drake
|
|
@@ -14,16 +14,22 @@ dependencies:
|
|
|
14
14
|
name: faraday
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: 2.14.3
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: 2.16.0
|
|
20
23
|
type: :runtime
|
|
21
24
|
prerelease: false
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
26
|
requirements:
|
|
24
|
-
- - "
|
|
27
|
+
- - ">="
|
|
25
28
|
- !ruby/object:Gem::Version
|
|
26
29
|
version: 2.14.3
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 2.16.0
|
|
27
33
|
- !ruby/object:Gem::Dependency
|
|
28
34
|
name: faraday-follow_redirects
|
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -255,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
255
261
|
- !ruby/object:Gem::Version
|
|
256
262
|
version: '0'
|
|
257
263
|
requirements: []
|
|
258
|
-
rubygems_version: 4.0.
|
|
264
|
+
rubygems_version: 4.0.20
|
|
259
265
|
specification_version: 4
|
|
260
266
|
summary: Yet Another Neocities.org CLI and API client with improvements
|
|
261
267
|
test_files: []
|