Opensteam_blog_logo4
opensteam.net | rss | search | archive
Results (escape to close):

v0.9.3 released!

Posted by michael.schaerfer on 01-Oct-08 at 17:46

We finally released a new version of openSteam today.

This release introduces some major enhancements of the checkout- and order-process, like shipping-rate calculation, tax management and an ActiveMerchant integration for credit-card payments.

New Features:

  • Taxes: define taxes or tax-groups for products and regions
  • ActiveMerchant integration
  • PaymentMethods: use implemented payment-methods or implement your own
  • ShippingRate: define rates for products, regions and payment-types.
  • PDF-Export for invoices (using the excellent prawnto plugin)

For a full list of changes please read the CHANGELOG, and if you're curious what to expect in future releases, please visit the Roadmap at our homepage.

In future posts we will try to describe some of the new features and their implementations in detail.

openSteam v0.9.2 released!

Posted by michael.schaerfer on 07-Aug-08 at 12:32

A new opensteam version is released to the world. This release fixes some bugs in the product-generators and admin-controller.

New Features:

  • Apply filter to the sortable tables (admin-backend)
  • SQLite3 compatibility
  • RESTful controller (admin-backend)

And we want to thank Gregg and Jason from railsenvy.com for mentioning opensteam in their newest podcast.

Comments: 0 (view/add your own) Tags: release

openSteam v0.9.1 released!

Posted by michael.schaerfer on 01-Aug-08 at 09:02

We're pleased to announce the new openSteam release, v0.9.1!

The new version of the web-based shopping framework for RubyOnRails introduces many new features such as:

  • Rails 2.1 compatible
  • create Invoices and Shipments for an Order and even for Order-Items
  • mark an Order, an Invoice or a Shipment as 'pending' or 'finished'. Or even create your own states and state-specific logic using modules.
  • a whole new Admin-Backend (overview and process orders, manage admins and/or customers, etc)
  • sortable and searchable tables in the admin-backend
  • a simple search form, finally!

See the CHANGELOG for more information on what we've done.

You can easily install opensteam by typing gem install opensteam. Or, if you already have it installed, type gem update.

If you're a developer and/or you're not afraid to live on the edge, checkout the current developer version using svn:

svn checkout svn://rubyforge.org/var/svn/opensteam

If you have any question, drop us an email or visit our forum at rubyforge

Comments: 0 (view/add your own) Tags: release

State-Pattern using Modules

Posted by michael.schaerfer on 22-Jul-08 at 21:20


In the last weeks, we tried to implement a state-pattern for our orders, simply put: different states means different functionality.
We tried various approaches, like simple state-symbols, state-classes (to hold the state-specifc methods and return new states), state-associations and the very nice AASM plugin by Scott Barron.
But all this techniques felt very clumsy for our simple needs and not so ... 'ruby-like'.

Then i stumbled across Jay Fields Post and really liked the approach of using just state-modules and delegating to the instance_method ('cause all modules included in a class are just ancestors of this class!).

Here a brief overview of our solution:
   1  # the order-class
   2  class Order
   3    include StateLogic
   4  
   5    #states
   6    include Finished
   7    attr_accessor :state
   8  end
The StateLogic Module (defines the 'fire_event' method to delegate to the state-module).
   1  module StateLogic
   2    def fire_event(name, *args, &block)
   3      state_module = self.state.classify.constantize
   4      
   5      if state_module.instance_methods(false).include?(name)
   6        state_module.instance_method(m).bind( self ).call( *args, &block )
   7      else
   8        puts "event '#{name}' not defined for state '#{state}'"
   9        return false
  10      end
  11    end
  12  end
A State-Module
   1  module Finished
   2    def self.included(base)
   3      self.instance_methods(false).each do |m|
   4        base.class_eval do
   5          define_method(m) { |*args| fire_event(m,*args) }
   6        end
   7      end
   8    end
   9  
  10    #an event
  11    def say_something
  12      puts "now in state '#{state}'"
  13    end
  14  
  15  end    
As you can see, we override every state-module instance_method in the receiver-class to call the fire_event method. And in this method, we check if the current state-module defines such an instance_method, bind it to the order-instance and call it (or printing an error message, if no such method is defined in the current state-module.)
Pretty simple!

openSteam v0.9.1 soon!

Posted by michael.schaerfer on 22-Jul-08 at 21:08

We're currently working hard on the next openSteam release (v0.9.1).

A full list of new features will come in the next days, but for now: there will be invoices and shipments, lots of refactored code, many states and a simple extension-mechanism for the admin-backend.

Comments: 0 (view/add your own) Tags: release