My First Ruby Gem - https://rubygems.org/gems/binary_puzzle_solver

63 views
Skip to first unread message

Shlomi Fish

unread,
Nov 6, 2012, 1:14:51 PM11/6/12
to isra...@googlegroups.com
Hi all,

today I finally released my first Ruby gem, an incomplete solver for the
so-called Binary Puzzles ( http://www.binarypuzzle.com/ ). See:

* https://rubygems.org/gems/binary_puzzle_solver

* https://github.com/shlomif/binary-puzzle-garden

Currently, documentation is very scarce if not non-existent, I have not settled
on a public API, I have yet to write the command-line program, there
are still many puzzles that it won't be able to solve, and I have not
implemented backtracking yet. Nonetheless, you may wish to take a look.

Here are some things I have learned:

1. http://timelessrepo.com/making-ruby-gems - after following this tutorial
to which its author referred me on IRC, I found that I didn't know what to put
in the Rakefile. As it turns out, just the :test target. See the repository.

2. Then I wanted to be able to upload the gem, so I looked into bundler, and it
created a new skeleton of the gem. After trying one git approach to mergin
them, I gave up and did another approach (of merging the important stuff from
"bundle gem binary_puzzle_solver" into the existing git working copy and
committing. This worked better.

3. My troubles were not over, however. Then I wanted to upload the gem, so I
tried "rake release" and "gem push" and realised I need to register at
rubygems.org. My first attempt with an insane password that contained many
special characters (If you want to know it was:
«
DN,oHZ5_0;$a3+Et_IleWSkM9km'FK
») failed and locked the "shlomif" account for good. Then I tried with
ShlomiFish / shl...@cpan.org and a less insane password (only alphanumeric),
and while I was able to login, the command:

«
curl -u ShlomiFish https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials
»

failed. After some debugging, I realised I revealed my username and password by
pasting the output of curl -vvv on IRC (don't do that!) and so changed the
E-mail to shl...@shlomifish.org and reset the password to something I crafted
by hand, instead of auto-generated, and then it worked.

So I was able to upload version 0.0.1 of the Binary Puzzle Solver.

----------------

I'll probably create a THANKS, CREDITS or AUTHORS file with all the people who
helped me.

If you want a solver that can solve more boards (including ambiguous ones),
but does not explain the reasoning behind the solution, and which is written in
hacky Perl, see tybalt's solver at:

https://github.com/shlomif/binary-puzzle-garden/blob/master/tybalt-perl/binarypuzzle.pl

Like the binary_puzzle_solver gem, it is also licensed under MIT/X11 licence.

Anyway, comments, suggestions, pull requests, GitHub tickets, etc. will be
welcome. I think I'll do something else for the time being though, because
getting the gem uploaded has exhausted me mentally (and I'm pretty tired today
having been woken up by the alarm for an appointment).

Regards,

Shlomi Fish

--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Original Riddles - http://www.shlomifish.org/puzzles/

What is is. Perceive It. Integrate it. Act on it. Idealize it.
— Leonard Peikoff

Please reply to list if it's a mailing list post - http://shlom.in/reply .
Reply all
Reply to author
Forward
0 new messages