From 9218854d276025c176a0b854f3f7071001800b33 Mon Sep 17 00:00:00 2001 From: Mike Slinn Date: Sat, 8 Jul 2023 10:08:39 -0400 Subject: [PATCH] Renamed project from creategem to nugem --- .rubocop.yml | 2 +- .vscode/creategem.json.code-snippets | 2 +- Gemfile | 2 +- README.md | 60 ++++++++++++--------- Rakefile | 4 +- bin/console | 2 +- bin/demo | 4 +- exe/creategem | 9 ---- exe/nugem | 9 ++++ lib/{creategem.rb => nugem.rb} | 10 ++-- lib/{creategem => nugem}/cli.rb | 12 ++--- lib/{creategem => nugem}/cli/cli_gem.rb | 12 ++--- lib/{creategem => nugem}/cli/cli_jekyll.rb | 32 +++++------ lib/{creategem => nugem}/cli/cli_rails.rb | 6 +-- lib/{creategem => nugem}/cli/jekyll_demo.rb | 2 +- lib/{creategem => nugem}/git.rb | 8 +-- lib/{creategem => nugem}/repository.rb | 4 +- lib/{creategem => nugem}/version.rb | 2 +- lib/util.rb | 2 +- creategem.gemspec => nugem.gemspec | 12 ++--- spec/jekyll_tag_spec.rb | 4 +- spec/spec_helper.rb | 2 +- test/{creategem_test.rb => nugem_test.rb} | 4 +- test/repository_test.rb | 18 +++---- test/test_helper.rb | 2 +- 25 files changed, 118 insertions(+), 108 deletions(-) delete mode 100755 exe/creategem create mode 100755 exe/nugem rename lib/{creategem.rb => nugem.rb} (84%) rename lib/{creategem => nugem}/cli.rb (90%) rename lib/{creategem => nugem}/cli/cli_gem.rb (85%) rename lib/{creategem => nugem}/cli/cli_jekyll.rb (85%) rename lib/{creategem => nugem}/cli/cli_rails.rb (95%) rename lib/{creategem => nugem}/cli/jekyll_demo.rb (99%) rename lib/{creategem => nugem}/git.rb (93%) rename lib/{creategem => nugem}/repository.rb (92%) rename lib/{creategem => nugem}/version.rb (64%) rename creategem.gemspec => nugem.gemspec (64%) rename test/{creategem_test.rb => nugem_test.rb} (52%) diff --git a/.rubocop.yml b/.rubocop.yml index d6cbaa5..f4df132 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -42,7 +42,7 @@ Metrics/AbcSize: Metrics/BlockLength: Exclude: - - creategem.gemspec + - nugem.gemspec Max: 30 Metrics/ClassLength: diff --git a/.vscode/creategem.json.code-snippets b/.vscode/creategem.json.code-snippets index b654746..26017ba 100644 --- a/.vscode/creategem.json.code-snippets +++ b/.vscode/creategem.json.code-snippets @@ -1,5 +1,5 @@ { - // Place your creategem workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and + // Place your nugem workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: diff --git a/Gemfile b/Gemfile index 16680f5..5c65fd5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -# Runtime gem dependencies are specified in creategem.gemspec +# Runtime gem dependencies are specified in nugem.gemspec gemspec group :development do diff --git a/README.md b/README.md index abedad8..806982f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# `Creategem` [![Gem Version](https://badge.fury.io/rb/createtem.svg)](https://badge.fury.io/rb/creategem) +# `Nugem` [![Gem Version](https://badge.fury.io/rb/createtem.svg)](https://badge.fury.io/rb/nugem) -** WORK IN PROGRESS ** +**WORK IN PROGRESS** -`Creategem` creates a scaffold project for a new gem in a new git repository. +`Nugem` creates a scaffold project for a new gem in a new git repository. After you add your special code to the gem scaffold, the project is ready to be released to a public or private gem server. @@ -21,31 +21,34 @@ with the following features: ## Installation + ```shell -$ gem install creategem +$ gem install nugem ``` To update the program: + ```shell -$ gem update creategem +$ gem update nugem ``` ## Subcommands and Options -`Creategem` has 4 subcommands `plain`, `jekyll`, `help` and `rails`: +`Nugem` has 4 subcommands `plain`, `jekyll`, `help` and `rails`: ### `help` Subcommand + The following lists the available subcommands: ```shell -$ creategem help +$ nugem help ``` The following provides detailed help for the specified subcommand: ```shell -$ creategem help [SUBCOMMAND] +$ nugem help [SUBCOMMAND] ``` @@ -101,7 +104,7 @@ and your gem will be published. ### `plain` Subcommand ```shell -$ creategem plain NAME [COMMON_OPTIONS] [--test-framework=minitest|rspec] +$ nugem plain NAME [COMMON_OPTIONS] [--test-framework=minitest|rspec] ``` `NAME` is the name of the gem to be generated. @@ -110,14 +113,16 @@ The default test framework for the `plain` subcommand is `rspec`, but you can specify `minitest` instead like this: ```shell -$ creategem plain my_gem --test-framework=minitest +$ nugem plain my_gem --test-framework=minitest ``` + ### `jekyll` Subcommand + The `jekyll` subcommand extends the `plain` subcommand and creates a new Jekyll plugin with the given NAME: ```shell -$ creategem jekyll NAME [OPTIONS] +$ nugem jekyll NAME [OPTIONS] ``` `NAME` is the name of the Jekyll plugin gem to be generated. @@ -126,7 +131,7 @@ In addition to the common options, the `jekyll`-specific `OPTIONS` are: `--block`, `--blockn`, `--filter`, `--hooks`, `--tag`, and `--tagn`. -Each of these options causes `creategem` to prompt the user for additional input. +Each of these options causes `nugem` to prompt the user for additional input. The test framework for `jekyll` plugins is `rspec`. @@ -135,7 +140,7 @@ except the `--hooks` option. For example: ```shell -$ creategem jekyll test_tags --tag my_tag1 --tag my_tag2 +$ nugem jekyll test_tags --tag my_tag1 --tag my_tag2 ``` The above creates a Jekyll plugin called `test_tags`, @@ -152,15 +157,16 @@ my_tag2 usage: {% my_tag2 %} For more information, type ```shell -$ creategem help jekyll +$ nugem help jekyll ``` ### `rails` Subcommand + The `rails` subcommand extends the `plain` subcommand and creates a new Rails plugin with the given NAME: ```shell -$ creategem rails NAME [OPTIONS] +$ nugem rails NAME [OPTIONS] ``` `NAME` is the name of the Ruby on Rails plugin gem to be generated. @@ -170,20 +176,21 @@ In addition to the common options, `rails` `OPTIONS` are You can specify if the plugin should be an engine (`--engine`) or a mountable engine (`--mountable`). -Each of these options causes `creategem` to prompt the user for additional input. +Each of these options causes `nugem` to prompt the user for additional input. The test framework for `rails` gems is `minitest`. For more information, type ```shell -$ creategem help rails +$ nugem help rails ``` ## Did It Work? + The following shows all files that were committed to the newly created git repository, -after `creategem jekyll` finished making two tag blocks: +after `nugem jekyll` finished making two tag blocks: ```shell $ git ls-tree --name-only --full-tree -r HEAD @@ -237,7 +244,9 @@ test/test_helper.rb ## Visual Studio Code Support -### Creategem Project + +### Nugem Project + #### Plugins If you have not installed the [Snippets](https://marketplace.visualstudio.com/items?itemName=devonray.snippet) extension, @@ -246,9 +255,9 @@ You can also review the list of suggested extensions of with the Ctrl `Extensions: Show Recommended Extensions` command. #### Snippets -The predefined snippets for `creategem` are defined in -[`.vscode/creategem.json.code-snippets`](.vscode/creategem.json.code-snippets). -These snippets are focused on maintaining `creategem` itself. +The predefined snippets for `nugem` are defined in +[`.vscode/nugem.json.code-snippets`](.vscode/nugem.json.code-snippets). +These snippets are focused on maintaining `nugem` itself. #### File Associations `.vscode/settings.json` defines file associations for various flavors of Thor templates in the `"files.associations"` section. @@ -256,12 +265,13 @@ You can disable them by commenting some or all of those definitions. ### Generated Projects + #### Plugins -Similarly, for each gem project generated by `creategem`, Visual Studio Code will suggest +Similarly, for each gem project generated by `nugem`, Visual Studio Code will suggest the user install missing extensions the first time those projects are opened. #### Snippets -The predefined snippets for gem projects generated by `creategem` are defined in +The predefined snippets for gem projects generated by `nugem` are defined in their `.vscode/gem.json.code-snippets` file. These snippets are focused on writing Jekyll plugins. @@ -285,7 +295,7 @@ and push the `.gem` file to https://rubygems.org. ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/mslinn/creategem. +Bug reports and pull requests are welcome on GitHub at https://github.com/mslinn/nugem. ## See Also diff --git a/Rakefile b/Rakefile index 407d654..08d1efd 100644 --- a/Rakefile +++ b/Rakefile @@ -24,8 +24,8 @@ end task publish: [:build] do $VERBOSE = nil - load 'creategem/version.rb' - system "gem push pkg/creategem-#{Creategem::VERSION}.gem" + load 'nugem/version.rb' + system "gem push pkg/nugem-#{Nugem::VERSION}.gem" end desc 'Bump patch version, create git tag, build the gem and release to geminabox (default)' diff --git a/bin/console b/bin/console index 367fad4..a7ae700 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require 'bundler/setup' -require 'creategem' +require 'nugem' require 'irb' IRB.start diff --git a/bin/demo b/bin/demo index 0f0b9e9..bd28e5b 100755 --- a/bin/demo +++ b/bin/demo @@ -4,7 +4,7 @@ require 'fileutils' require 'open3' require 'thor' -module CreategemDemo +module NugemDemo def self.run(command, input) shell = Thor::Shell::Color.new shell.say command, :yellow @@ -63,7 +63,7 @@ module CreategemDemo #{@jekyll_parameter_types.join "\n"} no END_INFO - CreategemDemo.run "exe/creategem #{@gem_type} #{@gem_name} --#{@jekyll_type} #{@jekyll_name}", input + NugemDemo.run "exe/nugem #{@gem_type} #{@gem_name} --#{@jekyll_type} #{@jekyll_name}", input end end diff --git a/exe/creategem b/exe/creategem deleted file mode 100755 index d608588..0000000 --- a/exe/creategem +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env ruby - -if File.exist? 'lib/creategem/cli.rb' - require_relative '../lib/creategem/cli' -else - require 'creategem/cli' -end - -Creategem::Cli.start diff --git a/exe/nugem b/exe/nugem new file mode 100755 index 0000000..edf5ca6 --- /dev/null +++ b/exe/nugem @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby + +if File.exist? 'lib/nugem/cli.rb' + require_relative '../lib/nugem/cli' +else + require 'nugem/cli' +end + +Nugem::Cli.start diff --git a/lib/creategem.rb b/lib/nugem.rb similarity index 84% rename from lib/creategem.rb rename to lib/nugem.rb index 2c0dc1e..7cdc287 100644 --- a/lib/creategem.rb +++ b/lib/nugem.rb @@ -1,10 +1,10 @@ require 'thor' -require_relative 'creategem/git' -require_relative 'creategem/repository' -require_relative 'creategem/version' +require_relative 'nugem/git' +require_relative 'nugem/repository' +require_relative 'nugem/version' require_relative 'util' -module Creategem +module Nugem # @return Path to the generated gem def self.dest_root(gem_name) File.expand_path "generated/#{gem_name}" @@ -13,7 +13,7 @@ def self.dest_root(gem_name) class Cli < Thor include Thor::Actions - package_name 'Creategem' + package_name 'Nugem' # These declarations make the class instance variable values available as an accessor, # which is necessary to name template files that are named '%variable_name%.extension'. diff --git a/lib/creategem/cli.rb b/lib/nugem/cli.rb similarity index 90% rename from lib/creategem/cli.rb rename to lib/nugem/cli.rb index ad2b73f..61330c4 100644 --- a/lib/creategem/cli.rb +++ b/lib/nugem/cli.rb @@ -1,14 +1,14 @@ require 'fileutils' require 'rugged' -require_relative '../creategem' +require_relative '../nugem' -# Creategem::Cli is a Thor class that is invoked when a user runs a creategem executable. +# Nugem::Cli is a Thor class that is invoked when a user runs a nugem executable. # This file defines the common aspects of the Thor class. # The cli/ directory contains class extensions specific to each Thor subcommand. -module Creategem +module Nugem class Cli < Thor include Thor::Actions - include Creategem::Git + include Nugem::Git class_option :executable, type: :boolean, default: false, desc: 'Include an executable for the gem.' @@ -50,13 +50,13 @@ def self.todo private def count_todos(filename) - filename_fq = "#{Creategem.dest_root gem_name}/#{filename}" + filename_fq = "#{Nugem.dest_root gem_name}/#{filename}" content = File.read filename_fq content.scan('TODO').length end def initialize_repository(gem_name) - Dir.chdir Creategem.dest_root(gem_name) do + Dir.chdir Nugem.dest_root(gem_name) do # say "Working in #{Dir.pwd}", :green run 'chmod +x bin/*' run 'chmod +x exe/*' if @executable diff --git a/lib/creategem/cli/cli_gem.rb b/lib/nugem/cli/cli_gem.rb similarity index 85% rename from lib/creategem/cli/cli_gem.rb rename to lib/nugem/cli/cli_gem.rb index 29841b6..b54405b 100644 --- a/lib/creategem/cli/cli_gem.rb +++ b/lib/nugem/cli/cli_gem.rb @@ -1,12 +1,12 @@ require 'thor' -# Creategem::Cli is a Thor class that is invoked when a user runs a creategem executable +# Nugem::Cli is a Thor class that is invoked when a user runs a nugem executable require_relative '../cli' -module Creategem +module Nugem class Cli < Thor include Thor::Actions - include Creategem::Git + include Nugem::Git desc 'plain NAME', 'Creates a new plain gem scaffold.' @@ -22,7 +22,7 @@ class Cli < Thor desc: 'Publish the gem in a private repository.' def plain(gem_name) - @dir = Creategem.dest_root gem_name + @dir = Nugem.dest_root gem_name @host = options['host'] @private = options['private'] @@ -38,11 +38,11 @@ def plain(gem_name) def create_plain_scaffold(gem_name) @gem_name = gem_name say "Creating a scaffold for a new plain Ruby gem named #{@gem_name} in #{@dir}.", :green - @class_name = Creategem.camel_case @gem_name + @class_name = Nugem.camel_case @gem_name @executable = options[:executable] @host = options[:bitbucket] ? :bitbucket : :github @private = options[:private] - @repository = Creategem::Repository.new( + @repository = Nugem::Repository.new( host: @host, user: git_repository_user_name(@host), name: @gem_name, diff --git a/lib/creategem/cli/cli_jekyll.rb b/lib/nugem/cli/cli_jekyll.rb similarity index 85% rename from lib/creategem/cli/cli_jekyll.rb rename to lib/nugem/cli/cli_jekyll.rb index a865f6b..9da9230 100644 --- a/lib/creategem/cli/cli_jekyll.rb +++ b/lib/nugem/cli/cli_jekyll.rb @@ -1,10 +1,10 @@ require_relative '../cli' require_relative 'jekyll_demo' -module Creategem +module Nugem class Cli < Thor # rubocop:disable Metrics/ClassLength include Thor::Actions - include Creategem::Git + include Nugem::Git attr_accessor :class_name, :filter_params, :trailing_args, :trailing_dump, :trailing_params @@ -40,8 +40,8 @@ class Cli < Thor # rubocop:disable Metrics/ClassLength def jekyll(gem_name) @gem_name = gem_name - @dir = Creategem.dest_root @gem_name - @class_name = Creategem.camel_case @gem_name + @dir = Nugem.dest_root @gem_name + @class_name = Nugem.camel_case @gem_name @jekyll = true @rspec = true @@ -110,28 +110,28 @@ def create_jekyll_scaffold def create_jekyll_block_scaffold(block_name) @block_name = block_name - @jekyll_class_name = Creategem.camel_case block_name + @jekyll_class_name = Nugem.camel_case block_name ask_option_names_types block_name # Defines @jekyll_parameter_names_types, which is a nested array of name/value pairs: # [["opt1", "string"], ["opt2", "boolean"]] say "Creating Jekyll block tag #{@block_name} scaffold within #{@jekyll_class_name}", :green @mute = true directory 'jekyll/block_scaffold', @dir, force: true, mode: :preserve - append_to_file "#{Creategem.dest_root gem_name}/demo/index.html", Cli.add_demo_example(block_name, @jekyll_parameter_names_types, :block) + append_to_file "#{Nugem.dest_root gem_name}/demo/index.html", Cli.add_demo_example(block_name, @jekyll_parameter_names_types, :block) end def create_jekyll_block_no_arg_scaffold(block_name) @block_name = block_name - @jekyll_class_name = Creategem.camel_case block_name + @jekyll_class_name = Nugem.camel_case block_name say "Creating Jekyll block tag no_arg #{@block_name} scaffold within #{@jekyll_class_name}", :green @mute = true directory 'jekyll/block_no_arg_scaffold', @dir, force: true, mode: :preserve - append_to_file "#{Creategem.dest_root gem_name}/demo/index.html", Cli.add_demo_example(block_name, @jekyll_parameter_names_types, :block) + append_to_file "#{Nugem.dest_root gem_name}/demo/index.html", Cli.add_demo_example(block_name, @jekyll_parameter_names_types, :block) end def create_jekyll_filter_scaffold(filter_name) # rubocop:disable Style/StringConcatenation @filter_name = filter_name - @jekyll_class_name = Creategem.camel_case filter_name + @jekyll_class_name = Nugem.camel_case filter_name @filter_params = ask('Jekyll filters have at least one input. ' \ "What are the names of additional inputs for #{filter_name}, if any?") .split(/[ ,\t]/) @@ -148,13 +148,13 @@ def create_jekyll_filter_scaffold(filter_name) directory 'jekyll/filter_scaffold', @dir, force: true, mode: :preserve tp = ': ' + @filter_params.map { |x| "'#{x}_value'" }.join(', ') unless @filter_params.empty? - append_to_file "#{Creategem.dest_root gem_name}/demo/index.html", Cli.add_filter_example(filter_name, tp) + append_to_file "#{Nugem.dest_root gem_name}/demo/index.html", Cli.add_filter_example(filter_name, tp) # rubocop:enable Style/StringConcatenation end def create_jekyll_generator_scaffold(generator_name) @generator_name = generator_name - @jekyll_class_name = Creategem.camel_case generator_name + @jekyll_class_name = Nugem.camel_case generator_name say "Creating a new Jekyll generator class scaffold #{@jekyll_class_name}", :green @mute = true directory 'jekyll/generator_scaffold', @dir, force: true, mode: :preserve @@ -162,7 +162,7 @@ def create_jekyll_generator_scaffold(generator_name) def create_jekyll_hooks_scaffold(plugin_name) @plugin_name = plugin_name - @jekyll_class_name = Creategem.camel_case plugin_name + @jekyll_class_name = Nugem.camel_case plugin_name say 'Creating a new Jekyll hook scaffold', :green @mute = true directory 'jekyll/hooks_scaffold', @dir, force: true, mode: :preserve @@ -170,23 +170,23 @@ def create_jekyll_hooks_scaffold(plugin_name) def create_jekyll_tag_no_arg_scaffold(tag_name) @tag_name = tag_name - @jekyll_class_name = Creategem.camel_case @tag_name + @jekyll_class_name = Nugem.camel_case @tag_name say "Creating Jekyll tag no_arg #{@tag_name} scaffold within #{@jekyll_class_name}", :green @mute = true directory 'jekyll/tag_no_arg_scaffold', @dir, force: true, mode: :preserve - append_to_file "#{Creategem.dest_root gem_name}/demo/index.html", Cli.add_demo_example(tag_name, @jekyll_parameter_names_types, :tag) + append_to_file "#{Nugem.dest_root gem_name}/demo/index.html", Cli.add_demo_example(tag_name, @jekyll_parameter_names_types, :tag) end def create_jekyll_tag_scaffold(tag_name) @tag_name = tag_name - @jekyll_class_name = Creategem.camel_case @tag_name + @jekyll_class_name = Nugem.camel_case @tag_name ask_option_names_types tag_name # Defines @jekyll_parameter_names_types, which is a nested array of name/value pairs: # [["opt1", "string"], ["opt2", "boolean"]] say "Creating Jekyll tag #{@tag_name} scaffold within #{@jekyll_class_name}", :green @mute = true # puts set_color("@jekyll_parameter_names_types=#{@jekyll_parameter_names_types}", :yellow) directory 'jekyll/tag_scaffold', @dir, force: true, mode: :preserve - append_to_file "#{Creategem.dest_root gem_name}/demo/index.html", Cli.add_demo_example(tag_name, @jekyll_parameter_names_types, :tag) + append_to_file "#{Nugem.dest_root gem_name}/demo/index.html", Cli.add_demo_example(tag_name, @jekyll_parameter_names_types, :tag) end end end diff --git a/lib/creategem/cli/cli_rails.rb b/lib/nugem/cli/cli_rails.rb similarity index 95% rename from lib/creategem/cli/cli_rails.rb rename to lib/nugem/cli/cli_rails.rb index 7640b0e..547d453 100644 --- a/lib/creategem/cli/cli_rails.rb +++ b/lib/nugem/cli/cli_rails.rb @@ -1,9 +1,9 @@ require_relative '../cli' -module Creategem +module Nugem class Cli < Thor include Thor::Actions - include Creategem::Git + include Nugem::Git desc 'rails NAME', 'Creates a new Rails rails scaffold.' @@ -26,7 +26,7 @@ def rails(gem_name) @private = options['private'] @test_framework = options['test_framework'] - @dir = Creategem.dest_root gem_name + @dir = Nugem.dest_root gem_name @engine = @host || @mountable @rails = true diff --git a/lib/creategem/cli/jekyll_demo.rb b/lib/nugem/cli/jekyll_demo.rb similarity index 99% rename from lib/creategem/cli/jekyll_demo.rb rename to lib/nugem/cli/jekyll_demo.rb index 677b229..ce9626f 100644 --- a/lib/creategem/cli/jekyll_demo.rb +++ b/lib/nugem/cli/jekyll_demo.rb @@ -1,4 +1,4 @@ -module Creategem +module Nugem class Cli < Thor include Thor::Actions diff --git a/lib/creategem/git.rb b/lib/nugem/git.rb similarity index 93% rename from lib/creategem/git.rb rename to lib/nugem/git.rb index a1a05a1..5cafa0e 100644 --- a/lib/creategem/git.rb +++ b/lib/nugem/git.rb @@ -1,7 +1,7 @@ require 'thor' require 'yaml' -module Creategem +module Nugem module Git include Thor::Actions @@ -15,7 +15,7 @@ def create_local_git_repository end def github_config - gh_hosts_file = Creategem.expand_env('$HOME/.config/gh/hosts.yml') + gh_hosts_file = Nugem.expand_env('$HOME/.config/gh/hosts.yml') return nil unless File.exist? gh_hosts_file YAML.safe_load(File.read(gh_hosts_file)) @@ -51,7 +51,7 @@ def create_remote_git_repository(repository) def git_repository_user_name(host) global_config = Rugged::Config.global - git_config_key = "creategem.#{host}user" + git_config_key = "nugem.#{host}user" user = global_config[git_config_key] gh_config = github_config @@ -65,7 +65,7 @@ def git_repository_user_name(host) def gem_server_url(private_) if private_ global_config = Rugged::Config.global - git_config_key = 'creategem.gemserver' + git_config_key = 'nugem.gemserver' url = global_config[git_config_key] if url.to_s.empty? diff --git a/lib/creategem/repository.rb b/lib/nugem/repository.rb similarity index 92% rename from lib/creategem/repository.rb rename to lib/nugem/repository.rb index c88783c..d8a0f97 100644 --- a/lib/creategem/repository.rb +++ b/lib/nugem/repository.rb @@ -1,5 +1,5 @@ -# Creategem::Repository contains informations about the git repository and the git user -module Creategem +# Nugem::Repository contains informations about the git repository and the git user +module Nugem class Repository attr_reader :gem_server_url, :global_config, :host, :name, :private, :user, :user_name, :user_email diff --git a/lib/creategem/version.rb b/lib/nugem/version.rb similarity index 64% rename from lib/creategem/version.rb rename to lib/nugem/version.rb index c6d5c89..9609aa3 100644 --- a/lib/creategem/version.rb +++ b/lib/nugem/version.rb @@ -1,3 +1,3 @@ -module Creategem +module Nugem VERSION = '0.8.0'.freeze end diff --git a/lib/util.rb b/lib/util.rb index bc40cf3..2dc2029 100644 --- a/lib/util.rb +++ b/lib/util.rb @@ -1,4 +1,4 @@ -module Creategem +module Nugem def self.camel_case(str) Thor::Util.camel_case str.tr('-', '_') end diff --git a/creategem.gemspec b/nugem.gemspec similarity index 64% rename from creategem.gemspec rename to nugem.gemspec index b809e82..6bf6cca 100644 --- a/creategem.gemspec +++ b/nugem.gemspec @@ -1,4 +1,4 @@ -require_relative 'lib/creategem/version' +require_relative 'lib/nugem/version' Gem::Specification.new do |spec| spec.authors = ['Igor Jancev', 'Mike Slinn'] @@ -7,16 +7,16 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.files = Dir['.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md'] spec.description = <<~END_DESC - Creategem creates a scaffold project for new gems. You can choose between Github and Bitbucket, + Nugem creates a scaffold project for new gems. You can choose between Github and Bitbucket, Rubygems or Geminabox, with or without an executable, etc. END_DESC - spec.homepage = 'https://github.com/mslinn/creategem' + spec.homepage = 'https://github.com/mslinn/nugem' spec.license = 'MIT' - spec.name = 'creategem' + spec.name = 'nugem' spec.require_paths = ['lib'] spec.required_ruby_version = '>= 3.1.0' - spec.summary = 'Creategem creates a scaffold project for new gems.' - spec.version = Creategem::VERSION + spec.summary = 'Nugem creates a scaffold project for new gems.' + spec.version = Nugem::VERSION spec.add_dependency 'rugged' spec.add_dependency 'thor' diff --git a/spec/jekyll_tag_spec.rb b/spec/jekyll_tag_spec.rb index 2314b5b..3e25027 100644 --- a/spec/jekyll_tag_spec.rb +++ b/spec/jekyll_tag_spec.rb @@ -1,7 +1,7 @@ -require_relative '../lib/creategem/cli/cli_jekyll' +require_relative '../lib/nugem/cli/cli_jekyll' class JekyllTagTest - RSpec.describe ::Creategem::Cli do + RSpec.describe ::Nugem::Cli do it 'tests tag option combinations' do params = [ %w[option1 string], diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 160e6b6..7e11301 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,4 @@ -require_relative '../lib/creategem' +require_relative '../lib/nugem' RSpec.configure do |config| config.filter_run :focus diff --git a/test/creategem_test.rb b/test/nugem_test.rb similarity index 52% rename from test/creategem_test.rb rename to test/nugem_test.rb index 68c7091..aeda7d1 100644 --- a/test/creategem_test.rb +++ b/test/nugem_test.rb @@ -1,7 +1,7 @@ require_relative 'test_helper' -class CreategemTest < Minitest::Test +class NugemTest < Minitest::Test def test_that_it_has_a_version_number - refute_nil ::Creategem::VERSION + refute_nil ::Nugem::VERSION end end diff --git a/test/repository_test.rb b/test/repository_test.rb index dd4ea64..ca302fa 100644 --- a/test/repository_test.rb +++ b/test/repository_test.rb @@ -2,21 +2,21 @@ class RepositoryTest < Minitest::Test def test_bitbucket - repo = Creategem::Repository.new(host: :bitbucket, - private: true, - user: 'maxmustermann', - name: :testrepo, - gem_server_url: 'https://gems.mustermann.com') + repo = Nugem::Repository.new(host: :bitbucket, + private: true, + user: 'maxmustermann', + name: :testrepo, + gem_server_url: 'https://gems.mustermann.com') assert_equal 'git@bitbucket.org:maxmustermann/testrepo.git', repo.origin assert repo.private? assert repo.bitbucket? end def test_github - repo = Creategem::Repository.new(host: :github, - user: 'maxmustermann', - name: :testrepo, - gem_server_url: 'https://rubygems.org') + repo = Nugem::Repository.new(host: :github, + user: 'maxmustermann', + name: :testrepo, + gem_server_url: 'https://rubygems.org') assert_equal 'git@github.com:maxmustermann/testrepo.git', repo.origin assert repo.public? assert repo.github? diff --git a/test/test_helper.rb b/test/test_helper.rb index 247f0af..330dfd6 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,4 +1,4 @@ -require_relative '../lib/creategem' +require_relative '../lib/nugem' require 'coveralls' Coveralls.wear!