Save 37% off PRO during our Black Friday Sale! »

Just In Time Inventory with Spree

0f5f0ea6a2dc7ed3cb5830377a4fe7e2?s=47 Ryan McGeary
February 16, 2012

Just In Time Inventory with Spree

In this talk, we will not only explore what it takes to extend Spree, but we will also experiment with the notion of using it build our products on demand. We will take Spree, slap a MakerBot on the backend, build some extensions, and build a store that automatically prints products only after an order is placed.


Ryan McGeary

February 16, 2012


  1. Just In Time Inventory with Spree Ryan McGeary @rmm5t

  2. Hey Ryan, We're going to do a SpreeConf in NYC.

    We're asking some people to give talks. Thanks for volunteering ;-) Sure, I’d love to talk. Let me coordinate my schedule and get back to you. (Shit, I don’t know anything about Spree.) Can we confirm you to speak? Sure thing. Let’s make it official. (Crap, what am I going to talk about?)
  3. Hey Ryan, I was wondering if you’d given some thought

    about the topic of your talk. Oh, yeah, I’ve got some ideas. No problem. (I’m doomed.) Oh, by the way, we think we’re going to be able to get Bre Pettis to do the keynote. No way! That’s awesome! I think I have a new idea for my talk. (I have a man crush on Bre.)

  5. None

  7. 0% Complete

  8. 1% Complete

  9. 80% Complete

  10. Just In Time Inventory with Spree

  11. 1: MakerBot 2: Spree 3: ??? 4: PROFIT!!!

  12. What About Bre?

  13. Building It!

  14. That Was Hot!

  15. Body Assembly

  16. Y Stage Assembly

  17. X Stage Assembly

  18. Finish It

  19. Make Stuff

  20. Island of Misfit Things

  21. I Got Better

  22. How Does It Print? •Reads STL Files •Cool 3D Preview

    •Includes Skeinforge •Generates GCode Files •Compiles to S3G •Triggers Print from SD Card
  23. ReplicatorG •It’s A GUI •No Command Line •No Good CLI

  24. HUZZAH! github

  25. None

  27. None
  28. DuplicatorG •Minimal CLI •Builds from SD Card •Uses JRuby •It

    worked! •Note: 32bit Only •RXTX (Serial comms) • JAVA_OPTS=-d32
  29. require "java" Dir["build/jar/*.jar", "build/shared/lib/*.jar"].each do |lib| require lib end java_import

    "" # ... Usage handling omitted ... machine_name = Base.preferences.get("", nil) serial_port = Base.preferences.get("serial.last_selected", nil) machine_loader = Base.machine_loader machine_interface = machine_loader.get_machine_interface(machine_name); machine_loader.connect(serial_port) machine_interface.build_remote(ARGV[0]) }
  30. $ wc -l `find ReplicatorG/src` 51082 total So What? $

    wc -l duplicatorg/*.rb 24 duplicatorg/duplicatorg.rb
  31. What about:

  32. $ gem install spree Unable to resolve dependencies


  34. $ gem install spree_cmd Rails 3.1.3 only!


  36. $ rails new thingsrus $ spree install

  37. Add Some Products Add a Shipping Method Add a Payment

    Method Custom Transition Hook Bam! Booya! Hellz Yeah!
  38. Spree::Order.class_eval do state_machine do after_transition to: "complete", do: :print_object end

    def print_object sku = self.line_items.first.product.sku command = "script/print_it #{sku}" (pid = fork) ? Process.detach(pid) : exec(command) rescue nil end end }

  40. Too Long; Didn’t Listen

  41. None
  42. ReplicatorG

  43. None
  44. DuplicatorG

  45. None
  46. None
  47. None
  48. $$$

  49. But Seriously...

  50. What’s Next?

  51. What’s Next?

  52. Ryan McGeary @rmm5t McGeary Consulting Group