This repository has been archived by the owner on Mar 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andy B
committed
Aug 7, 2017
1 parent
7a7b533
commit d6204dc
Showing
6 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
require 'rubotnik/cli' | ||
require 'rubotnik/generator' | ||
Rubotnik::CLI.start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
require 'thor' | ||
require 'rubotnik' | ||
require 'rubotnik/generator' | ||
|
||
module Rubotnik | ||
class CLI < Thor | ||
desc "test WORD", "Echos argument to console" | ||
def test(*word) | ||
puts word.join(' ') | ||
end | ||
|
||
desc "generate", "Generate file structure" | ||
def generate | ||
generator = Rubotnik::Generator.new | ||
generator.destination_root = '~/tmp/test' | ||
generator.invoke_all | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Commands | ||
# The contents of this module will be overridden by Commands in host | ||
# The contents of this module will be overridden by Commands inside host app | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require 'thor' | ||
require 'thor/group' | ||
require 'rubotnik' | ||
|
||
class Rubotnik::Generator < Thor::Group | ||
include Thor::Actions | ||
desc 'Generate a new filesystem structure' | ||
|
||
def self.source_root | ||
File.dirname(__FILE__) + '/../../templates' | ||
end | ||
|
||
# def create_config_file | ||
# copy_file 'config.yml', 'config/mygem.yml' | ||
# end | ||
|
||
def create_git_files | ||
copy_file 'gitignore', '.gitignore' | ||
create_file 'images/.gitkeep' | ||
create_file 'text/.gitkeep' | ||
end | ||
|
||
def create_output_directory | ||
empty_directory 'output' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters