How to access a data file in a plugin generator? - plugins

I'd like to access a data file I have in the _data folder and use this in a plugin generator, but I'm not sure how. I have:
site.data.projects.each do |project|
...
end
But when I try to compile it tells me "undefined method 'projects' for Hash(...) NoMethodError. What is the correct syntax?

If you post what your _data file looks like I can give you a better answer, but try:
site.data['projects'].each do |project|
...
end

Related

Generate starter code based on new file VSCode

Is there a way to configure some code based on a file extension when created in VS Code? I'm currently working with psioniq file header which has been pretty helpful in generating good header files, but I'm looking to take this a step farther.
When I create a new file, based on a specific file extension, I would like it to generate some starting code that I can configure. For example, I work with Verilog a lot. It would be really cool if Code could generate based on the file name.
Create new file
Code generates some code (like below) or something else that could be configured based on the filetype:
module <filename> (
input ,
output ,
);
endmodule
Anyone have any extensions they know about or resources they can point me to to implement this?
This would be a pretty easy extension to write but an alternative is snippets.
You can create keywords, based on the extensions, that when you type it it'll create all that code for you.
https://code.visualstudio.com/docs/editor/userdefinedsnippets

SoapUI reference attached file to edit contents?

I'm trying to modify the values of an attachment to a SOAP Request to correspond to values that I'm getting from a DataSource. I want to do this with a groovy script. I'm looking for a way to reference the attachment file path so I can edit the file itself but I'm having no luck finding that. Is there any way to do this?
I figured it out after looking at the API for a long time
import com.eviware.soapui.impl.wsdl.support.RequestFileAttachment
def xmlFile = testRunner.testCase.getTestStepByName("YOUR TEST STEP NAME").testRequest.getAttachmentAt(0).getUrl()
xmlFile will contain the full path of the attached file. Wanted to post this here in case someone else was looking for a quick way.

How do I store symbolic links in a ZIP file using Perl?

I'm using Archive::Zip, and I'd like to add symbolic links to an archive that I'm creating. Somehow I can't see how to do that.
It appears that when extracting a ZIP file, Archive::Zip does recognize contained symbolic links. But is there a write API?
Perhaps there's something that can be done by creating an Archive::Zip::Member and setting the (internal? external?) attributes? If so, I don't understand how.
Poking around the source code, it seems the trick is to create a member object, and set the right attributes, like this:
my $zip = Archive::Zip->new();
my $member = $zip->addString( 'plain-file', 'symlink-pointing-to-plain-file' );
$member->{'externalFileAttributes'} = 0xA1FF0000;
I got this from the code that adds files and detects that it is a symlink. Let's hope there aren't any edge cases...

how to connect or load file.dll to matlab?

I want through matlab tutorial but I did not understand it clearly.
Could anyone can explain to me step by step how to load and call .dll functions in matlab?
I tried to use loadlibrary function but I get and error, if anyone can tell we where to put the .dll file and the .h file?
I don't do this often, but i usually do something like:
fullpathToHeader = 'c:\full\path\to\a\header.h';
fullpathToDll = 'c:\full\path\to\a\libraty.dll';
loadlibrary(fullpathToDll, fullpathToHeader);
Then if that works, you can call library functions as:
[outArg1, outArg2, ...] = calllib('library','function',inArg1, inArg2, ...)
See the following link, which contains some problems I encountered and overcame, when trying to load a dll into matlab:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/341602

properties file in maven

i'm using maven properties file for subdivide test and production properties,
in main properties file I have something like this:
...
sender.store=mail#provider.it
sender.order=mail2#provider.it
sender.riesame=mail2#provider.it
riceiver.riesame=${riceiver.riesame}
riceiver.request=${riceiver.request}
...
in test properties i have something like this:
...
riceiver.riesame=mail4#provider.it
riceiver.request=mail5#provider.it
...
for completeness, in pro:
...
riceiver.riesame=mail6#provider.it
riceiver.request=mail7#provider.it
...
when I compile with maven, the properties result file doesn't change ${} variables....
after a lot of tests, i discovered that if I remove '#' char in 'sender.riesame', the properties file results correct!!
i searched in internet something about '#' char, but i don't found nothing
can you help me?
thanks in advance
(i'm sorry for my english)