archan937 / rich_cms

Enrichments (e9s) module for a pluggable CMS frontend
http://codehero.es/rails_gems_plugins/rich_cms
MIT License
42 stars 16 forks source link

feature: Use key-value store (adapter) for storing locale translations #7

Closed kristianmandrup closed 13 years ago

kristianmandrup commented 13 years ago

Would be really cool if you could integrate use of Toystore as a wrapper around most key-value backends.

https://github.com/newtoy/toystore

https://github.com/newtoy/adapter

http://railstips.org/blog/archives/2011/01/27/data-modeling-in-performant-systems/

Change your mind? Decide that you do not want to use Redis? Fancy Riak? Simply change the store to use the riak adapter and you are rolling.

require 'toystore'
require 'adapter/riak'

class User
  include Toy::Store
  store :riak, Riak::Client.new['users']

  attribute :email, String
end

Boom. You just completely changed your data store in a couple lines of code. Practical? Yes and no. Cool? Heck yeah.

I will check out your new code ASAP and see if I can better understand it and help out...

archan937 commented 13 years ago

Hi Kristian,

I was doubting whether to use Toystore or Moneta. My choose is Toystore (going to add an ActiveRecord adapter btw). Do you agree? ^^

Greets, Paul.

kristianmandrup commented 13 years ago

Cool :) Yeah, I think Toystore is the better choice! Amazing!

archan937 commented 13 years ago

Hi Kristian,

After some struggling with Toystore, I think it's better to go with Moneta. The adapters for instance have to be required apart from the Toystore gem which is kinda weird. Also, Toystore isn't documented very well and Moneta supports a lot more store engines.

Greets, Paul.

kristianmandrup commented 13 years ago

OK, fair enough! Go for it :) Sounds good...

kristianmandrup commented 13 years ago

Hi, How is it going with moneta? I found this little gem which you might find useful :)

https://github.com/jimmycuadra/to_lang

Cheers!

Kristian

archan937 commented 13 years ago

It's going really well I have to say. Except that time is always against use ;)

Check out: https://github.com/archan937/rich_cms/commits/features/orm_agnostic

And the to_lang gem is really cool! ^^ I will use that in the default_value implementation for Rich-i18n content items.

So stay tuned!!! ^^

Greets, Paul.

archan937 commented 13 years ago

He Kristian!

I have just merged my feature branch in the master branch as it is almost ready for a new release.

The gem provides an extensive test suite which can be setup with a single rake task (test:setup) ^^ I have just managed to setup the test suite with a clean RVM gemset and I was able to run all 6 Rails environments integration tests succesfully. Maybe you want to try it out yourself?! It is explained in the README :D

Anywayz, I hope to release a new version this weekend or at the beginning of next week. Talk to you later!

Greets, Paul.

archan937 commented 13 years ago

He Kristian,

How are you? Please look at https://github.com/archan937/rich_cms/tree/edge :D

I'm planning on releasing it this weekend.

Greets, Paul.

kristianmandrup commented 13 years ago

Hi Paul, I'm having lots of fun travelling the world. Nort much time for coding. Sounds great! Good work :)

Cheers, Kris

archan937 commented 13 years ago

He Kristian,

Well that's ok ;) Have a nice time travelling!

Greets, Paul.