Railsware Blog

on product management, engineering, design, culture and many more...

Share Rails configuration to Javascript

Share Rails configuration to Javascript

The usual way of storing Rails configuration data are YAML files. In one of our previous posts, we talked about proper way of dealing with Rails configuration. Nowadays, Javascript applications built on top of RESTful API are common practice, and in cases like this configuration data might be duplicated across …

BDD-style testing in Swift with Sleipnir

BDD-style testing in Swift with Sleipnir

Introduction In Objective-C people use different frameworks to write BDD-style tests for their code. Some of them are: Cedar Kiwi Specta With the inroduction of Swift we’ve decided to create BDD-style testing framework in pure Swift. After a couple weeks of implementation we are making the first public version of …

Creation of pure Swift module

Creation of pure Swift module

If you have already started playing with swift, you probably thought about how to include third party libraries into your project or how to distribute yours. Apple provides a mechanism to distribute code via frameworks (eventually, for iOS too), so making a custom framework, which will include both ObjC and …

Composing functions in Swift

Composing functions in Swift

In Swift – the new programming language introduced by Apple – functions are first class citizens. This basically means, that a function can be passed as a parameter, returned from another function or assigned to a value. It allows us to do a lot of useful stuff with them. Function …

Global variables in Swift are not variables

Global variables in Swift are not variables

The title sounds pretty strange, but I will explain what it means. While playing with Swift I’ve faced weird behaviour, a feature in fact, which isn’t covered in documentation (at least I didn’t find any references!). UPD: shame on me, how could I miss this? Global constants and variables are …

ChainFlow – refactor your data processing

ChainFlow – refactor your data processing

TL; DR; This article describes how to refactor and improve readability of complex data processing with syntax similar to Haskell do-notation and State monad. Motivation Latest project I’ve been involved in deals with a lot of data processing. Typical case was a method that receives a data chunk and chains …

Creating books with GitBook

Creating books with GitBook

If you are doing some books/docs writing or attempting to create your first book, you might get interested in this exceptionally nice tool – gitbook. It is a technical book building tool that allows you to embed code samples and exercises, and then generate a great online book that can …

Pitfalls of Rspec boolean matchers

Pitfalls of Rspec boolean matchers

Rspec provides a bunch of build-in matchers. They include matchers that help us work with boolean values. But not always these matchers are safe to use. be_true and be_false matchers I guess everybody used RSpec matchers be_true and be_false. There are a few examples with them:

but it’s good …

Time-comparison-in-Ruby

Time comparison in Ruby

I believe every ruby developer has faced time comparison issue at least once and tests are one of the possible areas where it may happen. RSpec message like this may confuse:

What’s wrong? Investigation Let’s create two Time objects:

At the first glance, they are equal. But it’s …

Interconnecting Elixir nodes

Interconnecting Elixir nodes

Elixir is a functional language built on top of Erlang VM. Therefore it uses Erlang mechanism for communication with nodes. Erlang has one simple rule: everyone connects to everyone. It provides a simple authentication mechanism by tokens called cookie. In this article I want to show how to use remote …