Class: Init

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions, Util
Defined in:
lib/commands/init.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Util

#add_to_git, #alter_index_html, #alter_link, #content_root, #each_presentation, #git_repository?, #has_remote?, #init_git, #parse_config, #presentation, #pull_from_git, #request_token

Class Method Details

.source_rootObject



11
12
13
# File 'lib/commands/init.rb', line 11

def self.source_root
  File.expand_path('../',__dir__)
end

Instance Method Details

#create_project_structureObject

TODO download latest reveal-framework. maybe rubyzip. duno



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/commands/init.rb', line 30

def create_project_structure

  @host = options[:host]
  @git = options[:git]

  interactive_mode unless @host && @project_name

  @url = URI.parse "http://#{@host}"

  empty_directory "#{@project_name}/master/slides"
  empty_directory "#{@project_name}/client/slides"

  template 'template/config.yml.erb', "#{@project_name}/config.yml"
  directory 'template/reveal.js-3.0.0/', "#{@project_name}/master/"
  directory 'template/reveal.js-3.0.0/', "#{@project_name}/client/"

  if @git
    @git == 'git' ?
        init_git(@project_name) : init_git(@project_name,@git)
  end
end