foobara-empty-ruby-project-generator 1.0.3 → 1.0.5
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/CHANGELOG.md +11 -0
- data/src/generators/license_generator.rb +4 -4
- data/src/generators/project_generator.rb +2 -2
- data/src/manifests/project_config.rb +4 -4
- data/src/write_empty_ruby_project_to_disk.rb +18 -18
- data/templates/.gitignore.erb +2 -0
- data/templates/boot/config.rb +1 -7
- data/templates/boot/finish.rb.erb +6 -0
- data/templates/boot/start.rb +12 -2
- data/templates/spec/spec_helper.rb +2 -0
- data/templates/spec/support/simplecov.rb +4 -5
- data/templates/spec/support/vcr.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cdd94a071a7ea95a1a265d7b4b21ebf47def1bec403a37006a9532ad7c2d31d9
|
|
4
|
+
data.tar.gz: c2edf8c142844d267030c10acf2c28e0f1538c072aed8b81d7dfa33a2fe847ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 796b690590459387a46f7711125d5f63713eb4bcfa135954b6bef8e6bbdf0203fd4e9851a455b147e3bdaf582c6e5815a1df6f19256c53ea6b9ad3c21f2ca0fe
|
|
7
|
+
data.tar.gz: 58a03f74330318ac08d3d2c85ab7dcce3fab243dc0513c5b59eb8c8e4efba3a6000a19d8edd5d8648bd856d954074eb7b7be5156ffc6106d4ea467bee032f064
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [1.0.5] - 2026-09-15
|
|
2
|
+
|
|
3
|
+
- Adds ./local_data to generated .gitignore
|
|
4
|
+
- Fixes various deprecation warnings that pop up in newly generated projects
|
|
5
|
+
- Defaults to branch coverage (should probably be optional!)
|
|
6
|
+
- Make sure all deprecation warnings are shown by default in newly generated projects
|
|
7
|
+
|
|
8
|
+
## [1.0.4] - 2025-08-24
|
|
9
|
+
|
|
10
|
+
- Scrub cookies in vcr.rb instead of deleting them
|
|
11
|
+
|
|
1
12
|
## [1.0.3] - 2025-08-24
|
|
2
13
|
|
|
3
14
|
- By default, strip Set-Cookie headers out of VCR cassettes
|
|
@@ -27,9 +27,9 @@ module Foobara
|
|
|
27
27
|
when "MPL-2.0"
|
|
28
28
|
Mpl2LicenseGenerator
|
|
29
29
|
else
|
|
30
|
-
# :
|
|
30
|
+
# simplecov:disable
|
|
31
31
|
raise "Unknown license string #{license_string}"
|
|
32
|
-
# :
|
|
32
|
+
# simplecov:enable
|
|
33
33
|
end
|
|
34
34
|
end.map do |klass|
|
|
35
35
|
klass.new(relevant_manifest)
|
|
@@ -54,9 +54,9 @@ module Foobara
|
|
|
54
54
|
"This project is dual licensed under your choice of the " \
|
|
55
55
|
"#{licenses.first} license and the #{licenses.last} license."
|
|
56
56
|
else
|
|
57
|
-
# :
|
|
57
|
+
# simplecov:disable
|
|
58
58
|
raise "Not sure what to do with #{licenses.size} licenses"
|
|
59
|
-
# :
|
|
59
|
+
# simplecov:enable
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
end
|
|
@@ -99,7 +99,7 @@ module Foobara
|
|
|
99
99
|
# TODO: implement #[] or move it up to Model from Entity if it exists there.
|
|
100
100
|
@author_names ||= read_attribute(:author_names) || begin
|
|
101
101
|
# TODO: dump a git config file in CI so we don't have to skip this
|
|
102
|
-
# :
|
|
102
|
+
# simplecov:disable
|
|
103
103
|
name = `git config --get user.name`
|
|
104
104
|
|
|
105
105
|
if $CHILD_STATUS.exitstatus == 0
|
|
@@ -107,13 +107,13 @@ module Foobara
|
|
|
107
107
|
else
|
|
108
108
|
raise "Must set author_names because we can't get it from git for some reason"
|
|
109
109
|
end
|
|
110
|
-
# :
|
|
110
|
+
# simplecov:enable
|
|
111
111
|
end
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
def author_emails
|
|
115
115
|
@author_emails ||= read_attribute(:author_emails) || begin
|
|
116
|
-
# :
|
|
116
|
+
# simplecov:disable
|
|
117
117
|
email = `git config --get user.email`
|
|
118
118
|
|
|
119
119
|
if $CHILD_STATUS.exitstatus == 0
|
|
@@ -121,7 +121,7 @@ module Foobara
|
|
|
121
121
|
else
|
|
122
122
|
raise "Must set author_emails because we can't get it from git for some reason"
|
|
123
123
|
end
|
|
124
|
-
# :
|
|
124
|
+
# simplecov:enable
|
|
125
125
|
end
|
|
126
126
|
end
|
|
127
127
|
|
|
@@ -115,9 +115,9 @@ module Foobara
|
|
|
115
115
|
run_cmd_and_return_output(cmd)
|
|
116
116
|
end
|
|
117
117
|
else
|
|
118
|
-
# :
|
|
118
|
+
# simplecov:disable
|
|
119
119
|
run_cmd_and_return_output(cmd)
|
|
120
|
-
# :
|
|
120
|
+
# simplecov:enable
|
|
121
121
|
end
|
|
122
122
|
end
|
|
123
123
|
|
|
@@ -131,14 +131,14 @@ module Foobara
|
|
|
131
131
|
run_cmd_and_return_output(cmd)
|
|
132
132
|
end
|
|
133
133
|
else
|
|
134
|
-
# :
|
|
134
|
+
# simplecov:disable
|
|
135
135
|
run_cmd_and_return_output(cmd)
|
|
136
|
-
# :
|
|
136
|
+
# simplecov:enable
|
|
137
137
|
end
|
|
138
138
|
rescue CouldNotExecuteError => e
|
|
139
|
-
# :
|
|
139
|
+
# simplecov:disable
|
|
140
140
|
warn e.message
|
|
141
|
-
# :
|
|
141
|
+
# simplecov:enable
|
|
142
142
|
end
|
|
143
143
|
|
|
144
144
|
def make_bin_files_executable
|
|
@@ -148,9 +148,9 @@ module Foobara
|
|
|
148
148
|
begin
|
|
149
149
|
run_cmd_and_return_output(cmd)
|
|
150
150
|
rescue CouldNotExecuteError => e
|
|
151
|
-
# :
|
|
151
|
+
# simplecov:disable
|
|
152
152
|
warn e.message
|
|
153
|
-
# :
|
|
153
|
+
# simplecov:enable
|
|
154
154
|
end
|
|
155
155
|
end
|
|
156
156
|
end
|
|
@@ -162,10 +162,10 @@ module Foobara
|
|
|
162
162
|
cmd = "git init"
|
|
163
163
|
run_cmd_and_return_output(cmd)
|
|
164
164
|
rescue CouldNotExecuteError => e
|
|
165
|
-
# :
|
|
165
|
+
# simplecov:disable
|
|
166
166
|
self.use_git_failed = true
|
|
167
167
|
warn e.message
|
|
168
|
-
# :
|
|
168
|
+
# simplecov:enable
|
|
169
169
|
end
|
|
170
170
|
|
|
171
171
|
def git_add_all
|
|
@@ -174,10 +174,10 @@ module Foobara
|
|
|
174
174
|
cmd = "git add ."
|
|
175
175
|
run_cmd_and_return_output(cmd)
|
|
176
176
|
rescue CouldNotExecuteError => e
|
|
177
|
-
# :
|
|
177
|
+
# simplecov:disable
|
|
178
178
|
self.use_git_failed = true
|
|
179
179
|
warn e.message
|
|
180
|
-
# :
|
|
180
|
+
# simplecov:enable
|
|
181
181
|
end
|
|
182
182
|
|
|
183
183
|
def git_commit
|
|
@@ -186,10 +186,10 @@ module Foobara
|
|
|
186
186
|
cmd = "git commit -m 'Create ruby project files'"
|
|
187
187
|
run_cmd_and_return_output(cmd)
|
|
188
188
|
rescue CouldNotExecuteError => e
|
|
189
|
-
# :
|
|
189
|
+
# simplecov:disable
|
|
190
190
|
self.use_git_failed = true
|
|
191
191
|
warn e.message
|
|
192
|
-
# :
|
|
192
|
+
# simplecov:enable
|
|
193
193
|
end
|
|
194
194
|
|
|
195
195
|
def github_create_repo
|
|
@@ -212,9 +212,9 @@ module Foobara
|
|
|
212
212
|
exit_status = run_cmd_and_write_output(cmd, raise_if_fails: false)
|
|
213
213
|
|
|
214
214
|
unless exit_status&.success?
|
|
215
|
-
# :
|
|
215
|
+
# simplecov:disable
|
|
216
216
|
self.push_to_github_failed = true
|
|
217
|
-
# :
|
|
217
|
+
# simplecov:enable
|
|
218
218
|
end
|
|
219
219
|
end
|
|
220
220
|
|
|
@@ -225,9 +225,9 @@ module Foobara
|
|
|
225
225
|
exit_status = run_cmd_and_write_output(cmd, raise_if_fails: false)
|
|
226
226
|
|
|
227
227
|
unless exit_status&.success?
|
|
228
|
-
# :
|
|
228
|
+
# simplecov:disable
|
|
229
229
|
self.use_git_failed = true
|
|
230
|
-
# :
|
|
230
|
+
# simplecov:enable
|
|
231
231
|
end
|
|
232
232
|
end
|
|
233
233
|
|
data/templates/.gitignore.erb
CHANGED
data/templates/boot/config.rb
CHANGED
|
@@ -9,16 +9,22 @@ last = %w[
|
|
|
9
9
|
|
|
10
10
|
skip = ["start.rb", "finish.rb", *first, *last]
|
|
11
11
|
|
|
12
|
+
# simplecov:disable
|
|
12
13
|
first.each { |f| require_relative f if File.exist?("#{__dir__}/#{f}") }
|
|
14
|
+
# simplecov:enable
|
|
13
15
|
|
|
14
16
|
require "<%= project_lib_file_path %>"
|
|
15
17
|
|
|
16
18
|
Dir.entries(__dir__).each do |boot_file|
|
|
17
19
|
next unless boot_file.end_with?(".rb")
|
|
18
20
|
next if skip.include?(boot_file)
|
|
21
|
+
# simplecov:disable
|
|
19
22
|
next unless File.exist?("#{__dir__}/#{boot_file}")
|
|
23
|
+
# simplecov:enable
|
|
20
24
|
|
|
21
25
|
require_relative boot_file
|
|
22
26
|
end
|
|
23
27
|
|
|
28
|
+
# simplecov:disable
|
|
24
29
|
last.each { |f| require_relative f if File.exist?("#{__dir__}/#{f}") }
|
|
30
|
+
# simplecov:enable
|
data/templates/boot/start.rb
CHANGED
|
@@ -3,8 +3,18 @@ ENV["FOOBARA_ENV"] ||= "development"
|
|
|
3
3
|
require "bundler/setup"
|
|
4
4
|
|
|
5
5
|
if ["development", "test"].include?(ENV["FOOBARA_ENV"])
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
# simplecov:disable
|
|
7
|
+
if ENV["CI"] != "true"
|
|
8
|
+
if ENV["RUBY_DEBUG"] == "true"
|
|
9
|
+
require "debug"
|
|
10
|
+
elsif ENV["USE_PRY"] == "true"
|
|
11
|
+
require "pry"
|
|
12
|
+
elsif ENV["USE_PRY_BYEBUG"] == "true"
|
|
13
|
+
require "pry"
|
|
14
|
+
require "pry-byebug"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
# simplecov:enable
|
|
8
18
|
end
|
|
9
19
|
|
|
10
20
|
require_relative "config"
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
require "simplecov"
|
|
2
2
|
|
|
3
3
|
SimpleCov.start do
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# minimum_coverage line: 100, branch: 100
|
|
4
|
+
skip "spec/support"
|
|
5
|
+
|
|
6
|
+
enable_coverage :branch
|
|
7
|
+
minimum_coverage line: 100, branch: 100
|
|
9
8
|
end
|
|
@@ -2,9 +2,14 @@ require "vcr"
|
|
|
2
2
|
|
|
3
3
|
VCR.configure do |config|
|
|
4
4
|
# config.filter_sensitive_data("<SCRUBBED_SOME_API_KEY>") { ENV.fetch("SOME_API_KEY", nil) }
|
|
5
|
+
# Scrubbing these by default just in-case they contain any sensitive data
|
|
5
6
|
config.before_record do |interaction|
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
if interaction.request.headers["Cookie"]
|
|
8
|
+
interaction.request.headers["Cookie"] = ["<SCRUBBED>"]
|
|
9
|
+
end
|
|
10
|
+
if interaction.response.headers["Set-Cookie"]
|
|
11
|
+
interaction.response.headers["Set-Cookie"] = ["<SCRUBBED>"]
|
|
12
|
+
end
|
|
8
13
|
end
|
|
9
14
|
|
|
10
15
|
config.cassette_library_dir = "spec/vcr_cassettes"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foobara-empty-ruby-project-generator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miles Georgi
|
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
143
143
|
- !ruby/object:Gem::Version
|
|
144
144
|
version: '0'
|
|
145
145
|
requirements: []
|
|
146
|
-
rubygems_version:
|
|
146
|
+
rubygems_version: 4.0.20
|
|
147
147
|
specification_version: 4
|
|
148
148
|
summary: Generates empty ruby project boilerplate code from a template
|
|
149
149
|
test_files: []
|