Giter VIP home page Giter VIP logo

Comments (10)

jonleighton avatar jonleighton commented on May 18, 2024

I think we should traverse up the directory tree until we find a Gemfile.

from spring.

senny avatar senny commented on May 18, 2024

I think that's a good idea. We would then:

  1. run up the directory tree until we find a Gemfile
  2. detect the application type from that directory (rails app | engine | unknown => error)

from spring.

jonleighton avatar jonleighton commented on May 18, 2024

I'm not sure how we'd detect if it's a rails app specifically?

from spring.

senny avatar senny commented on May 18, 2024

we could look for config/boot.rb. For an engine we could peek inside lib/<root_dir_name>/engine.rb this is would be very brittle tough.

from spring.

jonleighton avatar jonleighton commented on May 18, 2024

Yeah, seems quite brittle. Let's do this:

  • Traverse up to the Gemfile
  • Look for config/application.rb
  • If it doesn't exist, look for test/dummy/config/application.rb ("test/dummy" is what the generator creates in all cases, so seems reasonable to hardcode it)
  • Otherwise show an error saying that we couldn't find config/application.rb

Sound ok?

from spring.

senny avatar senny commented on May 18, 2024

I don't like the idea to hardcode test/dummy. We use spec/dummy in our engines.

from spring.

senny avatar senny commented on May 18, 2024

There is even a generator option to supply a path where to generate the dummy app.

from spring.

jonleighton avatar jonleighton commented on May 18, 2024

Ah good point. What do you think about linking config/application.rb to ../spec/dummy/config/application.rb? Do you reckon that's better/worse than having to create a config/spring.rb with some config pointing to the app root?

from spring.

senny avatar senny commented on May 18, 2024

I'm fine either way. We could think about adding something to rails to make it possible to detect engines or more specifically to reach the dummy application. If the symlink must be created manually I would favor the configuration option in config/spring.rb. In my opinion this would be a more reasonable place to look for specific stuff.

from spring.

jonleighton avatar jonleighton commented on May 18, 2024

Yeah I'm coming back around to the config option. Let's merge your patch then.

from spring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.