Code Monkey home page Code Monkey logo

Comments (6)

aaronlippold avatar aaronlippold commented on May 18, 2024

Hi, odd bug at the moement - where the relative path for the data is not being set correct after the gem install. It works if I clone it and run it locally but I will have our guys look at it and see if we can resolve the bug which I think is in the .gemspec file or in the 'requires' for the data loading

from heimdall_tools.

Bialogs avatar Bialogs commented on May 18, 2024

We should take a look at the way we are loading our files from lib/

Statements like this: RESOURCE_DIR = Pathname.new(__FILE__).join('../../data') using relative paths can be dangerous and may not always grab the correct file since they have to do with invocation location.

from heimdall_tools.

rx294 avatar rx294 commented on May 18, 2024

Fixed in #42

from heimdall_tools.

rx294 avatar rx294 commented on May 18, 2024

Hey @Bialogs if am not mistaken RESOURCE_DIR = Pathname.new(__FILE__).join('../../data') goes by relative location of the source code ...not the invocation location... and the gem does run from any location with this code...

if you still think it should be changed what do you think about
RESOURCE_DIR = "#{File.dirname __dir__}/data" ?

from heimdall_tools.

Bialogs avatar Bialogs commented on May 18, 2024

__FILE__ should be the relative location to the particular file from the invocation location so you'd need to do a File.expand_path(__FILE__) to get the absolute location to where the gem is installed and then use that for the RESOURCE_DIR.

Not sure if converting to a Pathname object will do the same behavior as File#expand_path.

Since we are setting a RESOURCE_DIR it might make sense to include that as a constant in the same pattern as version.rb.

from heimdall_tools.

rx294 avatar rx294 commented on May 18, 2024

this issue fixed by #42;
Pathname.new method revolves the absolute path and hence works as a gem

from heimdall_tools.

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.