neocities-red 1.1.0 → 1.1.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/ISSUE_TEMPLATE/bug_report.md +32 -32
- data/.github/PULL_REQUEST_TEMPLATE.md +18 -18
- data/.github/dependabot.yml +6 -6
- data/.github/workflows/ci.yml +139 -139
- data/.gitignore +38 -38
- data/.rspec +3 -3
- data/.rubocop.yml +43 -43
- data/CODE_OF_CONDUCT.md +128 -128
- data/CONTRIBUTING.md +83 -83
- data/Gemfile +12 -12
- data/Gemfile.lock +194 -193
- data/LICENSE +21 -21
- data/README.md +153 -153
- data/SECURITY.md +7 -7
- data/bin/neocities-red +9 -9
- data/ext/mkrf_conf.rb +21 -21
- data/lib/neocities_red/cli.rb +340 -335
- data/lib/neocities_red/cli_display.rb +281 -271
- data/lib/neocities_red/client.rb +200 -200
- data/lib/neocities_red/services/common/pizza.rb +107 -107
- data/lib/neocities_red/services/file/folder_uploader.rb +65 -65
- data/lib/neocities_red/services/file/list.rb +65 -65
- data/lib/neocities_red/services/file/remover.rb +35 -35
- data/lib/neocities_red/services/file/uploader.rb +45 -45
- data/lib/neocities_red/services/site/differencer.rb +76 -76
- data/lib/neocities_red/services/site/exporter.rb +43 -43
- data/lib/neocities_red/services/site/informer.rb +43 -43
- data/lib/neocities_red/services/site/pusher.rb +146 -146
- data/lib/neocities_red/version.rb +5 -5
- data/lib/neocities_red.rb +17 -17
- data/neocities-red.gemspec +54 -54
- data/spec/neocities_red/cli_display_spec.rb +139 -139
- data/spec/neocities_red/cli_spec.rb +68 -68
- data/spec/neocities_red/client_spec.rb +306 -306
- data/spec/neocities_red/services/common/pizza_spec.rb +26 -26
- data/spec/neocities_red/services/file/folder_uploader_spec.rb +64 -64
- data/spec/neocities_red/services/file/list_spec.rb +177 -177
- data/spec/neocities_red/services/file/remover_spec.rb +125 -125
- data/spec/neocities_red/services/file/uploader_spec.rb +158 -158
- data/spec/neocities_red/services/site/differencer_spec.rb +162 -162
- data/spec/neocities_red/services/site/exporter_spec.rb +116 -116
- data/spec/neocities_red/services/site/informer_spec.rb +180 -180
- data/spec/neocities_red/services/site/pusher_spec.rb +167 -167
- data/spec/spec_helper.rb +20 -20
- metadata +4 -10
data/README.md
CHANGED
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-

|
|
2
|
-
[](https://rubygems.org/gems/neocities-red)
|
|
3
|
-
[](https://www.ruby-lang.org/)
|
|
4
|
-
[]()
|
|
5
|
-
[](https://github.com/o-200/neocities-red/blob/main/LICENSE)
|
|
6
|
-
[]()
|
|
7
|
-
|
|
8
|
-
# 🟥 Neocities Red
|
|
9
|
-
|
|
10
|
-
> A modern Neocities CLI
|
|
11
|
-
|
|
12
|
-
A **refactored and extended fork** of the official https://github.com/neocities/neocities-ruby
|
|
13
|
-
|
|
14
|
-
Built for performance, reliability, and real-world workflows (especially static site generators).
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## ✨ Key Features
|
|
19
|
-
|
|
20
|
-
- **CLI** with explicit command help (`neocities-red help <command>`)
|
|
21
|
-
- **Parallel uploads** (up to 5 concurrent workers)
|
|
22
|
-
- **Smart diffing** (only upload what changed)
|
|
23
|
-
- **Automatic retries** (handles flaky Neocities API / SSL issues)
|
|
24
|
-
- **Recursive uploads** out of the box
|
|
25
|
-
- **SSG-friendly** (Jekyll, Hugo, Eleventy, etc.)
|
|
26
|
-
- **Namespaced services** grouped by domain (`file/`, `site/`, `common/`)
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Installation
|
|
31
|
-
|
|
32
|
-
### Requirements
|
|
33
|
-
|
|
34
|
-
- **Ruby 3.4+** (tested, supports 4.x)
|
|
35
|
-
|
|
36
|
-
Not a programmer?
|
|
37
|
-
|
|
38
|
-
- Install Ruby here - https://www.ruby-lang.org/en/
|
|
39
|
-
- For Windows you should have installed MSYS2 and MINGW
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
### Install
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
gem install neocities-red
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## Quick Start
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
neocities-red help
|
|
55
|
-
neocities-red help push
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## CLI Commands
|
|
61
|
-
|
|
62
|
-
```text
|
|
63
|
-
push Recursively upload a local directory to your site
|
|
64
|
-
upload Upload individual files/folders to your site
|
|
65
|
-
delete Delete remote files
|
|
66
|
-
diff Compare local directory with remote
|
|
67
|
-
list List remote files
|
|
68
|
-
info Show site info
|
|
69
|
-
pull Download latest remote files
|
|
70
|
-
logout Remove stored API key from config
|
|
71
|
-
version Print gem version
|
|
72
|
-
pizza Easter egg
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### `push` options
|
|
76
|
-
|
|
77
|
-
| Flag | Description |
|
|
78
|
-
| --- | --- |
|
|
79
|
-
| `--no-gitignore` | Ignore `.gitignore` filtering and upload matching files |
|
|
80
|
-
| `--ignore-dotfiles` | Skip dotfiles/dot-directories |
|
|
81
|
-
| `-e`, `--exclude` | Exclude file/directory paths |
|
|
82
|
-
| `--dry-run` | Show intended actions without mutating remote |
|
|
83
|
-
| `--optimized` | Skip files that already match remote hash |
|
|
84
|
-
| `--prune` | Delete remote files that do not exist locally |
|
|
85
|
-
|
|
86
|
-
Examples:
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
neocities-red push .
|
|
90
|
-
neocities-red push . --optimized --ignore-dotfiles
|
|
91
|
-
neocities-red push . -e node_modules -e .git
|
|
92
|
-
neocities-red diff . -e secret.txt
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Library Usage
|
|
98
|
-
|
|
99
|
-
### Basic Client
|
|
100
|
-
|
|
101
|
-
```ruby
|
|
102
|
-
require 'neocities-red'
|
|
103
|
-
|
|
104
|
-
client = NeocitiesRed::Client.new(api_key: 'YOUR_API_KEY')
|
|
105
|
-
|
|
106
|
-
client.upload(local_path, remote_path)
|
|
107
|
-
client.delete(remote_path)
|
|
108
|
-
client.list(remote_path)
|
|
109
|
-
client.info(sitename)
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
### Advanced: Services
|
|
115
|
-
|
|
116
|
-
```ruby
|
|
117
|
-
client = NeocitiesRed::Client.new(
|
|
118
|
-
sitename: 'o200',
|
|
119
|
-
password: 'secret'
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
service = NeocitiesRed::Services::File::List.new(
|
|
123
|
-
client,
|
|
124
|
-
'.',
|
|
125
|
-
true
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
files = service.show
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Current service namespaces:
|
|
132
|
-
|
|
133
|
-
- `NeocitiesRed::Services::File` (`Uploader`, `FolderUploader`, `List`, `Remover`)
|
|
134
|
-
- `NeocitiesRed::Services::Site` (`Pusher`, `Differencer`, `Exporter`, `Informer`)
|
|
135
|
-
- `NeocitiesRed::Services::Common` (`Pizza`)
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## Contributing
|
|
140
|
-
|
|
141
|
-
see CONTRIBUTING.md
|
|
142
|
-
|
|
143
|
-
---
|
|
144
|
-
|
|
145
|
-
## License
|
|
146
|
-
|
|
147
|
-
MIT — see LICENSE
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Acknowledgements
|
|
152
|
-
|
|
153
|
-
Built for the Neocities community.
|
|
1
|
+

|
|
2
|
+
[](https://rubygems.org/gems/neocities-red)
|
|
3
|
+
[](https://www.ruby-lang.org/)
|
|
4
|
+
[]()
|
|
5
|
+
[](https://github.com/o-200/neocities-red/blob/main/LICENSE)
|
|
6
|
+
[]()
|
|
7
|
+
|
|
8
|
+
# 🟥 Neocities Red
|
|
9
|
+
|
|
10
|
+
> A modern Neocities CLI
|
|
11
|
+
|
|
12
|
+
A **refactored and extended fork** of the official https://github.com/neocities/neocities-ruby
|
|
13
|
+
|
|
14
|
+
Built for performance, reliability, and real-world workflows (especially static site generators).
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## ✨ Key Features
|
|
19
|
+
|
|
20
|
+
- **CLI** with explicit command help (`neocities-red help <command>`)
|
|
21
|
+
- **Parallel uploads** (up to 5 concurrent workers)
|
|
22
|
+
- **Smart diffing** (only upload what changed)
|
|
23
|
+
- **Automatic retries** (handles flaky Neocities API / SSL issues)
|
|
24
|
+
- **Recursive uploads** out of the box
|
|
25
|
+
- **SSG-friendly** (Jekyll, Hugo, Eleventy, etc.)
|
|
26
|
+
- **Namespaced services** grouped by domain (`file/`, `site/`, `common/`)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
### Requirements
|
|
33
|
+
|
|
34
|
+
- **Ruby 3.4+** (tested, supports 4.x)
|
|
35
|
+
|
|
36
|
+
Not a programmer?
|
|
37
|
+
|
|
38
|
+
- Install Ruby here - https://www.ruby-lang.org/en/
|
|
39
|
+
- For Windows you should have installed MSYS2 and MINGW
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
### Install
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
gem install neocities-red
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
neocities-red help
|
|
55
|
+
neocities-red help push
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## CLI Commands
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
push Recursively upload a local directory to your site
|
|
64
|
+
upload Upload individual files/folders to your site
|
|
65
|
+
delete Delete remote files
|
|
66
|
+
diff Compare local directory with remote
|
|
67
|
+
list List remote files
|
|
68
|
+
info Show site info
|
|
69
|
+
pull Download latest remote files
|
|
70
|
+
logout Remove stored API key from config
|
|
71
|
+
version Print gem version
|
|
72
|
+
pizza Easter egg
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### `push` options
|
|
76
|
+
|
|
77
|
+
| Flag | Description |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| `--no-gitignore` | Ignore `.gitignore` filtering and upload matching files |
|
|
80
|
+
| `--ignore-dotfiles` | Skip dotfiles/dot-directories |
|
|
81
|
+
| `-e`, `--exclude` | Exclude file/directory paths |
|
|
82
|
+
| `--dry-run` | Show intended actions without mutating remote |
|
|
83
|
+
| `--optimized` | Skip files that already match remote hash |
|
|
84
|
+
| `--prune` | Delete remote files that do not exist locally |
|
|
85
|
+
|
|
86
|
+
Examples:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
neocities-red push .
|
|
90
|
+
neocities-red push . --optimized --ignore-dotfiles
|
|
91
|
+
neocities-red push . -e node_modules -e .git
|
|
92
|
+
neocities-red diff . -e secret.txt
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Library Usage
|
|
98
|
+
|
|
99
|
+
### Basic Client
|
|
100
|
+
|
|
101
|
+
```ruby
|
|
102
|
+
require 'neocities-red'
|
|
103
|
+
|
|
104
|
+
client = NeocitiesRed::Client.new(api_key: 'YOUR_API_KEY')
|
|
105
|
+
|
|
106
|
+
client.upload(local_path, remote_path)
|
|
107
|
+
client.delete(remote_path)
|
|
108
|
+
client.list(remote_path)
|
|
109
|
+
client.info(sitename)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
### Advanced: Services
|
|
115
|
+
|
|
116
|
+
```ruby
|
|
117
|
+
client = NeocitiesRed::Client.new(
|
|
118
|
+
sitename: 'o200',
|
|
119
|
+
password: 'secret'
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
service = NeocitiesRed::Services::File::List.new(
|
|
123
|
+
client,
|
|
124
|
+
'.',
|
|
125
|
+
true
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
files = service.show
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Current service namespaces:
|
|
132
|
+
|
|
133
|
+
- `NeocitiesRed::Services::File` (`Uploader`, `FolderUploader`, `List`, `Remover`)
|
|
134
|
+
- `NeocitiesRed::Services::Site` (`Pusher`, `Differencer`, `Exporter`, `Informer`)
|
|
135
|
+
- `NeocitiesRed::Services::Common` (`Pizza`)
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Contributing
|
|
140
|
+
|
|
141
|
+
see CONTRIBUTING.md
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
MIT — see LICENSE
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Acknowledgements
|
|
152
|
+
|
|
153
|
+
Built for the Neocities community.
|
data/SECURITY.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
We **do not** support security updates in public API's on neocities. If you're discovered a security vulnerability, please contact to neocities's creator via [this form](https://neocities.org/contact) to fix public API.
|
|
4
|
-
|
|
5
|
-
If you discover a security vulnerability which doesn't related to API, open a public issue with your contacts and i will contact to you.
|
|
6
|
-
|
|
7
|
-
Thank you for helping keep this project and its users safe! 💙
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
We **do not** support security updates in public API's on neocities. If you're discovered a security vulnerability, please contact to neocities's creator via [this form](https://neocities.org/contact) to fix public API.
|
|
4
|
+
|
|
5
|
+
If you discover a security vulnerability which doesn't related to API, open a public issue with your contacts and i will contact to you.
|
|
6
|
+
|
|
7
|
+
Thank you for helping keep this project and its users safe! 💙
|
data/bin/neocities-red
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
lib = File.expand_path("../lib", __dir__)
|
|
5
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
6
|
-
|
|
7
|
-
require "neocities_red"
|
|
8
|
-
|
|
9
|
-
NeocitiesRed::CLI.start(ARGV)
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
lib = File.expand_path("../lib", __dir__)
|
|
5
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
6
|
+
|
|
7
|
+
require "neocities_red"
|
|
8
|
+
|
|
9
|
+
NeocitiesRed::CLI.start(ARGV)
|
data/ext/mkrf_conf.rb
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "rubygems"
|
|
4
|
-
require "rubygems/command"
|
|
5
|
-
require "rubygems/dependency_installer"
|
|
6
|
-
begin
|
|
7
|
-
Gem::Command.build_args = ARGV
|
|
8
|
-
rescue NoMethodError => e
|
|
9
|
-
# build_args may not exist in older RubyGems versions
|
|
10
|
-
warn "Warning: #{e.message}"
|
|
11
|
-
end
|
|
12
|
-
inst = Gem::DependencyInstaller.new
|
|
13
|
-
begin
|
|
14
|
-
inst.install "openssl-win-root", "~> 1.1" if Gem.win_platform?
|
|
15
|
-
rescue StandardError => e
|
|
16
|
-
warn "Failed to install openssl-win-root: #{e.message}"
|
|
17
|
-
exit(1)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# create dummy rakefile to indicate success
|
|
21
|
-
File.write(File.join(File.dirname(__FILE__), "Rakefile"), "task :default\n")
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rubygems"
|
|
4
|
+
require "rubygems/command"
|
|
5
|
+
require "rubygems/dependency_installer"
|
|
6
|
+
begin
|
|
7
|
+
Gem::Command.build_args = ARGV
|
|
8
|
+
rescue NoMethodError => e
|
|
9
|
+
# build_args may not exist in older RubyGems versions
|
|
10
|
+
warn "Warning: #{e.message}"
|
|
11
|
+
end
|
|
12
|
+
inst = Gem::DependencyInstaller.new
|
|
13
|
+
begin
|
|
14
|
+
inst.install "openssl-win-root", "~> 1.1" if Gem.win_platform?
|
|
15
|
+
rescue StandardError => e
|
|
16
|
+
warn "Failed to install openssl-win-root: #{e.message}"
|
|
17
|
+
exit(1)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# create dummy rakefile to indicate success
|
|
21
|
+
File.write(File.join(File.dirname(__FILE__), "Rakefile"), "task :default\n")
|