Skip to content

Commit

Permalink
Merge pull request #245 from gjtorikian/dont-do-this
Browse files Browse the repository at this point in the history
Move debug gems into test env
  • Loading branch information
gjtorikian committed Jul 24, 2023
2 parents 527f487 + 7ee76b2 commit 08389d3
Show file tree
Hide file tree
Showing 20 changed files with 13 additions and 15 deletions.
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

0 comments on commit 08389d3

Please sign in to comment.