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.

0f5f0ea6a2dc7ed3cb5830377a4fe7e2?s=128

Ryan McGeary

February 16, 2012
Tweet

Transcript

  1. Just In Time Inventory with Spree Ryan McGeary http://ryan.mcgeary.org @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.)
  4. http://www.flickr.com/photos/joi/4433868118/

  5. None
  6. http://www.flickr.com/photos/bre/3458247336/ http://www.flickr.com/photos/medialab-prado/

  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? http://www.thingiverse.com/img/bre-about.jpg

  13. Building It!

  14. That Was Hot!

  15. Body Assembly http://wiki.makerbot.com/cupcake-cnc-0:cupcake-body-assembly

  16. Y Stage Assembly http://wiki.makerbot.com/cupcake-cnc-0:cupcake-y-stage-assembly

  17. X Stage Assembly http://wiki.makerbot.com/cupcake-cnc-0:cupcake-x-stage-assembly

  18. Finish It http://wiki.makerbot.com/cupcake-cnc-0:build-instructions

  19. Make Stuff http://www.thingiverse.com/

  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

    Alternatives
  24. HUZZAH! github

  25. None
  26. http://strongholdsmashers.com/wp-content/uploads/2011/10/rage.jpg

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

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

    "replicatorg.app.Base" # ... Usage handling omitted ... machine_name = Base.preferences.get("machine.name", 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

  33. http://strongholdsmashers.com/wp-content/uploads/2011/10/rage.jpg

  34. $ gem install spree_cmd Rails 3.1.3 only!

  35. http://strongholdsmashers.com/wp-content/uploads/2011/10/rage.jpg

  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 }
  39. THINGS US r (A BRIEF SPrEE DEMO)

  40. Too Long; Didn’t Listen

  41. None
  42. ReplicatorG

  43. None
  44. DuplicatorG https://github.com/rmm5t/duplicatorg

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

  49. But Seriously...

  50. What’s Next?

  51. What’s Next?

  52. Ryan McGeary ryan.mcgeary.org @rmm5t ryan@mcgeary.org McGeary Consulting Group http://spkr8.com/t/9284