"Application must run" requirement for Ruby assignment, create gem? [closed] - ruby

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
EDIT: In short, what do I need to do to create a running application in Ruby, do I need to create a gem?
ORIGINAL QUESTION THAT SUCKED:
I've never taken any programming classes, or had assignments before so I'm asking this question in hopes this is clear to someone who has had many programming assignments before.
Basically the instructions state, "The Application must Run."
The instructions on the assignment uploader state that no executable files should be uploaded and the application should be put into a .zip.
For a second I thought I'd just create the app code locally, zip all the files, and upload them, but now I'm second guessing that. It seems like I should create a gem out of my application and then the readme that would be uploaded would instruct them to just install the gem?
Am I on the right track here? I suppose my question can be stated as, I need to create a ruby application that will run, is the best way to do that by creating a gem? Or am I completely over thinking this?
Thank you very much.

The most likely thing is that it means this:
The application must run via executing the command ruby myapp.rb
So it "must run" when you pass the filename of you code to the ruby executable.
Anything else wouldn't make much sense. If you are required to make a gem, that would likely have been explicitly clear. But you should clarify this with your instructor, as there isn't a lot to go on here.

Related

How to read file properties in Go [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm looking for a way to read the properties of a file so that I can programmatically verify a file came from a specific company. I just want to perform the basic checks such as 'is it signed' and 'who signed it' - the information that you can get when you right-click the file and select 'Digital Signatures'. I can't call any OS specific tool (e.g. signtool --verify) and ideally want to avoid any third party libraries as we have a super strict policy in regards to using them.
This will be initially on windows using GoLang and will be used to verify some signed msi files. I was thinking I could load one of the OS dlls to help out but not sure what one would be able to provide that information. If someone can point me in the right direction I should be taking in order to solve this problem or provide a short example of something similiar that would be great.
It sounds like you want to call WinVerifyTrust, WinVerifyTrustEx, or some similar functionality. Searching for golang WinVerifyTrust, it looks like there exists some example go code you could reference for invoking the system's wintrust.dll. Assuming you're willing to write code that only works on Windows, that's probably the direction I would recommend.
From a more cross-platform perspective, you could instead look for OpenSSL wrappers or implementations. Reportedly, Windows PE digital signatures are based on PKCS#7, which OpenSSL should be able to support with enough glue code.

Working with monkey patches [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
Is monkey patching possible in Go as in Ruby?
If so, I have a third party library build, which contains one function called encrypt. Now i want to overwrite the behaviour of the function. Is that possible?
Golang is a compiled language, you'll have to edit the code, recompile and deploy all over again. "monkey patching" isn't possible as if you're talking about changing the software after it is already deployed like ruby. (which is an interpreted language).
But if your concerns are beyond an hotfix and involve adding new code at runtime from external source, you might want to have a look at go plugins.
here's a nice medium post about it.
I'm not big on ruby so to make sure we are on the same page: my understanding is that monkey patching allows you to change the underlying behaviours (methods) attached to a given type at runtime.
In go this would be a big fat no no, probably should be in ruby too for the most part :)
Types are concrete in go, everything has to know what it is dealing with at compile time. It's difficult to propose a solution without a clearer understanding of the end goal, can you provide a more concrete example?

What does gem mean? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am struggling with the concept gem. What does it mean? On jumpstart tutorial I read this
Steve Klabnik, an instructor for Jumpstart, created the sunlight-congress gem.
http://tutorials.jumpstartlab.com/projects/eventmanager.html
What he really did? Did he created the website? Did he created a gem for a website that is already existed?
What do you do when you say
gem 'sunlight-congress'
Please Make sure I am new to programming and explain it in a simple term. I really thank you for your help
See http://guides.rubygems.org/what-is-a-gem/
a gem is kind of a library in the Ruby world, like a Maven artifact in the java world (namely a jar file with identifier and version information and more)
In Ruby, a gem is nothing but a distributed code packaged as a library created by Ruby developer(s). The idea is to keep a particular functionality of code into a library but Ruby does it more beautifully by letting Ruby developers host it on http://rubygems.org/ and library then can used by others. For more information read: http://guides.rubygems.org/what-is-a-gem/

How to use another gem dir in addition to 'lib' [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I've created a Ruby gem with the traditional 'lib' structure, but I also have another directory, say 'more' at the same level as 'lib'. However I cannot seem to access any of the methods in the 'more/*.rb' files. Can anyone tell me what needs to be done?
PS - I know from /Shopify/Liquid that they have a similar situation with 'lib' and 'performance' dirs, and there is a 'performance/shopify/liquid.rb' file and also a 'lib/performance' dir but for the life of me I cannot figure out how all that fits together. If I could resolve that then I think it would also be applicable to my solution.
From liquid's gemspec:
s.require_path = "lib"
It doesn't look like /performance is used in the gem, it's only for benchmarking and testing.
liquid/lib doesn't appear to have a performance directory. Looks like the word 'performance' is only used in the Rakefile really. Again for testing.
You can do this as well, no magic needed, it's just another directory.
If you want to include another directory as a library path, then alter the gemspec require_path value.

Backing up open source gems in case they go away [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
We are wondering how developers deal with the possibility that a gem author deletes the git repository and the gem goes away. Forking/Cloning every gem we use and updating them with every new version of our app starts to get ridiculous if we have hundreds of gem dependencies. How have other developers tackled this potential issue?
You don't have to fork the repo. You just have to clone it. You can always push your clone to a newly-created project later on, if needed.
But yes, this sort of thing has happened before, with all of why the lucky stiff's projects.
The strategy is to stick to the majority. Only use gems that are very popular. The more popular, the less trouble. In case something happens, it is very likely that someone else using the same gem will do something for it.
Have you ever worried that Ruby itself gets abandoned? Have you ever worried that all operating systems die out? Have you ever worried that computers will become extinct? Have you ever worried that electricity supply will become deprecated?

Resources