<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ruby on</title><link>http://salopst.yearl.us/tags/ruby/</link><description>Recent content in Ruby on</description><generator>Hugo</generator><language>en</language><copyright>&lt;a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener"&gt;CC BY-NC 4.0&lt;/a&gt;</copyright><lastBuildDate>Tue, 21 Sep 2021 02:22:00 +0100</lastBuildDate><atom:link href="http://salopst.yearl.us/tags/ruby/index.xml" rel="self" type="application/rss+xml"/><item><title>Wranglergram decoder in ruby</title><link>http://salopst.yearl.us/wranglergram-decoder-in-ruby/</link><pubDate>Fri, 01 Jun 2018 17:35:03 +0000</pubDate><guid>http://salopst.yearl.us/wranglergram-decoder-in-ruby/</guid><description>&lt;p&gt;My local radio station has a quiz every once in a while. The questions are hardly &amp;ldquo;University Challenge&amp;rdquo;, but there is one question that always is fiendishly tricksy and slippery: to identify a place in the county from an anagram of it.&lt;/p&gt;&#10;&lt;p&gt;Constantly getting all but one question correct, it is, of course time to &lt;del&gt;cheat&lt;/del&gt; use lateral thinking.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;#1 get a list of place names. A &lt;a href="https://britishplacenames.uk/england/shropshire"&gt;gazetteer&lt;/a&gt; should do.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;#2 Build an index (hash). First thoughts were to md5 the names, but there&amp;rsquo;s an easier way: equalise case, remove spaces and punctuation, order the string&amp;hellip;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Fsked El Capitan home directory</title><link>http://salopst.yearl.us/fsked-el-capitan-home-directory/</link><pubDate>Mon, 23 May 2016 05:41:31 +0000</pubDate><guid>http://salopst.yearl.us/fsked-el-capitan-home-directory/</guid><description>&lt;p&gt;Not entirely sure how I managed to hose my user directory, but I did, and it followed a boot into safe mode (reboot and SHIFT) in order to update an ancient &lt;a href="https://www.macports.org/"&gt;MacPorts&lt;/a&gt; installation; &lt;a href="http://brew.sh/"&gt;homebrew&lt;/a&gt; sort of replaced that for my usage. OK, no biggie. I have back ups right? I do, but those back up in recent months have been based on Apple&amp;rsquo;s &lt;a href="https://en.wikipedia.org/wiki/Time_Machine_%28OS_X%29"&gt;Time Machine&lt;/a&gt;. I changed to this from &lt;a href="https://bombich.com/"&gt;Carbon Copy Cloner&lt;/a&gt; by means of experiment. CCC has been bullet-proof, and I have always used it for family members, but there was something enticing about the seeming simplicity of Time Machine&amp;hellip; something that is great for restoring files, but not so great, it turns out, for a full system restore. Suffice to say that a combination of backup solutions really is the way to go.&lt;/p&gt;</description></item><item><title>Posting from IA Writer to Wordpress (Coleman)</title><link>http://salopst.yearl.us/blog-post-ia-writer-to-wordpress-with-ruby/</link><pubDate>Sun, 24 Apr 2016 00:01:57 +0000</pubDate><guid>http://salopst.yearl.us/blog-post-ia-writer-to-wordpress-with-ruby/</guid><description>&lt;h2 id="0-wha"&gt;0. Wha?&lt;/h2&gt;&#10;&lt;p&gt;With the coming of the new &lt;a href="http://stephen.yearl.us/rescue-doggie-diary/"&gt;doggie into the house&lt;/a&gt;, perhaps I will again add more content to the &lt;a href="http://stephen.yearl.us"&gt;bloggy thing&lt;/a&gt; that I have kinda sorta not really been keeping over the last little while.&lt;/p&gt;&#10;&lt;p&gt;Probably this has been done by someone else on the Intertubz, but ach, why not. I have some time on my hands, so here are running notes in &lt;a href="https://ia.net/writer"&gt;IA Writer&lt;/a&gt; that will make its way to a &lt;a href="https://www.wordpress.com"&gt;Wordpress&lt;/a&gt; post by some means or other. There’s nothing special about IA writer, by the way. Well, there &lt;strong&gt;is&lt;/strong&gt;, but not for the purposes of the Wordpress posting. The same code should work with any plain-ish text file coming from any editor.&lt;/p&gt;</description></item><item><title>cleaning up a homebrew installation</title><link>http://salopst.yearl.us/cleaning-up-a-homebrew-installation/</link><pubDate>Tue, 23 Sep 2014 23:31:02 +0000</pubDate><guid>http://salopst.yearl.us/cleaning-up-a-homebrew-installation/</guid><description>&lt;p&gt;I keep meaning to get around to do this, but never do. This evening I took a look at &lt;a href="http://exercism.io"&gt;exercism.io&lt;/a&gt; and the installation of its CLI program had a Homebrew option, so then was a good a moment as any, that and with the imminent release of OS 42 (X.10.10)&amp;hellip;&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$brew -v&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;==&amp;gt; 0.9.5&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$sudo chown -R &lt;span style="color:#e6db74"&gt;`&lt;/span&gt;whoami&lt;span style="color:#e6db74"&gt;`&lt;/span&gt; /usr/local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$cd /usr/local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$git fetch origin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$git reset --hard origin/master&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$brew cleanup&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$brew upgrade&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;==&amp;gt; ALL OK!&lt;/p&gt;</description></item><item><title>rubypress</title><link>http://salopst.yearl.us/rubypress/</link><pubDate>Mon, 01 Sep 2014 18:35:07 +0000</pubDate><guid>http://salopst.yearl.us/rubypress/</guid><description>&lt;p&gt;Happy enough with the output of koiné word of the day for the time being. Maybe I&amp;rsquo;ll make it into a wordpress plugin or something at some point in the future, but probably not. For now it makes sense to have the local script interface with Wordpress&amp;rsquo; APIs. One of the more commonly used and updated rubygem is &lt;a href="https://github.com/zachfeldman/rubypress"&gt;rubypress&lt;/a&gt;, so let&amp;rsquo;s start there.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$gem install rubypress&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;==&amp;gt; write permission error&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$sudo chown -R &lt;span style="color:#e6db74"&gt;`&lt;/span&gt;whoami&lt;span style="color:#e6db74"&gt;`&lt;/span&gt; /Library/Ruby/Gems/2.0.0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$gem install rubypress&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$sudo gem update&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$sudo gem install rubygems-update&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$sudo update_rubygems&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$sudo gem update --system&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$gem -v&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;==&amp;gt; 2.4.1&lt;/p&gt;</description></item><item><title>Automated file management with maid</title><link>http://salopst.yearl.us/automated-file-management-with-maid/</link><pubDate>Mon, 22 Jul 2013 23:05:50 +0000</pubDate><guid>http://salopst.yearl.us/automated-file-management-with-maid/</guid><description>&lt;p&gt;I&amp;rsquo;ve been playing with &lt;a href="http://www.noodlesoft.com/hazel.php"&gt;Hazel&lt;/a&gt; a bit recently, mostly so I can get a handle on it to support others&amp;rsquo; usage of a simple file automation/ housekeeping application. I like it, but it is somewhat limited in not allowed nested conditional and other basic logic statements. Anyway, what Hazel does is not much more&amp;ndash; and very frequently less&amp;ndash; that what I&amp;rsquo;ve been doing with ad hoc cron scripts. These are not very tidy having built built up over the years. And so I Googled and I found a x-platform, ruby based Hazel alternative in &lt;a href="http://rubygems.org/gems/maid"&gt;maid&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Installing Ruby 1.9.2 with RVM fails on OS X Lion</title><link>http://salopst.yearl.us/installing-ruby-1-9-2-with-rvm-fails-on-os-x-lion/</link><pubDate>Fri, 28 Oct 2011 14:51:58 +0000</pubDate><guid>http://salopst.yearl.us/installing-ruby-1-9-2-with-rvm-fails-on-os-x-lion/</guid><description>&lt;p&gt;Remove RVM, thus making for a cleaner install later:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ RVM implode&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Remove XCode:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ sudo /Developer/Library/uninstall-devtools –mode&lt;span style="color:#f92672"&gt;=&lt;/span&gt;all&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;XCode is removed since in 4.2, at least, all references to gcc are linked to llvm-gcc (Apple&amp;rsquo;s) own fork of gcc. llvm will NOT compile ruby.&lt;/p&gt;&#10;&lt;p&gt;(One can always re-install from the AppStore later)&#10;download and install GCC-10.7-v2.pkg from &lt;a href="https://github.com/kennethreitz/osx-gcc-installer/downloads"&gt;https://github.com/kennethreitz/osx-gcc-installer/downloads&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This will install just the bare-bones GCC compiler. It can safely be overwritten by XCode if you decide to reinstall it, or simple removed using the same command as that used for removing XCode.&#10;reinstall RVM: &lt;a href="http://beginrescueend.com/rvm/install/"&gt;http://beginrescueend.com/rvm/install/&lt;/a&gt;&#10;Install the package manager &amp;ldquo;homebrew&amp;rdquo; from &lt;a href="http://mxcl.github.com/homebrew/"&gt;http://mxcl.github.com/homebrew/&lt;/a&gt; and with it install libiconv.&lt;/p&gt;</description></item></channel></rss>