Class: Rubysmith::CLI::Configuration::Content

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubysmith/cli/configuration/content.rb

Overview

Defines the common configuration content for use throughout the gem.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*arguments) ⇒ Content

Returns a new instance of Content.



47
48
49
50
51
52
53
# File 'lib/rubysmith/cli/configuration/content.rb', line 47

def initialize *arguments
  super

  self[:template_root] ||= Pathname(__dir__).join("../../templates").expand_path
  self[:build_root] ||= Pathname.pwd
  freeze
end

Instance Attribute Details

#author_emailObject

Returns the value of attribute author_email

Returns:

  • (Object)

    the current value of author_email



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def author_email
  @author_email
end

#author_nameObject

Returns the value of attribute author_name

Returns:

  • (Object)

    the current value of author_name



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def author_name
  @author_name
end

#author_urlObject

Returns the value of attribute author_url

Returns:

  • (Object)

    the current value of author_url



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def author_url
  @author_url
end

#build_amazing_printObject

Returns the value of attribute build_amazing_print

Returns:

  • (Object)

    the current value of build_amazing_print



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_amazing_print
  @build_amazing_print
end

#build_bundler_auditObject

Returns the value of attribute build_bundler_audit

Returns:

  • (Object)

    the current value of build_bundler_audit



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_bundler_audit
  @build_bundler_audit
end

#build_bundler_leakObject

Returns the value of attribute build_bundler_leak

Returns:

  • (Object)

    the current value of build_bundler_leak



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_bundler_leak
  @build_bundler_leak
end

#build_consoleObject

Returns the value of attribute build_console

Returns:

  • (Object)

    the current value of build_console



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_console
  @build_console
end

#build_documentationObject

Returns the value of attribute build_documentation

Returns:

  • (Object)

    the current value of build_documentation



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_documentation
  @build_documentation
end

#build_gitObject

Returns the value of attribute build_git

Returns:

  • (Object)

    the current value of build_git



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_git
  @build_git
end

#build_git_lintObject

Returns the value of attribute build_git_lint

Returns:

  • (Object)

    the current value of build_git_lint



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_git_lint
  @build_git_lint
end

#build_guardObject

Returns the value of attribute build_guard

Returns:

  • (Object)

    the current value of build_guard



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_guard
  @build_guard
end

#build_minimumObject

Returns the value of attribute build_minimum

Returns:

  • (Object)

    the current value of build_minimum



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_minimum
  @build_minimum
end

#build_pryObject

Returns the value of attribute build_pry

Returns:

  • (Object)

    the current value of build_pry



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_pry
  @build_pry
end

#build_reekObject

Returns the value of attribute build_reek

Returns:

  • (Object)

    the current value of build_reek



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_reek
  @build_reek
end

#build_refinementsObject

Returns the value of attribute build_refinements

Returns:

  • (Object)

    the current value of build_refinements



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_refinements
  @build_refinements
end

#build_rootObject

Returns the value of attribute build_root

Returns:

  • (Object)

    the current value of build_root



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_root
  @build_root
end

#build_rspecObject

Returns the value of attribute build_rspec

Returns:

  • (Object)

    the current value of build_rspec



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_rspec
  @build_rspec
end

#build_rubocopObject

Returns the value of attribute build_rubocop

Returns:

  • (Object)

    the current value of build_rubocop



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_rubocop
  @build_rubocop
end

#build_ruby_criticObject

Returns the value of attribute build_ruby_critic

Returns:

  • (Object)

    the current value of build_ruby_critic



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_ruby_critic
  @build_ruby_critic
end

#build_setupObject

Returns the value of attribute build_setup

Returns:

  • (Object)

    the current value of build_setup



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_setup
  @build_setup
end

#build_simple_covObject

Returns the value of attribute build_simple_cov

Returns:

  • (Object)

    the current value of build_simple_cov



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def build_simple_cov
  @build_simple_cov
end

#builders_pragmater_commentsObject

Returns the value of attribute builders_pragmater_comments

Returns:

  • (Object)

    the current value of builders_pragmater_comments



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def builders_pragmater_comments
  @builders_pragmater_comments
end

#builders_pragmater_includesObject

Returns the value of attribute builders_pragmater_includes

Returns:

  • (Object)

    the current value of builders_pragmater_includes



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def builders_pragmater_includes
  @builders_pragmater_includes
end

#configObject

Returns the value of attribute config

Returns:

  • (Object)

    the current value of config



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def config
  @config
end

#documentation_formatObject

Returns the value of attribute documentation_format

Returns:

  • (Object)

    the current value of documentation_format



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def documentation_format
  @documentation_format
end

#documentation_licenseObject

Returns the value of attribute documentation_license

Returns:

  • (Object)

    the current value of documentation_license



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def documentation_license
  @documentation_license
end

#helpObject

Returns the value of attribute help

Returns:

  • (Object)

    the current value of help



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def help
  @help
end

#nowObject

Returns the value of attribute now

Returns:

  • (Object)

    the current value of now



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def now
  @now
end

#project_nameObject

Returns the value of attribute project_name

Returns:

  • (Object)

    the current value of project_name



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def project_name
  @project_name
end

#template_pathObject

Returns the value of attribute template_path

Returns:

  • (Object)

    the current value of template_path



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def template_path
  @template_path
end

#template_rootObject

Returns the value of attribute template_root

Returns:

  • (Object)

    the current value of template_root



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def template_root
  @template_root
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



10
11
12
# File 'lib/rubysmith/cli/configuration/content.rb', line 10

def version
  @version
end

Instance Method Details

#project_classObject



59
# File 'lib/rubysmith/cli/configuration/content.rb', line 59

def project_class = project_name.camelcase

#project_labelObject



57
# File 'lib/rubysmith/cli/configuration/content.rb', line 57

def project_label = project_name.titleize

#project_rootObject



61
# File 'lib/rubysmith/cli/configuration/content.rb', line 61

def project_root = build_root.join(project_name)

#to_pathwayObject



63
64
65
# File 'lib/rubysmith/cli/configuration/content.rb', line 63

def to_pathway
  Pathway[start_root: template_root, start_path: template_path, end_root: build_root]
end

#with(attributes) ⇒ Object



55
# File 'lib/rubysmith/cli/configuration/content.rb', line 55

def with(attributes) = self.class.new(to_h.merge(attributes))