Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move debug gems into test env #245

Merged
merged 5 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"rust-analyzer.checkOnSave.command": "clippy",
"[ruby]": {
"editor.defaultFormatter": "Shopify.ruby-lsp"
}
}
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gemspec
gem "github_changelog_generator", "~> 1.16"

group :debug do
gem "awesome_print"
gem "amazing_print"
gem "debug"
end

Expand Down
5 changes: 0 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# frozen_string_literal: true

if ENV.fetch("DEBUG", false)
require "awesome_print"
require "debug"
end

# Gem Spec
require "bundler"
COMMONMARKER_SPEC = Bundler.load_gemspec("commonmarker.gemspec")
Expand Down
5 changes: 0 additions & 5 deletions lib/commonmarker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
require "commonmarker/renderer"
require "commonmarker/version"

if ENV.fetch("DEBUG", false)
require "awesome_print"
require "debug"
end

module Commonmarker
class << self
# Public: Parses a CommonMark string into an HTML string.
Expand Down
2 changes: 1 addition & 1 deletion lib/commonmarker/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def process_plugins(plugins)

[:syntax_highlighter].each do |type|
define_singleton_method :"process_#{type}_plugin" do |plugin|
return nil if plugin.nil? # plugin explicitly nil, remove it
return if plugin.nil? # plugin explicitly nil, remove it

Commonmarker::Config::PLUGINS[type].each_with_object({}) do |(key, value), hash|
if plugin.nil? # option not provided, go for the default
Expand Down
2 changes: 1 addition & 1 deletion lib/commonmarker/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Commonmarker
VERSION = "1.0.0.pre9"
VERSION = "1.0.0.pre10"
end
2 changes: 1 addition & 1 deletion rakelib/test.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require "rake/testtask"
Rake::TestTask.new("test") do |t|
t.libs << "lib"
t.libs << "test"
t.pattern = "test/test_*.rb"
t.pattern = "test/**/*_test.rb"
t.verbose = true
t.warning = false
end
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/test_extensions.rb → test/extensions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_definition_lists
: Ruby wrapper for comrak (CommonMark parser)
MARKDOWN

extensions = { strikethrough: false, description_lists: true }
extensions = { strikethrough: false, description_lists: true }
options = { extension: extensions, render: { hardbreaks: false } }
output = Commonmarker.to_html(markdown, options: options)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
require "minitest/pride"
require "minitest/focus"

if ENV.fetch("DEBUG", false)
require "amazing_print"
require "debug"
end

include Commonmarker

FIXTURES_DIR = File.join(File.dirname(__FILE__), "fixtures")
Expand Down