Class: Usmu::Github::Pages
- Inherits:
-
Object
- Object
- Usmu::Github::Pages
show all
- Defined in:
- lib/usmu/github/pages/version.rb,
lib/usmu/github/pages.rb
Defined Under Namespace
Modules: Commands
Classes: Configuration
Constant Summary
collapse
- VERSION =
The current version string for the gem
'1.0.2'
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ Pages
Returns a new instance of Pages.
10
11
12
13
|
# File 'lib/usmu/github/pages.rb', line 10
def initialize
@log = Logging.logger[self]
@log.debug("Initializing usmu-github-pages v#{VERSION}")
end
|
Instance Method Details
#command_deploy(args, options) ⇒ void
41
42
43
|
# File 'lib/usmu/github/pages.rb', line 41
def command_deploy(args, options)
Usmu::Github::Pages::Commands::Deploy.new(args, options).run(config)
end
|
#command_init(args, options) ⇒ void
37
38
39
|
# File 'lib/usmu/github/pages.rb', line 37
def command_init(args, options)
Usmu::Github::Pages::Commands::Init.new(args, options).run(config)
end
|
#commands(ui, c) ⇒ void
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/usmu/github/pages.rb', line 16
def commands(ui, c)
@log.debug('Adding commands from usmu-github-pages.')
@ui = ui
c.command(:'gh-pages init') do |command|
command.syntax = 'usmu gh-pages init'
command.description = 'Ensures that your repository is compatible and setup correctly for Github Pages.'
command.action(&method(:command_init))
end
c.command(:'gh-pages deploy') do |command|
command.syntax = 'usmu gh-pages deploy'
command.description = 'Generates a site and commits it to Github.'
command.action(&method(:command_deploy))
end
end
|
#config ⇒ void
33
34
35
|
# File 'lib/usmu/github/pages.rb', line 33
def config
@config ||= Configuration.new(@ui.configuration['plugin', 'github-pages', default: {}])
end
|