Skip to content

Instantly share code, notes, and snippets.

@joebutler2
Forked from JoeyButler/INSTALL.md
Created March 17, 2014 00:06
Show Gist options
  • Save joebutler2/9591751 to your computer and use it in GitHub Desktop.
Save joebutler2/9591751 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
class App < Thor
include Thor::Actions
desc "create", "creates folder with project name include the gemfile and rvm gemset"
def create(name)
Dir.mkdir name
template "templates/generic_gemfile.erb", "#{name}/Gemfile"
`echo 'rvm use 1.9.3-p125@#{name} --create' > #{name}/.rvmrc`
end
# Used internally by thor. I have no idea why it doesn't have this by default.
def self.source_root
File.dirname(__FILE__)
end
end

thor install app_create.thor Make sure that the templates__generic_gemfile.erb is renamed and moved to ~/.thor/templates/generic_gemfile.erb

Then you can run thor list to verify that the script was installed successfully. If the command appears in the output, you should be good to run thor app:create APP_NAME.

source 'https://rubygems.org'
group :development do
gem 'pry'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment