rails_build 2.4.3 → 2.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +107 -48
- data/bin/rails_build +1 -1
- data/lib/rails_build/_lib.rb +1 -1
- data/lib/rails_build.rb +1 -1
- data/rails_build.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85f445833fa2d2a73f3fdcc41602c12a29b0710c3efe1f22fb3ca2255f28d0b3
|
4
|
+
data.tar.gz: c763470f51741a1082165bc9d4d67fe6528904bc5ac4598fad840a1b3025f702
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c1776c7af9d7b84230b00d573503897a90109f01c77ff4e039dce651dd7f4bb01333b30efe773f3dca9bf7b5b6a014e8211683e0b13a52b4b79cc61f13fbee6
|
7
|
+
data.tar.gz: c546c9901cfc78d879e6089e1a4ff59061e5b62f67706f9c712b035aff35e17e350d536323e8be2314b84333a21bc69b30667bf07edb4e43fe011504015c3315
|
data/README.md
CHANGED
@@ -3,27 +3,20 @@
|
|
3
3
|
- install
|
4
4
|
|
5
5
|
```sh
|
6
|
-
|
7
6
|
echo 'gem "raild_build"' >> Gemfile
|
8
|
-
|
9
7
|
bundle
|
10
|
-
|
11
8
|
```
|
12
9
|
|
13
10
|
- setup
|
14
11
|
|
15
12
|
```sh
|
16
|
-
|
17
13
|
rails_build --init
|
18
|
-
|
19
14
|
```
|
20
15
|
|
21
16
|
- build
|
22
17
|
|
23
18
|
```sh
|
24
|
-
|
25
19
|
rails_build
|
26
|
-
|
27
20
|
```
|
28
21
|
|
29
22
|
- deploy?
|
@@ -49,78 +42,144 @@
|
|
49
42
|
absolutely minimal configuration. it should be pretty darn self
|
50
43
|
explanatory:
|
51
44
|
|
52
|
-
```ruby
|
45
|
+
```ruby
|
46
|
+
|
47
|
+
# file : ./config/rails_build.rb
|
53
48
|
|
54
|
-
|
49
|
+
<<~________
|
55
50
|
|
56
|
-
|
51
|
+
this file should to enumerate all the urls you'd like to build
|
57
52
|
|
58
|
-
|
53
|
+
the contents of your ./public directory, and any assets, are automaticaly
|
54
|
+
included
|
59
55
|
|
60
|
-
|
61
|
-
included
|
56
|
+
therefore you need only declare which dynamic urls, that is to say, 'routes'
|
62
57
|
|
63
|
-
|
58
|
+
you would like included in your build
|
64
59
|
|
65
|
-
|
60
|
+
it is not loaded except during build time, and will not affect your normal
|
61
|
+
rails app in any way
|
66
62
|
|
67
|
-
|
68
|
-
rails app in any way
|
63
|
+
________
|
69
64
|
|
70
|
-
________
|
71
65
|
|
66
|
+
RailsBuild.configure do |config|
|
72
67
|
|
73
|
-
|
68
|
+
# most of the time you are going to want your root route included, which
|
69
|
+
# will translate into an ./index.html being output in the build, as you
|
70
|
+
# would expect.
|
71
|
+
#
|
74
72
|
|
75
|
-
|
76
|
-
# will translate into an ./index.html being output in the build, as you
|
77
|
-
# would expect
|
78
|
-
#
|
73
|
+
config.urls << '/'
|
79
74
|
|
80
|
-
|
75
|
+
# include any/all additional routes youd' like built thusly
|
76
|
+
#
|
81
77
|
|
82
|
-
|
83
|
-
|
78
|
+
Post.each do |post|
|
79
|
+
config.urls << "/posts/#{ post.id }"
|
80
|
+
end
|
81
|
+
|
82
|
+
# thats it! - now just run `rails_build` and you are gtg
|
84
83
|
|
85
|
-
Post.each do |post|
|
86
|
-
config.urls << "/posts/#{ post.id }"
|
87
84
|
end
|
88
85
|
|
89
|
-
|
86
|
+
```
|
87
|
+
|
88
|
+
# CONFIGURATION
|
89
|
+
|
90
|
+
although `rails_build` aims to be as zero-config as possible, it does expose
|
91
|
+
a few configuration settings, which you may configure in
|
92
|
+
`config/rails_build.rb`:
|
93
|
+
|
94
|
+
- *config.urls*
|
95
|
+
|
96
|
+
as shown above, the config has a list of urls that the build process
|
97
|
+
will GET. this is a simple array and contains only '/' by default, the
|
98
|
+
root route, such that the default unconfigured build would map '/' ->
|
99
|
+
'index.html' and not be empty. if your app does not have a root route,
|
100
|
+
or you do not wish to include that route in your build, simply call
|
101
|
+
`config.urls.clear`
|
102
|
+
|
90
103
|
|
91
|
-
|
104
|
+
- *config.force_ssl*
|
92
105
|
|
93
|
-
|
106
|
+
this one can be important. when `rails_build` starts your rails app, it
|
107
|
+
does so with *RAILS_ENV=production*, such that the build is of production
|
108
|
+
quality and speed. (you can change this by running `rails_build
|
109
|
+
--env=development`, etc.). this can cause issues since the build runs on
|
110
|
+
localhost, and rails (without `thruster`), has no facility for ssl
|
111
|
+
termination. as such, you may want the the following
|
112
|
+
|
113
|
+
```ruby
|
114
|
+
# file : ./config/environments/production.rb
|
115
|
+
|
116
|
+
config.force_ssl = ENV['RAILS_BUILD'] ? false : true
|
117
|
+
```
|
118
|
+
|
119
|
+
- *config.index_html*
|
120
|
+
|
121
|
+
controls the mapping of urls to build files, eg.
|
122
|
+
|
123
|
+
```ruby
|
124
|
+
RailsBuild.configure do
|
125
|
+
config.index_html = true # the default
|
126
|
+
config.urls << "/post/42" #=> ./build/posts/42/index.html
|
127
|
+
end
|
128
|
+
|
129
|
+
# vs.
|
130
|
+
|
131
|
+
RailsBuild.configure do
|
132
|
+
config.index_html = false
|
133
|
+
config.urls << "/post/42" #=> ./build/posts/42.html
|
134
|
+
end
|
135
|
+
```
|
136
|
+
|
137
|
+
- *config.path*
|
138
|
+
|
139
|
+
this is the path to the build config file itself, the default is
|
140
|
+
`./config/rails_build.rb`, as you would expect
|
141
|
+
|
142
|
+
- *config.trailing_slash*
|
143
|
+
|
144
|
+
this is current un-used, but maybe be used in the future. it's default is the
|
145
|
+
value of
|
146
|
+
|
147
|
+
```ruby
|
148
|
+
Rails.application.default_url_options[:trailing_slash]
|
149
|
+
```
|
94
150
|
|
95
151
|
# MOTIVATION
|
96
152
|
|
97
|
-
why
|
98
|
-
other-soon-to-be-released-blazing-fast-one-i-am-building-on Roda?
|
153
|
+
why yet _another_ static site builder? why not hugo or, the
|
154
|
+
other-soon-to-be-released-blazing-fast-one-i-am-building-on Roda?
|
155
|
+
|
156
|
+
because:
|
99
157
|
|
100
|
-
|
158
|
+
- there are a lot of Rails apps
|
159
|
+
- nothing is as fast as static
|
160
|
+
- Rails has no facility to 'pre-render' routes on deployment
|
101
161
|
|
102
|
-
|
103
|
-
|
104
|
-
|
162
|
+
so, you can use this tool to leverage the code and the app you already have,
|
163
|
+
and/or to utilize the entire Rails ecosystem, it's docs and gems, to build
|
164
|
+
sophisticated sites without needing to learn yet another framework.
|
105
165
|
|
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.
|
109
166
|
|
110
|
-
#
|
167
|
+
# RTFM
|
111
168
|
|
112
|
-
as always, docs are worthless and
|
169
|
+
as always, docs are worthless and ruby is beautiful, so #RTFC ->
|
113
170
|
|
114
|
-
|
171
|
+
https://github.com/ahoward/rails_build/blob/main/bin/rails_build
|
115
172
|
|
116
173
|
|
117
174
|
# LICENSE
|
118
175
|
|
119
|
-
|
176
|
+
the gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
120
177
|
|
121
178
|
# AI _boo_
|
122
179
|
|
123
|
-
|
124
|
-
application, or
|
125
|
-
existing inside a commercial
|
126
|
-
your
|
180
|
+
any and all usage, in any way, shape, or form, in prohibited by any ai
|
181
|
+
application, or llm. this includes indexing, knowing about, training on, or
|
182
|
+
existing inside a commercial llm or training data set. iff (that is not a
|
183
|
+
typo) your llm is oss, please contact me directly before including this source.
|
184
|
+
|
185
|
+
any usage by openai, or google, is forbidden regardless.
|
data/bin/rails_build
CHANGED
data/lib/rails_build/_lib.rb
CHANGED
data/lib/rails_build.rb
CHANGED
@@ -72,7 +72,7 @@ module RailsBuild
|
|
72
72
|
defaults = {
|
73
73
|
path: RailsBuild.config_path,
|
74
74
|
trailing_slash: (defined?(Rails) ? !!Rails.application.default_url_options[:trailing_slash] : false),
|
75
|
-
force_ssl: (defined?(Rails) ? !!Rails.configuration.force_ssl :
|
75
|
+
force_ssl: (defined?(Rails) ? !!Rails.configuration.force_ssl : false),
|
76
76
|
urls: %w[ / ],
|
77
77
|
index_html: true,
|
78
78
|
}
|
data/rails_build.gemspec
CHANGED
@@ -3,7 +3,7 @@
|
|
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.4"
|
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"
|