class Dopstick::Generator::Options
Public Class Methods
new(options)
click to toggle source
# File lib/dopstick/generator/options.rb, line 8 def initialize(options) @options = options end
Public Instance Methods
[](key)
click to toggle source
# File lib/dopstick/generator/options.rb, line 12 def [](key) @options[key] end
bin?()
click to toggle source
# File lib/dopstick/generator/options.rb, line 32 def bin? !@options[:bin].empty? end
github_url()
click to toggle source
# File lib/dopstick/generator/options.rb, line 60 def github_url "https://github.com/#{github_user}/#{package_name}" end
github_user()
click to toggle source
# File lib/dopstick/generator/options.rb, line 48 def github_user @github_user ||= @options[:author_github].presence || `git config user.github`.chomp.presence || "[USER]" end
merge(other)
click to toggle source
# File lib/dopstick/generator/options.rb, line 16 def merge(other) @options.merge(other) end
method_missing(name, *args)
click to toggle source
Calls superclass method
# File lib/dopstick/generator/options.rb, line 24 def method_missing(name, *args) @options.key?(name) ? @options[name] : super end
paypal_user()
click to toggle source
# File lib/dopstick/generator/options.rb, line 54 def paypal_user @paypal_user ||= @options[:author_paypal].presence || `git config user.paypal`.chomp.presence || "[USER]" end
respond_to_missing?(name, _include_all)
click to toggle source
Calls superclass method
# File lib/dopstick/generator/options.rb, line 20 def respond_to_missing?(name, _include_all) options.key?(name) || super end
skip_install?()
click to toggle source
# File lib/dopstick/generator/options.rb, line 28 def skip_install? @options[:skip_install] end
user_email()
click to toggle source
# File lib/dopstick/generator/options.rb, line 42 def user_email @user_email ||= @options[:author_email].presence || `git config user.email`.chomp.presence || "your@email.com" end
user_name()
click to toggle source
# File lib/dopstick/generator/options.rb, line 36 def user_name @user_name ||= @options[:author_name].presence || `git config user.name`.chomp.presence || "Your Name" end