Class: Gemsmith::CLI
- Inherits:
-
Thor
- Object
- Thor
- Gemsmith::CLI
show all
- Includes:
- CLIHelpers, CLIOptions, Thor::Actions, ThorPlus::Actions
- Defined in:
- lib/gemsmith/cli.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from CLIHelpers
#editor, enforce_symbol_keys, #gem_class, #gem_name, open_gem, pick_gem, print_gems, process_gem, read_gem, #template_options
Methods included from CLIOptions
author_email, author_name, author_url, company_name, company_url, default_boolean, gem_platform, gem_private_key, gem_public_key, gem_url, github_user, initialize_template_options, rails_version, ruby_version, year
Constructor Details
#initialize(args = [], options = {}, config = {}) ⇒ CLI
30
31
32
33
34
35
|
# File 'lib/gemsmith/cli.rb', line 30
def initialize args = [], options = {}, config = {}
super args, options, config
@settings_file = File.join ENV["HOME"], ".gemsmith", "settings.yml"
@settings = load_yaml @settings_file
@template_options = {}
end
|
Class Method Details
.source_root ⇒ Object
Overwrites the Thor template source root.
25
26
27
|
# File 'lib/gemsmith/cli.rb', line 25
def self.source_root
File.expand_path File.join(File.dirname(__FILE__), "templates")
end
|
Instance Method Details
#edit ⇒ Object
79
80
81
|
# File 'lib/gemsmith/cli.rb', line 79
def edit
`#{editor} #{@settings_file}`
end
|
#help(task = nil) ⇒ Object
91
92
93
|
# File 'lib/gemsmith/cli.rb', line 91
def help task = nil
say and super
end
|
#open(name) ⇒ Object
67
68
69
|
# File 'lib/gemsmith/cli.rb', line 67
def open name
process_gem name, "open"
end
|
#read(name) ⇒ Object
73
74
75
|
# File 'lib/gemsmith/cli.rb', line 73
def read name
process_gem name, "read"
end
|
#version ⇒ Object
85
86
87
|
# File 'lib/gemsmith/cli.rb', line 85
def version
say "Gemsmith " + VERSION
end
|