Class: DrinkUpDoctor::NewTwbsSite
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- DrinkUpDoctor::NewTwbsSite
- Includes:
- Thor::Actions
- Defined in:
- lib/drink_up_doctor/new_twbs_site.rb
Class Method Summary collapse
Instance Method Summary collapse
- #app_name ⇒ Object
- #copy_bootstrap_boilerplate ⇒ Object
- #copy_gemfile ⇒ Object
- #copy_gulp_file ⇒ Object
- #create_baseurl_config ⇒ Object
- #create_bower_file ⇒ Object
- #create_config ⇒ Object
- #create_package_file ⇒ Object
- #create_project_directory ⇒ Object
- #create_setup ⇒ Object
- #print_instructions ⇒ Object
Class Method Details
.source_root ⇒ Object
22 23 24 |
# File 'lib/drink_up_doctor/new_twbs_site.rb', line 22 def self.source_root File.("../../../", __FILE__) end |
Instance Method Details
#app_name ⇒ Object
8 9 10 |
# File 'lib/drink_up_doctor/new_twbs_site.rb', line 8 def app_name @app_name || File.basename($0) end |
#copy_bootstrap_boilerplate ⇒ Object
84 85 86 |
# File 'lib/drink_up_doctor/new_twbs_site.rb', line 84 def copy_bootstrap_boilerplate directory "bootstrap-boilerplate", name end |
#copy_gemfile ⇒ Object
75 76 77 |
# File 'lib/drink_up_doctor/new_twbs_site.rb', line 75 def copy_gemfile copy_file "templates/Gemfile", "#{name}/Gemfile" end |
#copy_gulp_file ⇒ Object
71 72 73 |
# 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 ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/drink_up_doctor/new_twbs_site.rb', line 54 def create_baseurl_config config_file = "#{name}/_baseurl.yml" config = { "baseurl" => ["baseurl"] } create_file config_file, config.to_yaml prepend_to_file config_file, "# Generated by #{app_name}" end |
#create_bower_file ⇒ Object
63 64 65 |
# 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 ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/drink_up_doctor/new_twbs_site.rb', line 30 def create_config config_file = "#{name}/_config.yml" config = {"name" => name} config.merge! config.merge!({ "social" => { "twitter" => ["twitter_username"], "github" => ["github_username"] }, "baseurl" => "", "markdown" => "kramdown", "kramdown" => { "input" => "GFM", "hard_wrap" => false }, "defaults" => { "author" => ["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 ⇒ Object
67 68 69 |
# 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 ⇒ Object
26 27 28 |
# File 'lib/drink_up_doctor/new_twbs_site.rb', line 26 def create_project_directory empty_directory name end |
#create_setup ⇒ Object
79 80 81 82 |
# 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 ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/drink_up_doctor/new_twbs_site.rb', line 88 def print_instructions puts <<-instructions ******************************************************************************** Completing the Installation --------------------------- Change into the new site directory and run the setup script: $ cd "./#{name}" $ ./.setup.sh This will install the npm modules, bower components, and ruby gems needed to work with your new site. After the setup is complete, you can start up the gulp server and start blogging: $ gulp When you are ready to publish, shut down the gulp server with Ctrl-C and run the distribution build: $ gulp dist The distribution will be in "./#{name}/_dist/" and you can push that to where your site is located. (Github pages, AWS S3, your own server, or whatever you choose to use.) ******************************************************************************** instructions end |