Provide a uniform api between Simple, KeyValue and Chain stores #109

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
@kidpollo

Provide a uniform api between Simple, KeyValue and Chain stores for public and private methods.

This is because a couple of gems I use out there need to call some of the internal methods of the simple store. When you try to use other gems configured with a Chain backend call those calls fail.

Basically I added the initialized?, translations and init_translations to the KeyValue and Chain stores.

Also added the functionality to be able to read back the translations from a key value store back to a hash as if it where read from the YAML files.

The gems that i know that would benefit from this would be i18n-js and babilu

@svenfuchs

This comment has been minimized.

Show comment Hide comment
@svenfuchs

svenfuchs Sep 21, 2011

Owner

Whoops, commented over here kidpollo/i18n@3bc7ac9#commitcomment-601777 where I though I'd comment on the pull request. Maybe more coffee is in order.

So, I kinda like the idea.

I do think though that if we're supporting an api for 3rd party code then we should make it public.

Still pondering the exact api though.

Owner

svenfuchs commented Sep 21, 2011

Whoops, commented over here kidpollo/i18n@3bc7ac9#commitcomment-601777 where I though I'd comment on the pull request. Maybe more coffee is in order.

So, I kinda like the idea.

I do think though that if we're supporting an api for 3rd party code then we should make it public.

Still pondering the exact api though.

@kidpollo

This comment has been minimized.

Show comment Hide comment
@kidpollo

kidpollo Sep 21, 2011

Examples of where protected instance methods are used elsewhere:

https://github.com/fnando/i18n-js/blob/master/lib/i18n-js.rb#L127

https://github.com/toretore/babilu/blob/master/lib/i18n_extensions.rb#L11

My particular use case is because I want to use either of these gems with a Redis Store chained to the Simple store and neither Chain or Key Stores have the appropriate methods to be used with these either of these gems

Examples of where protected instance methods are used elsewhere:

https://github.com/fnando/i18n-js/blob/master/lib/i18n-js.rb#L127

https://github.com/toretore/babilu/blob/master/lib/i18n_extensions.rb#L11

My particular use case is because I want to use either of these gems with a Redis Store chained to the Simple store and neither Chain or Key Stores have the appropriate methods to be used with these either of these gems

@kidpollo kidpollo closed this Sep 21, 2011

@kidpollo kidpollo reopened this Sep 21, 2011

@kidpollo

This comment has been minimized.

Show comment Hide comment
@kidpollo

kidpollo Sep 21, 2011

Woops closed this by accident :P

Woops closed this by accident :P

@robotmay

This comment has been minimized.

Show comment Hide comment
@robotmay

robotmay Feb 24, 2012

Any further updates on this? Just bumped into the issue with i18n-js; I'm probably going to work around it for now but this would be useful in the future.

Any further updates on this? Just bumped into the issue with i18n-js; I'm probably going to work around it for now but this would be useful in the future.

@kidpollo

This comment has been minimized.

Show comment Hide comment
@kidpollo

kidpollo Oct 23, 2012

I have not checked this out in a while. I will take a look at the most recent changes on the gem to see if things have changed.

Is there still an interest on providing uniform public apis for all backends?

I have not checked this out in a while. I will take a look at the most recent changes on the gem to see if things have changed.

Is there still an interest on providing uniform public apis for all backends?

@radar

This comment has been minimized.

Show comment Hide comment
@radar

radar Nov 20, 2016

Collaborator

@kidpollo Yes I like this idea too. Could you please update your branch against the latest master? Will look at releasing this in 0.9.0.

Collaborator

radar commented Nov 20, 2016

@kidpollo Yes I like this idea too. Could you please update your branch against the latest master? Will look at releasing this in 0.9.0.

@radar radar added this to the 0.9.0 milestone Nov 20, 2016

@kidpollo

This comment has been minimized.

Show comment Hide comment
@kidpollo

kidpollo Nov 24, 2016

Woah 5 years later still relevant?

Woah 5 years later still relevant?

@radar

This comment has been minimized.

Show comment Hide comment
@radar

radar Nov 24, 2016

Collaborator

@kidpollo Do you think it would be relevant? Is it still useful to provide a uniform API?

Collaborator

radar commented Nov 24, 2016

@kidpollo Do you think it would be relevant? Is it still useful to provide a uniform API?

@kidpollo

This comment has been minimized.

Show comment Hide comment
@kidpollo

kidpollo Nov 24, 2016

@radar updated

@radar updated

@radar radar modified the milestones: 0.9.0, 0.10.0 Oct 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment