class GemHadar::Setup
setup.perform
setup = GemHadar::Setup.new
@example Setting up a new gem project
providing a solid foundation for gem development.
components like the lib directory, VERSION file, and Rakefile are in place,
configuration files needed for a Ruby gem project. It ensures that essential
This class is responsible for creating the basic directory layout and
structure.
A class that handles the initialization and setup of a new gem project
def perform
and creating a default Rakefile with basic GemHadar configuration if one
directory, initializing a VERSION file with '0.0.0' if it doesn't exist,
The perform method sets up the basic project structure by creating the lib
def perform mkdir_p 'lib' unless File.exist?('VERSION') File.open('VERSION', 'w') do |output| output.puts '0.0.0' end end unless File.exist?('Rakefile') File.open('Rakefile', 'w') do |output| output.puts <<~EOT # vim: set filetype=ruby et sw=2 ts=2: require 'gem_hadar' GemHadar do #developing true #name 'TODO' module_type :class #author 'TODO' #email 'todo@example.com' #homepage "https://github.com/TODO/NAME" #summary 'TODO' description 'TODO' test_dir 'spec' ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.AppleDouble', '.bundle', '.yardoc', 'tags' readme 'README.md' #executables << 'bin/TODO' #dependency 'TODO', '~>1.2.3' #licenses << 'TODO end EOT end end end