scipio 0.7.0 → 0.9.0
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
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +7 -0
- data/README.md +2 -49
- data/lib/scipio/cli.rb +2 -34
- data/lib/scipio/config.rb +0 -15
- data/lib/scipio/gems.rb +5 -5
- data/lib/scipio/version.rb +1 -1
- data/lib/stdlib/string.rb +1 -1
- data/template/lib/%{gem_name_slash}/cli.rb.erb +9 -6
- data.tar.gz.sig +3 -5
- metadata +8 -10
- metadata.gz.sig +0 -0
- data/lib/scipio/rake.rb +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e647acd21927916b582e8391d84b7073319ad0ae9a344f8f1139f5afa6e86286
|
4
|
+
data.tar.gz: 88878f4358de95ebe42e01bcf70840c4505182dfca71a727f943e8adea1b0ec1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94c1b8ac7bd03711779ad53d26c2a0fae1370cddbb04a89c6ede4ceef8bdbe7130359b9af51f4ab33b2ef454df5232d431e631642e3bead62c6649c350b70a05
|
7
|
+
data.tar.gz: 7f6df4b551610f6fbb511af71cc5f283d5b3928f30685d48bf735cff010bdecd67729e6817c8c1bfc80c68b1c17f97092183ead45e6c490bfb5b1fb07d32320f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Scipio Changelog
|
2
2
|
|
3
|
+
## 0.8.0 - 28 August 2024
|
4
|
+
|
5
|
+
- Breaking changes
|
6
|
+
- split off Rake tasks to the new Reki gem, to focus on new gems & repos here
|
7
|
+
- minor template changes (named arguments in the cli methods)
|
8
|
+
- bug fix - attempt gem creation with no local template copy present
|
9
|
+
|
3
10
|
## 0.7.0 - 27 August 2024
|
4
11
|
|
5
12
|
- Breaking changes
|
data/README.md
CHANGED
@@ -1,52 +1,5 @@
|
|
1
1
|
# Scipio
|
2
2
|
|
3
|
-
|
4
|
-
- set up new Ruby Gems using a configurable template
|
5
|
-
- set up local & remote git repos
|
6
|
-
- launch Rake tasks from anywhere
|
3
|
+
This gem is no longer maintained. Please see [mikekreuzer.com][mikekreuzer.com] for my more recent work.
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
## Status
|
11
|
-
|
12
|
-
Early days. Development status "3 - Alpha" in Python terms.
|
13
|
-
|
14
|
-
(Those Python statuses are 1 - Planning, 2 - Pre-alpha, 3 - Alpha, 4 - Beta, 5 - Production/Stable, 6 - Mature, 7 - Inactive.)
|
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
|
-
|
30
|
-
## Ancient history
|
31
|
-
|
32
|
-
<img src="./Scipio.png" alt="Scipio Africanus, OG" />
|
33
|
-
|
34
|
-
In 2015 Scipio was a Swift package manager written in Python, but it was soon made obsolete by the growth of Apple's own package manager. Carthage was one of the other alternatives around at the time. Carthago delenda est.
|
35
|
-
|
36
|
-
A little earlier, Scipio was also a Roman general & one of the authors of Carthage's defeat in the Second Punic War.
|
37
|
-
|
38
|
-
## Development
|
39
|
-
|
40
|
-
After checking out the repo, run `bundle install` to install dependencies. Then, run `rake test` to run the tests.
|
41
|
-
|
42
|
-
To install this gem locally, run `bundle exec rake local`.
|
43
|
-
|
44
|
-
`bundle exec rake -T` to see the current options.
|
45
|
-
|
46
|
-
## Contributing
|
47
|
-
|
48
|
-
Bug reports and pull requests are welcome at [https://codeberg.org/kreuzer/scipio](https://codeberg.org/kreuzer/scipio). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://codeberg.org/kreuzer/scipio/src/branch/main/CODE_OF_CONDUCT.md).
|
49
|
-
|
50
|
-
## Code of Conduct
|
51
|
-
|
52
|
-
Everyone interacting in the Scipio project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://codeberg.org/kreuzer/scipio/src/branch/main/CODE_OF_CONDUCT.md).
|
5
|
+
[mikekreuzer.com]: https://mikekreuzer.com
|
data/lib/scipio/cli.rb
CHANGED
@@ -6,7 +6,6 @@ require "yaml"
|
|
6
6
|
require_relative "config"
|
7
7
|
require_relative "gems"
|
8
8
|
require_relative "git"
|
9
|
-
require_relative "rake"
|
10
9
|
|
11
10
|
module Scipio
|
12
11
|
# CLI handled by optparse
|
@@ -15,8 +14,7 @@ module Scipio
|
|
15
14
|
@options = {}
|
16
15
|
OptionParser.new do |opts|
|
17
16
|
opts.banner = <<~BANNER
|
18
|
-
Scipio
|
19
|
-
Expanded help here
|
17
|
+
Scipio is a CLI utility to set up Ruby Gems & git repos
|
20
18
|
|
21
19
|
Commands:
|
22
20
|
BANNER
|
@@ -25,14 +23,11 @@ module Scipio
|
|
25
23
|
init(opts:)
|
26
24
|
local(opts:)
|
27
25
|
naked_repo(opts:)
|
28
|
-
rake(opts:)
|
29
|
-
tasks(opts:)
|
30
26
|
version(opts:)
|
31
27
|
end.parse!
|
32
28
|
|
33
29
|
create_gem
|
34
30
|
create_repo
|
35
|
-
create_task
|
36
31
|
rescue OptionParser::InvalidOption
|
37
32
|
puts "Invalid option"
|
38
33
|
# don't have opts here to show help
|
@@ -72,18 +67,6 @@ module Scipio
|
|
72
67
|
end
|
73
68
|
end
|
74
69
|
|
75
|
-
def rake(opts:)
|
76
|
-
opts.on("-r RAKE", "--rake RAKE", "Run Rake in directory RAKE, or named RAKE in config") do |opt|
|
77
|
-
@options[:rake] = opt
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
def tasks(opts:)
|
82
|
-
opts.on("-t TASK", "--task TASK", "Rake task, use -t -T to list tasks, leave off for the default task") do |opt|
|
83
|
-
@options[:task] = opt
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
70
|
def version(opts:)
|
88
71
|
opts.on("-v", "--version", "The version") do
|
89
72
|
puts Scipio::VERSION
|
@@ -97,6 +80,7 @@ module Scipio
|
|
97
80
|
config = Scipio::Config.new
|
98
81
|
repo = Scipio::Git.new(config:, repo_name: @options[:gem])
|
99
82
|
gem = Scipio::Gems.new(config:, gem_name: @options[:gem])
|
83
|
+
gem.init
|
100
84
|
|
101
85
|
repo.create_dir
|
102
86
|
repo.init_before_write
|
@@ -124,21 +108,5 @@ module Scipio
|
|
124
108
|
exit
|
125
109
|
end
|
126
110
|
end
|
127
|
-
|
128
|
-
def create_task
|
129
|
-
if @options[:rake]
|
130
|
-
config = Scipio::Config.new
|
131
|
-
@options[:task] ||= ""
|
132
|
-
rake = Scipio::Rake.new(options: @options, config:)
|
133
|
-
rake.run
|
134
|
-
exit
|
135
|
-
end
|
136
|
-
|
137
|
-
# no rake dir or name, but a task
|
138
|
-
if @options[:task]
|
139
|
-
puts "--task requires --rake NAME, the directory or named Rake file you're calling this task on"
|
140
|
-
exit
|
141
|
-
end
|
142
|
-
end
|
143
111
|
end
|
144
112
|
end
|
data/lib/scipio/config.rb
CHANGED
@@ -8,7 +8,6 @@ module Scipio
|
|
8
8
|
attr_reader :git_dir,
|
9
9
|
:git_domain,
|
10
10
|
:git_site,
|
11
|
-
:rake_dirs,
|
12
11
|
:user_email,
|
13
12
|
:user_fullname,
|
14
13
|
:user_name
|
@@ -76,17 +75,7 @@ module Scipio
|
|
76
75
|
e-mail: #{@user_email}
|
77
76
|
name: \t#{@user_fullname}
|
78
77
|
user: \t#{@user_name}
|
79
|
-
|
80
|
-
Rake
|
81
78
|
INFO
|
82
|
-
if rake_dirs
|
83
|
-
rake_dirs.each do |name, dir|
|
84
|
-
puts "#{name} - #{dir}"
|
85
|
-
end
|
86
|
-
else
|
87
|
-
puts "No rake directories defined"
|
88
|
-
end
|
89
|
-
# exit
|
90
79
|
end
|
91
80
|
|
92
81
|
def ask_for_git_dir
|
@@ -109,7 +98,6 @@ module Scipio
|
|
109
98
|
@user_email = git["user_email"]
|
110
99
|
@user_fullname = git["user_fullname"]
|
111
100
|
@user_name = git["user_name"]
|
112
|
-
@rake_dirs = config["rake"]
|
113
101
|
end
|
114
102
|
|
115
103
|
def save_file
|
@@ -120,9 +108,6 @@ module Scipio
|
|
120
108
|
"user_email" => @user_email,
|
121
109
|
"user_fullname" => @user_fullname,
|
122
110
|
"user_name" => @user_name
|
123
|
-
},
|
124
|
-
"rake" => {
|
125
|
-
"name" => "path"
|
126
111
|
}}
|
127
112
|
yaml = config.to_yaml
|
128
113
|
File.write(Config.config_file, yaml)
|
data/lib/scipio/gems.rb
CHANGED
@@ -29,12 +29,12 @@ module Scipio
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def init
|
32
|
-
FileUtils.mkdir_p
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
FileUtils.mkdir_p(@template_dir)
|
33
|
+
if Dir.empty?(@template_dir)
|
34
|
+
FileUtils.cp_r(@gem_default_templates, @config_dir)
|
35
|
+
puts "Templates copied"
|
36
36
|
end
|
37
|
-
|
37
|
+
puts "Templates directory - #{@template_dir}"
|
38
38
|
end
|
39
39
|
|
40
40
|
def relative_out_path(path_from:)
|
data/lib/scipio/version.rb
CHANGED
data/lib/stdlib/string.rb
CHANGED
@@ -13,27 +13,30 @@ module <%= gem_name.colonize.camelize %>
|
|
13
13
|
|
14
14
|
Commands:
|
15
15
|
BANNER
|
16
|
-
help(opts)
|
17
|
-
options_other(opts)
|
18
|
-
version(opts)
|
16
|
+
help(opts:)
|
17
|
+
options_other(opts:)
|
18
|
+
version(opts:)
|
19
19
|
end.parse!
|
20
|
+
rescue OptionParser::InvalidOption
|
21
|
+
puts "Invalid option"
|
22
|
+
# don't have opts here to show help
|
20
23
|
end
|
21
24
|
|
22
|
-
def help(opts)
|
25
|
+
def help(opts:)
|
23
26
|
opts.on("-h", "--help", "This help message") do
|
24
27
|
puts opts
|
25
28
|
exit
|
26
29
|
end
|
27
30
|
end
|
28
31
|
|
29
|
-
def options_other(opts)
|
32
|
+
def options_other(opts:)
|
30
33
|
opts.on("-o", "--other", "Do... other") do |_o|
|
31
34
|
puts "OK"
|
32
35
|
exit
|
33
36
|
end
|
34
37
|
end
|
35
38
|
|
36
|
-
def version(opts)
|
39
|
+
def version(opts:)
|
37
40
|
opts.on("-v", "--version", "The version") do
|
38
41
|
puts <%= gem_name.colonize.camelize %>::VERSION
|
39
42
|
exit
|
data.tar.gz.sig
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
���"
|
3
|
-
|
4
|
-
г�s<]�!��}�9�VP��ƾƉ3��k� ��t�}�دH0��o��l�D_v�֤�<��{�(��c�4\����������
|
5
|
-
�)�t�J#�����Sp��-��`�)g�v���(8.mF��"Lv
|
1
|
+
5�n}��hE<��Bf�*��>>q�D�V�u*�7_l���[Nx:I�������kȢ3e'�kx�hS{/-�ax��t���y��:�r%.K�NE"ݓbLQ�����m���$��a�f
|
2
|
+
al`��^�l���I��p{����~��K��BL,��hY��R��!�HjOn\�n�_eo��8�^���jR ��]n�.�,���%m�i�f�8��_���h7��7Q���'����z�ņU� "��Q�_>m�׳G2:&�_�\�\�`���=��nt�P
|
3
|
+
�K�9�`��3^Y�D��#!���qBV$�u�a�� S��� 6��z�M �Q�~xo���ǯP*}_������&K�\.�\]���1�V�F0
|
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.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Kreuzer
|
@@ -35,13 +35,12 @@ cert_chain:
|
|
35
35
|
YgqTixCwts6cQYIdYNFtJbzKvRNqyviKKxPaum7UWAv6Uy80gxgJ8p+fG81FsxbZ
|
36
36
|
0ULnXrHlhf/CHs550TxRlXalgxBCImGdHzWjhdJeC1dZP3olgNtjO23ywtw=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2025-03-05 00:00:00.000000000 Z
|
39
39
|
dependencies: []
|
40
|
-
description:
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
- launch Rake tasks from anywhere
|
40
|
+
description: 'This gem is no longer maintained. Please see mikekreuzer.com for my
|
41
|
+
more recent work.
|
42
|
+
|
43
|
+
'
|
45
44
|
email:
|
46
45
|
- mike@mikekreuzer.com
|
47
46
|
executables:
|
@@ -60,7 +59,6 @@ files:
|
|
60
59
|
- lib/scipio/config.rb
|
61
60
|
- lib/scipio/gems.rb
|
62
61
|
- lib/scipio/git.rb
|
63
|
-
- lib/scipio/rake.rb
|
64
62
|
- lib/scipio/version.rb
|
65
63
|
- lib/stdlib/string.rb
|
66
64
|
- template/%{gem_name}.gemspec.erb
|
@@ -111,6 +109,6 @@ requirements: []
|
|
111
109
|
rubygems_version: 3.5.17
|
112
110
|
signing_key:
|
113
111
|
specification_version: 4
|
114
|
-
summary:
|
115
|
-
|
112
|
+
summary: This gem is no longer maintained. Please see mikekreuzer.com for my more
|
113
|
+
recent work.
|
116
114
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/scipio/rake.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "bundler"
|
4
|
-
|
5
|
-
module Scipio
|
6
|
-
# To call Rake from anywhere
|
7
|
-
class Rake
|
8
|
-
def initialize(options:, config:)
|
9
|
-
@rake = options[:rake]
|
10
|
-
@task = options[:task] # may be an empty string
|
11
|
-
@dir = config.rake_dirs
|
12
|
-
end
|
13
|
-
|
14
|
-
# if running without bundler
|
15
|
-
# https://mattbrictson.com/blog/run-shell-commands-in-ruby
|
16
|
-
def self.with_original_bundler_env(&)
|
17
|
-
return yield unless defined?(Bundler)
|
18
|
-
Bundler.with_original_env(&)
|
19
|
-
end
|
20
|
-
|
21
|
-
def run
|
22
|
-
dir = try_dir(rake: @rake)
|
23
|
-
Dir.chdir(dir) do
|
24
|
-
# Bundler.with_original_env do
|
25
|
-
Rake.with_original_bundler_env do
|
26
|
-
system("bundle exec rake #{@task} --trace", exception: true)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# try for a directory, then an entry in the config
|
32
|
-
# TODO: note - watch out for directories in the directory you're calling scipio from,
|
33
|
-
# rake will search the tree upwards from any directory it uses
|
34
|
-
def try_dir
|
35
|
-
dir =
|
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]
|
40
|
-
else
|
41
|
-
p "Don't know directory or config entry - #{@rake}"
|
42
|
-
exit
|
43
|
-
end
|
44
|
-
File.expand_path(dir)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|