Posts

Showing posts with the label Ruby

Google Cloud DNS API example with ruby

Image
Recently, I did my first steps with Google Cloud DNS API. I was using ruby to do my development and ruby library is in early-stage (May 2017) and has only alpha version. It still works pretty well and I have been able to implement everything I needed. However, I had some hard time to figure out how to do that. Despite there are lots of documentations in the beginning I was a bit confused. There are lots of articles about popular Google API, but not match about DNS and ruby. So I decided to share my experience and put the whole process here in simple steps: Setup Authorization Create record Delete record Update existing record 1. Setup Google provide ruby libriry via gem. To install it simply run: gem install google-api-client or set it with Gemfile. More information can be found on Google's github page: https://github.com/google/google-api-ruby-client Google API has three types of  authentication schemes: API keys Service accounts User accounts ...

URL parser ruby C extension binding with C library re2c lexer

This is step-by-step description how to create Ruby C extension using static library. Creating Ruby extensions is not a complicated task. There are plenty of tutorials and articles. Also Ruby API is clean and well described. For me, an interesting task was to create a Ruby project using external library included in the project within git repository. Lets imaging we want to create Ruby library for parsing text. Lets say, URL. Of course, there is standard Ruby library (URI), and it is ruby code. But if we want something faster,  it is good idea to use C extension.