gem_hadar 2.6.0 → 2.8.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
- data/.all_images.yml +20 -0
- data/.github/workflows/static.yml +51 -0
- data/README.md +4 -0
- data/Rakefile +15 -1
- data/gem_hadar.gemspec +15 -5
- data/lib/gem_hadar/github.rb +37 -0
- data/lib/gem_hadar/github_workflows/static.yml.erb +51 -0
- data/lib/gem_hadar/template_compiler.rb +1 -1
- data/lib/gem_hadar/version.rb +1 -1
- data/lib/gem_hadar.rb +81 -11
- metadata +148 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61bd73fbacc235d0b8f20dbfdc163a073b357f5f6cf57d0532f4cb926bf856ff
|
4
|
+
data.tar.gz: 939d6f711ff16aa17709aeb57adf3bc58d1845e7e61b7aa3e4ff6a7d8a009104
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2562b0bf0bc25803f14dfc4aba508d6a3c8aac6a23ca9063c5e4a62f213645e73dfd3fb486688c9b7d61d19c492b8bc74ea6442420f5c545c223271aeb3d6f2
|
7
|
+
data.tar.gz: 8fd48f5fe9a5e5e50837434f32b666302ed4fa6e85f44480437fb357fcd6a0a6011cdd40d617a30eb4a4b40d440eee1e2a75f60e1b9c81631f1efc6d3f86a5c0
|
data/.all_images.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
dockerfile: |-
|
2
|
+
RUN apk add --no-cache build-base yaml-dev openssl-dev git
|
3
|
+
RUN gem update --system
|
4
|
+
RUN gem install bundler gem_hadar
|
5
|
+
|
6
|
+
script: &script |-
|
7
|
+
echo -e "\e[1m"
|
8
|
+
ruby -v
|
9
|
+
echo -e "\e[0m"
|
10
|
+
bundle update
|
11
|
+
bundle install --jobs=$(getconf _NPROCESSORS_ONLN)
|
12
|
+
rake spec
|
13
|
+
|
14
|
+
fail_fast: true
|
15
|
+
|
16
|
+
images:
|
17
|
+
ruby:3.4-alpine: *script
|
18
|
+
ruby:3.3-alpine: *script
|
19
|
+
ruby:3.2-alpine: *script
|
20
|
+
ruby:3.1-alpine: *script
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# Simple workflow for deploying static content to GitHub Pages
|
2
|
+
name: Deploy static content to Pages
|
3
|
+
|
4
|
+
on:
|
5
|
+
# Runs on pushes targeting the default branch
|
6
|
+
push:
|
7
|
+
branches: [ "master" ]
|
8
|
+
|
9
|
+
# Allows you to run this workflow manually from the Actions tab
|
10
|
+
workflow_dispatch:
|
11
|
+
|
12
|
+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
13
|
+
permissions:
|
14
|
+
contents: read
|
15
|
+
pages: write
|
16
|
+
id-token: write
|
17
|
+
|
18
|
+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
19
|
+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
20
|
+
concurrency:
|
21
|
+
group: "pages"
|
22
|
+
cancel-in-progress: false
|
23
|
+
|
24
|
+
jobs:
|
25
|
+
# Single deploy job since we're just deploying
|
26
|
+
deploy:
|
27
|
+
environment:
|
28
|
+
name: github-pages
|
29
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
30
|
+
runs-on: ubuntu-latest
|
31
|
+
steps:
|
32
|
+
- name: Checkout
|
33
|
+
uses: actions/checkout@v4
|
34
|
+
- name: Setup Pages
|
35
|
+
uses: actions/configure-pages@v5
|
36
|
+
- name: Setup Ruby
|
37
|
+
uses: ruby/setup-ruby@v1
|
38
|
+
with:
|
39
|
+
ruby-version: '3.4'
|
40
|
+
- name: Generate Documentation
|
41
|
+
run: |
|
42
|
+
gem install gem_hadar
|
43
|
+
bundle install
|
44
|
+
rake doc
|
45
|
+
- name: Upload artifact
|
46
|
+
uses: actions/upload-pages-artifact@v3
|
47
|
+
with:
|
48
|
+
path: 'doc'
|
49
|
+
- name: Deploy to GitHub Pages
|
50
|
+
id: deployment
|
51
|
+
uses: actions/deploy-pages@v4
|
data/README.md
CHANGED
@@ -28,6 +28,10 @@ using rake tasks. It is a comprehensive Ruby gem automation tool that provides:
|
|
28
28
|
- **Gemfile and .gitignore automation** - Automatic creation and management of
|
29
29
|
essential project files with 📦dependency management
|
30
30
|
|
31
|
+
## Documentation
|
32
|
+
|
33
|
+
Complete API documentation is available at: [GitHub.io](https://flori.github.io/gem_hadar/)
|
34
|
+
|
31
35
|
## Workflow Diagrams
|
32
36
|
|
33
37
|
### Gem Build Process
|
data/Rakefile
CHANGED
@@ -18,13 +18,27 @@ GemHadar do
|
|
18
18
|
|
19
19
|
executables << 'gem_hadar'
|
20
20
|
|
21
|
-
|
21
|
+
github_workflows(
|
22
|
+
'static.yml' => { branches: '[ "master" ]' }
|
23
|
+
)
|
24
|
+
|
25
|
+
dependency 'tins', '~> 1.0'
|
22
26
|
dependency 'term-ansicolor', '~> 1.0'
|
23
27
|
dependency 'ollama-ruby', '~> 1.7'
|
24
28
|
dependency 'mize'
|
25
29
|
dependency 'rake'
|
26
30
|
dependency 'yard'
|
31
|
+
dependency 'openssl', '>= 3.3.1'
|
32
|
+
dependency 'net-http'
|
33
|
+
dependency 'json', '~> 2.0'
|
34
|
+
dependency 'pathname'
|
35
|
+
dependency 'uri'
|
36
|
+
dependency 'set'
|
37
|
+
dependency 'fileutils'
|
38
|
+
dependency 'erb'
|
39
|
+
development_dependency 'all_images'
|
27
40
|
development_dependency 'rspec', '~> 3.13'
|
41
|
+
development_dependency 'simplecov'
|
28
42
|
|
29
43
|
licenses << 'MIT'
|
30
44
|
end
|
data/gem_hadar.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: gem_hadar 2.
|
2
|
+
# stub: gem_hadar 2.8.0 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "gem_hadar".freeze
|
6
|
-
s.version = "2.
|
6
|
+
s.version = "2.8.0".freeze
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
14
|
s.executables = ["gem_hadar".freeze]
|
15
15
|
s.extra_rdoc_files = ["README.md".freeze, "lib/gem_hadar.rb".freeze, "lib/gem_hadar/github.rb".freeze, "lib/gem_hadar/prompt_template.rb".freeze, "lib/gem_hadar/setup.rb".freeze, "lib/gem_hadar/simplecov.rb".freeze, "lib/gem_hadar/template_compiler.rb".freeze, "lib/gem_hadar/utils.rb".freeze, "lib/gem_hadar/version.rb".freeze, "lib/gem_hadar/warn.rb".freeze]
|
16
|
-
s.files = ["Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/gem_hadar".freeze, "gem_hadar.gemspec".freeze, "lib/gem_hadar.rb".freeze, "lib/gem_hadar/github.rb".freeze, "lib/gem_hadar/prompt_template.rb".freeze, "lib/gem_hadar/setup.rb".freeze, "lib/gem_hadar/simplecov.rb".freeze, "lib/gem_hadar/template_compiler.rb".freeze, "lib/gem_hadar/utils.rb".freeze, "lib/gem_hadar/version.rb".freeze, "lib/gem_hadar/warn.rb".freeze, "spec/gem_hadar_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
16
|
+
s.files = [".all_images.yml".freeze, ".github/workflows/static.yml".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/gem_hadar".freeze, "gem_hadar.gemspec".freeze, "lib/gem_hadar.rb".freeze, "lib/gem_hadar/github.rb".freeze, "lib/gem_hadar/github_workflows/static.yml.erb".freeze, "lib/gem_hadar/prompt_template.rb".freeze, "lib/gem_hadar/setup.rb".freeze, "lib/gem_hadar/simplecov.rb".freeze, "lib/gem_hadar/template_compiler.rb".freeze, "lib/gem_hadar/utils.rb".freeze, "lib/gem_hadar/version.rb".freeze, "lib/gem_hadar/warn.rb".freeze, "spec/gem_hadar_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
17
17
|
s.homepage = "https://github.com/flori/gem_hadar".freeze
|
18
18
|
s.licenses = ["MIT".freeze]
|
19
19
|
s.rdoc_options = ["--title".freeze, "GemHadar - Library for the development of Ruby Gems".freeze, "--main".freeze, "README.md".freeze]
|
@@ -23,12 +23,22 @@ Gem::Specification.new do |s|
|
|
23
23
|
|
24
24
|
s.specification_version = 4
|
25
25
|
|
26
|
-
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.
|
26
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.7".freeze])
|
27
|
+
s.add_development_dependency(%q<all_images>.freeze, [">= 0".freeze])
|
27
28
|
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.13".freeze])
|
28
|
-
s.
|
29
|
+
s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
|
30
|
+
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.0".freeze])
|
29
31
|
s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.0".freeze])
|
30
32
|
s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.7".freeze])
|
31
33
|
s.add_runtime_dependency(%q<mize>.freeze, [">= 0".freeze])
|
32
34
|
s.add_runtime_dependency(%q<rake>.freeze, [">= 0".freeze])
|
33
35
|
s.add_runtime_dependency(%q<yard>.freeze, [">= 0".freeze])
|
36
|
+
s.add_runtime_dependency(%q<openssl>.freeze, [">= 3.3.1".freeze])
|
37
|
+
s.add_runtime_dependency(%q<net-http>.freeze, [">= 0".freeze])
|
38
|
+
s.add_runtime_dependency(%q<json>.freeze, ["~> 2.0".freeze])
|
39
|
+
s.add_runtime_dependency(%q<pathname>.freeze, [">= 0".freeze])
|
40
|
+
s.add_runtime_dependency(%q<uri>.freeze, [">= 0".freeze])
|
41
|
+
s.add_runtime_dependency(%q<set>.freeze, [">= 0".freeze])
|
42
|
+
s.add_runtime_dependency(%q<fileutils>.freeze, [">= 0".freeze])
|
43
|
+
s.add_runtime_dependency(%q<erb>.freeze, [">= 0".freeze])
|
34
44
|
end
|
data/lib/gem_hadar/github.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
+
# A module that provides GitHub API integration functionality for GemHadar.
|
5
|
+
#
|
6
|
+
# This module contains the ReleaseCreator class which handles the creation of
|
7
|
+
# GitHub releases through the GitHub Releases API. It manages authentication,
|
8
|
+
# request construction, and response processing for release operations.
|
9
|
+
#
|
10
|
+
# @see GemHadar::GitHub::ReleaseCreator
|
4
11
|
module GemHadar::GitHub
|
5
12
|
end
|
6
13
|
|
@@ -30,6 +37,17 @@ class GemHadar::GitHub::ReleaseCreator
|
|
30
37
|
end
|
31
38
|
self.github_api_url = 'https://api.github.com'
|
32
39
|
|
40
|
+
# The initialize method sets up the ReleaseCreator instance with required
|
41
|
+
# GitHub API configuration.
|
42
|
+
#
|
43
|
+
# This method stores the owner, repository, and authentication token needed
|
44
|
+
# to interact with the GitHub Releases API. It also accepts an optional API
|
45
|
+
# version parameter to specify which version of the GitHub API to use.
|
46
|
+
#
|
47
|
+
# @param owner [ String ] the GitHub username or organization name
|
48
|
+
# @param repo [ String ] the repository name
|
49
|
+
# @param token [ String ] the personal access token for authentication
|
50
|
+
# @param api_version [ String ] the GitHub API version to use (defaults to '2022-11-28')
|
33
51
|
def initialize(owner:, repo:, token:, api_version: '2022-11-28')
|
34
52
|
@owner = owner
|
35
53
|
@repo = repo
|
@@ -37,6 +55,25 @@ class GemHadar::GitHub::ReleaseCreator
|
|
37
55
|
@api_version = api_version
|
38
56
|
end
|
39
57
|
|
58
|
+
# The perform method creates a new GitHub release using the GitHub API.
|
59
|
+
#
|
60
|
+
# This method sends a POST request to the GitHub Releases API to create a new
|
61
|
+
# release for the specified repository. It constructs the appropriate HTTP
|
62
|
+
# headers including authentication and content type, prepares the release
|
63
|
+
# data with the provided parameters, and handles the API response by parsing
|
64
|
+
# successful responses or raising an error for failed requests.
|
65
|
+
#
|
66
|
+
# @param tag_name [ String ] the name of the tag to associate with the release
|
67
|
+
# @param target_commitish [ String ] the commit SHA or branch name to use for the release
|
68
|
+
# @param body [ String ] the release notes or description content
|
69
|
+
# @param name [ String ] the name of the release (defaults to tag_name)
|
70
|
+
# @param draft [ Boolean ] whether to create a draft release (defaults to false)
|
71
|
+
# @param prerelease [ Boolean ] whether to mark the release as a pre-release (defaults to false)
|
72
|
+
#
|
73
|
+
# @return [ JSON::GenericObject ] the parsed response data from the GitHub API containing
|
74
|
+
# details about the created release
|
75
|
+
#
|
76
|
+
# @raise [ RuntimeError ] if the GitHub API request fails with a non-success status code
|
40
77
|
def perform(tag_name:, target_commitish:, body:, name: tag_name, draft: false, prerelease: false)
|
41
78
|
uri = URI("#{self.class.github_api_url}/repos/#@owner/#@repo/releases")
|
42
79
|
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# Simple workflow for deploying static content to GitHub Pages
|
2
|
+
name: Deploy static content to Pages
|
3
|
+
|
4
|
+
on:
|
5
|
+
# Runs on pushes targeting the default branch
|
6
|
+
push:
|
7
|
+
branches: <%= github_workflows_variables.fetch(:branches, '[ "master" ]') %>
|
8
|
+
|
9
|
+
# Allows you to run this workflow manually from the Actions tab
|
10
|
+
workflow_dispatch:
|
11
|
+
|
12
|
+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
13
|
+
permissions:
|
14
|
+
contents: read
|
15
|
+
pages: write
|
16
|
+
id-token: write
|
17
|
+
|
18
|
+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
19
|
+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
20
|
+
concurrency:
|
21
|
+
group: "pages"
|
22
|
+
cancel-in-progress: false
|
23
|
+
|
24
|
+
jobs:
|
25
|
+
# Single deploy job since we're just deploying
|
26
|
+
deploy:
|
27
|
+
environment:
|
28
|
+
name: github-pages
|
29
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
30
|
+
runs-on: ubuntu-latest
|
31
|
+
steps:
|
32
|
+
- name: Checkout
|
33
|
+
uses: actions/checkout@v4
|
34
|
+
- name: Setup Pages
|
35
|
+
uses: actions/configure-pages@v5
|
36
|
+
- name: Setup Ruby
|
37
|
+
uses: ruby/setup-ruby@v1
|
38
|
+
with:
|
39
|
+
ruby-version: '3.4'
|
40
|
+
- name: Generate Documentation
|
41
|
+
run: |
|
42
|
+
gem install gem_hadar
|
43
|
+
bundle install
|
44
|
+
rake doc
|
45
|
+
- name: Upload artifact
|
46
|
+
uses: actions/upload-pages-artifact@v3
|
47
|
+
with:
|
48
|
+
path: 'doc'
|
49
|
+
- name: Deploy to GitHub Pages
|
50
|
+
id: deployment
|
51
|
+
uses: actions/deploy-pages@v4
|
@@ -41,7 +41,7 @@ class GemHadar::TemplateCompiler
|
|
41
41
|
def compile(src, dst)
|
42
42
|
template = File.read(src)
|
43
43
|
File.open(dst, 'w') do |output|
|
44
|
-
erb = ERB.new(template,
|
44
|
+
erb = ERB.new(template, trim_mode: ?-)
|
45
45
|
erb.filename = src.to_s
|
46
46
|
output.write erb.result binding
|
47
47
|
end
|
data/lib/gem_hadar/version.rb
CHANGED
data/lib/gem_hadar.rb
CHANGED
@@ -9,10 +9,8 @@ require 'rake'
|
|
9
9
|
require 'net/http'
|
10
10
|
require 'uri'
|
11
11
|
require 'tins/xt'
|
12
|
-
require 'tins/secure_write'
|
13
12
|
require 'rake/clean'
|
14
13
|
require 'rake/testtask'
|
15
|
-
require 'dslkit/polite'
|
16
14
|
require 'set'
|
17
15
|
require 'pathname'
|
18
16
|
require 'ollama'
|
@@ -1223,10 +1221,10 @@ class GemHadar
|
|
1223
1221
|
# namespace:
|
1224
1222
|
#
|
1225
1223
|
# - It creates subtasks in the :version:push namespace for each configured
|
1226
|
-
#
|
1224
|
+
# Git remote, allowing individual pushes to specific remotes.
|
1227
1225
|
# - It also defines a top-level :version:push task that depends on all the
|
1228
|
-
#
|
1229
|
-
# tag to all remotes.
|
1226
|
+
# individual remote push tasks, enabling a single command to push the
|
1227
|
+
# version tag to all remotes.
|
1230
1228
|
#
|
1231
1229
|
# The tasks utilize the git_remotes method to determine which remotes are
|
1232
1230
|
# configured and generate appropriate push commands for each one.
|
@@ -1249,7 +1247,8 @@ class GemHadar
|
|
1249
1247
|
# The master_push_task method defines Rake tasks for pushing the master
|
1250
1248
|
# branch to configured Git remotes.
|
1251
1249
|
#
|
1252
|
-
# This method sets up a hierarchical task structure under the :master
|
1250
|
+
# This method sets up a hierarchical task structure under the :master
|
1251
|
+
# namespace:
|
1253
1252
|
#
|
1254
1253
|
# - It creates subtasks in the :master:push namespace for each configured Git
|
1255
1254
|
# remote, allowing individual pushes to specific remotes.
|
@@ -1468,7 +1467,8 @@ class GemHadar
|
|
1468
1467
|
# The rvm_task method creates a .rvmrc file that configures RVM to use the
|
1469
1468
|
# specified Ruby version and gemset for the project.
|
1470
1469
|
#
|
1471
|
-
# This task generates a .rvmrc file in the project root directory with
|
1470
|
+
# This task generates a .rvmrc file in the project root directory with
|
1471
|
+
# commands to:
|
1472
1472
|
# - Use the Ruby version specified by the rvm.use accessor
|
1473
1473
|
# - Create the gemset specified by the rvm.gemset accessor
|
1474
1474
|
# - Switch to using that gemset
|
@@ -1672,6 +1672,7 @@ class GemHadar
|
|
1672
1672
|
version_tag_task
|
1673
1673
|
push_task
|
1674
1674
|
release_task
|
1675
|
+
github_workflows_task
|
1675
1676
|
write_ignore_file
|
1676
1677
|
write_gemfile
|
1677
1678
|
if extensions.full?
|
@@ -2020,6 +2021,71 @@ class GemHadar
|
|
2020
2021
|
remotes_uris.find { |uri| uri.hostname == 'github.com' }
|
2021
2022
|
end
|
2022
2023
|
end
|
2024
|
+
|
2025
|
+
# The github_workflows attribute accessor for configuring GitHub Actions
|
2026
|
+
# workflows.
|
2027
|
+
#
|
2028
|
+
# This method sets up a DSL accessor for the github_workflows attribute,
|
2029
|
+
# which specifies the configuration for generating GitHub Actions workflow
|
2030
|
+
# files from ERB templates. It provides a way to define which workflows to
|
2031
|
+
# generate and the variables to use when rendering the templates.
|
2032
|
+
#
|
2033
|
+
# @return [ Hash ] a hash mapping workflow names to their configuration
|
2034
|
+
# variables
|
2035
|
+
dsl_accessor :github_workflows do
|
2036
|
+
{}
|
2037
|
+
end
|
2038
|
+
|
2039
|
+
# The github_workflows_variables method retrieves the cached variables used
|
2040
|
+
# for GitHub Actions workflow template compilation.
|
2041
|
+
#
|
2042
|
+
# This method returns the stored hash of variables that were previously set
|
2043
|
+
# during the configuration of GitHub workflows. If no variables have been
|
2044
|
+
# set, it returns an empty hash as a default value.
|
2045
|
+
#
|
2046
|
+
# @return [ Hash ] the hash of variables used for GitHub workflow template
|
2047
|
+
# rendering or an empty hash if none are set
|
2048
|
+
def github_workflows_variables
|
2049
|
+
@github_workflows_variables || {}
|
2050
|
+
end
|
2051
|
+
|
2052
|
+
# The github_workflows_task method sets up Rake tasks for generating GitHub
|
2053
|
+
# Actions workflow files from ERB templates.
|
2054
|
+
#
|
2055
|
+
# This method configures a hierarchical task structure under the :github namespace that:
|
2056
|
+
# - Compiles configured workflow templates from ERB files into actual workflow YAML files
|
2057
|
+
# - Creates a :workflows task that depends on all compiled template files
|
2058
|
+
# - Sets up a :workflows:clean task to remove generated workflow files
|
2059
|
+
# - Uses the github_workflows configuration to determine which workflows to generate
|
2060
|
+
# - Applies template variables to customize the generated workflows
|
2061
|
+
def github_workflows_task
|
2062
|
+
namespace :github do
|
2063
|
+
templates = []
|
2064
|
+
src_dir = Pathname.new(__dir__).join('gem_hadar', 'github_workflows')
|
2065
|
+
dst_dir = Pathname.pwd.join('.github', 'workflows')
|
2066
|
+
github_workflows.each do |workflow, variables|
|
2067
|
+
@github_workflows_variables = variables
|
2068
|
+
src = src_dir.join(workflow + '.erb')
|
2069
|
+
puts "Compiling #{src.to_s.inspect} to #{dst_dir.to_s.inspect} now."
|
2070
|
+
unless src.exist?
|
2071
|
+
warn "Workflow template #{src.to_s.inspect} doesn't exist! => Skipping."
|
2072
|
+
end
|
2073
|
+
mkdir_p dst_dir
|
2074
|
+
dst = dst_dir.join(workflow)
|
2075
|
+
templates << (template(src, dst) {}).to_s
|
2076
|
+
end
|
2077
|
+
desc "Create all configured github workflow tasks"
|
2078
|
+
task :workflows => templates
|
2079
|
+
namespace :workflows do
|
2080
|
+
desc "Delete all created github workflows"
|
2081
|
+
task :clean do
|
2082
|
+
github_workflows.each_key do |workflow|
|
2083
|
+
rm_f dst_dir.join(workflow), verbose: true
|
2084
|
+
end
|
2085
|
+
end
|
2086
|
+
end
|
2087
|
+
end
|
2088
|
+
end
|
2023
2089
|
end
|
2024
2090
|
|
2025
2091
|
# The GemHadar method serves as the primary entry point for configuring and
|
@@ -2044,14 +2110,18 @@ end
|
|
2044
2110
|
# using the provided block configuration. It ensures the source file has an
|
2045
2111
|
# extension and raises an error if not.
|
2046
2112
|
#
|
2047
|
-
# @param
|
2113
|
+
# @param src [ String ] the path to the template file to be processed
|
2114
|
+
# @param dst [ String ] the path to file that will be the product
|
2048
2115
|
#
|
2049
2116
|
# @yield [ block ] the configuration block for the template compiler
|
2050
2117
|
#
|
2051
2118
|
# @return [ Pathname ] the Pathname object representing the destination file path
|
2052
|
-
def template(
|
2053
|
-
template_src = Pathname.new(
|
2054
|
-
template_dst =
|
2119
|
+
def template(src, dst = nil, &block)
|
2120
|
+
template_src = Pathname.new(src)
|
2121
|
+
template_dst = dst ? Pathname.new(dst) : template_src
|
2122
|
+
if template_dst.extname == '.erb'
|
2123
|
+
template_dst = template_dst.sub_ext('erb')
|
2124
|
+
end
|
2055
2125
|
template_src == template_dst and raise ArgumentError,
|
2056
2126
|
"pathname #{pathname.inspect} needs to have a file extension"
|
2057
2127
|
file template_dst.to_s => template_src.to_s do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem_hadar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
@@ -15,14 +15,28 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: '2.
|
18
|
+
version: '2.7'
|
19
19
|
type: :development
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: '2.
|
25
|
+
version: '2.7'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: all_images
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
26
40
|
- !ruby/object:Gem::Dependency
|
27
41
|
name: rspec
|
28
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -37,20 +51,34 @@ dependencies:
|
|
37
51
|
- - "~>"
|
38
52
|
- !ruby/object:Gem::Version
|
39
53
|
version: '3.13'
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: simplecov
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
type: :development
|
62
|
+
prerelease: false
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
40
68
|
- !ruby/object:Gem::Dependency
|
41
69
|
name: tins
|
42
70
|
requirement: !ruby/object:Gem::Requirement
|
43
71
|
requirements:
|
44
72
|
- - "~>"
|
45
73
|
- !ruby/object:Gem::Version
|
46
|
-
version: '1'
|
74
|
+
version: '1.0'
|
47
75
|
type: :runtime
|
48
76
|
prerelease: false
|
49
77
|
version_requirements: !ruby/object:Gem::Requirement
|
50
78
|
requirements:
|
51
79
|
- - "~>"
|
52
80
|
- !ruby/object:Gem::Version
|
53
|
-
version: '1'
|
81
|
+
version: '1.0'
|
54
82
|
- !ruby/object:Gem::Dependency
|
55
83
|
name: term-ansicolor
|
56
84
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,6 +149,118 @@ dependencies:
|
|
121
149
|
- - ">="
|
122
150
|
- !ruby/object:Gem::Version
|
123
151
|
version: '0'
|
152
|
+
- !ruby/object:Gem::Dependency
|
153
|
+
name: openssl
|
154
|
+
requirement: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: 3.3.1
|
159
|
+
type: :runtime
|
160
|
+
prerelease: false
|
161
|
+
version_requirements: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: 3.3.1
|
166
|
+
- !ruby/object:Gem::Dependency
|
167
|
+
name: net-http
|
168
|
+
requirement: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
type: :runtime
|
174
|
+
prerelease: false
|
175
|
+
version_requirements: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
180
|
+
- !ruby/object:Gem::Dependency
|
181
|
+
name: json
|
182
|
+
requirement: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - "~>"
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '2.0'
|
187
|
+
type: :runtime
|
188
|
+
prerelease: false
|
189
|
+
version_requirements: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - "~>"
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: '2.0'
|
194
|
+
- !ruby/object:Gem::Dependency
|
195
|
+
name: pathname
|
196
|
+
requirement: !ruby/object:Gem::Requirement
|
197
|
+
requirements:
|
198
|
+
- - ">="
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: '0'
|
201
|
+
type: :runtime
|
202
|
+
prerelease: false
|
203
|
+
version_requirements: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - ">="
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '0'
|
208
|
+
- !ruby/object:Gem::Dependency
|
209
|
+
name: uri
|
210
|
+
requirement: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
215
|
+
type: :runtime
|
216
|
+
prerelease: false
|
217
|
+
version_requirements: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - ">="
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
222
|
+
- !ruby/object:Gem::Dependency
|
223
|
+
name: set
|
224
|
+
requirement: !ruby/object:Gem::Requirement
|
225
|
+
requirements:
|
226
|
+
- - ">="
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: '0'
|
229
|
+
type: :runtime
|
230
|
+
prerelease: false
|
231
|
+
version_requirements: !ruby/object:Gem::Requirement
|
232
|
+
requirements:
|
233
|
+
- - ">="
|
234
|
+
- !ruby/object:Gem::Version
|
235
|
+
version: '0'
|
236
|
+
- !ruby/object:Gem::Dependency
|
237
|
+
name: fileutils
|
238
|
+
requirement: !ruby/object:Gem::Requirement
|
239
|
+
requirements:
|
240
|
+
- - ">="
|
241
|
+
- !ruby/object:Gem::Version
|
242
|
+
version: '0'
|
243
|
+
type: :runtime
|
244
|
+
prerelease: false
|
245
|
+
version_requirements: !ruby/object:Gem::Requirement
|
246
|
+
requirements:
|
247
|
+
- - ">="
|
248
|
+
- !ruby/object:Gem::Version
|
249
|
+
version: '0'
|
250
|
+
- !ruby/object:Gem::Dependency
|
251
|
+
name: erb
|
252
|
+
requirement: !ruby/object:Gem::Requirement
|
253
|
+
requirements:
|
254
|
+
- - ">="
|
255
|
+
- !ruby/object:Gem::Version
|
256
|
+
version: '0'
|
257
|
+
type: :runtime
|
258
|
+
prerelease: false
|
259
|
+
version_requirements: !ruby/object:Gem::Requirement
|
260
|
+
requirements:
|
261
|
+
- - ">="
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
version: '0'
|
124
264
|
description: This library contains some useful functionality to support the development
|
125
265
|
of Ruby Gems
|
126
266
|
email: flori@ping.de
|
@@ -139,6 +279,8 @@ extra_rdoc_files:
|
|
139
279
|
- lib/gem_hadar/version.rb
|
140
280
|
- lib/gem_hadar/warn.rb
|
141
281
|
files:
|
282
|
+
- ".all_images.yml"
|
283
|
+
- ".github/workflows/static.yml"
|
142
284
|
- Gemfile
|
143
285
|
- LICENSE
|
144
286
|
- README.md
|
@@ -147,6 +289,7 @@ files:
|
|
147
289
|
- gem_hadar.gemspec
|
148
290
|
- lib/gem_hadar.rb
|
149
291
|
- lib/gem_hadar/github.rb
|
292
|
+
- lib/gem_hadar/github_workflows/static.yml.erb
|
150
293
|
- lib/gem_hadar/prompt_template.rb
|
151
294
|
- lib/gem_hadar/setup.rb
|
152
295
|
- lib/gem_hadar/simplecov.rb
|