rails_build 2.4.2 → 2.4.3
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/LICENSE +1 -1
- data/README.md +3 -2
- data/bin/rails_build +23 -102
- data/lib/rails_build/_lib.rb +1 -1
- data/rails_build.gemspec +2 -4
- metadata +2 -3
- data/config/rails_build.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4fae63ed8cb2534100892282892347286408622ef72421b3718ad3d3d9a9ba4
|
4
|
+
data.tar.gz: 74b33c5464171e0d52bc3da8398555ff29eb88729f4db3dabb219becea435750
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e4e0b70af59724c84175c7c6ce997dd4f3e559dddf15321c0e127085c53ccc20d9e7706f0af6b85ba22d9e8542352b5253642fb1b6a5893d0858827d5d0c753
|
7
|
+
data.tar.gz: 628de557959a02d58b6c925029876c27df38298195c04e332bb3827d672120054dd35fdc15f2957a1ab7037596a40ea033357a2230e8c422c7ccac06c154308e
|
data/LICENSE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Nonstandard
|
data/README.md
CHANGED
@@ -72,8 +72,9 @@
|
|
72
72
|
|
73
73
|
RailsBuild.configure do |config|
|
74
74
|
|
75
|
-
# most of the time you are going to want your route included, which
|
76
|
-
# translate into an ./index.html being output in the build
|
75
|
+
# most of the time you are going to want your root route included, which
|
76
|
+
# will translate into an ./index.html being output in the build, as you
|
77
|
+
# would expect
|
77
78
|
#
|
78
79
|
|
79
80
|
config.urls << '/'
|
data/bin/rails_build
CHANGED
@@ -194,7 +194,7 @@ module RailsBuild
|
|
194
194
|
|
195
195
|
#
|
196
196
|
def init!
|
197
|
-
config =
|
197
|
+
config = SAMPLE_CONFIG
|
198
198
|
|
199
199
|
path = './config/rails_build.rb'
|
200
200
|
|
@@ -361,88 +361,6 @@ module RailsBuild
|
|
361
361
|
end
|
362
362
|
end
|
363
363
|
|
364
|
-
#
|
365
|
-
=begin
|
366
|
-
def parallel_build!
|
367
|
-
size = @parallel
|
368
|
-
|
369
|
-
stats = {
|
370
|
-
:success => [],
|
371
|
-
:missing => [],
|
372
|
-
:failure => [],
|
373
|
-
}
|
374
|
-
|
375
|
-
times = []
|
376
|
-
|
377
|
-
elapsed = timing do
|
378
|
-
ThreadPool.new(size:) do |tp|
|
379
|
-
tp.run do
|
380
|
-
@urls.each{|url| tp.process!(url:)}
|
381
|
-
end
|
382
|
-
|
383
|
-
tp.process do |url:|
|
384
|
-
uri = uri_for(url)
|
385
|
-
path = path_for(uri)
|
386
|
-
|
387
|
-
upath = uri.path
|
388
|
-
rpath = relative_path(path, :from => @directory)
|
389
|
-
|
390
|
-
code = nil
|
391
|
-
body = nil
|
392
|
-
|
393
|
-
time =
|
394
|
-
timing do
|
395
|
-
code, body = http_get(uri)
|
396
|
-
write_path(path, body) if code == 200
|
397
|
-
end
|
398
|
-
|
399
|
-
tp.success!(url:, rpath:, time:, code:)
|
400
|
-
end
|
401
|
-
|
402
|
-
tp.success do |url:, rpath:, time:, code:|
|
403
|
-
times.push(time)
|
404
|
-
rps = (times.size / times.sum).round(4)
|
405
|
-
msg = "#{ url } -> /#{ rpath } (time:#{ time }, rps:#{ rps }, code:#{ code })"
|
406
|
-
|
407
|
-
case code
|
408
|
-
when 200
|
409
|
-
log(:info, msg)
|
410
|
-
stats[:success].push(url)
|
411
|
-
when 404
|
412
|
-
log(:error, msg)
|
413
|
-
stats[:missing].push(url)
|
414
|
-
else
|
415
|
-
log(:error, msg)
|
416
|
-
stats[:failure].push(url)
|
417
|
-
end
|
418
|
-
end
|
419
|
-
end
|
420
|
-
end
|
421
|
-
|
422
|
-
borked = 0
|
423
|
-
|
424
|
-
if stats[:missing].size > 0
|
425
|
-
borked += stats[:missing].size
|
426
|
-
log(:error, "missing on #{ stats[:missing].size } url(s)")
|
427
|
-
end
|
428
|
-
|
429
|
-
if stats[:failure].size > 0
|
430
|
-
borked += stats[:failure].size
|
431
|
-
log(:error, "failure on #{ stats[:failure].size } url(s)")
|
432
|
-
end
|
433
|
-
|
434
|
-
if borked > 0
|
435
|
-
exit(borked)
|
436
|
-
end
|
437
|
-
|
438
|
-
rps = (times.size / times.sum).round(4)
|
439
|
-
|
440
|
-
log(:info, "downloaded #{ @urls.size } urls at ~#{ rps } rps")
|
441
|
-
|
442
|
-
@urls
|
443
|
-
end
|
444
|
-
=end
|
445
|
-
|
446
364
|
#
|
447
365
|
def parallel_build!
|
448
366
|
size = @parallel
|
@@ -883,37 +801,40 @@ END {
|
|
883
801
|
RailsBuild::CLI.run!
|
884
802
|
}
|
885
803
|
|
886
|
-
|
887
|
-
<<~
|
804
|
+
module RailsBuild
|
805
|
+
SAMPLE_CONFIG = <<~'__'
|
806
|
+
<<~________
|
888
807
|
|
889
|
-
|
808
|
+
this file should to enumerate all the urls you'd like to build
|
890
809
|
|
891
|
-
|
810
|
+
the contents of your ./public directory, and any assets, are automaticaly included
|
892
811
|
|
893
|
-
|
812
|
+
therefore you need only declare which dynamic urls, that is to say, 'routes'
|
894
813
|
|
895
|
-
|
814
|
+
you would like included in your build
|
896
815
|
|
897
|
-
|
816
|
+
it is not loaded except during build time, and will not affect your normal rails app in any way
|
898
817
|
|
899
|
-
________
|
818
|
+
________
|
900
819
|
|
901
820
|
|
902
|
-
RailsBuild.configure do |config|
|
821
|
+
RailsBuild.configure do |config|
|
903
822
|
|
904
|
-
|
905
|
-
|
906
|
-
|
823
|
+
# most of the time you are going to want your route included, which will
|
824
|
+
# translate into an ./index.html being output in the build
|
825
|
+
#
|
907
826
|
|
908
|
-
|
827
|
+
config.urls << '/'
|
909
828
|
|
910
|
-
|
911
|
-
|
829
|
+
# include any/all additional routes youd' like built thusly
|
830
|
+
#
|
912
831
|
|
913
|
-
|
914
|
-
|
915
|
-
|
832
|
+
Post.each do |post|
|
833
|
+
config.urls << "/posts/#{ post.id }"
|
834
|
+
end
|
916
835
|
|
917
|
-
|
836
|
+
# thats it! - now just run `rails_build` and you are GTG
|
918
837
|
|
838
|
+
end
|
839
|
+
__
|
919
840
|
end
|
data/lib/rails_build/_lib.rb
CHANGED
data/rails_build.gemspec
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
|
4
4
|
Gem::Specification::new do |spec|
|
5
5
|
spec.name = "rails_build"
|
6
|
-
spec.version = "2.4.
|
6
|
+
spec.version = "2.4.3"
|
7
7
|
spec.required_ruby_version = '>= 3.0'
|
8
8
|
spec.platform = Gem::Platform::RUBY
|
9
9
|
spec.summary = "a small, simple, bullet proof, and fast enough static site generator built on top of the rails you already know and love"
|
10
10
|
spec.description = "rails_build is a very small, fast enough, static site generator built\non top of the rails you already know and love.\n\nit's been in production usage for close to a decade but i've been too\nbusy to relase it until now. also, #wtf is up with javascript land?!\n\nit has a small set of dependencies, namely the `parallel` gem, and\nrequires absolutely minimal configuration. it should be pretty darn\nself explanatory:"
|
11
|
-
spec.license = "
|
11
|
+
spec.license = "Nonstandard"
|
12
12
|
|
13
13
|
spec.files =
|
14
14
|
["LICENSE",
|
@@ -16,8 +16,6 @@ Gem::Specification::new do |spec|
|
|
16
16
|
"Rakefile",
|
17
17
|
"bin",
|
18
18
|
"bin/rails_build",
|
19
|
-
"config",
|
20
|
-
"config/rails_build.rb",
|
21
19
|
"lib",
|
22
20
|
"lib/rails_build",
|
23
21
|
"lib/rails_build.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_build
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ara T. Howard
|
@@ -58,13 +58,12 @@ files:
|
|
58
58
|
- README.md
|
59
59
|
- Rakefile
|
60
60
|
- bin/rails_build
|
61
|
-
- config/rails_build.rb
|
62
61
|
- lib/rails_build.rb
|
63
62
|
- lib/rails_build/_lib.rb
|
64
63
|
- rails_build.gemspec
|
65
64
|
homepage: https://github.com/ahoward/rails_build
|
66
65
|
licenses:
|
67
|
-
-
|
66
|
+
- Nonstandard
|
68
67
|
metadata: {}
|
69
68
|
post_install_message:
|
70
69
|
rdoc_options: []
|
data/config/rails_build.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
<<~________
|
2
|
-
|
3
|
-
this file should to enumerate all the urls you'd like to build
|
4
|
-
|
5
|
-
the contents of your ./public directory, and any assets, are automaticaly included
|
6
|
-
|
7
|
-
therefore you need only declare which dynamic urls, that is to say, 'routes'
|
8
|
-
|
9
|
-
you would like included in your build
|
10
|
-
|
11
|
-
it is not loaded except during build time, and will not affect your normal rails app in any way
|
12
|
-
|
13
|
-
________
|
14
|
-
|
15
|
-
|
16
|
-
RailsBuild.configure do |config|
|
17
|
-
|
18
|
-
# most of the time you are going to want your route included, which will
|
19
|
-
# translate into an ./index.html being output in the build
|
20
|
-
#
|
21
|
-
|
22
|
-
config.urls << '/'
|
23
|
-
|
24
|
-
# include any/all additional routes youd' like built thusly
|
25
|
-
#
|
26
|
-
|
27
|
-
Post.each do |post|
|
28
|
-
config.urls << "/posts/#{ post.id }"
|
29
|
-
end
|
30
|
-
|
31
|
-
# thats it! - now just run `rails_build` and you are GTG
|
32
|
-
|
33
|
-
end
|