Allow feature listing. Because it will be useful for flipper-ui list and... #10

wants to merge 1 commit into

2 participants


... manipulate features.


Interesting. The main reason I had not done this or even thought about this was that I am assuming that people might want to run the UI outside of the application, where they would might have access to the same data store, but not necessarily the code.

I actually just ensured that features get added to a set in the adapter whenever they are enabled or disabled in 6b63363.

After seeing this, I'm thinking that we should make DSL#features return adapter.set_members('features') and change the existing features method to something like memoized_features, as that is more what it is doing.

What are your thoughts on this?


Maybe DSL#features using adpater.set_members('features') will not work.
Because I ran the flipper-ui tests and its fails here:

1) Flipper::UI::Middleware GET /flipper renders view
     Failure/Error: last_response.body.should match(/stats/i)
     ... ./spec/flipper-ui/middleware_spec.rb:41 ... 

Looking at the code I saw that this line: is returning an empty set.

So, when I changed

@features = flipper.adapter.set_members('features').map { |name| }


@features = flipper.send(:features).map { |name| }

it worked.

I don't know if I'm missing something... and I couldn't understand why Adapter#set_members('features') is returning empty.

When I run examples/basic.rb in the first situation, flipper view show only the logo
So, when I changed the middleware, it list all the features added.


I believe it is because I haven't released latest flipper. If you lock flipper to master instead of a gem version it should work.


Sorry for the confusion. I think I have it locked locally to my WIP by using :path in the gemfile.


Nice, You're right. I changed to github and it worked.
Thanks, I'll close this.

@jonduarte jonduarte closed this Sep 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment