scipio 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -1
  3. data/CHANGELOG.md +10 -1
  4. data/README.md +15 -1
  5. data/lib/scipio/cli.rb +16 -16
  6. data/lib/scipio/config.rb +4 -4
  7. data/lib/scipio/gems.rb +20 -15
  8. data/lib/scipio/rake.rb +8 -6
  9. data/lib/scipio/version.rb +1 -1
  10. data/lib/stdlib/string.rb +37 -0
  11. data/template/{%{gem_name}.gemspec.t → %{gem_name}.gemspec.erb} +3 -3
  12. data/template/.gitignore +20 -5
  13. data/template/.standard +1 -0
  14. data/template/CHANGELOG.md.erb +5 -0
  15. data/template/{Gemfile → Gemfile.erb} +1 -0
  16. data/template/{README.md → README.md.erb} +10 -6
  17. data/template/{Rakefile → Rakefile.erb} +12 -17
  18. data/template/bin/{%{gem_name} → %{gem_name}.erb} +2 -2
  19. data/template/lib/{%{gem_name}/cli.rb → %{gem_name_slash}/cli.rb.erb} +2 -2
  20. data/template/lib/{%{gem_name}/version.rb → %{gem_name_slash}/version.rb.erb} +1 -1
  21. data/template/lib/%{gem_name_slash}.rb.erb +7 -0
  22. data/template/sig/%{gem_name_slash}/cli.rbs.erb +13 -0
  23. data/template/sig/%{gem_name_slash}.rbs.erb +3 -0
  24. data/template/test/{test_%{gem_name}.rb → %{gem_name_test}.rb.erb} +2 -2
  25. data.tar.gz.sig +0 -0
  26. metadata +31 -27
  27. metadata.gz.sig +0 -0
  28. data/template/CHANGELOG.md +0 -5
  29. data/template/lib/%{gem_name}.rb +0 -7
  30. /data/template/{CODE_OF_CONDUCT.md → CODE_OF_CONDUCT.md.erb} +0 -0
  31. /data/template/{LICENSE.txt → LICENSE.txt.erb} +0 -0
  32. /data/template/bin/{console → console.erb} +0 -0
  33. /data/template/bin/{setup → setup.erb} +0 -0
  34. /data/template/test/{test_helper.rb → test_helper.rb.erb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29c4950894226b9ec6a2646ffd46b3c6d7421c9e07760e957ee5ee281c0f561e
4
- data.tar.gz: d76240c28cc28b067a76e2c1d5c84ab8bcde59cdd7b51f29a356663b4f92089d
3
+ metadata.gz: ea0fe5447366a0cf4667c9c5229bedd8655b4834b723e9ec69af4a01cae2c54d
4
+ data.tar.gz: 4bdade6cb2e464db6652c74715ae3b36d9b5e7b1285c88f6afe84a350566842c
5
5
  SHA512:
6
- metadata.gz: 87e20da207af3745b8a6bf222c19bfb8050ad023cde50f3ea1b9444ee373dbc0c12bef69fc512a35338cd42de0cdecebf98c2f3f59a1f016222a85d9011c1acb
7
- data.tar.gz: 63cd46a934be3a8b32a100f5a981ad7f5ec91034e87cb7d3fd2e875d6bcab38fe9bdd015334f9b795edd080fc64558fde42bc2f46d6ae2c57a3d6c11c149eb71
6
+ metadata.gz: b5d08adeb33365c1226e8f7a5cba3a1980c8ac7c138189f3996db45138a22e7fb884d651050a9deecdac4e2802ba78a6177b4b8a795a591f3172178069b41e45
7
+ data.tar.gz: bb1680babc5f474f2cae62c59d5bfcbb9b7043a57dcba7d89de69521898ecd9b23a154f85b281fe514430b324feb9b74b6fe814056d248c022a55f4c64e6fbd3
checksums.yaml.gz.sig CHANGED
@@ -1 +1,2 @@
1
- fr'10��7py�h > 茙��+��u&aX9��'�!�o|�!��ϧ�F�7�6p�?�h���O+��;=?����'�-e�ӣ���_P0!�[�yPz��<���_�Y�XSq�1 ��3�ՠ���NI������#T�ů6=�UK�w�ڗ���#�QP�*]���
1
+ w�����!��~ A�e[ǚL��%��H"Lj]��Cʪ|�D�xC)l d~u�7#�S�w
2
+ ��K%��v���P�7,���`Y;�V�oNQ᠇t���0�>4w�@�ʝH�n@�?��+ǚ9�|�g �� VU����Gz�3Ž�Hp��!�!��PI�K��~h}��}Q �����͊M8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Scipio Changelog
2
2
 
3
+ ## 0.7.0 - 27 August 2024
4
+
5
+ - Breaking changes
6
+ - bug fix/add support for - hyphens & underscores in gem names
7
+ - add .erb extensions to the default template files
8
+ - add RBS files to the default template
9
+ - Add RBS & type signatures
10
+ - Some refactoring
11
+
3
12
  ## 0.6.0 - 13 August 2024
4
13
 
5
- - Initial Ruby release
14
+ - Initial Ruby release (earlier versions were a Python project)
data/README.md CHANGED
@@ -5,7 +5,7 @@ A small CLI utility to:
5
5
  - set up local & remote git repos
6
6
  - launch Rake tasks from anywhere
7
7
 
8
- Generally to help set up & run Ruby projects with less typing. Scipio. Skip IO. Geddit?
8
+ Set up & run Ruby projects with less typing. Scipio. Skip IO. Geddit?
9
9
 
10
10
  ## Status
11
11
 
@@ -13,6 +13,20 @@ Early days. Development status "3 - Alpha" in Python terms.
13
13
 
14
14
  (Those Python statuses are 1 - Planning, 2 - Pre-alpha, 3 - Alpha, 4 - Beta, 5 - Production/Stable, 6 - Mature, 7 - Inactive.)
15
15
 
16
+ ## Why
17
+
18
+ I'm a big fan of Bundler & Gem as package management tools. But I'm not a fan of the assumptions about licensing (MIT or nothing), repos (just Github), & Rake that are baked into the Bundler gem command. So I built Scipio, to make gem setup a user choice. It seemed a natural place to add the ability to run Rake scripts from anywhere.
19
+
20
+ ## Installation
21
+
22
+ `gem install scipio`
23
+
24
+ You will need to have Git and Berg installed and configured, as well as the Rake gem, in order to use them all via Scipio.
25
+
26
+ ## Usage
27
+
28
+ ...
29
+
16
30
  ## Ancient history
17
31
 
18
32
  <img src="./Scipio.png" alt="Scipio Africanus, OG" />
data/lib/scipio/cli.rb CHANGED
@@ -20,14 +20,14 @@ module Scipio
20
20
 
21
21
  Commands:
22
22
  BANNER
23
- gem(opts)
24
- help(opts)
25
- init(opts)
26
- local(opts)
27
- naked_repo(opts)
28
- rake(opts)
29
- task(opts)
30
- version(opts)
23
+ gems(opts:)
24
+ help(opts:)
25
+ init(opts:)
26
+ local(opts:)
27
+ naked_repo(opts:)
28
+ rake(opts:)
29
+ tasks(opts:)
30
+ version(opts:)
31
31
  end.parse!
32
32
 
33
33
  create_gem
@@ -38,20 +38,20 @@ module Scipio
38
38
  # don't have opts here to show help
39
39
  end
40
40
 
41
- def gem(opts)
41
+ def gems(opts:)
42
42
  opts.on("-g GEM", "--gem GEM", "Create a new ruby gem named GEM") do |opt|
43
43
  @options[:gem] = opt
44
44
  end
45
45
  end
46
46
 
47
- def help(opts)
47
+ def help(opts:)
48
48
  opts.on("-h", "--help", "This help message") do
49
49
  puts opts
50
50
  exit
51
51
  end
52
52
  end
53
53
 
54
- def init(opts)
54
+ def init(opts:)
55
55
  opts.on("-i", "--initialize", "Initialize config & template files, show details if they exist") do
56
56
  config = Scipio::Config.new
57
57
  config.info
@@ -60,31 +60,31 @@ module Scipio
60
60
  end
61
61
  end
62
62
 
63
- def local(opts)
63
+ def local(opts:)
64
64
  opts.on("-l", "--local", "With a gem or repo, do not create or connect to the origin") do
65
65
  @options[:local] = true
66
66
  end
67
67
  end
68
68
 
69
- def naked_repo(opts)
69
+ def naked_repo(opts:)
70
70
  opts.on("-n REPO", "--naked REPO", "Create a new naked git repo named REPO") do |opt|
71
71
  @options[:repo] = opt
72
72
  end
73
73
  end
74
74
 
75
- def rake(opts)
75
+ def rake(opts:)
76
76
  opts.on("-r RAKE", "--rake RAKE", "Run Rake in directory RAKE, or named RAKE in config") do |opt|
77
77
  @options[:rake] = opt
78
78
  end
79
79
  end
80
80
 
81
- def task(opts)
81
+ def tasks(opts:)
82
82
  opts.on("-t TASK", "--task TASK", "Rake task, use -t -T to list tasks, leave off for the default task") do |opt|
83
83
  @options[:task] = opt
84
84
  end
85
85
  end
86
86
 
87
- def version(opts)
87
+ def version(opts:)
88
88
  opts.on("-v", "--version", "The version") do
89
89
  puts Scipio::VERSION
90
90
  exit
data/lib/scipio/config.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require "yaml"
4
4
 
5
5
  module Scipio
6
- # Stored git repo config for Scipio
6
+ # Persist & use configuration
7
7
  class Config
8
8
  attr_reader :git_dir,
9
9
  :git_domain,
@@ -60,7 +60,7 @@ module Scipio
60
60
  parse_git_config
61
61
  parse_berg_user_info
62
62
  parse_berg_config
63
- @git_site = "#{@git_site}/#{@user_name}"
63
+ @git_site = File.join(@git_site, @user_name)
64
64
  FileUtils.mkdir_p(Config.template_dir)
65
65
  save_file
66
66
  end
@@ -124,8 +124,8 @@ module Scipio
124
124
  "rake" => {
125
125
  "name" => "path"
126
126
  }}
127
- json = config.to_yaml
128
- File.write(Config.config_file, json)
127
+ yaml = config.to_yaml
128
+ File.write(Config.config_file, yaml)
129
129
  end
130
130
 
131
131
  # ~/.Config -> @user_email, @user_fullname
data/lib/scipio/gems.rb CHANGED
@@ -6,6 +6,7 @@ require "fileutils"
6
6
  require "pathname"
7
7
 
8
8
  require_relative "config"
9
+ require_relative "../stdlib/string"
9
10
 
10
11
  module Scipio
11
12
  # Create the skeleton of a new Gem
@@ -18,6 +19,8 @@ module Scipio
18
19
  @git_dir = config.git_dir
19
20
  @template_dir = Config.template_dir
20
21
  @vars = {gem_name: @gem_name,
22
+ gem_name_slash: @gem_name.slash,
23
+ gem_name_test: @gem_name.test,
21
24
  git_site: config.git_site,
22
25
  user_name: config.user_name,
23
26
  user_fullname: config.user_fullname,
@@ -25,31 +28,41 @@ module Scipio
25
28
  date: DateTime.now}
26
29
  end
27
30
 
28
- def templates(dir:)
29
- # except for dot files this could be... Dir[File.join(dir, "**/*")]
30
- filter_types = %w[. .. .DS_Store]
31
- Dir.glob(File.join(dir, "**/*"), File::FNM_DOTMATCH)
32
- .select { |file| !file.end_with?(*filter_types) }
31
+ def init
32
+ FileUtils.mkdir_p @template_dir
33
+ unless Dir.empty? @template_dir
34
+ puts "Templates directory not empty - #{@template_dir}"
35
+ exit
36
+ end
37
+ FileUtils.cp_r(@gem_default_templates, @config_dir)
33
38
  end
34
39
 
35
40
  def relative_out_path(path_from:)
36
41
  out = Pathname.new(path_from)
37
42
  .relative_path_from(@template_dir)
38
43
  .to_s
39
- .chomp(".t")
44
+ .chomp(".erb")
40
45
  out % @vars
41
46
  end
42
47
 
48
+ def templates
49
+ # except for dot files this could be... Dir[File.join(dir, "**/*")]
50
+ filter_types = %w[. .. .DS_Store]
51
+ Dir.glob(File.join(@template_dir, "**/*"), File::FNM_DOTMATCH)
52
+ .select { |file| !file.end_with?(*filter_types) }
53
+ end
54
+
43
55
  def write
44
56
  out_dir = File.join(@git_dir, @gem_name)
45
57
  # create_out_dir(out_dir:)
46
- templates(dir: @template_dir).each do |path_from|
58
+ templates.each do |path_from|
47
59
  path_to = File.join(out_dir, relative_out_path(path_from:))
48
60
 
49
61
  if File.directory? path_from
50
62
  FileUtils.mkdir_p path_to
51
63
  else
52
64
  puts path_to # TODO: unless silent
65
+ FileUtils.mkdir_p Pathname(path_to).dirname # just in case
53
66
  template = ERB.new(File.read(path_from))
54
67
  IO.write(path_to, template.result_with_hash(@vars))
55
68
  end
@@ -57,13 +70,5 @@ module Scipio
57
70
  end
58
71
 
59
72
  # copy the default template files for users to modify or use
60
- def init
61
- FileUtils.mkdir_p @template_dir
62
- unless Dir.empty? @template_dir
63
- puts "Templates directory not empty - #{@template_dir}"
64
- exit
65
- end
66
- FileUtils.cp_r(@gem_default_templates, @config_dir)
67
- end
68
73
  end
69
74
  end
data/lib/scipio/rake.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler"
2
4
 
3
5
  module Scipio
@@ -29,14 +31,14 @@ module Scipio
29
31
  # try for a directory, then an entry in the config
30
32
  # TODO: note - watch out for directories in the directory you're calling scipio from,
31
33
  # rake will search the tree upwards from any directory it uses
32
- def try_dir(rake:)
34
+ def try_dir
33
35
  dir =
34
- if File.directory?(File.expand_path(rake))
35
- rake
36
- elsif @dir.key?(rake) && File.directory?(File.expand_path(@dir[rake]))
37
- @dir[rake]
36
+ if File.directory?(File.expand_path(@rake))
37
+ @rake
38
+ elsif @dir.key?(@rake) && File.directory?(File.expand_path(@dir[@rake]))
39
+ @dir[@rake]
38
40
  else
39
- p "Don't know directory or config entry - #{rake}"
41
+ p "Don't know directory or config entry - #{@rake}"
40
42
  exit
41
43
  end
42
44
  File.expand_path(dir)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Scipio
4
- VERSION = "0.6.0"
4
+ VERSION = "0.7.0"
5
5
  end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Extending the String class just like I promised I'd never do
4
+ class String
5
+ # these_words to TheseWords, this to This
6
+ def camelize
7
+ split("_").map { |word| word.capitalize_first }.join
8
+ end
9
+
10
+ # worD to WordD (& not Word, which is what capitalize would do)
11
+ def capitalize_first
12
+ sub(/\w/) { |word| word.upcase }
13
+ end
14
+
15
+ # these-words to These::Words - used for Module names
16
+ def colonize
17
+ # sub("-", "::")
18
+ split("-").map { |word| word.capitalize_first }.join("::")
19
+ end
20
+
21
+ # this/and/that to that - used in require_relative
22
+ def last_part
23
+ File.basename(tr("-", "/"))
24
+ end
25
+
26
+ # these-words to these/words - used in file paths
27
+ def slash
28
+ tr("-", "/")
29
+ end
30
+
31
+ # these-words to these/test_words
32
+ def test
33
+ slashed = slash
34
+ last = slashed.last_part
35
+ slashed.sub(/.*\K#{last}/, "test_#{last}")
36
+ end
37
+ end
@@ -4,11 +4,11 @@
4
4
  # lib = File.expand_path("lib", __dir__)
5
5
  # $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
6
 
7
- require_relative "lib/<%= gem_name %>/version"
7
+ require_relative "lib/<%= gem_name.slash %>/version"
8
8
 
9
9
  Gem::Specification.new do |spec|
10
10
  spec.name = "<%= gem_name %>"
11
- spec.version = <%= gem_name.capitalize %>::VERSION
11
+ spec.version = <%= gem_name.colonize.camelize %>::VERSION
12
12
  spec.authors = ["<%= user_fullname %>"]
13
13
  spec.email = ["<%= user_email %>"]
14
14
 
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.description = <<~DESC
17
17
  TODO: Longer description
18
18
  DESC
19
- spec.homepage = "<%= git_site %>/<%= user_name %>/<%= gem_name %>"
19
+ spec.homepage = "<%= git_site %>/<%= gem_name %>"
20
20
  spec.license = "AGPL-3.0-or-later"
21
21
  spec.required_ruby_version = ">= 3.3"
22
22
 
data/template/.gitignore CHANGED
@@ -1,11 +1,26 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
4
  /coverage/
5
- /doc/
5
+ /InstalledFiles
6
6
  /pkg/
7
7
  /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
8
11
  /tmp/
9
12
 
10
- # rspec failure tracking
13
+ /.yardoc/
14
+ /_yardoc/
15
+ /doc/
16
+ /rdoc/
17
+
18
+ /.bundle/
19
+ /vendor/bundle
20
+ /lib/bundler/man/
21
+
22
+ .DS_Store
23
+ .env
24
+ .idea
11
25
  .rspec_status
26
+ .ruby-lsp
@@ -0,0 +1 @@
1
+ ruby_version: 3.3
@@ -0,0 +1,5 @@
1
+ # <%= gem_name.capitalize %> Changelog
2
+
3
+ ## 0.1.0 - <%= date.strftime("%e %B %Y") %>
4
+
5
+ - Initial release
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  group :development do
6
6
  gem "minitest", "~> 5.24"
7
7
  gem "rake", "~> 13.0"
8
+ gem "rbs", "~> 3.5", ">= 3.5.3"
8
9
  gem "simplecov", "~> 0.22.0"
9
10
  gem "standard", "~> 1.35"
10
11
  end
@@ -2,19 +2,23 @@
2
2
 
3
3
  ...
4
4
 
5
- ## Installation
5
+ ## Status
6
6
 
7
- ...
7
+ ... in Python terms.
8
8
 
9
- ## Usage
9
+ (Those Python statuses are 1 - Planning, 2 - Pre-alpha, 3 - Alpha, 4 - Beta, 5 - Production/Stable, 6 - Mature, 7 - Inactive.)
10
+
11
+ ## Why
10
12
 
11
13
  ...
12
14
 
13
- ## Status
15
+ ## Installation
14
16
 
15
- ... in Python terms.
17
+ `gem install <%= gem_name %>`
16
18
 
17
- (Those Python statuses are 1 - Planning, 2 - Pre-alpha, 3 - Alpha, 4 - Beta, 5 - Production/Stable, 6 - Mature, 7 - Inactive.)
19
+ ## Usage
20
+
21
+ ...
18
22
 
19
23
  ## Development
20
24
 
@@ -2,32 +2,31 @@
2
2
 
3
3
  require "digest/sha2"
4
4
  require "minitest/test_task"
5
- require "reek/rake/task"
6
5
  require "standard/rake"
7
6
 
8
- require_relative "lib/<%= gem_name %>/version"
7
+ require_relative "lib/<%= gem_name.slash %>/version"
9
8
 
10
9
  Minitest::TestTask.create
11
10
 
12
11
  namespace :build do
13
12
  def check
14
- built_gem_path = "pkg/<%= gem_name %>-#{<%= gem_name.capitalize %>::VERSION}.gem"
13
+ built_gem_path = "pkg/<%= gem_name %>-#{<%= gem_name.colonize.camelize %>::VERSION}.gem"
15
14
  checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
16
- checksum_path = "./checksums/<%= gem_name %>-#{<%= gem_name.capitalize %>::VERSION}.gem.sha512"
15
+ checksum_path = "./checksums/<%= gem_name %>-#{<%= gem_name.colonize.camelize %>::VERSION}.gem.sha512"
17
16
  FileUtils.rm(Dir.glob("./checksums/*"))
18
17
  File.write(checksum_path, checksum)
19
18
  end
20
19
 
21
20
  def signed_build
22
21
  ENV["UNSIGNED_BUILD"] = "false"
23
- sh "bundle exec gem build <%= gem_name %>.gemspec --output=./pkg/<%= gem_name %>-#{<%= gem_name.capitalize %>::VERSION}.gem"
22
+ sh "bundle exec gem build <%= gem_name %>.gemspec --output=./pkg/<%= gem_name %>-#{<%= gem_name.colonize %>::VERSION}.gem"
24
23
  end
25
24
 
26
25
  desc "Unsigned build & local install, update the repo's checksum"
27
26
  task :local do
28
27
  ENV["UNSIGNED_BUILD"] = "true"
29
- sh "bundle exec gem build <%= gem_name %>.gemspec --output=./pkg/<%= gem_name %>-#{<%= gem_name.capitalize %>::VERSION}.gem"
30
- sh "bundle exec gem install ./pkg/<%= gem_name %>-#{<%= gem_name.capitalize %>::VERSION}.gem -P MediumSecurity"
28
+ sh "bundle exec gem build <%= gem_name %>.gemspec --output=./pkg/<%= gem_name %>-#{<%= gem_name.colonize.camelize %>::VERSION}.gem"
29
+ sh "bundle exec gem install ./pkg/<%= gem_name %>-#{<%= gem_name.colonize.camelize %>::VERSION}.gem -P MediumSecurity"
31
30
  check
32
31
  end
33
32
 
@@ -35,7 +34,7 @@ namespace :build do
35
34
  task :local_sy do
36
35
  signed_build
37
36
  check
38
- sh "bundle exec gem install ./pkg/<%= gem_name %>-#{<%= gem_name.capitalize %>::VERSION}.gem -P HighSecurity"
37
+ sh "bundle exec gem install ./pkg/<%= gem_name %>-#{<%= gem_name.colonize.camelize %>::VERSION}.gem -P HighSecurity"
39
38
  end
40
39
 
41
40
  desc "Publish it - this will build & sign, then commit, push and publish"
@@ -45,17 +44,13 @@ namespace :build do
45
44
  check
46
45
  # tag git repo
47
46
  sh "git add ."
48
- sh "git commit -m \"v#{<%= gem_name.capitalize %>::VERSION}\""
49
- sh "git tag -s v#{<%= gem_name.capitalize %>::VERSION} -m \"v#{<%= gem_name.capitalize %>::VERSION}\""
50
- sh "git push origin \"v#{<%= gem_name.capitalize %>::VERSION}\""
47
+ sh "git commit -m \"v#{<%= gem_name.colonize.camelize %>::VERSION}\""
48
+ sh "git tag -s v#{<%= gem_name.colonize.camelize %>::VERSION} -m \"v#{<%= gem_name.colonize.camelize %>::VERSION}\""
49
+ sh "git push origin \"v#{<%= gem_name.colonize.camelize %>::VERSION}\""
51
50
  sh "git push"
52
51
  # publish to rubygems, will require OTP
53
- sh "gem push ./pkg/<%= gem_name %>-#{<%= gem_name.capitalize %>::VERSION}.gem"
52
+ sh "gem push ./pkg/<%= gem_name %>-#{<%= gem_name.colonize.camelize %>::VERSION}.gem"
54
53
  end
55
54
  end
56
55
 
57
- Reek::Rake::Task.new do |t|
58
- t.fail_on_error = false
59
- end
60
-
61
- task default: %i[standard:fix reek]
56
+ task default: %i[standard:fix]
@@ -4,6 +4,6 @@
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
5
5
 
6
6
  require 'bundler/setup'
7
- require '<%= gem_name %>/cli'
7
+ require '<%= gem_name.slash %>/cli'
8
8
 
9
- <%= gem_name.capitalize %>::CLI.new.start
9
+ <%= gem_name.colonize.camelize %>::CLI.new.start
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "optparse"
4
4
 
5
- module <%= gem_name.capitalize %>
5
+ module <%= gem_name.colonize.camelize %>
6
6
  # CLI handled by optparse
7
7
  class CLI
8
8
  def start(*_args)
@@ -35,7 +35,7 @@ module <%= gem_name.capitalize %>
35
35
 
36
36
  def version(opts)
37
37
  opts.on("-v", "--version", "The version") do
38
- puts <%= gem_name.capitalize %>::VERSION
38
+ puts <%= gem_name.colonize.camelize %>::VERSION
39
39
  exit
40
40
  end
41
41
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module <%= gem_name.capitalize %>
3
+ module <%= gem_name.colonize.camelize %>
4
4
  VERSION = "0.1.0"
5
5
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "<%= gem_name.last_part %>/version"
4
+
5
+ # <%= gem_name.capitalize %>'s top level module
6
+ module <%= gem_name.colonize.camelize %>
7
+ end
@@ -0,0 +1,13 @@
1
+ module <%= gem_name.colonize.camelize %>
2
+ class CLI
3
+ @options: Hash[String, String]
4
+
5
+ def help:(opts: OptionParser) -> void
6
+
7
+ def options_other:(opts: OptionParser) -> void
8
+
9
+ def start:(Array[untyped] _args) -> void
10
+
11
+ def version: -> void
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ module <%= gem_name.colonize.camelize %>
2
+ VERSION: String
3
+ end
@@ -2,9 +2,9 @@
2
2
 
3
3
  require "test_helper"
4
4
 
5
- class Test<%= gem_name.capitalize %> < Minitest::Test
5
+ class Test<%= gem_name.test %> < Minitest::Test
6
6
  def test_that_it_has_a_version_number
7
- refute_nil ::<%= gem_name.capitalize %>::VERSION
7
+ refute_nil ::<%= gem_name.colonize.camelize %>::VERSION
8
8
  end
9
9
 
10
10
  def test_it_does_something_useful
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scipio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Kreuzer
@@ -12,7 +12,7 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEeDCCAuCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMQ0wCwYDVQQDDARtaWtl
14
14
  MRswGQYKCZImiZPyLGQBGRYLbWlrZWtyZXV6ZXIxEzARBgoJkiaJk/IsZAEZFgNj
15
- b20wHhcNMjQwODA4MDIzNjEwWhcNMjUwODA4MDIzNjEwWjBBMQ0wCwYDVQQDDARt
15
+ b20wHhcNMjQwODEzMDczOTMzWhcNMjUwODEzMDczOTMzWjBBMQ0wCwYDVQQDDARt
16
16
  aWtlMRswGQYKCZImiZPyLGQBGRYLbWlrZWtyZXV6ZXIxEzARBgoJkiaJk/IsZAEZ
17
17
  FgNjb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQCmglRYFT8KQzXy
18
18
  FfR96x8RTRUmk3ahagfIoH8gkCLrTpKL6qmEbzRBrmg3utjAMooQK3xn0aLwVq6T
@@ -25,17 +25,17 @@ cert_chain:
25
25
  xfs+km5aTprQKQHK1IpLcWQ/23KbZbOHS0sJjem1WzbzBBtHHhcCAwEAAaN7MHkw
26
26
  CQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFKf5PbSu3EXt0eEsHMty
27
27
  EisanEBpMB8GA1UdEQQYMBaBFG1pa2VAbWlrZWtyZXV6ZXIuY29tMB8GA1UdEgQY
28
- MBaBFG1pa2VAbWlrZWtyZXV6ZXIuY29tMA0GCSqGSIb3DQEBCwUAA4IBgQBB1pEL
29
- PPmfEMPwNamql+b2aIkvOt0YEXMf7fUgp/BiFAYV+gZad/n986+0nPAW2GaPIdxI
30
- dFSOiEf0QBvqIfAneVZZZuxAzEEhsCDpvtC8kI0v/mSmiTI2ZRZQbiuSHJH/uqMX
31
- GrhpdekaLop0w6O6yjlPXt3p4Xm80c8wYQwptMdJsbuzZtRBg0mDYEkhIx3ww00P
32
- 46yTjs8UZPOKTzh0HwtX/FYOqrtAFbNrNS8u6kvEXZUv/bTklc7RSCVjbuO2iqtd
33
- H/Vp9AfhQ9r/DD5ETlhqUKLfAbsJDAgrWjwwJh5CCpe9K6ZGU2/23hQX/o7KMMId
34
- j7yChcdwTf8FSZQVnofOAnx0yXOSPtwO94kC63GYYSuSEyRs3zyFfsQ1QUu6sUGc
35
- ePu9aPoMUctW7oy5Cn1y/gm8sg+kMyGO4qC6q5M5EyfCPZIz5XUtLZKstIZHW5DK
36
- /F7laAkX2XDBV5Cs1j7iLEgJPyL+U0b+vMSAl19+/sO8adoXNZO1qAMsqew=
28
+ MBaBFG1pa2VAbWlrZWtyZXV6ZXIuY29tMA0GCSqGSIb3DQEBCwUAA4IBgQAhdHiW
29
+ TwKU2JWbPUrErM3Pnu+2J7jzXuUWiGVg0toGn/lEPOm3crvBSXIWSCnHNFVMV90W
30
+ QuKUVButhH5u+WjzriBkuG6zIUfjSxBDVehLZoGo8E27PO58pBzPgWD7ZRS0S0H6
31
+ d1PFSPLTFvm2AkwOM9pXQxAXeCg25vkEbFeKBi147/++7tmsnU0pMYnSmuUUBFFu
32
+ QMr7UTxT0d6wnmTMErqPmD+VMnyGvX62aMqXAyL0FMZDJeVzoeEii2CYS4L9qkwY
33
+ PLWx2xbdV0LcT/Har9JmYX7b/Cio/tH023rZ++nPeD0k6n2nGfm+IVlknHM571c9
34
+ 7sfPFxBucVUXL1sPl9GcQbMjfL+t7QS1rr2PhRuwCsRTStNcNZaRCd/mZUKKP+3l
35
+ YgqTixCwts6cQYIdYNFtJbzKvRNqyviKKxPaum7UWAv6Uy80gxgJ8p+fG81FsxbZ
36
+ 0ULnXrHlhf/CHs550TxRlXalgxBCImGdHzWjhdJeC1dZP3olgNtjO23ywtw=
37
37
  -----END CERTIFICATE-----
38
- date: 2024-08-13 00:00:00.000000000 Z
38
+ date: 2024-08-27 00:00:00.000000000 Z
39
39
  dependencies: []
40
40
  description: |
41
41
  A small CLI utility to:
@@ -62,25 +62,29 @@ files:
62
62
  - lib/scipio/git.rb
63
63
  - lib/scipio/rake.rb
64
64
  - lib/scipio/version.rb
65
- - template/%{gem_name}.gemspec.t
65
+ - lib/stdlib/string.rb
66
+ - template/%{gem_name}.gemspec.erb
66
67
  - template/.gitignore
67
- - template/CHANGELOG.md
68
- - template/CODE_OF_CONDUCT.md
69
- - template/Gemfile
70
- - template/LICENSE.txt
71
- - template/README.md
72
- - template/Rakefile
73
- - template/bin/%{gem_name}
74
- - template/bin/console
75
- - template/bin/setup
68
+ - template/.standard
69
+ - template/CHANGELOG.md.erb
70
+ - template/CODE_OF_CONDUCT.md.erb
71
+ - template/Gemfile.erb
72
+ - template/LICENSE.txt.erb
73
+ - template/README.md.erb
74
+ - template/Rakefile.erb
75
+ - template/bin/%{gem_name}.erb
76
+ - template/bin/console.erb
77
+ - template/bin/setup.erb
76
78
  - template/certs/.gitkeep
77
79
  - template/checksums/.gitkeep
78
- - template/lib/%{gem_name}.rb
79
- - template/lib/%{gem_name}/cli.rb
80
- - template/lib/%{gem_name}/version.rb
80
+ - template/lib/%{gem_name_slash}.rb.erb
81
+ - template/lib/%{gem_name_slash}/cli.rb.erb
82
+ - template/lib/%{gem_name_slash}/version.rb.erb
81
83
  - template/pkg/.gitkeep
82
- - template/test/test_%{gem_name}.rb
83
- - template/test/test_helper.rb
84
+ - template/sig/%{gem_name_slash}.rbs.erb
85
+ - template/sig/%{gem_name_slash}/cli.rbs.erb
86
+ - template/test/%{gem_name_test}.rb.erb
87
+ - template/test/test_helper.rb.erb
84
88
  homepage: https://codeberg.org/kreuzer/scipio
85
89
  licenses:
86
90
  - AGPL-3.0-or-later
metadata.gz.sig CHANGED
Binary file
@@ -1,5 +0,0 @@
1
- ## [Unreleased]
2
-
3
- ## [0.1.0] - <%= date.strftime("%e %B %Y") %>
4
-
5
- - Initial release
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "<%= gem_name %>/version"
4
-
5
- # <%= gem_name.capitalize %>'s top level module
6
- module <%= gem_name.capitalize %>
7
- end
File without changes
File without changes
File without changes