rails_build 1.2.0 → 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 +5 -5
- data/LICENSE +1 -0
- data/README.md +71 -127
- data/Rakefile +437 -22
- data/bin/rails_build +387 -365
- data/lib/rails_build/_lib.rb +87 -0
- data/lib/rails_build.rb +188 -17
- data/rails_build.gemspec +40 -0
- metadata +31 -110
- data/MIT-LICENSE +0 -20
- data/app/assets/config/rails_build_manifest.js +0 -2
- data/app/assets/javascripts/rails_build/application.js +0 -13
- data/app/assets/stylesheets/rails_build/application.css +0 -32
- data/app/controllers/rails_build/application_controller.rb +0 -12
- data/app/helpers/rails_build/application_helper.rb +0 -4
- data/app/jobs/rails_build/application_job.rb +0 -4
- data/app/mailers/rails_build/application_mailer.rb +0 -6
- data/app/models/rails_build/application_record.rb +0 -5
- data/app/views/layouts/rails_build/application.html.erb +0 -14
- data/app/views/rails_build/application/index.html.erb +0 -20
- data/bin/rails +0 -13
- data/config/routes.rb +0 -10
- data/lib/rails_build/engine.rb +0 -50
- data/lib/rails_build/version.rb +0 -3
- data/lib/tasks/rails_build_tasks.rake +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
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
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Nonstandard
|
data/README.md
CHANGED
@@ -1,182 +1,126 @@
|
|
1
|
-
#
|
1
|
+
# TL;DR;
|
2
2
|
|
3
|
-
|
4
|
-
built as a Rails 5 engine.
|
3
|
+
- install
|
5
4
|
|
5
|
+
```sh
|
6
6
|
|
7
|
+
echo 'gem "raild_build"' >> Gemfile
|
7
8
|
|
8
|
-
|
9
|
+
bundle
|
9
10
|
|
10
|
-
|
11
|
-
a static site suitable for deployment to [Netlify](https://www.netlify.com/), Amazon S3, or your favorite
|
12
|
-
static website hosting solution. It does this by:
|
11
|
+
```
|
13
12
|
|
14
|
-
-
|
15
|
-
- Precompiling all assets
|
16
|
-
- Including every static resource in ./public/
|
17
|
-
- GET'ing every configured url via super fast parallel downloading
|
13
|
+
- setup
|
18
14
|
|
19
|
-
|
20
|
-
sites and requires learning practically no new techniques to make super fast
|
21
|
-
building static websites.
|
15
|
+
```sh
|
22
16
|
|
17
|
+
rails_build --init
|
23
18
|
|
19
|
+
```
|
24
20
|
|
25
|
-
|
21
|
+
- build
|
26
22
|
|
27
|
-
|
28
|
-
static site generators. You need to drop a *./config/rails_build.rb* looking
|
29
|
-
something like this into your app:
|
23
|
+
```sh
|
30
24
|
|
31
|
-
|
32
|
-
|
33
|
-
RailsBuild.configure do |rails_build|
|
34
|
-
|
35
|
-
urls = rails_build.urls
|
36
|
-
|
37
|
-
urls << "/"
|
38
|
-
|
39
|
-
urls << "/about/"
|
40
|
-
|
41
|
-
urls << "/contact/"
|
42
|
-
|
43
|
-
|
44
|
-
Post.each do |post|
|
45
|
-
urls << blog_path(post)
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
|
51
|
-
```
|
25
|
+
rails_build
|
52
26
|
|
53
|
-
|
54
|
-
./public/ directory - that you want to include in your build.
|
27
|
+
```
|
55
28
|
|
56
|
-
|
29
|
+
- deploy?
|
57
30
|
|
58
|
-
|
59
|
-
|
31
|
+
the contents of ./build/ are good to deploy to *any* static web host
|
32
|
+
including netlify, vercel, an s3 bucket, or simply your app's own ./public
|
33
|
+
directory in order to 'pre-cache' a ton of pages
|
60
34
|
|
61
|
-
|
35
|
+
ps. if you want to preview your local static ./build i *highly* recommend
|
62
36
|
|
63
|
-
|
37
|
+
https://github.com/copiousfreetime/launchy
|
64
38
|
|
65
|
-
```
|
66
|
-
|
67
|
-
vs.
|
68
39
|
|
69
|
-
|
40
|
+
# ABOUT
|
70
41
|
|
71
|
-
|
42
|
+
rails_build is a very small, fast enough, static site generator built on top
|
43
|
+
of the rails you already know and love.
|
72
44
|
|
73
|
-
|
45
|
+
it's been in production usage for close to a decade but i've been too busy
|
46
|
+
to relase it until now. also, #wtf is up with javascript land?!
|
74
47
|
|
75
|
-
|
76
|
-
|
48
|
+
it has a small set of dependencies, namely the `parallel` gem, and requires
|
49
|
+
absolutely minimal configuration. it should be pretty darn self
|
50
|
+
explanatory:
|
77
51
|
|
78
52
|
```ruby
|
79
53
|
|
80
|
-
|
81
|
-
|
82
|
-
rails_build.trailing_slash false # the default is 'true'
|
83
|
-
|
84
|
-
end
|
85
|
-
|
86
|
-
```
|
87
|
-
|
88
|
-
The only real impact will be felt if you are using relative urls in your site
|
89
|
-
like './about' vs. '../about'
|
90
|
-
|
91
|
-
|
54
|
+
# file : ./config/rails_build.rb
|
92
55
|
|
93
|
-
|
56
|
+
<<~________
|
94
57
|
|
95
|
-
|
58
|
+
this file should to enumerate all the urls you'd like to build
|
96
59
|
|
97
|
-
|
98
|
-
|
60
|
+
the contents of your ./public directory, and any assets, are automaticaly
|
61
|
+
included
|
99
62
|
|
100
|
-
|
101
|
-
production mode and, therefore, making a build go fast follows the *exact same
|
102
|
-
rules* as making anything other Rails' application fast. The first place to
|
103
|
-
reach is typically fragment caching of partials used in your app.
|
63
|
+
therefore you need only declare which dynamic urls, that is to say, 'routes'
|
104
64
|
|
65
|
+
you would like included in your build
|
105
66
|
|
106
|
-
|
107
|
-
|
108
|
-
normally built when
|
67
|
+
it is not loaded except during build time, and will not affect your normal
|
68
|
+
rails app in any way
|
109
69
|
|
110
|
-
|
111
|
-
|
112
|
-
~> rake assets:precompile
|
113
|
-
|
114
|
-
```
|
70
|
+
________
|
115
71
|
|
116
|
-
is run will be included in the build.
|
117
72
|
|
73
|
+
RailsBuild.configure do |config|
|
118
74
|
|
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
|
78
|
+
#
|
119
79
|
|
120
|
-
|
80
|
+
config.urls << '/'
|
121
81
|
|
122
|
-
|
82
|
+
# include any/all additional routes youd' like built thusly
|
83
|
+
#
|
123
84
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
```
|
130
|
-
|
131
|
-
And then execute:
|
132
|
-
|
133
|
-
```bash
|
134
|
-
|
135
|
-
$ bundle
|
136
|
-
|
137
|
-
$ bundle binstubs rails_build
|
138
|
-
|
139
|
-
|
140
|
-
```
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
## Building Your Site
|
145
|
-
|
146
|
-
|
147
|
-
After installation and configuration simply run
|
148
|
-
|
149
|
-
```bash
|
150
|
-
|
151
|
-
~> ./bin/rails_build
|
152
|
-
|
153
|
-
|
154
|
-
# or, if you prefer, simply
|
85
|
+
Post.each do |post|
|
86
|
+
config.urls << "/posts/#{ post.id }"
|
87
|
+
end
|
155
88
|
|
156
|
-
|
89
|
+
# thats it! - now just run `rails_build` and you are GTG
|
157
90
|
|
91
|
+
end
|
158
92
|
|
159
93
|
```
|
160
94
|
|
95
|
+
# MOTIVATION
|
161
96
|
|
97
|
+
why another static site builder? why not hugo or, the
|
98
|
+
other-soon-to-be-released-blazing-fast-one-i-am-building-on Roda?
|
162
99
|
|
163
|
-
|
100
|
+
because:
|
164
101
|
|
165
|
-
|
166
|
-
|
102
|
+
- there are a lot of Rails apps
|
103
|
+
- nothing is as fast as static
|
104
|
+
- Rails has no facility to 'pre-render' routes on deployment
|
167
105
|
|
168
|
-
|
106
|
+
so, you can use this tool to leverage the code and the app you already have,
|
107
|
+
and/or to utilize the entire Rails ecosystem, it's docs and gems, to build
|
108
|
+
sophisticated sites without needing to learn yet another framework.
|
169
109
|
|
170
|
-
|
110
|
+
# HOW IT WORKS
|
171
111
|
|
172
|
-
|
112
|
+
as always, docs are worthless and Ruby is beautiful, so #RTFC ->
|
173
113
|
|
174
|
-
|
114
|
+
https://github.com/ahoward/rails_build/blob/main/bin/rails_build
|
175
115
|
|
176
|
-
to be configured as the build command and directory respectively.
|
177
116
|
|
117
|
+
# LICENSE
|
178
118
|
|
119
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
179
120
|
|
180
|
-
|
121
|
+
# AI _boo_
|
181
122
|
|
182
|
-
|
123
|
+
Any and all usage, in any way, shape, or form, in prohibited by any AI
|
124
|
+
application, or LLM. This includes indexing, knowing about, training on, or
|
125
|
+
existing inside a commercial LLM or training data set. Iff (and *only* if)
|
126
|
+
your LLM is OSS, please contact me directly before including this source.
|