Giter VIP home page Giter VIP logo

Comments (5)

kristianmandrup avatar kristianmandrup commented on August 26, 2024

I made a workaround which is actually pretty decent.

def self.source_root
template_path = ENV['THOR_TEMPLATE_PATH'] ? File.join(ENV['THOR_TEMPLATE_PATH'], 'new-thor-task') : File.dirname(FILE)
File.join(template_path, 'templates')
end

.bash_profile

export TEMPLATE_PATH=~/Development/Languages/Ruby/Templates
export THOR_TEMPLATE_PATH=$TEMPLATE_PATH/thor

Then I just create a new directory for each thor task under THOR_TEMPLATE_PATH and then copy the templates dir into this dir, fx

THOR_TEMPLATE_PATH/my_thor_task/templates

I will now try to fork thor and patch it with this or a similar solution.

from thor.

kristianmandrup avatar kristianmandrup commented on August 26, 2024

The Thor repository root is at ~/.thor (thor_root). Any directories inside thor_root are treated as task packages with a main.thor expected.

~/.thor/thor.yaml has pointers to your local thor projects, so they are not "truly" installed. There is a package option, but I'm not sure how to use it.

I have now added an option to deploy a task. This will create a task package, with the task code in a separate dir with a main.thor file. To do this run

$ thor install lib/mythor.thor

This latest version expects the thor file and supporting ruby code to all reside in a lib folder and any templates in a templates folder

/my_task
  + lib
    - mythor.thor
  + templates   

Enjoy!

from thor.

josevalim avatar josevalim commented on August 26, 2024

Yes, I hear your pain. We need to improve the thor install urgently. In my Thor refactor, I haven't touched the Thor::Runner bit and it's a little bit falling behind the other features.

I've seen you've done a lot of work in your fork, but it's kinda of mixed. You are improving several parts and adding new features, so it makes hard to review.

Sorry, I should have reviewed it earlier but I'm quite busy lately. Are you interested in starting a new branch and port your Thor::Runner refactor? We can discuss the new features as we go.

If you don't have my private e-mail, please send me a message and I will reply! Thanks!

from thor.

kristianmandrup avatar kristianmandrup commented on August 26, 2024

Yeah, let us start a new branch. What should we call it? 'runner-upgrade' ?

from thor.

rafaelfranca avatar rafaelfranca commented on August 26, 2024

Closing since this is too old. If you still have the problem please let us know.

from thor.

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.