Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate namespaced interactors/organizers in the right directory #9

Merged
merged 1 commit into from Sep 8, 2014

Conversation

ersatzryan
Copy link
Contributor

[Fixes #5]

rails g interactor foo/bar should generate app/interactors/foo/bar.rb

currently this generates

class Foo::Bar
  include Interactor

  def call
  end
end

which is less than ideal, but follows how Rails does it

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 166d5e9 on rg-better-generators into e144128 on master.

end
end
EOF
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should be generating an organizer but it looks like a copy/paste of the interactor test.


path = "app/interactors/invoice/place_order.rb"
check_file_presence([path], true)
check_exact_file_content(path, <<-EOF)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<<-EOF.sub(/^\s{10}/, "") (or whatever the right number of spaces is) and then indent the code below so it fits better.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it looks like junk in the test but it also makes it clear exactly what the expected output is without concern over indentation. Active Support gives you String#strip_heredoc but it's not available to us here. I'm comfortable leaving this as is.

rails g interactor foo/bar should generate app/interactors/foo/bar.rb
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling c7a1c53 on rg-better-generators into e144128 on master.

laserlemon added a commit that referenced this pull request Sep 8, 2014
Generate namespaced interactors/organizers in the right directory
@laserlemon laserlemon merged commit 43e5708 into master Sep 8, 2014
@laserlemon laserlemon deleted the rg-better-generators branch September 8, 2014 19:40
@laserlemon
Copy link
Collaborator

Version 2.0.1 released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generating namespaced interactors does not generate proper folders
4 participants