Class: GemBootstrap::Configuration Private

Inherits:
Object
  • Object
show all
Defined in:
lib/gem-bootstrap/configuration.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_name:, module_name:, gem_name:, author_name:, author_email:, github_username:) ⇒ Configuration

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/gem-bootstrap/configuration.rb', line 9

def initialize(
  project_name:,
  module_name:,
  gem_name:,
  author_name:,
  author_email:,
  github_username:
)
  @project_name = project_name
  @module_name = module_name
  @gem_name = gem_name
  @author_name = author_name
  @author_email = author_email
  @project_summary = project_name
  @github_username = github_username
  @github_repo = "#{github_username}/#{gem_name}"
  @year = Time.now.utc.year
  @docs_url = "https://www.rubydoc.info/github/#{github_repo}/master"
  @gitter_url = "https://gitter.im/#{github_username}"
  @github_url = "https://github.com/#{github_repo}"
  @changelog_url = @github_url + '/blob/master/CHANGELOG.md'
end

Instance Attribute Details

#author_emailString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


48
49
50
# File 'lib/gem-bootstrap/configuration.rb', line 48

def author_email
  @author_email
end

#author_nameString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


45
46
47
# File 'lib/gem-bootstrap/configuration.rb', line 45

def author_name
  @author_name
end

#changelog_urlString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


69
70
71
# File 'lib/gem-bootstrap/configuration.rb', line 69

def changelog_url
  @changelog_url
end

#docs_urlString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


60
61
62
# File 'lib/gem-bootstrap/configuration.rb', line 60

def docs_url
  @docs_url
end

#gem_nameString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


42
43
44
# File 'lib/gem-bootstrap/configuration.rb', line 42

def gem_name
  @gem_name
end

#github_repoString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


54
55
56
# File 'lib/gem-bootstrap/configuration.rb', line 54

def github_repo
  @github_repo
end

#github_urlString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


66
67
68
# File 'lib/gem-bootstrap/configuration.rb', line 66

def github_url
  @github_url
end

#github_usernameString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


51
52
53
# File 'lib/gem-bootstrap/configuration.rb', line 51

def github_username
  @github_username
end

#gitter_urlString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


63
64
65
# File 'lib/gem-bootstrap/configuration.rb', line 63

def gitter_url
  @gitter_url
end

#module_nameString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


39
40
41
# File 'lib/gem-bootstrap/configuration.rb', line 39

def module_name
  @module_name
end

#project_nameString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


33
34
35
# File 'lib/gem-bootstrap/configuration.rb', line 33

def project_name
  @project_name
end

#project_summaryString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


36
37
38
# File 'lib/gem-bootstrap/configuration.rb', line 36

def project_summary
  @project_summary
end

#yearInteger (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Integer)


57
58
59
# File 'lib/gem-bootstrap/configuration.rb', line 57

def year
  @year
end

Class Method Details

.build(options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • options (Slop::Options)


74
75
76
77
78
79
80
81
82
83
84
# File 'lib/gem-bootstrap/configuration.rb', line 74

def build(options)
  gem_name = options.arguments.first
  new(
    project_name: project_name(gem_name),
    module_name: module_name(gem_name),
    gem_name: gem_name,
    author_name: author(options),
    author_email: email(options),
    github_username: options[:github_username]
  )
end