Questions tagged [unless]

12 questions
1
vote
0 answers

Nested Unless tags break Liquid/Jekyll

I've been working with generating some JSON data from liquid tags, it seems that excluding the last comma in this JSON data is not happening when nesting 'unless' tags. Please see answer below, this initial issue and question was not the…
Moxxi
  • 39
  • 7
1
vote
1 answer

What do I wrong comparing a tuple of integers in PureScript?

Debugging my event handler for the mouse move event, I wrote this code: unless (scrollDelta == Tuple 0 0) $ trace (show scrollDelta) \_ -> do ... And I get console output Tuple 0 0 The idea behind this is to save a difference in the mouse…
ruben.moor
  • 1,876
  • 15
  • 27
1
vote
1 answer

Ruby unless conditional with || operator

I am confused about how the Ruby unless conditional works with the || operator. So what I've got essentially: <% unless @instance_variable.method || local_variable.another_method %> code block <% end % At the moment, the first part is evaluating…
0
votes
0 answers

Laravel validation - field A required when one of two conditions is acheived: field B filled or filed C has a specific value

Laravel validation - field A required unless when one of two conditions is acheived: field B filled or filed C has a specific value Hi I have control panel for news website with three filed source writer_id place_id I need "source" to be required…
0
votes
1 answer

Unless and Until in programming languages

What is the difference between if (false == ) and if (!) and unless () What is the difference between while (false == ) and while (!) and until () Why isn't unless and until…
0
votes
2 answers

(Liquid) Checking for a variable in an array

I’m looking to find if the title of the current collection page exists inside the array of shop.vendors and display a div only if the collection page title does not exist in the array. From the documentation it seems like I should be able to do this…
0
votes
2 answers

why the unless function in perl isn't working

I was writing a simple perl script which calculates payment based on the hours given by the user and the program mustn't allow payments above 500 hrs but has to allow upto 600 for females, and I was using the unless function but it is not working it…
akram seid
  • 91
  • 5
0
votes
1 answer

How can I make an "Unless condition" in an IF statement c++

I'm making blackjack in C++ and I'm nearing the end! I'm making my winning and loss statements. But my issue is that I need my if statements to determine not only whether or not the dealer's/players hand is greater or less than one another it needs…
Hostyle27
  • 11
  • 4
0
votes
1 answer

shell built-ins fail in exec statement

I have the following exec statement: exec { 'enable-locale': command => 'sed -i "/^#en_US.*/s/^#//" /etc/locale.gen', provider => shell, # for grep …
qdii
  • 12,505
  • 10
  • 59
  • 116
-1
votes
1 answer

Using a one-line unless or if statement in Ruby

I am new to Ruby. I am looking for an elegant one line solution to this line of code: puts "Year: ".colorize(:light_blue) + "#{instrument.year}" I would like it to print "N/A" if instrument.year is "" (an empty string). I imagine an unless, if or…
mlgvla
  • 17
  • 3
-2
votes
1 answer

Ruby unless vs if logic

Can someone please explain this behavior? Why does nil return true when result = true if i but returns false when result = false unless i unless case screenshot def my_all?(pattern = nil) result = true my_each do |i| case pattern when nil p…
dili021
  • 58
  • 6