From b456db8554dbc3cded9f394cd894d92ee6d1c1bc Mon Sep 17 00:00:00 2001 From: uvlad7 Date: Wed, 11 Oct 2023 03:35:40 +0300 Subject: [PATCH] Fix style --- Gemfile | 26 +++++++++++++------------- Rakefile | 20 ++++++++++---------- xml2json.gemspec | 3 ++- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Gemfile b/Gemfile index a6da979..469285c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,26 +1,26 @@ # frozen_string_literal: true -source 'https://rubygems.org' +source "https://rubygems.org" # Specify your gem's dependencies in xml2json.gemspec gemspec -gem 'rake', '~> 13.0' +gem "rake", "~> 13.0" -gem 'rake-compiler' -gem 'rb_sys', '~> 0.9.63' +gem "rake-compiler" +gem "rb_sys", "~> 0.9.63" -gem 'rspec', '~> 3.0' +gem "rspec", "~> 3.0" -gem 'rubocop', '~> 1.21' +gem "rubocop", "~> 1.21" -gem 'yard-rustdoc' +gem "yard-rustdoc" -gem 'pry' -gem 'pry-byebug' -gem 'yard' +gem "pry" +gem "pry-byebug" +gem "yard" # # Cause I want to use rack adapter -gem 'rack' -gem 'rackup' +gem "rack" +gem "rackup" # # Cause I want to use rack adapter with puma server -gem 'puma' +gem "puma" diff --git a/Rakefile b/Rakefile index e98428a..4e9464c 100644 --- a/Rakefile +++ b/Rakefile @@ -1,31 +1,31 @@ # frozen_string_literal: true -require 'bundler/setup' +require "bundler/setup" -require 'bundler/gem_tasks' -require 'rspec/core/rake_task' +require "bundler/gem_tasks" +require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) -require 'rubocop/rake_task' +require "rubocop/rake_task" RuboCop::RakeTask.new -require 'rb_sys/extensiontask' +require "rb_sys/extensiontask" task build: :compile gemspec = Gem::Specification.load("xml2json.gemspec") -RbSys::ExtensionTask.new('xml2json', gemspec) do |ext| - ext.lib_dir = 'lib/xml2json' +RbSys::ExtensionTask.new("xml2json", gemspec) do |ext| + ext.lib_dir = "lib/xml2json" end -require 'yard' +require "yard" YARD::Rake::YardocTask.new do |t| - t.files = gemspec.files - t.options += ['--output-dir', ENV['YARD_OUTPUT_DIR']] if ENV['YARD_OUTPUT_DIR'] + t.files = gemspec.files.select { |f| File.extname(f) == ".rb" } + t.options += ["--output-dir", ENV["YARD_OUTPUT_DIR"]] if ENV["YARD_OUTPUT_DIR"] end task default: %i[compile spec rubocop yard] diff --git a/xml2json.gemspec b/xml2json.gemspec index a847d9e..9b13415 100644 --- a/xml2json.gemspec +++ b/xml2json.gemspec @@ -30,7 +30,8 @@ Gem::Specification.new do |spec| # end # end spec.files = [ - *Dir["ext/**/*"], *Dir["lib/**/*"], *Dir["sig/**/*"], + # .rb - to exclude lib/xml2json/xml2json.so + *Dir["ext/**/*"], *Dir["lib/**/*.rb"], *Dir["sig/**/*"], "Cargo.lock", "Cargo.toml" ].reject { |f| File.directory?(f) } spec.bindir = "exe"