From f1f6dfa692a0b5b90ba4a70af7c2a2c8c8206196 Mon Sep 17 00:00:00 2001 From: Takuya Noguchi Date: Tue, 3 Jan 2023 12:27:09 +0000 Subject: [PATCH] Rewrite rubygems guide from HAML to Markdown Signed-off-by: Takuya Noguchi --- source/guides/rubygems.html.haml | 53 -------------------------------- source/guides/rubygems.html.md | 45 +++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 53 deletions(-) delete mode 100644 source/guides/rubygems.html.haml create mode 100644 source/guides/rubygems.html.md diff --git a/source/guides/rubygems.html.haml b/source/guides/rubygems.html.haml deleted file mode 100644 index e7a474e147..0000000000 --- a/source/guides/rubygems.html.haml +++ /dev/null @@ -1,53 +0,0 @@ -.container.guide - %h2 Using Bundler while developing a gem - - .contents - .bullet - .description - If you're creating a gem from scratch, you can use bundler's built in gem skeleton to create a base gem for you to edit. - .how - :code - $ bundle gem my_gem - .notes - This will create a new directory named my_gem with your new gem skeleton. - .bullet - .description - If you already have a gem, you can create a Gemfile and use Bundler to manage your development dependencies. Here's an example. - :code - # lang: ruby - source "https://rubygems.org" - - gemspec - - gem "rspec", "~> 3.9" - gem "rubocop", "0.79.0" - .notes - In this Gemfile, the `gemspec` method imports gems listed with `add_runtime_dependency` in the `my_gem.gemspec` file, and it also installs rspec and rubocop to test and develop the gem. - All dependencies from the gemspec and Gemfile will be installed by `bundle install`, but rspec and rubocop will not be included by `gem install mygem` or `bundle add mygem`. - .bullet - .description - Runtime dependencies in your gemspec are treated as if they are listed in your Gemfile, and development dependencies are added by default to the group, :development. - You can change that group with the :development_group option - :code - # lang: ruby - gemspec :development_group => :dev - .bullet - .description - As well, you can point to a specific gemspec using :path. If your gemspec is in /gemspec/path, use - :code - # lang: ruby - gemspec :path => '/gemspec/path' - .bullet - .description - If you have multiple gemspecs in the same directory, specify which one you'd like to reference using :name - :code - # lang: ruby - gemspec :name => 'my_awesome_gem' - .notes - This will use my_awesome_gem.gemspec - - .bullet - .description - That's it! Use bundler when developing your gem, and otherwise, use gemspecs normally! - :code - $ gem build my_gem.gemspec diff --git a/source/guides/rubygems.html.md b/source/guides/rubygems.html.md new file mode 100644 index 0000000000..5a92ca44a0 --- /dev/null +++ b/source/guides/rubygems.html.md @@ -0,0 +1,45 @@ +## Using Bundler while developing a gem + +If you're creating a gem from scratch, you can use bundler's built in gem skeleton to create a base gem for you to edit. + +~~~ +$ bundle gem my_gem +~~~ + +This will create a new directory named `my_gem` with your new gem skeleton. +If you already have a gem, you can create a Gemfile and use Bundler to manage your development dependencies. Here's an example. + +~~~ruby +source "https://rubygems.org" +gemspec +gem "rspec", "~> 3.9" +gem "rubocop", "0.79.0" +~~~ + +In this Gemfile, the `gemspec` method imports gems listed with `add_runtime_dependency` in the `my_gem.gemspec` file, and it also installs rspec and rubocop to test and develop the gem. +All dependencies from the gemspec and Gemfile will be installed by `bundle install`, but rspec and rubocop will not be included by `gem install mygem` or `bundle add mygem`. +Runtime dependencies in your gemspec are treated as if they are listed in your Gemfile, and development dependencies are added by default to the group, `:development`. +You can change that group with the `:development_group` option + +~~~ruby +gemspec :development_group => :dev +~~~ + +As well, you can point to a specific gemspec using `:path`. If your gemspec is in `/gemspec/path`, use + +~~~ruby +gemspec :path => '/gemspec/path' +~~~ + +If you have multiple gemspecs in the same directory, specify which one you'd like to reference using `:name` + +~~~ruby +gemspec :name => 'my_awesome_gem' +~~~ + +This will use `my_awesome_gem.gemspec` +That's it! Use bundler when developing your gem, and otherwise, use gemspecs normally! + +~~~ +$ gem build my_gem.gemspec +~~~