Skip to content

Commit

Permalink
various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Apr 24, 2024
1 parent 2255c61 commit 56444f3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion bridgetown-core/lib/bridgetown-core/site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def initialize(config, label: :main, loaders_manager: nil)

def data=(new_data)
@data = new_data
data_hash = @data.to_h.transform_keys(&:to_sym)
data_hash = @data.to_dot_h.transform_keys(&:to_sym)
@signals = Bridgetown::Signals.define(*data_hash.keys) do
def inspect # rubocop:disable Lint/NestedMethodDefinition
var_peeks = instance_variables.filter_map do |var_name|
Expand Down
4 changes: 2 additions & 2 deletions bridgetown-core/lib/bridgetown-core/utils/aux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ module Bridgetown
module Utils
module Aux
def self.with_color(name, message)
return message unless !name.nil? && Bridgetown::Utils::Ansi::COLORS[name.to_sym]
return message unless !name.nil? && Bridgetown::Foundation::Ansi::COLORS[name.to_sym]

Bridgetown::Utils::Ansi.send(name, message)
Bridgetown::Foundation::Ansi.send(name, message)
end

def self.running_pids
Expand Down
25 changes: 0 additions & 25 deletions bridgetown-core/test/test_ansi.rb

This file was deleted.

23 changes: 23 additions & 0 deletions bridgetown-foundation/test/test_ansi.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

require "test_helper"

class TestAnsi < Minitest::Test
def setup
@subject = Bridgetown::Foundation::Ansi
end

Bridgetown::Foundation::Ansi::COLORS.each_key do |color|
define_method :"test_respond_to_color_#{color}" do
assert @subject.respond_to?(color)
end
end

def test_able_to_strip_colors
assert_equal "hello", @subject.strip(@subject.yellow(@subject.red("hello")))
end

def test_able_to_detect_colors
assert @subject.has?(@subject.yellow("hello"))
end
end

0 comments on commit 56444f3

Please sign in to comment.