diff --git a/Gemfile b/Gemfile index fc71d90..9b5d251 100644 --- a/Gemfile +++ b/Gemfile @@ -1,12 +1,12 @@ # frozen_string_literal: true -source "https://rubygems.org" +source 'https://rubygems.org' # Specify your gem's dependencies in todo_marker.gemspec gemspec -gem "rake", "~> 13.0" +gem 'rake', '~> 13.0' -gem "rspec", "~> 3.0" +gem 'rspec', '~> 3.0' -gem "rubocop", "~> 1.21" +gem 'rubocop', '~> 1.21' diff --git a/Rakefile b/Rakefile index cca7175..4964751 100644 --- a/Rakefile +++ b/Rakefile @@ -1,11 +1,11 @@ # frozen_string_literal: true -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 diff --git a/bin/console b/bin/console index 11fb2c5..e5b7cd5 100755 --- a/bin/console +++ b/bin/console @@ -1,11 +1,11 @@ #!/usr/bin/env ruby # frozen_string_literal: true -require "bundler/setup" -require "todo_marker" +require 'bundler/setup' +require 'todo_marker' # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. -require "irb" +require 'irb' IRB.start(__FILE__) diff --git a/bin/todo_marker b/bin/todo_marker index 7c57c37..0b869c4 100755 --- a/bin/todo_marker +++ b/bin/todo_marker @@ -1,10 +1,12 @@ -# bin/todo_marker -#!/usr/bin/env ruby +# frozen_string_literal: true -require "todo_marker" +# bin/todo_marker +# !/usr/bin/env ruby + +require 'todo_marker' if ARGV.empty? - puts "Usage: todo_marker " + puts 'Usage: todo_marker ' exit 1 end diff --git a/lib/todo_marker.rb b/lib/todo_marker.rb index 340a016..b93934a 100644 --- a/lib/todo_marker.rb +++ b/lib/todo_marker.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true # lib/todo_marker.rb -require "todo_marker/version" -require "find" +require 'todo_marker/version' +require 'find' module TodoMarker TODO_REGEX = /# !!TODO!! "(.*?)"/ @@ -11,7 +11,7 @@ module TodoMarker todos = [] Find.find(directory) do |path| - next unless path.end_with?(".rb") + next unless path.end_with?('.rb') File.readlines(path).each_with_index do |line, index| next unless line.match(TODO_REGEX) @@ -28,7 +28,7 @@ module TodoMarker end def self.create_todo_file(directory, todos) - File.open(File.join(directory, "TODO.md"), "w") do |file| + File.open(File.join(directory, 'TODO.md'), 'w') do |file| file.puts "# TODO List\n\n" todos.each do |todo| file.puts "- #{todo[:message]} (#{todo[:file]}:#{todo[:line]})" diff --git a/lib/todo_marker/version.rb b/lib/todo_marker/version.rb index 1f84b4a..abc36a9 100644 --- a/lib/todo_marker/version.rb +++ b/lib/todo_marker/version.rb @@ -2,5 +2,5 @@ # lib/todo_marker/version.rb module TodoMarker - VERSION = "0.1.0" + VERSION = '0.1.0' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 51baa61..b1eaf31 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true -require "todo_marker" +require 'todo_marker' RSpec.configure do |config| # Enable flags like --only-failures and --next-failure - config.example_status_persistence_file_path = ".rspec_status" + config.example_status_persistence_file_path = '.rspec_status' # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! diff --git a/spec/todo_marker_spec.rb b/spec/todo_marker_spec.rb index 3cd2cc0..707cc43 100644 --- a/spec/todo_marker_spec.rb +++ b/spec/todo_marker_spec.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true RSpec.describe TodoMarker do - it "has a version number" do + it 'has a version number' do expect(TodoMarker::VERSION).not_to be nil end - it "does something useful" do + it 'does something useful' do expect(false).to eq(true) end end diff --git a/todo_marker.gemspec b/todo_marker.gemspec index 6413682..6c96b46 100644 --- a/todo_marker.gemspec +++ b/todo_marker.gemspec @@ -1,26 +1,27 @@ # frozen_string_literal: true -require_relative "lib/todo_marker/version" +require_relative 'lib/todo_marker/version' Gem::Specification.new do |spec| - spec.name = "todo_marker" + spec.name = 'todo_marker' spec.version = TodoMarker::VERSION - spec.authors = ["VetheonGames"] - spec.email = ["connor@pixelridgesoftworks.com"] + spec.authors = ['VetheonGames'] + spec.email = ['connor@pixelridgesoftworks.com'] - spec.summary = "Standalone gem for generating TODO.md files" + spec.summary = 'Standalone gem for generating TODO.md files' spec.description = "This standalone gem takes in source code files written in Ruby, and generates a TODO.md file from them. mark things to add to the TODO.md with the `# !!TODO!!` magic comment" - spec.homepage = "https://git.pixelridgesoftworks.com/PixelRidge-Softworks/Todo_Marker" - spec.license = "MIT" - spec.required_ruby_version = ">= 3.2" + spec.homepage = 'https://git.pixelridgesoftworks.com/PixelRidge-Softworks/Todo_Marker' + spec.license = 'MIT' + spec.required_ruby_version = '>= 3.2' - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = "https://git.pixelridgesoftworks.com/PixelRidge-Softworks/Todo_Marker" + spec.metadata['homepage_uri'] = spec.homepage + spec.metadata['source_code_uri'] = 'https://git.pixelridgesoftworks.com/PixelRidge-Softworks/Todo_Marker' - spec.files = Dir["lib/**/*.rb", "bin/*"] - spec.bindir = "bin" - spec.executables = ["todo_marker"] - spec.require_paths = ["lib"] + spec.files = Dir['lib/**/*.rb', 'bin/*'] + spec.bindir = 'bin' + spec.executables = ['todo_marker'] + spec.require_paths = ['lib'] + spec.metadata['rubygems_mfa_required'] = 'true' end