1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00

Rename the option from new_hash_syntax to colonize_symbol_keys

This commit is contained in:
Mauro George 2015-03-19 18:18:19 -03:00
parent 896e8f7d4e
commit a4d960f1c8
4 changed files with 21 additions and 21 deletions

View file

@ -41,7 +41,7 @@ Default options:
:raw => false, # Do not recursively format object instance variables.
:sort_keys => false, # Do not sort hash keys.
:limit => false, # Limit large output for arrays and hashes. Set to a boolean or integer.
:new_hash_syntax => false, # Use the foo: 'bar' syntax, when the key is a symbol
:colonize_symbol_keys => false, # Use the foo: 'bar' syntax, when the key is a symbol
:color => {
:args => :pale,
:array => :white,

View file

@ -43,7 +43,7 @@ module AwesomePrint
@data = @data.map do |key, value|
formatter.indented do
if options[:new_hash_syntax] && is_a_symbol?(key)
if options[:colonize_symbol_keys] && is_a_symbol?(key)
new_hash_syntax_format(key, value)
else
old_hash_syntax_format(key, value)

View file

@ -14,7 +14,7 @@ module AwesomePrint
:raw => false, # Do not recursively format object instance variables.
:sort_keys => false, # Do not sort hash keys.
:limit => false, # Limit large output for arrays and hashes. Set to a boolean or integer.
:new_hash_syntax => false, # Use the foo: 'bar' syntax, when the key is a symbol
:colonize_symbol_keys => false, # Use the foo: 'bar' syntax, when the key is a symbol
:color => {
:args => :pale,
:array => :white,

View file

@ -276,7 +276,7 @@ EOS
end
it "new hash syntax" do
expect(@hash.ai(:plain => true, :new_hash_syntax => true)).to eq <<-EOS.strip
expect(@hash.ai(:plain => true, :colonize_symbol_keys => true)).to eq <<-EOS.strip
{
1 => {
sym: {
@ -330,7 +330,7 @@ EOS
end
it "colored with new hash syntax" do
expect(@hash.ai(:new_hash_syntax => true)).to eq <<-EOS.strip
expect(@hash.ai(:colonize_symbol_keys => true)).to eq <<-EOS.strip
{
1\e[0;37m => \e[0m{
sym\e[0;37m: \e[0m{