Piggybak: Recent Updates and Upgrades
Piggybak, an open source Ruby on Rails ecommerce gem, implemented as a mountable solution, has continued to be upgraded and maintained over the last several months to keep up to date with Rails security releases and Ruby releases. Here are some quick notes on recent work:
- Piggybak (version 0.7.5) is now compatible with Rails 4.1.6, which is the most up to date release of Rails. See the Rails release notes for more details on this recent release. The Piggybak Demo is now running on Rails 4.1.6.
- Piggybak is compatible with Ruby 2.1.2, and the demo is running on Ruby 2.1.2.
- Recent updates in Piggybak include migration fixes to handle table namespace issues, and updates to remove methods that are no longer present in Rails (that were previously deprecated).
- Recent updates to the demo include updates to the integration testing suite to allow testing to be compatible with Rails 4.1.6, as well as modifications to how the demo handles exceptions.
Make sure to check out Piggybak on github repository for more details on these recent updates.
piggybak ruby rails
Aliasin’ and Redmine plugins
Recently I was tasked with creating a plugin to customize End Point’s Redmine instance. In working through this I was exposed for the first time to alias_method_chain. What follows is my journey down the rabbit hole as I wrap my head around new (to me) Ruby/Rails magic.
The Rails core method alias_method_chain encapsulates a common pattern of using alias_method twice: first to rename an original method to a method “without" a feature, and second to rename a new method “with" a feature to the original method. Whaaaa? Let’s start by taking a look at Ruby core methods alias and alias_method before further discussing alias_method_chain.
alias and alias_method
At first glance, they achieve the same goal with slightly different syntax:
class Person
def hello
"Hello"
end
alias say_hello hello
end
Person.new.hello
=> "Hello"
Person.new.say_hello
=> "Hello"
class Person
def hello
"Hello"
end
alias_method :say_hello, :hello
end
Person.new.hello
=> "Hello"
Person.new.say_hello
=> "Hello"
Let’s see what happens when we have a class inherit from Person in each of the cases above.
class Person
def …
extensions ruby rails
Analyzer Reports with Geo Map Option in Pentaho 5 BI Server
The “Geo Map” option in Analyzer Reports provides a feature to visualize data with geographic locations. We will learn how to design a Mondrian schema and configure Pentaho to make use of the “Geo Map” feature in the Analyzer Reports. This article will show us how to set this feature up step by step.
Enable Geo Map feature on Geographic fields in Mondrian Schema
The Mondrian schema has two main categories called Dimensions and Measures. The Dimensions are defined as levels in the Mondrian schema. The Geographic fields should have two additional annotations to use Geo Map. The two annotations are:
-
Data.Role — defines the type of level generally; for this type of node, this must be set to ‘Geography’.
-
Geo.Role — defines the geographical classification in a hierarchy. These can be either predefined roles (‘country’, ‘state’, ‘city’, ‘postalcode’) or custom roles.
Sample Level with Annotation:
<Level name="Country Name" visible="true" column="country" type="String" uniqueMembers="false" levelType="Regular" hideMemberIf="Never">
<Annotations>
<Annotation name="Data.Role"> …
gis pentaho postgres reporting casepointer
Today’s Internet Slowdown
Today End Point is participating in an Internet-wide campaign to raise awareness about net neutrality, the FCC’s role in overseeing the Internet in the United States, and the possible effects of lobbying by large consumer Internet providers.
Many companies and individuals are in favor of specific “net neutrality” regulation by the FCC, and make good arguments for it, such as these by Battle for the Net, Etsy and ThoughtWorks and Reddit.
There are also plenty speaking out against certain specific regulatory proposals out there: TechFreedom, Google, Facebook, Microsoft, Yahoo!, Todd Wasserman, and with a jaunty propagandistic style, NCTA, the cable company’s lobby.
I think we are all sympathetic to free-market arguments and support non-governmental solutions that allow companies and individuals to create things without getting permission, and to arrange services and peering as they see fit. It seems that most people and companies understand the need to pay for more bandwidth, and more data transfer. (Marketers are the ones promising unlimited everything, then hiding limits in the fine print!) Many of us are worried about further entrenching government in private networks, whether …
community
Adventures in Downgrading my Linode Plan
I recently went through the process of downgrading and downsizing my Linode plan and I wanted to share a few of the [small] hoops that I had to jump through to get there, with the help of the Linode Support team.
Background
I’ve had a small personal WordPress site running for more than a few years now. I also use this server for personal Ruby on Rails development. When I began work on that site, I tried out a few shared hosting providers such as Bluehost and GoDaddy because of the low cost (Bluehost was ~$6/mo) at the time. However, I quickly encountered common limitations of shared server hosting:
- Shared hosting providers typically make it very difficult to run Ruby on Rails, especially edge versions of Ruby on Rails. It’s possible this has improved over the last few years, but when you are a developer and want to experiment (not locally), shared hosting providers are not going to give you the freedom to do so.
- Shared hosting providers do not give you control of specific performance settings (e.g. use of mod_gzip, expires headers), so I was suffering from lack of control for my little WordPress site as well as my Rails sites. While this is another limitation that may have …
hosting sysadmin
Enhancing the labelsontime.com Spree application
Labels on Time is an online retailer that delivers top-quality thermal roll and direct thermal labels—and all on time, of course. They came to us last year to upgrade their Spree site, resolve bugs, and develop cutting-edge features, utilizing our expertise with the ecommerce platform. Spree Commerce is an open-source ecommerce solution built on Ruby on Rails, and manages all aspects of the fulfillment process, from checkout to shipping to discounts, and much more.
UPGRADING THE SPREE PLATFORM
There were quite a few challenges associated with the upgrade, since Labels on Time was still running on Spree’s version 2.0, which was not yet stable. To keep some stability, we initially worked off a fork of Spree, and selectively brought in changes from 2.0 when we were sure they were stable and reliable enough.
USING SPREE GEMS
To date, some of the Spree gems we have used on the site include:
Active Shipping: This is a Spree plugin that can interface with USPS, UPS and FedEx. Label on Time’s active_shipping gem interacts with the UPS API, which is a big task to tackle since it requires a lot of configuration, especially every time Spree is updated.
Another important gem we use for Labels …
ecommerce ruby rails spree
Rsyslog property based filtering features
Do you need something more powerful than the usual, clunky selectors based Rsyslog filtering rules but still you don’t see the benefit of going full throttle and use RainerScript?
Perhaps you weren’t aware, but there is an additional filtering rule you may not have used, which is a great alternative to the classic selector-based one, called property-based filtering.
This kind of filtering lets you create rules like:
:msg, contains, "firewall: IN=" -/var/log/firewall
There’s a few more properties that you can use like hostname,fromhost,fromip and the number (and variety) is growing over time.
Instead of just verifying that a specific string is contained in the highlighted property, you could also be interested in operators like isempty, isequal or the powerful regex and ereregex which could be used to compare the string content against regexes, that we all love so much.
:fromhost, regex, ".*app-fe\d{2}" -/data/myapp/frontend_servers.log
:fromhost, regex, ".*app-db\d{2}" -/data/myapp/DB_servers.log
Also remember that you can always use the ! to negate the condition and the discard operator to block Rsyslog from further rules parsing for that specific content: …
linux sysadmin
Looking at development environments with DevCamps and Vagrant
For most web developers, you have practices and tools that you are used to using to do your work. And for most web developers this means setting up your workstation with all the things you need to do your editing, compiling, testing, and pushing code to some place for sharing or deployment. This is a very common practice even though it is fraught with problems- like getting a database setup properly, configuring a web server, any other services (memcached, redis, mongodb, etc), and many more issues.
Hopefully at some point you realize the pain that is involved in doing everything on your workstation directly and start looking for a better way to do web development. In this post I will be looking at some ways to do this better: using a virtual machine (VM), Vagrant, and DevCamps.
Using a VM for development
One way to improve things is to use a local virtual machine for your development (for example, using VirtualBox, or VMware Fusion). You can edit your code normally on your workstation, but then execute and test it in the VM. This also makes your workstation “clean”, moving all those dependencies (like a database, web server, etc.) off your workstation and into the VM. It also gets …
camps environment tools vagrant