rails_build 2.4.3 → 2.4.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4fae63ed8cb2534100892282892347286408622ef72421b3718ad3d3d9a9ba4
4
- data.tar.gz: 74b33c5464171e0d52bc3da8398555ff29eb88729f4db3dabb219becea435750
3
+ metadata.gz: 85f445833fa2d2a73f3fdcc41602c12a29b0710c3efe1f22fb3ca2255f28d0b3
4
+ data.tar.gz: c763470f51741a1082165bc9d4d67fe6528904bc5ac4598fad840a1b3025f702
5
5
  SHA512:
6
- metadata.gz: 3e4e0b70af59724c84175c7c6ce997dd4f3e559dddf15321c0e127085c53ccc20d9e7706f0af6b85ba22d9e8542352b5253642fb1b6a5893d0858827d5d0c753
7
- data.tar.gz: 628de557959a02d58b6c925029876c27df38298195c04e332bb3827d672120054dd35fdc15f2957a1ab7037596a40ea033357a2230e8c422c7ccac06c154308e
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
- # file : ./config/rails_build.rb
49
+ <<~________
55
50
 
56
- <<~________
51
+ this file should to enumerate all the urls you'd like to build
57
52
 
58
- this file should to enumerate all the urls you'd like to build
53
+ the contents of your ./public directory, and any assets, are automaticaly
54
+ included
59
55
 
60
- the contents of your ./public directory, and any assets, are automaticaly
61
- included
56
+ therefore you need only declare which dynamic urls, that is to say, 'routes'
62
57
 
63
- therefore you need only declare which dynamic urls, that is to say, 'routes'
58
+ you would like included in your build
64
59
 
65
- you would like included in your build
60
+ it is not loaded except during build time, and will not affect your normal
61
+ rails app in any way
66
62
 
67
- it is not loaded except during build time, and will not affect your normal
68
- rails app in any way
63
+ ________
69
64
 
70
- ________
71
65
 
66
+ RailsBuild.configure do |config|
72
67
 
73
- RailsBuild.configure do |config|
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
- # 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
- #
73
+ config.urls << '/'
79
74
 
80
- config.urls << '/'
75
+ # include any/all additional routes youd' like built thusly
76
+ #
81
77
 
82
- # include any/all additional routes youd' like built thusly
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
- # thats it! - now just run `rails_build` and you are GTG
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
- end
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 another static site builder? why not hugo or, the
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
- because:
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
- - 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
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
- # HOW IT WORKS
167
+ # RTFM
111
168
 
112
- as always, docs are worthless and Ruby is beautiful, so #RTFC ->
169
+ as always, docs are worthless and ruby is beautiful, so #RTFC ->
113
170
 
114
- https://github.com/ahoward/rails_build/blob/main/bin/rails_build
171
+ https://github.com/ahoward/rails_build/blob/main/bin/rails_build
115
172
 
116
173
 
117
174
  # LICENSE
118
175
 
119
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
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
- 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.
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
@@ -288,7 +288,7 @@ module RailsBuild
288
288
 
289
289
  def extract_urls!
290
290
  path = @config.path
291
- urls = @config.urls
291
+ urls = @config.urls.uniq
292
292
 
293
293
  if urls.size == 0
294
294
  abort("failed to find any rails_build urls in:\n#{ @config.to_json }")
@@ -1,5 +1,5 @@
1
1
  module RailsBuild
2
- VERSION = '2.4.3' unless defined?(VERSION)
2
+ VERSION = '2.4.4' unless defined?(VERSION)
3
3
 
4
4
  class << self
5
5
  def version
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 : true),
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.3"
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"
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.3
4
+ version: 2.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ara T. Howard