Category Archives: WSU

It’s A New Dawn, A New Day, A New Life…In Testing (10/28/16 Week 6)

And it feels soooo goooood!

What’s good? When we people get to do their things their own way. Where there are no strings or repetitive procedure to tie down the curiosity of the human mind. The fact where you do not have to ask the same questions over and over again, or drive to the same location every weekday  or even ordering the same cheese pizza with no toppings. You are you, and switching everything up makes life feel refreshing again. This principle isn’t just in one’s daily life, but can also be applied to the average software tester.

d25c45e5362e4789a710570edcb99f80

When you start as a software tester, you are probably very excited of the day ahead eager to begin your new chapter in life. That’s great! Keep that spirit up, because when you start out testing, you are mostly like going to be given the same test cases over and over again hence the mighty potential to drain your energy for the love of testing. But don’t let that get to you at all, it doesn’t have to be that way! Even though in the end orders are orders, its worth taking a leap of faith and dumping all of those repetitive test case procedures, and start making you own documentation!

Yes, you may be new so you may not have enough experience to derive your own test cases. But that does not mean that you are not skilled! Many reasons why one would want to make new test case documentation from scratch could either range from new testing environments, new or modified code, and more importantly, its a lot more fun!

The next time you use old repetitive test cases, make sure you do whatever you can in your power to use newly developed ones by yourself instead. After all, being a software tester includes doing whatever it takes to make stuff work right. Nothing hurts when it comes to a slight bit of change.

(Source : http://www.testthisblog.com/2016/03/start-from-scratch-vs-old-test.html)

From the blog CS@Worcester – Dan's Tech Rant by danbarbara and used with permission of the author. All other rights reserved by the author.

How To Be The Terminator (10/21/16 Week 5)

It is your duty to protect the world from devastation.. the world of the software you are working on that is!

Fret not, it is not a difficult task. Previously, it has been mentioned the tactics of organization has led to perfect control and containment of peace amongst the living entity known as the source code.  However, it is not until one is in the moment where they realize it was easier said than done. They may have had a basic plan to tackle infestation of software bugs letting the tranquility of software compile happily, but one can not be too prepared when about to face what they are looking for. One must know how to REACT.

You are not just a software tester. You are a pokemon trainer, Indiana Jones, and Sherlock Holmes. You are just about everything that you need to be before you become the terminator itself!

9100616-cartoon-superhero-office-nerd-punching-the-air-stock-vector

You may have spotted a bug, but it wasn’t a satisfying as the bug when away forcing you to reproduce what ever you did to bring it back. This is where you put your pokemon hat on and grab those pokeballs, as you go retracing your steps finding the creature you wanted to catch before.

Once you have captured your bug, its not over. There could be more bugs located around the area where the bug you found and reported was. You must scan the surrounding of the code itself and use your discoveries to find the treasure (the other bugs). It doesn’t hurt to pretend wearing a cowboy hat while you do that too.

After scoping out the area, the magnifying glass will help you analyze the data other findings you may have encountered in which you can estimate a rough idea of how far certain problems can spread or how severe they can be when the software is launched.

Lastly, all information must be reported to the headquarters. Once everyone is aware, the process of termination can begin. After shining the spotlight on the possible trouble that may negatively effect the sweet result of the creation, the evil pesticides may be overridden and the world may be saved once again.

Just remember to REACT properly, and as a QA tester you should feel proud of yourself. Your actions have you been deemed as a super hero… cape may or may not be included. Your identity may be anonymous to the public, but rest assured no good deed goes unpunished. As long as you stay by the morals of Reproducing, Exploring, Analyzing, Communicating, and Triage, you may be one step closer on ending the epidemic of a bug-riddling source code.

(source: http://www.brendanconnolly.net/react-to-bugs/)

From the blog CS@Worcester – Dan's Tech Rant by danbarbara and used with permission of the author. All other rights reserved by the author.

Small Amount of Nails, Many Big Holes. (10/14/16)

Have you ever been to one of those batting cages where there is a machine that shoots a baseball straight at you to hit it? Usually it shoots the ball going off based on a timed interval or its continually controlled using some kind of remote control. Imagine this machine in particular is processing based on a timed interval, but the machine secretly had sophisticated AI installed and starts acting on its own pumping out dozens of balls at a fast speed per second. The large amount of balls whip right to you at a certain speed and the only thought you have in your mind is how in the world do you get out of there before getting injured. Usually one would get hit before they manage to move out of the way completely (at least in this scenario), but there is a much more deliberate response to such a situation: focus on hitting the balls that are aiming toward your body with your ninja skills/reflexes and exclude the balls that you know will be far enough to miss hitting you, until the machine runs out of balls that is.

Now in the software testing world, this machine is the software that has been developed for you to test. And the balls that the software is shooting at you, are the bugs. These bugs are within the software are annoying, and most importantly get you in trouble if not reported or dealt with. Bugs can range from software-breaking bugs (the baseballs aiming for your body), or small minor bugs (the baseballs that are no where close to you) that can be over looked. It is up to you (yes you are the only QA guy in the company again), to make sure bugs that are discovered are taken care of in a way where the most important ones are set as high priority and the not so threatening ones to be set in the  “we will get to it whenever we get to it” category. Of course, everything depends on the time you have before the software launches or puts an update out. Getting the best product within the constraints giving to you all depends on you, QA.

tumblr_lzd6aldfmg1qe736z

It’s not that bad really, with a little bit of organizing you can create simple and understanding charts detailing the bugs you found along with given them a label based on threat level and priority. Where you tag a minor bug as level 0 for “eh, whatever” or tagging a more severe as level 5 for “WE GOT A 23-19! WE GOT A 23-19!” Some great ways of prioritizing bugs can be found on Software Testing Stuff’s how to prioritize bugs numerically blog. It’s always a good practice to sort out bugs, let alone will be easier to communicate with the rest of the developer team with easy-to-use charts.

I hope you are good at playing find and seek and know gold from bronze, it shall help you on your quest to prioritize the little insects that need to be squashed.

Source: http://www.softwaretestingstuff.com/2011/09/how-to-prioritize-bugs-numerically.html

From the blog CS@Worcester – Dan's Tech Rant by danbarbara and used with permission of the author. All other rights reserved by the author.

Not Your Dream Job: Video-game Testing (10/7/16)

WIP

 

 

Source: http://www.softwaretestingtricks.com/2014/08/tips-for-becoming-expert-video-game-tester.html

From the blog CS@Worcester – Dan's Tech Rant by danbarbara and used with permission of the author. All other rights reserved by the author.

If It Breaks, It’s All Your Fault (9/30/16)

fault-injection-software-testing

Ever had the chance to work in QA before? Sitting in a cramped space repeated test cases over and over again on different builds for 8 hours plus overtime a day for 5 days a week? Its not that bad, not at all. You are just doing your job which completely relies on patience (you know that thing many people don’t really have now-a-days) with the occasional trip to the vending machine once every couple hours. Oh and more thing, the entire project you are working on relies solely on your shoulders, if something breaks at launch and you never found it, or if you found an issue that was never fixed, the fingers all point to you (or the other QA lab rats you work with, but since you’re reading the blog, you’re the only one working in QA).

Kind of funny how its the guy that barely resembles anything in the SCRUM chart that tries their very best so the people receive the greater good of the product they are working on,  and in some cases they end up proud for what they did. Infused in their minds the reason, “well, we have to start somewhere to move up”, they had to keep track of SO many actions by jotting down a load of test cases, and using different platforms/devices to do the same thing over and over again, but if QA is happy with the product then the customers will be too. But will they care? It’s not like they will be SO happy with the product they search hard enough to find who worked on it or tested it so they can thank them properly. When its the complete opposite though, then people care enough to rant to the company that made the product and then all that hate gracefully trickles down to you, the guy that is suppose to expose the broken to be un-broken.

Want an example of the type of  bugs that could’ve been missed or not fixed before launch? Unexpected behaviors. A really great demonstration of that is a fun test using hot key conditions conducted by QA Hates You. When testing Mozilla Thunderbird, (an e-mail hub app kind of like Outlook),  QA Hates you manages to trigger unexpected behaviors in the app by doing two actions at the same time that the users would never do. Will QA testers ever test the irregular activities of human beings or just what they always do instead? Whatever you choose to do whether instructed or not instructed to do as being the QA guy, just remember: if it breaks, it’s your fault.

Source: http://qahatesyou.com/wordpress/2016/08/fun-test-hot-key-race-conditions/

 

 

From the blog CS@Worcester – Dan's Tech Rant by danbarbara and used with permission of the author. All other rights reserved by the author.

Bull-sh*t Anti-Viruses (9/23/16)

stupid

Software Seller: Hello, would you like any anti-virus software for your new computer?

Translation: Hello potential victim, can we get more money from you based on your *unawareness of technology?

Innocent and unnecessarily worrying customer: Um, i don’t know. It’s a bit expensive.

Translation: There isn’t any.  They are innocent. 

Software Seller:  We highly recommend you get ant-virus software, or your computer *will* most likely get infected.

Translation: We really really REALLY want your money, worry about this because it will help persuade you to give us your money.

Innocent and unnecessarily worrying customer: Oh ok, I’ll take it.

Translation: You know more than me sooo…

Software Seller:  Awesome.

Translation:  

image

 

*unawareness: a nicer way to say stupid


 

In the common world, if there is a villain there is a hero just for the sake of balancing.. this world isn’t common. Nowadays, if there is a villain there is another villain disguised as a hero. That other villain is your average everyday anti-virus.

windows_7_compatible_antivirus_software

Take a good look at the picture above. Each one of those is a program in existence that does not need to exist, if it does its solely because of human error.

People feel comfortable seeing a big huge screen pop up whenever you are on your computer or even when you boot it up everyday where there is a big green check mark saying you are secured. But are you?

If you feel comfortable about the fact that the majority of your computer’s power being taken just to scan every file you click on or every program you want open for infectious data that doesn’t even need to be smart enough to sneak through your viruses, then there is a problem.

If you are willingly paying per year for an anti-virus that usually sees threats as temporary cookies that are harmless or for an anti-virus that doesn’t do anything when you know for sure you are infected, you’re not doing something right.

If people want to know why viruses appear on laptops, its simple! It’s because they let it happen!

As of today, computers with Windows 10 and Mac computers do not get viruses out of the blue. The reason why is short and sweet- they do whatever they can to make sure you don’t let it through.

People download stuff. This is how viruses come up. No, it doesn’t appear out of the blue. People torrent illegal content, or they think a fishy site is legit. If they see free they go for it, or if a prompt pops up they click allow to have the program download. The human brain is the best anti-virus you will ever have.

You are the one controlling what goes through and doesn’t and the so called anti-viruses you buy for the store or google to get for free do not operate for that because you gave these viruses permission to access your computer.

For windows 7/8/ and 10, they have a built in security system that does not take a lot of power, don’t need to scan regularly, doesn’t make your computer slow and its called Windows Defender. You don’t need internet for it unless you want to update it, but its already there! If you get an anti-virus it wont activate since the computer senses you have security software. Defender is pretty much common sense for your brain, that is if the prompts and warnings windows give you doesn’t alert your attention you are about to infect your laptop.

For mac, by default 3rd party applications are not allowed to be downloaded, for your safety. On top of that, every-time you need to download something it will ask for your user credentials and also give you pop ups to re-think your choice if need be.

As mentioned previously, the best anti-viruses in the world is your brain. Your common senses knows all. Only you can prevent wildfires, only you can prevent infections on your electrical, button-pushing, folding sandwich box.

 

 

From the blog CS@Worcester – Dan's Tech Rant by danbarbara and used with permission of the author. All other rights reserved by the author.

system.out.println(“hello world”);

Greetings fellow inhabitants of planet earth.

home-character-oh

Using your technological purchases, such as this laptop or tablet or phone you are most likely using  right now, you demand extra features such as connection to the world wide web. I know you demanded internet, otherwise you would not be reading this post right now.

I mean, i get it. It’s great. We need internet. But every bit of greatness comes at a price. Now, I don’t know why but I have unwillingly decided to take a few minutes a week (give or take time for procrastination) to highlight the ‘comes at a price’ part.

For now you only need to know three things:

  1. Please don’t stop reading to take a selfie, now isn’t the time for that.
  2. Your great, great, great, grandparents would be ashamed for succumbing to the laziness of the future.
  3. I’m pretty sure that you are an iPhone user, if not then you might be able to escape this trapped illusion society has been dragged into.

Welcome to my tech rant. No button-pushing users allowed.

Dan

 

 

From the blog CS@Worcester – Dan's Tech Rant by danbarbara and used with permission of the author. All other rights reserved by the author.

call-with-container: Linux containers for GNU Guix

Containers have become a hot topic. Docker, LXC, Rkt, systemd-nspawn,
etc. are popular and make a lot headlines on technology news websites.
There are even entire conferences dedicated to "containerization."
The next release of GNU Guix, a purely functional package manager,
will feature basic support for Linux containers, dubbed
call-with-container. GNU Guix is written in the Guile Scheme
programming language. Thus, in typical Scheme fashion, we have used
the call-with-* naming convention (like our old friend
call-with-current-continuation, for example) to refer to the
container implementation, which allows the user to apply an arbitrary
Scheme procedure in a new, containerized process. For those familiar
with Guile, it’s like a fancier version of primitive-fork. In
addition to forking via clone(2), call-with-container unshares
resources such as the network, mount, and user namespaces from the
host system and creates a temporary file system in a chroot (though we
actually use pivot_root instead), among other things.

So, given the fast-paced world of Linux container development and the
companies investing huge sums of money into the aformentioned tools,
why add another implementation to the mix? What’s wrong with the
status quo? What can Guix possibly add? Let’s dive into the
motivation behind Guix containers, how they differ from the status
quo, and how they solve issues that other implementations cannot.

The Trouble with Disk Images

The term "container" has in practice come to mean a disk image whose
binaries are run in a lightweight virtualization with kernel
namespaces. Docker and friends work with raw disk images, or layers
of them, as their fundamental data unit. There are several issues
with this approach. This presents issues with regards to disk and
memory usage and file system complexity. Containers typically include
the minimal core software of a GNU/Linux distribution within them,
plus the extra software that is application-specific.

WRITEME: Deduplicating software amongst containers via
content-addressable storage (/gnu/store) and full dependency graph

Imperative vs. Functional – The Dockerfile Problem

WRITEME: Functional > Imperative. Mention issues with imperative
Dockerfiles and how the order of operations influences how well the
cache is utilized. Docker cannot possibly know the details that Guix
knows because Docker defers to other package managers to do things
that are opaque to it.

Guix and GuixSD Containers

WRITEME: Simple, unprivileged containers with ‘guix environment’. Add
example for sharing file systems from the host.

WRITEME: GuixSD containers with ‘guix system container’. Mention the
use of a real init system (dmd) and the full-system configuration
language.

WRITEME: An arbitrary Scheme script that launches a container, showing
that (guix build linux-container) is a generic library to be re-used as
you wish.

Future Work

WRITEME: The future: cgroups, networking, orchestration. Reach out
for contributors.

As an aside, before I bid you farewell, dear reader: I live in the
Boston area and I’m looking for local meetups and conferences that
would welcome a technical presentation about GNU Guix and the benefits
of the functional package and configuration management paradigm. If
you have the connections and I have piqued your interest, please send
an email to davet at gnu dot org.

From the blog dthompson by David Thompson and used with permission of the author. All other rights reserved by the author.

Web Development with Guile Scheme

Guile Scheme is a wonderful general-purpose programming language. I
use it for simple scripting, systems programming, game programming,
and of course, web programming. I think that, despite not having the
wealth of libraries available in Ruby/Java/etc., Guile provides an
excellent environment for web programming thanks to its advanced
features: First-class and higher-order functions, hygienic macros,
pattern matching, quasiquote, and REPL server.

Guile ships with a nice, small set of HTTP modules in the (web)
namespace that expose data types for URIs, HTTP requests, and HTTP
responses. Guile also provides an HTTP client and server. What makes
Guile’s web modules stand out from a lot of other languages is that
they use expressive data types to represent URIs and HTTP headers
rather than treating them as strings. This eliminates an entire class
of bugs and security vulnerabilities caused by mishandling "stringly
typed" data, such as header injection. Using expressive data types
will be a common theme amongst all components of the web programming
tools I will describe below. Now, let’s see how to write a web
application with Guile!

Handling Requests

WRITEME: Status quo: String-based routes

WRITEME: Guile: Pattern Matching

Rendering Responses

WRITEME: Status quo: String-based templating

injection bugs

WRITEME: Guile: SXML and SJSON

Iterative Development

WRITEME: Status quo: Auto-reloading changed files

WRITEME: Guile: REPL server

From the blog dthompson by David Thompson and used with permission of the author. All other rights reserved by the author.

Ruby on Guix

I’ve been working with Ruby professionally for over 3 years now and
I’ve grown frustrated with two of its most popular development tools:
RVM and Bundler. For those that may not know, RVM is the Ruby version
manager and it allows unprivileged users to download, compile,
install, and manage many versions of Ruby instead of being stuck with
the one that is installed globally by your distro’s package manager.
Bundler is the tool that allows developers to keep a version
controlled "Gemfile" that specifies all of the project’s dependencies
and provides utilities to install and update those gems. These tools
are crucial because Ruby developers often work with many applications
that use different versions of Ruby and/or different versions of gems
such as Rails. Traditional GNU/Linux distributions install packages
to the global /usr directory, limiting users to a single version
of Ruby and associated gems, if they are packaged at all. Traditional
package management fails to meet the needs of a lot of users, so many
niche package managers have been developed to supplement them.

Taking a step back, it becomes apparent that dependency isolation is a
general problem that isn’t confined to software written in Ruby: Node
has npm and nvm, Python has pip and virtualenv, and so on. A big
limitation of all these language-specific package managers is that
they cannot control what is outside of their language domain. In
order to use RVM to successfully compile a version of Ruby, you need
to make sure you have the GCC toolchain, OpenSSL, readline, libffi,
etc. installed using the system package manager (note: I’ve seen RVM
try to build prerequisites like OpenSSL before, which I then disabled
to avoid duplication and security issues and I recommend you do the
same.) In order to use Bundler to install Nokogiri, you need to make
sure libxml2 has been installed using the system package manager. If
you work with more than a single language, the number of different
package management tools needed to get work done is staggering. For
web applications, it’s not uncommon to use RVM, Bundler, NPM, Bower,
and the system package manager simultaneously to get all of the
necessary programs and libraries. Large web applications are
notoriously difficult to deploy, and companies hire a bunch of
operations folk like me to try to wrangle it all.

Anyway, let’s forget about Node, Python, etc. and just focus on Ruby.
Have you or someone you work with encountered hard to debug issues and
Git merge conflicts due to a problem with Gemfile.lock? Bundler’s
fast and loose versioning in the Gemfile (e.g. rails >= 4.0)
causes headaches when different users update different gems at
different times and check the resulting auto-generated
Gemfile.lock into the repository. Have you ever been frustrated
that it’s difficult to deduplicate gems that are shared between
multiple bundled gem sets? Have you looked at the RVM home page
and been frustrated that they recommend you to curl | bash to
install their software? Have you been annoyed by RVM’s strange system
of overriding shell built-ins in order to work its magic? I’m not
sure how you feel, dear reader, but my Ruby environments feel like one
giant, brittle hack, and I’m often enough involved in fixing issues
with them on my own workstation, that of my colleagues, and on
production servers.

So, if you’re still with me, what do we do about this? How can we
work to improve upon the status quo? Just use Docker? Docker is
helpful, and certainly much better than no isolation at all, but it
hides the flaws of package management inside an opaque disk image and
restricts the environments in which your application is built to
function. The general problem of dependency isolation is orthogonal
to the runtime environment, be it container, virtual machine, or "bare
metal." Enter functional package management. What does it mean for a
package manager to be functional? GNU Guix, the functional package
manager that I contribute to and recommend, has this to say:

GNU Guix is a functional package management tool for the GNU
system. Package management consists of all activities that relate
to building packages from sources, honoring their build-time and
run-time dependencies, installing packages in user environments,
upgrading installed packages to new versions or rolling back to a
previous set, removing unused software packages, etc.

The term functional refers to a specific package management
discipline. In Guix, the package build and installation process
is seen as a function, in the mathematical sense. That function
takes inputs, such as build scripts, a compiler, and libraries,
and returns an installed package.

Guix has a rich set of features, some of which you may find in other
package managers, but not all of them (unless you use another
functional package manager such as Nix.) Gem/Bundler can do
unprivileged gem installation, but it cannot do transactional upgrades
and rollbacks or install non-Ruby dependencies. Dpkg/yum/pacman can
install all build-time and rumtime dependencies, but it cannot do
unprivileged package installation to isolated user environments. And
none of them can precisely describe the full dependency graph (all
the way down to the C compiler’s compiler) but Guix can.

Guix is written in Guile, an implementation of the Scheme programming
language. The upcoming release of Guix will feature a Ruby build
system that captures the process of installing gems from .gem
archives and a RubyGems import utility to make it easier to write Guix
packages by using the metadata available on https://rubygems.org.
Ruby developers interested in functional package management are
encouraged to try packaging their gems (and dependencies) for Guix.

Now, how exactly can Guix replace RVM and Bundler? Guix uses an
abstraction called a "profile" that represents a user-defined set of
packages that should work together. Think of it as having many
/usr file system trees that can be used in isolation from the
others (without invoking virtualization technologies such as virtual
machines or containers.) To install multiple versions of Ruby and
various gems, the user need only create a separate profile for them:

guix package --profile=project-1 --install ruby-2.2 ruby-rspec-3
# Hypothetical packages:
guix package --profile=project-2 --install ruby-1.9 ruby-rspec-2

A profile is a "symlink forest" that is the union of all the packages
it includes, and files are deduplicated among all of them. To
actually use the profile, the relevant environment variables must be
configured. Guix is aware of such variables, and can tell you what to
set by running the following:

guix package --search-paths --profile=project-1

Additionally, you can also create ad-hoc development environments with
the guix environment tool. This tool will spawn a sub-shell (or
another program of your choice) in an environment in which a set of
specified packages are available. This is my preferred method as it
automagically sets all of the environment variables for me and Guix is
free to garbage collect the packages when I close the sub-shell:

# Launch a Ruby REPL with ActiveSupport available.
guix environment --ad-hoc ruby ruby-activesupport -E irb

In order to make this environment reproducible for others, I recommend
keeping a package.scm file in version control that describes the
complete dependency graph for your project, as well as metadata such
as the license, version, and description:

(use-modules (guix packages)
             (guix licenses)
             (guix build-system ruby)
             (gnu packages)
             (gnu packages version-control)
             (gnu packages ssh)
             (gnu packages ruby))

(package
  (name "cool-ruby-project")
  (version "1.0")
  (source #f) ; not needed just to create dev environment
  (build-system ruby-build-system)
  ;; These correspond roughly to "development" dependencies.
  (native-inputs
   `(("git" ,git)
     ("openssh" ,openssh)
     ("ruby-rspec" ,ruby-rspec)))
  (propagated-inputs
   `(("ruby-pg" ,ruby-pg)
     ("ruby-nokogiri" ,ruby-nokogiri)
     ("ruby-i18n" ,ruby-i18n)
     ("ruby-rails" ,ruby-rails)))
  (synopsis "A cool Ruby project")
  (description "This software does some cool stuff, trust me.")
  (home-page "https://example.com")
  (license expat))

With this package file, it is simple to an instantiate a development
environment:

guix environment -l package.scm

I’m not covering it in this post, but properly filling out the blank
source field above would allow for building development snapshots,
including running the test suite, in an isolated build container using
the guix build utility. This is a very useful when composed with
a continuous integration system. Guix itself uses Hydra as its CI
system to perform all package builds.

As mentioned earlier, one of the big advantages of writing Guix
package recipes is that the full dependency graph can be captured,
including non-Ruby components. The pg gem provides a good example:

(define-public ruby-pg
  (package
    (name "ruby-pg")
    (version "0.18.2")
    (source
     (origin
       (method url-fetch)
       (uri (rubygems-uri "pg" version))
       (sha256
        (base32
         "1axxbf6ij1iqi3i1r3asvjc80b0py5bz0m2wy5kdi5xkrpr82kpf"))))
    (build-system ruby-build-system)
    (arguments
     '(#:test-target "spec"))
    ;; Native inputs are used only at build and test time.
    (native-inputs
     `(("ruby-rake-compiler" ,ruby-rake-compiler)
       ("ruby-hoe" ,ruby-hoe)
       ("ruby-rspec" ,ruby-rspec)))
    ;; Native extension links against PostgreSQL shared library.
    (inputs
     `(("postgresql" ,postgresql)))
    (synopsis "Ruby interface to PostgreSQL")
    (description "Pg is the Ruby interface to the PostgreSQL RDBMS.  It works
with PostgreSQL 8.4 and later.")
    (home-page "https://bitbucket.org/ged/ruby-pg")
    (license license:ruby)))

Note how the recipe specifies the PostgreSQL dependency. Below is the
dependency graph for ruby-pg as produced by guix graph, excluding
the GCC compiler toolchain and other low-level tools for brevity.
Pretty neat, eh?

Given that Guix doesn’t yet have many gems packaged (help wanted), it
can still be advantageous to use it for getting more up-to-date
packages than many distros provide, but in conjuction with Bundler for
fetching Ruby gems. This gets RVM out of your hair whilst creating a
migration path away from Bundler at a later time once the required
gems have been packaged:

cd my-project/
guix environment --ad-hoc ruby bundler libxml2 libxslt # etc.
# A small bash script can be used to make these gem sets.
mkdir .gems
export GEM_HOME=$PWD/.gems
export GEM_PATH=$GEM_HOME:$GEM_PATH
export PATH=$GEM_HOME/bin:$PATH
bundle install

As you’ve seen in the above package snippets, Guix package definitions
are typically very short and rather easy to write yourself. The
guix import gem tool was made to lower the barrier even more by
generating most of the boilerplate code. For example:

guix import gem pry

Produces this Scheme code:

(package
  (name "ruby-pry")
  (version "0.10.1")
  (source
    (origin
      (method url-fetch)
      (uri (rubygems-uri "pry" version))
      (sha256
        (base32
          "1j0r5fm0wvdwzbh6d6apnp7c0n150hpm9zxpm5xvcgfqr36jaj8z"))))
  (build-system ruby-build-system)
  (propagated-inputs
    `(("ruby-coderay" ,ruby-coderay)
      ("ruby-method-source" ,ruby-method-source)
      ("ruby-slop" ,ruby-slop)))
  (synopsis
    "An IRB alternative and runtime developer console")
  (description
    "An IRB alternative and runtime developer console")
  (home-page "http://pryrepl.org")
  (license expat))

One still has to package the propagated inputs if they aren’t yet
available, add the necessary inputs for building native extensions if
needed, and fiddle with the native inputs needed to run the test
suite, but for most pure Ruby gems this gets you close to a working
package quickly.

In conclusion, while support for Ruby in Guix is still in its early
days, I hope that you have seen the benefits that using a
general-purpose, functional package manager can bring to your Ruby
environments (and all other environments, too.) For more information
about Guix concepts, installation instructions, programming interface,
and tools, please refer to the official manual. Check out the
help page for ways to contact the development team for help or to
report bugs. If you are interested in getting your hands dirty,
please contribute. Besides contributions of code, art, and docs,
we also need hardware donations to grow our build farm to meet the
needs of all our users. Happy hacking!

From the blog dthompson by David Thompson and used with permission of the author. All other rights reserved by the author.