archival 0.0.10 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/lib/archival/helper_server.rb +13 -6
- data/lib/archival/markdown_renderer.rb +2 -2
- data/lib/archival/version.rb +1 -1
- data/package.json +1 -1
- metadata +3 -4
- data/archival.gemspec +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42d89221cb0631429658fbc280543138b92405efdfdc0f2b85147b9257fdc74a
|
4
|
+
data.tar.gz: b20b8458a7200984c511d6c3def55598e7157932b1c0039230f584b6c4a99c2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dff3560896d691c518ec63af55c41a9430717f57dd6bb9234811d86e8aee9d3a42b11a20ea27a0fe436415617dc1a5cdf5134be2b53f683c98ef5d58d96ecd3f
|
7
|
+
data.tar.gz: bf23c900d3971e85bb6d89eae95d8aa055ef38aefe8ebefdc9d6ecbe8b023bca5f594acf44460d6e01c1ccf9e08e89f8be4e66c0242316d10908d786ec9bad50
|
data/README.md
CHANGED
@@ -53,6 +53,18 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
53
53
|
|
54
54
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
55
55
|
|
56
|
+
To point a local archival site at a local version, run inside the website dir:
|
57
|
+
|
58
|
+
```
|
59
|
+
bundle config local.archival /path/to/local/git/repository
|
60
|
+
```
|
61
|
+
|
62
|
+
Then comment out the archival dependency in Gemfile and add:
|
63
|
+
|
64
|
+
```
|
65
|
+
gem 'archival', github: 'jesseditson/archival', branch: 'main'
|
66
|
+
```
|
67
|
+
|
56
68
|
## Contributing
|
57
69
|
|
58
70
|
Bug reports and pull requests are welcome on GitHub at https://github.com/jesseditson/archival.
|
@@ -127,15 +127,17 @@ module Archival
|
|
127
127
|
# warn "Payload size: #{payload_size} bytes"
|
128
128
|
|
129
129
|
mask = 4.times.map { @socket.getbyte }
|
130
|
-
#
|
130
|
+
# warn "Got mask: #{mask.inspect}"
|
131
131
|
|
132
132
|
data = payload_size.times.map { @socket.getbyte }
|
133
|
-
#
|
133
|
+
# warn "Got masked data: #{data.inspect}"
|
134
|
+
|
135
|
+
return unless data[0]
|
134
136
|
|
135
137
|
unmasked_data = data.each_with_index.map do |byte, i|
|
136
138
|
byte ^ mask[i % 4]
|
137
139
|
end
|
138
|
-
#
|
140
|
+
# warn "Unmasked the data: #{unmasked_data.inspect}"
|
139
141
|
|
140
142
|
unmasked_data.pack('C*').force_encoding('utf-8')
|
141
143
|
end
|
@@ -148,9 +150,14 @@ module Archival
|
|
148
150
|
end
|
149
151
|
|
150
152
|
def serve_static(client, path, base = @build_dir)
|
151
|
-
|
152
|
-
|
153
|
-
|
153
|
+
full_path = File.join(base, path)
|
154
|
+
if File.file? full_path
|
155
|
+
buffer = File.open(full_path).read
|
156
|
+
buffer.sub! '$PORT', @port.to_s
|
157
|
+
client.print buffer
|
158
|
+
else
|
159
|
+
client.print 'Unknown File'
|
160
|
+
end
|
154
161
|
end
|
155
162
|
|
156
163
|
def http_response(client, config)
|
@@ -4,7 +4,7 @@ require 'redcarpet'
|
|
4
4
|
|
5
5
|
module Archival
|
6
6
|
class MarkdownRenderer < Redcarpet::Render::HTML
|
7
|
-
def autolink(link,
|
7
|
+
def autolink(link, _opts)
|
8
8
|
# TODO: handle link_type?
|
9
9
|
"<a href=\"#{rewrite_link(link)}\">#{rewrite_link(link)}</a>"
|
10
10
|
end
|
@@ -23,7 +23,7 @@ title=\"#{title}\" alt=\"#{alt_text}\"/>"
|
|
23
23
|
def rewrite_link(link)
|
24
24
|
if link.start_with?('http') || link.start_with?('mailto') ||
|
25
25
|
link.start_with?('www') || link.start_with?('/')
|
26
|
-
link
|
26
|
+
return link
|
27
27
|
end
|
28
28
|
template_dir = File.dirname(@options[:template_file])
|
29
29
|
resolved_link = Pathname.new(File.join(@options[:pages_root], link))
|
data/lib/archival/version.rb
CHANGED
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: archival
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Ditson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -83,7 +83,6 @@ files:
|
|
83
83
|
- README.md
|
84
84
|
- Rakefile
|
85
85
|
- action.yml
|
86
|
-
- archival.gemspec
|
87
86
|
- bin/archival
|
88
87
|
- bin/bundle
|
89
88
|
- bin/htmldiff
|
@@ -132,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
131
|
- !ruby/object:Gem::Version
|
133
132
|
version: '0'
|
134
133
|
requirements: []
|
135
|
-
rubygems_version: 3.3.
|
134
|
+
rubygems_version: 3.3.7
|
136
135
|
signing_key:
|
137
136
|
specification_version: 4
|
138
137
|
summary: An incredibly simple CMS for durable websites
|
data/archival.gemspec
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = 'archival'
|
5
|
-
s.version = '0.0.10'
|
6
|
-
s.summary = 'An incredibly simple CMS for durable websites'
|
7
|
-
s.description = 'https://jesseditson.com/the-simplest-cms-part-1'
|
8
|
-
s.authors = ['Jesse Ditson']
|
9
|
-
s.email = 'jesse.ditson@gmail.com'
|
10
|
-
s.homepage = 'https://archival.dev'
|
11
|
-
s.license = 'Unlicense'
|
12
|
-
s.required_ruby_version = '>= 2.5'
|
13
|
-
|
14
|
-
# Specify which files should be added to the gem when it is released.
|
15
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
16
|
-
s.files = Dir.chdir(File.expand_path(__dir__)) do
|
17
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
18
|
-
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
19
|
-
end
|
20
|
-
end
|
21
|
-
s.bindir = 'exe'
|
22
|
-
s.executables = 'archival'
|
23
|
-
s.require_paths = ['lib']
|
24
|
-
|
25
|
-
s.add_dependency 'liquid', '~> 5.1.0'
|
26
|
-
s.add_dependency 'listen', '~> 3.7.0'
|
27
|
-
s.add_dependency 'redcarpet', '~> 3.5.1'
|
28
|
-
s.add_dependency 'tomlrb', '~> 2.0.1'
|
29
|
-
|
30
|
-
s.metadata = {
|
31
|
-
'rubygems_mfa_required' => 'true'
|
32
|
-
}
|
33
|
-
end
|