class DrinkUpDoctor::NewTwbsSite

Public Class Methods

source_root() click to toggle source
# File lib/drink_up_doctor/new_twbs_site.rb, line 22
def self.source_root
  File.expand_path("../../../", __FILE__)
end

Public Instance Methods

app_name() click to toggle source
# File lib/drink_up_doctor/new_twbs_site.rb, line 8
def app_name
  @app_name || File.basename($0)
end
copy_bootstrap_boilerplate() click to toggle source
# File lib/drink_up_doctor/new_twbs_site.rb, line 84
def copy_bootstrap_boilerplate
  directory "bootstrap-boilerplate", name
end
copy_gemfile() click to toggle source
# File lib/drink_up_doctor/new_twbs_site.rb, line 75
def copy_gemfile
  copy_file "templates/Gemfile", "#{name}/Gemfile"
end
copy_gulp_file() click to toggle source
# File lib/drink_up_doctor/new_twbs_site.rb, line 71
def copy_gulp_file
  template "templates/gulpfile.js.erb", "#{name}/gulpfile.js"
end
create_baseurl_config() click to toggle source
# File lib/drink_up_doctor/new_twbs_site.rb, line 54
def create_baseurl_config
  config_file = "#{name}/_baseurl.yml"
  config = {
    "baseurl" => options["baseurl"]
  }
  create_file config_file, config.to_yaml
  prepend_to_file config_file, "# Generated by #{app_name}"
end
create_bower_file() click to toggle source
# File lib/drink_up_doctor/new_twbs_site.rb, line 63
def create_bower_file
  template "templates/bower.json.erb", "#{name}/bower.json"
end
create_config() click to toggle source
# File lib/drink_up_doctor/new_twbs_site.rb, line 30
def create_config
  config_file = "#{name}/_config.yml"
  config = {"name" => name}
  config.merge! options
  config.merge!({
      "social" => {
        "twitter" => options["twitter_username"],
        "github"  => options["github_username"]
      },
      "baseurl" => "",
      "markdown" => "kramdown",
      "kramdown" => {
        "input" => "GFM",
        "hard_wrap" => false
      },
      "defaults" => {
        "author" => options["author"]
      },
      "exclude" => %w[README.md bower.json package.json gulpfile.js node_modules bower_components Gemfile Gemfile.lock]
    })
  create_file config_file, config.to_yaml
  prepend_to_file config_file, "# Generated by #{app_name}\n"
end
create_package_file() click to toggle source
# File lib/drink_up_doctor/new_twbs_site.rb, line 67
def create_package_file
  template "templates/package.json.erb", "#{name}/package.json"
end
create_project_directory() click to toggle source
# File lib/drink_up_doctor/new_twbs_site.rb, line 26
def create_project_directory
  empty_directory name
end
create_setup() click to toggle source
# File lib/drink_up_doctor/new_twbs_site.rb, line 79
def create_setup
  copy_file "templates/setup.sh", "#{name}/.setup.sh"
  chmod "#{name}/.setup.sh", 0755
end
print_instructions() click to toggle source