thor Questions

1

I'm using thor to write command-line tasks (in a rails 3 app) and trying to pipe input to them over heroku, e.g. cat somefile.csv | heroku run thor sometask works great on my local machine cat som...
Ceric asked 9/12, 2013 at 13:35

4

Solved

I'm making a custom generator that generates a new rails app, and I do it like this require 'thor' require 'rails/generators/rails/app/app_generator' class AppBuilder < Rails::AppBuilder incl...
Disaster asked 26/3, 2012 at 21:7

2

Solved

I have a Thor script that uses several methods class Update < Thor desc "do_it", "a simple task" def do_it puts i_did_it end # no desc here !!! def i_did_it "I ...
Maddis asked 1/11, 2011 at 0:31

1

I need to invoke a task twice in Thor. In Rake, this could be accomplished by "re-enabling" it, but I can't find an equivalent in either of http://www.rubydoc.info/github/wycats/thor/master/Thor/In...
Mcshane asked 22/9, 2017 at 17:19

5

Solved

With Thor one can use method_option to set the options for a particular task. To set the options for all tasks in a class one can use class_option. But what about the case where one wants some task...
Godevil asked 15/1, 2013 at 20:28

2

Solved

How can I deploy a simple ruby script via homebrew? Here's what I tried Wrote formula in a GitHub repo named homebrew-foo # file https://github.com/foo/homebrew-foo/blob/master/foo.rb class Foo ...
Shaw asked 16/7, 2017 at 16:45

2

I'm trying to create a new app using rails-api. When I run rails-api new mynewapp I get the following: /Users/sandy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/thor-0.19.1.1/lib/thor/parser/opt...
Outtalk asked 13/9, 2015 at 17:57

4

Solved

I am trying to create a new Ruby on Rails application. Every time I type in rails new after, I get this error /usr/local/lib/ruby/gems/2.2.0/gems/thor-0.19.2/lib/thor/parser/option.rb:130:in `vali...
Genius asked 26/11, 2016 at 21:42

1

I'd like to provide thor tasks instead of rake tasks in a Railtie. There is a straight forward and well documented way for providing rake scripts in Railties: class MyRailtie < Rails::Railtie ...
Hyetography asked 16/2, 2012 at 9:50

4

I have a command-line application which uses thor to handle the parsing of options. I want to unit test the command-line functionality against the code with test-unit and/or minitest. I can't seem...
Inbred asked 24/12, 2011 at 0:6

3

Solved

I'm looking for a way to create a command-line thor app that will run a default method without any arguments. I fiddled with Thor's default_method option, but still requires that I pass in an argum...
Canning asked 31/8, 2011 at 6:37

2

Solved

Is it possible to create aliases for commands in Thor? Much like command aliasing in Commander. https://github.com/tj/commander#command-aliasing I am able to find aliases for options, but not for...
Amersham asked 13/2, 2015 at 16:37

3

Solved

How do I add a --version option to my Ruby Thor command line interface application. For example I want to be able to run $ thor_app --version > thor_app version 1.0.0 This question is related t...
Alius asked 2/4, 2014 at 11:28

2

Solved

I want to somehow ask the user to say their flickr_id, flickr_apikey and that stuff, but id' be most happy to do it under my install command so it dosn't end up being such a long and heavy line bec...
Goodkin asked 5/1, 2011 at 14:5

0

Our organization wants to experiment with using devdocs.io to integrate our API docs. I installed devdocs.io locally and have it running in my browser. I do: $ thor list assets ------ thor assets:...
Kulak asked 29/8, 2014 at 13:49

3

I'm using Thor and trying to output YAML to a file. In irb I get what I expect. Plain text in YAML format. But when part of a method in Thor, its output is different... class Foo < Thor includ...
Grafton asked 3/3, 2012 at 22:11

3

The thor wiki page, Making an Exectable, shows you how to create a thor powered CLI command that looks something like this: bash ./mythorcommand foo This requires you to pass in the thor task fo...
Stale asked 1/9, 2011 at 23:5

1

Solved

In bundler/bundler & rails/rails project, there are some *.tt files (Go to the project page, click t then type .tt). Inside this kind of file, it could use ERB. Example of a .tt file (from bund...
Mosora asked 1/5, 2014 at 3:33

3

There are some great helper methods from Thor::Actions (http://textmate.rubyforge.org/thor/Thor/Actions.html) that I want access to but I cannot seem to use them without employing a Thor CLI app. ...
Majors asked 26/6, 2013 at 23:43

1

Solved

I am working on a rails engine and I am trying to write a generator that will put this line do_stuff (foo) as the last statement in config/routes.rb, without breaking the file syntax. Specifica...
Lett asked 7/11, 2013 at 12:21

4

Solved

I want to automate things like: Creating a new Ruby on Rails application with pre-selected database, Git initialize it, create a Heroku project, commit all files, etc. Upload all files in folder ...
Kendrakendrah asked 19/8, 2010 at 17:8

3

Solved

I'm new to Thor (and to Ruby) and I'm considering using it within a build script, as it's said it can be a replacement to Rake (thus to Make). However after a short trial, I'm confused about the er...
Kisangani asked 21/6, 2013 at 18:24

1

Solved

I am trying to create a executable ruby script using Thor. I have defined the options for my task. So far I have something like this class Command < Thor desc "csv2strings CSV_FILENAME", "co...
Ragan asked 27/6, 2013 at 16:37

5

I'm writing a Rails 3 generator that creates two different models. Here's a very simplified example of what I'm trying to do: def my_generator_task invoke "model", ["foo"] invoke "model", ["bar"...
Straddle asked 2/12, 2010 at 2:58

1

Solved

Or, to be more specific: Can't I just use private methods instead?
Rogerrogerio asked 28/2, 2013 at 9:8

© 2022 - 2024 — McMap. All rights reserved.