-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from DannyBen/housekeeping
Drop support for Ruby 2.x
- Loading branch information
Showing
11 changed files
with
58 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require: | ||
- rubocop-performance | ||
- rubocop-rspec | ||
|
||
inherit_gem: | ||
rentacop: | ||
- rentacop.yml | ||
- rspec.yml | ||
|
||
AllCops: | ||
TargetRubyVersion: 3.0 | ||
Exclude: | ||
- dev/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
source "https://rubygems.org" | ||
source 'https://rubygems.org' | ||
|
||
gem 'byebug' | ||
gem 'docspec' | ||
gem 'lp' | ||
gem 'rspec' | ||
gem 'runfile' | ||
gem 'runfile-tasks' | ||
gem 'rspec' | ||
gem 'simplecov' | ||
gem 'lp' | ||
gem 'byebug' | ||
gem 'docspec' | ||
|
||
gemspec | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
require "runfile-tasks" | ||
require_relative 'lib/getcomments' | ||
|
||
title "GetComments Developer Toolbelt" | ||
summary "Runfile tasks for building the GetComments gem" | ||
version GetComments::VERSION | ||
|
||
RunfileTasks::RubyGems.all 'getcomments' | ||
RunfileTasks::Testing.rspec | ||
import_gem 'runfile-tasks/gem' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
lib = File.expand_path('../lib', __FILE__) | ||
lib = File.expand_path('lib', __dir__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require 'date' | ||
require 'getcomments/version' | ||
|
||
Gem::Specification.new do |s| | ||
s.name = 'getcomments' | ||
s.version = GetComments::VERSION | ||
s.date = Date.today.to_s | ||
s.summary = "Extract comments from a Ruby source file" | ||
s.description = "Extract comments from a Ruby source file" | ||
s.authors = ["Danny Ben Shitrit"] | ||
s.summary = 'Extract comments from a Ruby source file' | ||
s.description = 'Extract comments from a Ruby source file' | ||
s.authors = ['Danny Ben Shitrit'] | ||
s.email = 'db@dannyben.com' | ||
s.files = Dir['README.md', 'lib/**/*.*'] | ||
s.homepage = 'https://github.com/DannyBen/getcomments' | ||
s.license = 'MIT' | ||
s.required_ruby_version = ">= 2.2.2" | ||
|
||
s.required_ruby_version = '>= 3.0' | ||
s.metadata['rubygems_mfa_required'] = 'true' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module GetComments | ||
VERSION = "0.2.0" | ||
end | ||
VERSION = '0.2.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
# Module comment | ||
module TestModule | ||
|
||
# Class comment | ||
class TestClass | ||
|
||
# Attribute comment | ||
attr_reader :some_attr | ||
|
||
# Method comment | ||
def some_method(with:, args:) | ||
end | ||
def some_method(with:, args:); end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,44 @@ | ||
require 'spec_helper' | ||
|
||
describe Code do | ||
subject { described_class.new code } | ||
|
||
let(:code) { File.read 'spec/fixtures/basic.rb' } | ||
let(:subject) { described_class.new code } | ||
|
||
describe "#comments" do | ||
describe '#comments' do | ||
let(:result) { subject.comments } | ||
|
||
it "returns a hash" do | ||
it 'returns a hash' do | ||
expect(result).to be_a Hash | ||
end | ||
|
||
it "respects indented comments" do | ||
it 'respects indented comments' do | ||
expect(result['def some_method']).to match(/ With indented example/) | ||
end | ||
|
||
it "captures comments for module" do | ||
expect(result['module TestModule']).to eq "Module comment" | ||
it 'captures comments for module' do | ||
expect(result['module TestModule']).to eq 'Module comment' | ||
end | ||
|
||
it "captures comments for class" do | ||
expect(result['class TestClass']).to eq "Class comment" | ||
it 'captures comments for class' do | ||
expect(result['class TestClass']).to eq 'Class comment' | ||
end | ||
|
||
it "captures comments for def" do | ||
expect(result['def another_method']).to eq "Method comment" | ||
it 'captures comments for def' do | ||
expect(result['def another_method']).to eq 'Method comment' | ||
end | ||
|
||
it "captures comments for attr accessors" do | ||
expect(result['attr_reader :some_attr']).to eq "Attribute comment" | ||
it 'captures comments for attr accessors' do | ||
expect(result['attr_reader :some_attr']).to eq 'Attribute comment' | ||
end | ||
|
||
it "captures floating comments" do | ||
expect(result['comment_1']).to eq "Floating comment" | ||
expect(result['comment_2']).to eq "Another floating comment" | ||
it 'captures floating comments' do | ||
expect(result['comment_1']).to eq 'Floating comment' | ||
expect(result['comment_2']).to eq 'Another floating comment' | ||
end | ||
|
||
it "captures end of file comments" do | ||
expect(result['comment_3']).to eq "EOF comment" | ||
it 'captures end of file comments' do | ||
expect(result['comment_3']).to eq 'EOF comment' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters