From 392826342bd6ad01fbc8bab946894b9d54b109cb Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Wed, 12 Feb 2020 18:23:08 +0000 Subject: [PATCH] feat!: Implement blank_gem that does nothing. --- .gitignore | 13 +++++++++++++ .versionrc.js | 8 ++++++++ Gemfile | 8 ++++++++ LICENSE | 21 +++++++++++++++++++++ Makefile | 9 +++++++++ README.md | 29 +++++++++++++++++++++++++++++ Rakefile | 3 +++ VERSION | 1 + blank_gem.gemspec | 32 ++++++++++++++++++++++++++++++++ lib/blank_gem.rb | 5 +++++ lib/blank_gem/version.rb | 7 +++++++ 11 files changed, 136 insertions(+) create mode 100644 .gitignore create mode 100644 .versionrc.js create mode 100644 Gemfile create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md create mode 100644 Rakefile create mode 100644 VERSION create mode 100644 blank_gem.gemspec create mode 100644 lib/blank_gem.rb create mode 100644 lib/blank_gem/version.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6355904 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ + +Gemfile.lock + +# rspec failure tracking +.rspec_status diff --git a/.versionrc.js b/.versionrc.js new file mode 100644 index 0000000..2786e98 --- /dev/null +++ b/.versionrc.js @@ -0,0 +1,8 @@ +module.exports = config = {}; + +config.bumpFiles = [ + { + filename: "VERSION", + type: "plain-text" + } +]; diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..9c9569a --- /dev/null +++ b/Gemfile @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' + +# Specify your gem's dependencies in blank_gem.gemspec +gemspec + +gem 'rake' diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..65a63a4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Jim Myhrberg + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..55457b8 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +.PHONY: new-version +new-version: + $(if $(shell command -v npx),, \ + $(error No npx executable in PATH, please install NodeJS)) + $(if $(shell command -v standard-version),, \ + $(error No standard-version executable in PATH, \ + install with: npm i -g standard-version)) + + npx standard-version diff --git a/README.md b/README.md new file mode 100644 index 0000000..d9d724f --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# BlankGem + +A blank/empty Ruby gem that does nothing. Useful for testing that only specific +Bundler groups are loaded when using a dummy group. + +## Installation + +Add this line to your application's Gemfile, ideally under a group you'll never +want: + +```ruby +gem 'blank_gem', group: :never +``` + +And then execute: + + $ bundle install + +## Usage + +Simply set Bundler's `without` option to exclude the group you've put the +`blank_gem` within. For example: + + $ bundle config set without 'never' + +## Contributing + +Bug reports and pull requests are welcome on GitHub at +https://github.com/jimeh/blank_gem. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..7398a90 --- /dev/null +++ b/Rakefile @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require 'bundler/gem_tasks' diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..8acdd82 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.1 diff --git a/blank_gem.gemspec b/blank_gem.gemspec new file mode 100644 index 0000000..f578416 --- /dev/null +++ b/blank_gem.gemspec @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require_relative 'lib/blank_gem/version' + +Gem::Specification.new do |spec| + spec.name = 'blank_gem' + spec.version = BlankGem::VERSION + spec.authors = ['Jim Myhrberg'] + spec.email = ['contact@jimeh.me'] + + spec.summary = 'A blank/empty Ruby gem that does nothing.' + spec.description = 'A blank/empty Ruby gem that does nothing. Useful for ' \ + 'testing that only specific Bundler groups are loaded ' \ + 'when using a dummy group.' + spec.homepage = 'https://github.com/jimeh/blank_gem' + spec.required_ruby_version = Gem::Requirement.new('>= 2.0.0') + + spec.metadata['homepage_uri'] = spec.homepage + spec.metadata['source_code_uri'] = spec.homepage + spec.metadata['changelog_uri'] = spec.homepage + + spec.files = Dir.glob('lib/**/*') + [ + 'Gemfile', + 'LICENSE', + 'README.md', + 'Rakefile', + 'VERSION' + ] + spec.bindir = 'exe' + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ['lib'] +end diff --git a/lib/blank_gem.rb b/lib/blank_gem.rb new file mode 100644 index 0000000..970a210 --- /dev/null +++ b/lib/blank_gem.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +require 'blank_gem/version' + +module BlankGem; end diff --git a/lib/blank_gem/version.rb b/lib/blank_gem/version.rb new file mode 100644 index 0000000..1245e83 --- /dev/null +++ b/lib/blank_gem/version.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module BlankGem + VERSION = File.read( + File.expand_path(File.join('..', '..', 'VERSION'), __dir__) + ) +end