Ruby and WS-Security - ruby

I'm having troubles finding good Ruby libraries that implement WS-Security. I've seen wss4r but have yet to use it (and the documentation is a bit light on it). What libraries do you use for this task, or is there a better alternative?

I don't work with soap much myself, but this ruby extension is on my list of things to try: here. Might want to check it out.

Related

How good enough it is to build a REST Api based server in C++?

I am looking from a security perspective and are there any frameworks available to build and use JSON?
I am interested because of the performance which C++ can offer. Currently, Python and Node.js are also available option for me. How can I decide which language+framework should I use ?
Appreciate your support.
Thanks !
PS. - Currently, I am using Java Spring to implement restful apis.
There's plenty of them out there. The absolute simplest one I found, and use, is this. https://github.com/eidheim/Simple-Web-Server .
There are clearly more sophisticated ones out there, just "ask the google". I don't know of any exhaustive comparisons between these frameworks and the ones you specified. However, you could write your own simple benchmarks around the domain you're most interested in. That's what really matters, right?
For json libs there's rapidjson and spirit json. Don't waste your time with boost::property_tree, it's not fully fleshed out wrt JSON.
As for speed. It's compiled so.... its a good possibility that a C++ framework will outperform one based on an interpreted language. So lets say it's faster, you have a heck of a learning curve to climb (assuming you don't know C++ already) but in the end, in my humble opinion it's worth it. I've done these before in Python and Ruby. I really enjoy having the compiler check types. My code is more robust, it does what I tell it to do, and I'm not forced to use exceptions.
Tip: get a code completion plugin like YouCompleteMe

Can you use ruby for web pages other than ruby on rails?

Is Ruby primarily only used in ruby on rails? Is it used on the server side for general work like php is? Also, I haven't seen a lot of hype about rails anymore. Is Ruby and/or RoR dead or fading away?
I ask because I was interested in RhoMobile for building mobile apps, but I didn't want to get into using an antiquated language.
Thanks.
edit: Can i use Ruby for web pages if I don't want to use rails? (I do not mean another framework. I mean like php.)
Regarding your question about Ruby and/or RoR dead or fading away, look at the job trends
There are many web-frameworks for Ruby, not just Rails, Sinatra being one of them.
You shouldn't be deciding to use a language or technology, because there is or there is not a hype around it.
If a product is able to solve your problems, then you should use it. I know people building stuff in Smalltalk nowadays (who would have thought, right?), because it's great and it works.
Take a look at Sinatra, for example.
Also there is a lot of tools written entirely in ruby.

Ruby: Using Reek as a Training Tool

Would Reek be useful in training a ruby noob in good practices or does it require an experienced ruby eye to use and interpret?
I have mumble-muble years or programing experience but mostly in C variants. I've used Ruby lightly for the last few years as a utility scripting language but my ruby code is obviously largely just transliterated C. Now I wish to use it as a serious tool and I want to learn the "ruby way."
I've planned to use TDD/BDD from the start to provide the necessary training feedback and it looks like perhaps Reek might be useful in providing feedback about non-standard forms and uses. However, by long experience, I know that such tools can be two-edged swords that require prior experience to use and in hands of novice cause more problems than they solve.
Does anyone have experience in using reek (or a similar tool) in this way?
If it matters, I will be focusing initially on writing stand-alone applications for MacOS X i.e. no rails, server-stuff, etc.
No, Reek is not intended to be a Ruby style checker. If you want such a thing, I'd suggest Roodi -- or, better yet, pairing with someone who can show you good Ruby style.
I wrote Reek as a little research project, and frankly it isn't as useful as simpler tools such as flay, flog and rcov. Learn to be a better coder by eliminating duplication and complexity, and by TDDing your code.
Reek warns about possible design issues (and some more trivial things), but it does not help you write idiomatic Ruby. Frankly, I think reading the features is just as valuable as actually running reek.
My advice for someone coming from C-like languages: get the for-loop out of your system. Pretend it does not exist. That will force you into more rubyish idiom.
Have a look at RuboCop
It detects many small things, and can even auto-correct some of them. If you use Git, you can stash your changes before you run RuboCop, so you can see the corrections using git diff.
I had to work to force myself into the TDD mindset and I am finding the toolkit provided by the metrical gem (a wrapper for metric_fu) pretty helpful. In fact I'd recommend going through all of the Railscasts on testing - it's not a huge time sink and I found it valuable.
The recent Railscast on how he does testing is a great way to set things up, then I went back and went through the other tutorials on Request Specs, Capybara, Metrical etc.

safe browsing with ruby

any usable ruby code to interact with the safe browsing API from google?
i did search at google but i didn't find any mature and solid code.
I have 3 points:
(0) I'd say that This looks alright, as does this
(1) Having used quite a few ruby gems for various obscure things, I find bugs all the time. It helps the open source community and the world if you find a gem, fix a bug, and let the rest of the world benefit by submitting a pull request. Tests make the life of a contributor sooooooooooo much easier, and guarantee that your fix works, so use gems with extensive tests where possible, even if they are not mature and you half-expect them to fail.
(2) From experience, gems which have lots of objects encapsulating something can sometimes be counterproductive. This has tripped me up in the case of the ruby mail gem and the tire gem (though that's not to say that they are not good and incredibly useful gems.). This applies to you if you only need to make one type of API call, say, and take a simple action. Using the simplest gem is sometimes advantageous, and for this purpose you might not need to use any gem at all! Just write a class that uses Net::HTTP to call the HTTP API: https://developers.google.com/safe-browsing/lookup_guide

What is an easy way to display graphs in Ruby?

I am looking at some graphing options, and would like one that has the cleanliness of Sparklines gem but that doesn't require Rmagick. I'd like one with some clear tutorials, too.
Check out http://railscasts.com/episodes/223-charts as a possible solution.
What's the problem with Rmagick? I'm just thinking a little more info might help, but because of that restriction I guess my answer probably won't suit you either--I'd say switch to JRuby and use any of the packages available on the jvm.
I use win32ole to get Excel to create graphs. Probably more suitable if you're on a desktop rather than a web server.

Resources