{"action":"opened","issue":{"url":"https://api.github.com/repos/SamSaffron/message_bus/issues/24","labels_url":"https://api.github.com/repos/SamSaffron/message_bus/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/SamSaffron/message_bus/issues/24/comments","events_url":"https://api.github.com/repos/SamSaffron/message_bus/issues/24/events","html_url":"https://github.com/SamSaffron/message_bus/issues/24","id":59999679,"number":24,"title":"ActionDispatch::Flash shouldn't be required to run this gem!","user":{"login":"arcreative","id":1896026,"avatar_url":"https://avatars.githubusercontent.com/u/1896026?v=3","gravatar_id":"","url":"https://api.github.com/users/arcreative","html_url":"https://github.com/arcreative","followers_url":"https://api.github.com/users/arcreative/followers","following_url":"https://api.github.com/users/arcreative/following{/other_user}","gists_url":"https://api.github.com/users/arcreative/gists{/gist_id}","starred_url":"https://api.github.com/users/arcreative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcreative/subscriptions","organizations_url":"https://api.github.com/users/arcreative/orgs","repos_url":"https://api.github.com/users/arcreative/repos","events_url":"https://api.github.com/users/arcreative/events{/privacy}","received_events_url":"https://api.github.com/users/arcreative/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-05T19:07:35Z","updated_at":"2015-03-05T19:07:35Z","closed_at":null,"body":"IMO, `app.middleware.insert_before(ActionDispatch::Flash, MessageBus::Rack::Middleware)` is a bit naïve since you don't know that the project will have it required.  In my rails-api project, it errors out: \r\n\r\n```\r\n=> Booting WEBrick\r\n=> Rails 4.1.8 application starting in development on http://0.0.0.0:3000\r\n=> Run `rails server -h` for more startup options\r\n=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)\r\n=> Ctrl-C to shutdown server\r\nExiting\r\n/Users/adam/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/stack.rb:125:in `assert_index': No such middleware to insert before: ActionDispatch::Flash (RuntimeError)\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/actionpack-4.1.8/lib/action_dispatch/middleware/stack.rb:88:in `insert'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/configuration.rb:68:in `block in merge_into'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/configuration.rb:67:in `each'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/configuration.rb:67:in `merge_into'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/engine.rb:497:in `app'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/application/finisher.rb:36:in `block in <module:Finisher>'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `instance_exec'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/initializable.rb:30:in `run'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/initializable.rb:55:in `block in run_initializers'\r\n\tfrom /Users/adam/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'\r\n\tfrom /Users/adam/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'\r\n\tfrom /Users/adam/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'\r\n\tfrom /Users/adam/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'\r\n\tfrom /Users/adam/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each'\r\n\tfrom /Users/adam/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `call'\r\n\tfrom /Users/adam/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'\r\n\tfrom /Users/adam/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'\r\n\tfrom /Users/adam/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/initializable.rb:54:in `run_initializers'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/application.rb:300:in `initialize!'\r\n\tfrom /Users/adam/repos/arcreative/hydrogen-api/config/environment.rb:5:in `<top (required)>'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `block in require'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:232:in `load_dependency'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/dependencies.rb:247:in `require'\r\n\tfrom /Users/adam/repos/arcreative/hydrogen-api/config.ru:3:in `block in <main>'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'\r\n\tfrom /Users/adam/repos/arcreative/hydrogen-api/config.ru:in `new'\r\n\tfrom /Users/adam/repos/arcreative/hydrogen-api/config.ru:in `<main>'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/commands/server.rb:50:in `app'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/commands/server.rb:130:in `log_to_stdout'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/commands/server.rb:67:in `start'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:81:in `block in server'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:76:in `tap'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:76:in `server'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/commands/commands_tasks.rb:40:in `run_command!'\r\n\tfrom /Users/adam/.rvm/gems/ruby-2.2.0/gems/railties-4.1.8/lib/rails/commands.rb:17:in `<top (required)>'\r\n\tfrom bin/rails:4:in `require'\r\n\tfrom bin/rails:4:in `<main>'\r\n```"}}