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

Cannot interact with rails when encounter a conflict #49

Open
victorteokw opened this issue Jan 23, 2015 · 4 comments
Open

Cannot interact with rails when encounter a conflict #49

victorteokw opened this issue Jan 23, 2015 · 4 comments

Comments

@victorteokw
Copy link
Contributor

Below is output

Projectile Rails Compilation started at Fri Jan 23 14:11:28

bundle exec rails generate scaffold Fuck fuck:string
      invoke  active_record
      create    db/migrate/20150123061131_create_fucks.rb
      create    app/models/fuck.rb
      invoke    test_unit
      create      test/models/fuck_test.rb
      create      test/fixtures/fucks.yml
      invoke  resource_route
       route    resources :fucks
      invoke  scaffold_controller
      create    app/controllers/fucks_controller.rb
      invoke    slim
      create      app/views/fucks
      create      app/views/fucks/index.html.slim
      create      app/views/fucks/edit.html.slim
      create      app/views/fucks/show.html.slim
      create      app/views/fucks/new.html.slim
      create      app/views/fucks/_form.html.slim
      invoke    test_unit
      create      test/controllers/fucks_controller_test.rb
      invoke    helper
      create      app/helpers/fucks_helper.rb
      invoke      test_unit
      invoke    jbuilder
      create      app/views/fucks/index.json.jbuilder
      create      app/views/fucks/show.json.jbuilder
      invoke  assets
      invoke    coffee
      create      app/assets/javascripts/fucks.js.coffee
      invoke    scss
      create      app/assets/stylesheets/fucks.css.scss
    conflict    app/assets/stylesheets/scaffolds.css.scss                                                                 
      invoke  scss
  Overwrite /Users/1/Documents/Project/tiehkaiwoo/app/assets/stylesheets/scaffolds.css.scss? (enter "h" for help) [Ynaqdh] 

By changing second argument of compile to t resolves this issue.
But all the projectile-rails specific hooks won't run. (e. g. buttons link to file.)
I tried redefine projectile-rails-compilation-mode's parent mode to be comint-mode, the issue is still exist.

Any ideas?

@asok
Copy link
Owner

asok commented Jan 23, 2015

The t argument to the compile makes the compile command run it in the compilation-shell-minor-mode which allows for interactions.
I've followed the idea of rspec-mode to pass a custom compilation-mode instead of t to be able to add some specific things to the compile buffer (like buttons for instance).
As far as I understand after running the generate and encountering a step when a user has to input something it should be sufficient enough to just enable compilation-shell-minor-mode. After that it should be possible to input characters and send them to the process.
But I'm getting error "n is undefined" (after hitting "n" key). I'll try to take a closer look at that.

@victorteokw
Copy link
Contributor Author

Thanks

@kisp
Copy link

kisp commented Feb 15, 2024

Evaluating

(defadvice compile (before ad-compile-smart activate)
  "Advises `compile' so it sets the argument COMINT to t."
  (ad-set-arg 1 t))

(see https://www.masteringemacs.org/article/compiling-running-scripts-emacs)

makes it work for me by using comint-mode.

@kisp
Copy link

kisp commented Feb 15, 2024

Maybe it would be possible to derive projectile-rails-generate-mode from comint-mode?

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

No branches or pull requests

3 participants