Does RubyMine have a way to know what the node object is in Chef?

Answered

Looking to test recipes in RubyMine out, but basic node object values aren't seen as valid variables in RubyMine. I'm doing someting like this:

if node['platform'] == 'windows'
puts "Test"
end

 

Any recommendations to get this working or not really a possibility here?

 

4 comments
Comment actions Permalink

Hello,

just to be sure, do you mean that the code provided is highlighted? Could you please attach a screenshot?

0
Comment actions Permalink

No, I mean in chef there is a node object you can query. RubyMine is not able to see this object to query it so that 100% proper chef statement above does not work in RubyMine, or any IDE really. I think the power of the IDE will be useful once it is able to talk to the node object. It is kinda useless without it since Chef depends on looking at the node object (where you want to be) to decide if it needs to make changes during convergence.

0
Comment actions Permalink

Is it about providing completion for node object's attributes? It'd be great if you could provide a project sample on our tracker with your expectations so that we can investigate it better https://youtrack.jetbrains.com/issues/RUBY (or you can write me to rubymine-support@jetbrains.com)

0
Comment actions Permalink

A very important way chef works with servers during convergence is it will save data about a node every time it converges. This data is very important for development because typically you look for current system states in that node data. The recipes you're programming will typically compare the current system state to desired system state to decide how it willl run logisitically.

It looks like no IDE out there is smart enough to take into consideration NODE data of a machine you're developing on. While you can use KITCHEN do look at node data manually, this is not really an efficient way as a developer to program.

I think if RubyMine was the first to add this functionality, it would pretty much own the majority market share of Chef Developers.

Good luck if you implement it, thanks!

-Lance

0

Please sign in to leave a comment.