gemfather-cli 0.1.1 → 0.2.1

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: c80850beac849658b418983fb4fa7b7b6310dcefcdd95e3b365a68402b42bda2
4
- data.tar.gz: dccb5039ec85d1341983f96aa55825eed1b52815e76ef12383662cc2dfdbfcc0
3
+ metadata.gz: e7b2b4aadbd5726b8d37c4df6cd742880e5b08404d90c1385e72d222973931f2
4
+ data.tar.gz: f644b28ff1a33803d60a3965e8a22ba1289bb207114ca1a87f07492311c8929d
5
5
  SHA512:
6
- metadata.gz: 5ed22014acd490e9fc6d48be0e5edfafee9a749ef34c102f2d86e0275e2ad89dfce92770dc845acb9646209157e5508c6ea15bf71ebd2cadc9a3d4adc85b6852
7
- data.tar.gz: ba2da66bb91df273f1e7422188d599b1d8f88feb4142f6552ddedfe09956bb71e7fc04219f7ee0a9067556681fb5bcb9e7c49acf0f2a6e0c90ea155568cfa855
6
+ metadata.gz: fb53a29de1668e1ccdea980dfc0b72fed61607d979c0140c6a75393c5af90a80052c4fc4a073335add0437419048272e91a08bb216bbb59c72e73fb0ef05bc60
7
+ data.tar.gz: 60c95d321f51c13b4cd591c2a78113df010064958cb7a8d2919d2a3f01a0c0bf149e7332ee20ac9a9cb6e4103031f449f16f6bd4c43dca66d2c402d970c653f1
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## [0.2.1](https://github.com/k0va1/gemfather-cli/compare/v0.2.0...v0.2.1) (2025-11-08)
4
+
5
+
6
+ ### Features
7
+
8
+ * new settings, release please and templates ([a3cd69e](https://github.com/k0va1/gemfather-cli/commit/a3cd69e92eac50d87a9890424b15a720d1e7b1a2))
9
+ * new settings, release please and templates ([5f0a6d1](https://github.com/k0va1/gemfather-cli/commit/5f0a6d1133c0cd5c0b2962ec7b7008f44e6261c5))
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 k0va1
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Gemfather CLI
2
+
3
+ ![Build status](https://github.com/k0va1/gemfather-cli/actions/workflows/main.yml/badge.svg)
4
+
5
+ `gemfather-cli` allows you to create new gems easily providing predifined templates
6
+
7
+ [![asciicast](https://asciinema.org/a/598640.svg)](https://asciinema.org/a/598640)
8
+
9
+ It includes:
10
+ * Makefile
11
+ * Linter config
12
+ * Test config
13
+
14
+ ## Supported Ruby versions
15
+
16
+ This gem supports Ruby version >= 2.6.0
17
+
18
+ ## Installation
19
+
20
+ `gem install gemfather-cli`
21
+
22
+ ## Usage
23
+
24
+ Just call `gemfather` in the terminal
25
+
26
+ ## Development
27
+
28
+ * run `make install` to install gem dependencies
29
+ * run `make start` to install gem dependencies
30
+ * run `make test` to run tests
31
+ * run `make lint-fix` to run autocorrect
32
+ * run `make install_gem` to intall gem locally
33
+ * run `make reinstall_gem` to reintall gem locally
34
+
35
+ ## Contributing
36
+
37
+ Bug reports and pull requests are welcome on GitHub at https://github.com/k0va1/gemfather-cli.
38
+
39
+ ## License
40
+
41
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/exe/gemfather CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
2
 
4
3
  require "bundler/setup"
5
4
  require "gemfather/cli"
@@ -0,0 +1,71 @@
1
+ require "tty-prompt"
2
+
3
+ module Gemfather
4
+ module Cli
5
+ class SettingsBuilder
6
+ DEFAULT_GEM_NAME = "awesome-new-gem"
7
+ DEFAULT_USER_EMAIL = "your-mail@example.com"
8
+ DEFAULT_USERNAME = `whoami`.chomp
9
+
10
+ attr_accessor :settings
11
+
12
+ def initialize
13
+ @settings = {}
14
+ end
15
+
16
+ def call
17
+ prompt = TTY::Prompt.new(interrupt: :exit)
18
+
19
+ user_email = `git config user.email`.chomp
20
+ settings[:email] = user_email.empty? ? DEFAULT_USER_EMAIL : user_email
21
+
22
+ username = `git config user.name`.chomp
23
+ settings[:username] = username.empty? ? DEFAULT_USERNAME : username
24
+
25
+ settings[:name] = prompt.ask("Gem name:", default: DEFAULT_GEM_NAME)
26
+ settings[:summary] = prompt.ask("Summary", default: DEFAULT_GEM_NAME)
27
+ settings[:description] = prompt.ask("Description", default: DEFAULT_GEM_NAME)
28
+ settings[:homepage] = prompt.ask("Home page(URL)", default: DEFAULT_GEM_NAME, value: "https://github.com/")
29
+
30
+ settings[:licence] = prompt.select("Select Licence") do |menu|
31
+ menu.choice "MIT", "mit"
32
+ menu.choice "N/A", "n/a"
33
+ end
34
+
35
+ settings[:linter] = prompt.select("Select linter") do |menu|
36
+ menu.choice "Standard", "standard"
37
+ menu.choice "Rubocop", "rubocop"
38
+ menu.choice "N/A", "n/a"
39
+ end
40
+
41
+ settings[:test] = prompt.select("Select test tool") do |menu|
42
+ menu.choice "RSpec", "rspec"
43
+ menu.choice "Minitest", "minitest"
44
+ menu.choice "N/A", "n/a"
45
+ end
46
+
47
+ settings[:ci] = prompt.select("Select CI") do |menu|
48
+ menu.choice "GitHub", "github"
49
+ menu.choice "Gitlab", "gitlab"
50
+ end
51
+
52
+ settings[:use_release_please] = prompt.yes?("Do you want to use release-please for releases?")
53
+
54
+ settings[:makefile?] = prompt.yes?("Do you need Makefile?")
55
+ settings[:coc?] = prompt.yes?("Do you need Code Of Conduct?")
56
+ settings[:changelog?] = prompt.yes?("Do you need CHANGELOG file?")
57
+
58
+ settings[:debugger] = prompt.select("Select debugger tool:") do |menu|
59
+ menu.choice "IRB", "irb"
60
+ menu.choice "Pry", "pry"
61
+ end
62
+
63
+ settings
64
+ end
65
+
66
+ def get_binding
67
+ binding
68
+ end
69
+ end
70
+ end
71
+ end
@@ -1,7 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Gemfather
4
2
  module Cli
5
- VERSION = "0.1.1"
3
+ VERSION = "0.2.1"
6
4
  end
7
5
  end
data/lib/gemfather/cli.rb CHANGED
@@ -1,22 +1,20 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "cli/settings_reader"
1
+ require_relative "cli/settings_builder"
4
2
  require "fileutils"
3
+ require "erb"
5
4
 
6
5
  module Gemfather
7
6
  module Cli
8
7
  class Error < StandardError; end
9
8
 
10
- # Entrypoint of the gem
11
9
  class Runner
12
- attr_accessor :settings
10
+ attr_accessor :settings_builder, :settings
13
11
 
14
- def initialize(settings_reader = ::Gemfather::Cli::SettingsReader.new)
15
- @settings_reader = settings_reader
12
+ def initialize(settings_builder: Gemfather::Cli::SettingsBuilder.new)
13
+ @settings_builder = settings_builder
14
+ @settings = @settings_builder.call
16
15
  end
17
16
 
18
17
  def call
19
- populate_settings
20
18
  init_gem
21
19
  update_gem_info
22
20
  copy_templates
@@ -24,29 +22,23 @@ module Gemfather
24
22
 
25
23
  private
26
24
 
27
- def populate_settings
28
- @settings = @settings_reader.call
29
- end
30
-
31
25
  def build_bundle_options
32
26
  linter_options = build_linter_options
33
27
  test_options = build_test_options
34
- coc_options = build_coc_options
35
28
  ci_options = build_ci_options
36
29
 
37
30
  [
38
31
  linter_options,
39
32
  test_options,
40
- coc_options,
41
33
  ci_options
42
34
  ].join(" ")
43
35
  end
44
36
 
45
37
  def build_linter_options
46
38
  case settings[:linter]
47
- when "Rubocop"
39
+ when "rubocop"
48
40
  "--linter=rubocop"
49
- when "Standard"
41
+ when "standard"
50
42
  "--linter=standard"
51
43
  else
52
44
  ""
@@ -55,25 +47,17 @@ module Gemfather
55
47
 
56
48
  def build_test_options
57
49
  case settings[:test]
58
- when "Minitest"
50
+ when "minitest"
59
51
  "--test=minitest"
60
- when "RSpec"
52
+ when "rspec"
61
53
  "--test=rspec"
62
- when "TestUnit"
63
- "--test=test-unit"
64
54
  else
65
55
  ""
66
56
  end
67
57
  end
68
58
 
69
- def build_coc_options
70
- settings[:coc] ? "--coc" : "--no-coc"
71
- end
72
-
73
59
  def build_ci_options
74
- cis = { "Github" => "github", "Gitlab" => "gitlab", "Travis" => "travis", "Circle" => "circle" }
75
- ci_name = cis[settings[:ci]]
76
- ci_name ? "--ci=#{ci_name}" : ""
60
+ settings[:ci] ? "--ci=#{settings[:ci]}" : ""
77
61
  end
78
62
 
79
63
  def init_gem
@@ -85,14 +69,11 @@ module Gemfather
85
69
  gemspec_path = File.join(Dir.pwd, settings[:name], "#{settings[:name]}.gemspec")
86
70
  updated_gemspec_lines = update_gemspec_lines(gemspec_path)
87
71
 
88
- File.open(gemspec_path, "w") do |f|
89
- f.write(updated_gemspec_lines.join)
90
- f.close
91
- end
72
+ File.write(gemspec_path, updated_gemspec_lines.join)
92
73
  end
93
74
 
94
- def update_gemspec_lines(gemspec_path) # rubocop:disable Metrics/MethodLength
95
- IO.readlines(gemspec_path).map do |line| # rubocop:disable Metrics/BlockLength
75
+ def update_gemspec_lines(gemspec_path)
76
+ IO.readlines(gemspec_path).map do |line|
96
77
  case line
97
78
  when /spec\.summary =.*/
98
79
  line.gsub(/=\s".*"/, "= \"#{settings[:summary]}\"")
@@ -100,6 +81,16 @@ module Gemfather
100
81
  line.gsub(/=\s".*"/, "= \"#{settings[:description]}\"")
101
82
  when /spec\.homepage =.*/
102
83
  line.gsub(/=\s".*"/, "= \"#{settings[:homepage]}\"")
84
+ when /spec\.metadata\["homepage_uri"\] =.*/
85
+ line.gsub(/=\s".*"/, "= spec.homepage")
86
+ when /spec\.metadata\["source_code_uri"\] =.*/
87
+ line.gsub(/=\s".*"/, "= spec.homepage")
88
+ when /spec\.metadata\["changelog_uri"\] =.*/
89
+ if settings[:changelog?]
90
+ line.gsub(/=\s".*"/, "= \"#{settings[:homepage]}/blob/master/CHANGELOG.md\"")
91
+ end
92
+ when /spec\.metadata\["allowed_push_host"\] =.*/
93
+ next
103
94
  else
104
95
  line
105
96
  end
@@ -107,11 +98,64 @@ module Gemfather
107
98
  end
108
99
 
109
100
  def copy_templates
110
- return unless settings[:makefile]
101
+ copy_makefile
102
+ copy_changelog
103
+ copy_coc
104
+ copy_release_please
105
+ copy_ci_files
106
+ end
107
+
108
+ def copy_makefile
109
+ return unless settings[:makefile?]
110
+
111
+ rendered_string = render_erb("Makefile.erb", settings_builder.get_binding)
112
+ File.write(File.join(new_gem_root, "Makefile"), rendered_string)
113
+ end
114
+
115
+ def copy_changelog
116
+ return unless settings[:changelog?]
117
+
118
+ FileUtils.cp(File.join(templates_root, "CHANGELOG.md"), new_gem_root)
119
+ end
120
+
121
+ def copy_coc
122
+ return unless settings[:coc?]
123
+
124
+ rendered_string = render_erb("CODE_OF_CONDUCT.md.erb", settings_builder.get_binding)
125
+ File.write(File.join(new_gem_root, "CODE_OF_CONDUCT.md"), rendered_string)
126
+ end
127
+
128
+ def copy_release_please
129
+ return unless settings[:use_release_please]
130
+
131
+ rendered_string = render_erb("release-please-config.json.erb", settings_builder.get_binding)
132
+ File.write(File.join(new_gem_root, "release-please-config.json"), rendered_string)
133
+ FileUtils.cp(File.join(templates_root, ".release-please-manifest.json"), new_gem_root)
134
+
135
+ if settings[:ci] == "github"
136
+ FileUtils.cp(File.join(templates_root, "ci/github/release.yml"), File.join(new_gem_root, ".github/workflows/release.yml"))
137
+ end
138
+ end
139
+
140
+ def copy_ci_files
141
+ if settings[:ci] == "github"
142
+ FileUtils.rm_rf(File.join(new_gem_root, ".github/workflows/main.yml"))
143
+ FileUtils.cp(File.join(templates_root, "ci/github/ci.yml"), File.join(new_gem_root, ".github/workflows/ci.yml"))
144
+ end
145
+ end
146
+
147
+ def new_gem_root
148
+ @new_gem_root ||= File.join(Dir.pwd, settings[:name])
149
+ end
150
+
151
+ def templates_root
152
+ @templates_root ||= File.join(File.dirname(__dir__), "../templates")
153
+ end
111
154
 
112
- puts File.join(File.dirname(__dir__))
113
- new_gem_root = File.join(Dir.pwd, settings[:name])
114
- FileUtils.cp(File.join(File.dirname(__dir__), "../templates/Makefile"), new_gem_root)
155
+ def render_erb(file, binding)
156
+ template_path = File.join(templates_root, file)
157
+ template = ERB.new(File.read(template_path))
158
+ template.result(binding)
115
159
  end
116
160
  end
117
161
  end
data/lib/gemfather_cli.rb CHANGED
@@ -1,3 +1 @@
1
- # frozen_string_literal: true
2
-
3
1
  require "gemfather/cli"
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.0"
3
+ }
@@ -0,0 +1 @@
1
+ # Changelog
@@ -0,0 +1,36 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+ We, the maintainers and contributors, pledge to make participation in this project a harassment-free experience for everyone. We are committed to creating a welcoming and inclusive community regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
5
+
6
+ ## Our Standards
7
+ ### Examples of behavior that contributes to a positive environment:
8
+ - Using welcoming and inclusive language
9
+ - Being respectful of differing viewpoints and experiences
10
+ - Accepting constructive criticism gracefully
11
+ - Focusing on what is best for the community
12
+ - Showing empathy toward other community members
13
+
14
+ ### Examples of unacceptable behavior:
15
+ - Harassment or discriminatory jokes and language
16
+ - Personal or political attacks
17
+ - Publishing others’ private information without permission
18
+ - Unwanted sexual attention or advances
19
+ - Any conduct that would be considered inappropriate in a professional setting
20
+
21
+ ## Our Responsibilities
22
+ Project maintainers are responsible for clarifying standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable conduct.
23
+
24
+ Maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, issues, and other contributions that do not align with this Code of Conduct.
25
+
26
+ ## Scope
27
+ This Code of Conduct applies within all project spaces and in public spaces when an individual is representing the project or its community.
28
+
29
+ ## Enforcement
30
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainers at **<%= settings[:email] %>**.
31
+ All complaints will be reviewed and investigated, and will result in a response that is deemed necessary and appropriate to the circumstances.
32
+
33
+ Maintainers are obligated to respect the privacy and safety of reporters.
34
+
35
+ ## Attribution
36
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
@@ -0,0 +1,25 @@
1
+ .PHONY: test lint-fix console install
2
+
3
+ install:
4
+ bundle install
5
+
6
+ console:
7
+ bin/console
8
+ <% if settings[:test] == "rspec" %>
9
+
10
+ test:
11
+ bundle exec rspec
12
+ <% elsif settings[:test] == "minitest" %>
13
+
14
+ test:
15
+ bundle exec rake test
16
+ <% end %>
17
+ <% if settings[:linter] == "rubocop" %>
18
+
19
+ lint-fix:
20
+ bundle exec rubocop -A
21
+ <% elsif settings[:linter] == "standard" %>
22
+
23
+ lint-fix:
24
+ bundle exec standardrb --fix
25
+ <% end %>
@@ -0,0 +1,19 @@
1
+ name: CI
2
+ on: [push]
3
+ jobs:
4
+ tests:
5
+ runs-on: ubuntu-latest
6
+ strategy:
7
+ matrix:
8
+ ruby-version: ['3.2', '3.3', '3.4']
9
+
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+
13
+ - name: Setup Ruby
14
+ uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: ${{ matrix.ruby-version }}
17
+
18
+ - name: Run tests & linters
19
+ run: bundle install && bundle exec rake
@@ -0,0 +1,37 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ permissions:
9
+ contents: write
10
+ id-token: write
11
+ pull-requests: write
12
+
13
+ jobs:
14
+ release:
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: Release Please
19
+ uses: googleapis/release-please-action@v4
20
+ id: release
21
+ with:
22
+ token: ${{ secrets.GH_TOKEN }}
23
+
24
+ - uses: actions/checkout@v4
25
+ if: ${{ steps.release.outputs.release_created }}
26
+ with:
27
+ fetch-tags: true
28
+
29
+ - name: Set up Ruby
30
+ uses: ruby/setup-ruby@v1
31
+ if: ${{ steps.release.outputs.release_created }}
32
+ with:
33
+ bundler-cache: true
34
+ ruby-version: 3.4
35
+
36
+ - uses: rubygems/release-gem@v1
37
+ if: ${{ steps.release.outputs.release_created }}
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) <%= Time.now.year %> <%= settings[:username] %>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,16 @@
1
+ {
2
+ "packages": {
3
+ ".": {
4
+ "package-name": "<%= settings[:name] %>",
5
+ "include-component-in-tag": false,
6
+ "changelog-path": "CHANGELOG.md",
7
+ "release-type": "ruby",
8
+ "bump-minor-pre-major": true,
9
+ "bump-patch-for-minor-pre-major": true,
10
+ "draft": false,
11
+ "prerelease": false,
12
+ "version-file": "lib/<%= settings[:name] %>/version.rb"
13
+ }
14
+ },
15
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
16
+ }
metadata CHANGED
@@ -1,15 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemfather-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - k0va1
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2022-11-16 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: zeitwerk
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '2.6'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '2.6'
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: tty-prompt
15
28
  requirement: !ruby/object:Gem::Requirement
@@ -24,6 +37,62 @@ dependencies:
24
37
  - - "~>"
25
38
  - !ruby/object:Gem::Version
26
39
  version: '0.23'
40
+ - !ruby/object:Gem::Dependency
41
+ name: bundler
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '2.0'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '2.0'
54
+ - !ruby/object:Gem::Dependency
55
+ name: rake
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '13.0'
61
+ type: :development
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '13.0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: rspec
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.0'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '3.0'
82
+ - !ruby/object:Gem::Dependency
83
+ name: standard
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - '='
87
+ - !ruby/object:Gem::Version
88
+ version: 1.51.0
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - '='
94
+ - !ruby/object:Gem::Version
95
+ version: 1.51.0
27
96
  description: Ask some questions & create a new gem template
28
97
  email:
29
98
  - al3xander.koval@gmail.com
@@ -32,20 +101,29 @@ executables:
32
101
  extensions: []
33
102
  extra_rdoc_files: []
34
103
  files:
104
+ - CHANGELOG.md
105
+ - LICENSE.txt
106
+ - README.md
35
107
  - exe/gemfather
36
108
  - lib/gemfather/cli.rb
37
- - lib/gemfather/cli/settings_reader.rb
109
+ - lib/gemfather/cli/settings_builder.rb
38
110
  - lib/gemfather/cli/version.rb
39
111
  - lib/gemfather_cli.rb
40
- - templates/Makefile
112
+ - templates/.release-please-manifest.json
113
+ - templates/CHANGELOG.md
114
+ - templates/CODE_OF_CONDUCT.md.erb
115
+ - templates/Makefile.erb
116
+ - templates/ci/github/ci.yml
117
+ - templates/ci/github/release.yml
118
+ - templates/licences/mit.txt.erb
119
+ - templates/release-please-config.json.erb
41
120
  homepage: https://gitlab.com/k0va1/gemfather-cli
42
121
  licenses:
43
122
  - MIT
44
123
  metadata:
45
124
  homepage_uri: https://gitlab.com/k0va1/gemfather-cli
46
125
  source_code_uri: https://gitlab.com/k0va1/gemfather-cli
47
- changelog_uri: https://gitlab.com/k0va1/gemfather-cli
48
- post_install_message:
126
+ changelog_uri: https://gitlab.com/k0va1/gemfather-cli/blob/main/CHANGELOG.md
49
127
  rdoc_options: []
50
128
  require_paths:
51
129
  - lib
@@ -53,15 +131,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
53
131
  requirements:
54
132
  - - ">="
55
133
  - !ruby/object:Gem::Version
56
- version: 2.6.0
134
+ version: 3.2.0
57
135
  required_rubygems_version: !ruby/object:Gem::Requirement
58
136
  requirements:
59
137
  - - ">="
60
138
  - !ruby/object:Gem::Version
61
139
  version: '0'
62
140
  requirements: []
63
- rubygems_version: 3.3.3
64
- signing_key:
141
+ rubygems_version: 3.6.9
65
142
  specification_version: 4
66
143
  summary: Gem for creating other gems
67
144
  test_files: []
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "tty-prompt"
4
-
5
- module Gemfather
6
- module Cli
7
- # Class responsible to collect user input and build settings hash
8
- class SettingsReader
9
- def call # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
10
- settings = {}
11
- prompt = TTY::Prompt.new
12
-
13
- settings[:name] = prompt.ask("Gem name:", default: "awesome-new-gem")
14
- settings[:summary] = prompt.ask("Summary", default: "awesome-new-gem")
15
- settings[:description] = prompt.ask("Description", default: "awesome-new-gem")
16
- settings[:homepage] = prompt.ask("Home page(URL)", default: "awesome-new-gem")
17
-
18
- settings[:linter] = prompt.select("Select linter") do |menu|
19
- menu.choice "Rubocop"
20
- menu.choice "Standard"
21
- menu.choice "N/A"
22
- end
23
-
24
- settings[:test] = prompt.select("Select test tool:") do |menu|
25
- menu.choice "RSpec"
26
- menu.choice "Minitest"
27
- menu.choice "TestUnit"
28
- menu.choice "N/A"
29
- end
30
-
31
- settings[:ci] = prompt.select("Select CI tool:") do |menu|
32
- menu.choice "GitHub"
33
- menu.choice "Gitlab"
34
- menu.choice "Travis"
35
- menu.choice "Circle"
36
- end
37
-
38
- settings[:makefile?] = prompt.yes?("Do you need Makefile?")
39
- settings[:coc] = prompt.yes?("Do you need Code Of Conduct?")
40
-
41
- settings[:debugger] = prompt.select("Select debugger tool:") do |menu|
42
- menu.choice "IRB"
43
- menu.choice "Pry"
44
- end
45
-
46
- settings
47
- end
48
- end
49
- end
50
- end
data/templates/Makefile DELETED
@@ -1,13 +0,0 @@
1
- .PHONY: test
2
-
3
- install:
4
- bundle install
5
-
6
- cons:
7
- bin/console
8
-
9
- test:
10
- bundle exec rspec
11
-
12
- lint:
13
- bundle exec rubocop