├── .gitignore ├── README.md ├── VERSION ├── classes └── String.rb ├── includes ├── Arguments.rb └── commands │ ├── Create.rb │ ├── Destroy.rb │ ├── Fix.rb │ ├── Help.rb │ ├── Install.rb │ ├── Setup.rb │ └── Uninstall.rb ├── install.sh ├── license.txt └── start.rb /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WPLOCAL 2 | ====== 3 | 4 | *CREATE AND RUN A WORDPRESS INSTANCE LOCALLY WITHIN 8 SECONDS!* 5 | 6 | *WPLOCAL* is a command-line tool for creating and managing very fast local WordPress installations. You can create an instante in merely 8 seconds with its dedicated folder and database, without using any complicated or cumbersome platform such as Docker or Vagrant. Instead, it uses [Laravel Valet](https://laravel.com/docs/5.3/valet) (which uses [Caddy](https://caddyserver.com) and [DNSMasq](https://en.wikipedia.org/wiki/Dnsmasq)), MariaDB, the mighty [wp-cli](http://wp-cli.org) and PHP7 libraries all through composer and brew package managers. 7 | 8 | For the latest news on this project, follow [@hellodevapps on Twitter](https://twitter.com/hellodevapps), me [@schmitzoide on Twitter](https://twitter.com/hellodevapps) or [visit my blog](http://schmitzoide.blog). There will be a roadmap soon here for an overview of what's planned for upcoming releases, and also with directions on how to contribute to this project and where to work on first. THERE'S A LOT TO DO! For now, I just want to test this out and get a grip of how it is working as a basic simple and very useful tool and take it to higher levels such us remote instance replications, cloning, local sharing, automatic publications and more. 9 | 10 | All this comes out of our daily working day at [hellodev](https://hellodev.us), a WordPress specialised agency from Porto, Portugal, as a contribution to the community. 11 | 12 | ## Using 13 | 14 | *WPLOCAL* goal is to provide a command-line interface for creating a local WordPress installation with one simple line: `wplocal create -w mysite`. This will create a folder named mysite, and in it, the latest WordPress release with a database called `mysite`, and a running site at `http://mysite.test`. 15 | 16 | ```bash 17 | $ wplocal create -w mysite 18 | Going to install WordPress on folder /Users/marcelschmitz/Documents/Websites/mysite accessible at http://mysite.test... 19 | Creating folder... 20 | Installing WordPress here... 21 | Downloading WordPress 4.9.7 (en_US)... 22 | Using cached file '/Users/marcelschmitz/.wp-cli/cache/core/wordpress-4.9.7-en_US.tar.gz'... 23 | Success: WordPress downloaded. 24 | ✔︎ Done 25 | Creating database... 26 | Starting MySQL 27 | .161129 23:44:48 mysqld_safe Logging to '/usr/local/var/mysql/Marcels-iMac.local.err'. 28 | SUCCESS! 29 | ✔︎ Done 30 | Configuring WordPress... 31 | Success: Generated 'wp-config.php' file. 32 | Starting Valet... 33 | A [mysite] symbolic link has been created in [/Users/marcelschmitz/.valet/Sites/mysite]. 34 | ✔︎ All Done! 35 | ✔︎ Installed 36 | ``` 37 | 38 | This created the above install in 8 seconds! You can very quickly undo this, delete everything created by the command line with this simple command: 39 | 40 | ```bash 41 | $ wplocal destroy -w mysite 42 | Going to uninstall website on folder /Users/marcelschmitz/Documents/Websites/mysite and delete the database. Proceed? (y)es / (n)o 43 | y 44 | Deleting database... 45 | Starting MySQL 46 | SUCCESS! 47 | ✔︎ Done 48 | Deleting folder... 49 | 161129 23:46:32 mysqld_safe Logging to '/usr/local/var/mysql/Marcels-iMac.local.err'. 50 | ✔︎ Done 51 | ``` 52 | 53 | This took 1 second to complete. It is really just that simple. 54 | 55 | ## Installing 56 | 57 | To install this command-line tool you'll need to download the complete project and run the install script. 58 | 59 | Minimum requirements are an OS X operating system, 10.8 or greater. Sorry, no Linux or UNIX support yet. More on that later! 60 | 61 | When you're ready you can download the complete project into a folder and lauch the terminal inside that folder. Then you need to do this simple lines of commands: 62 | 63 | ```bash 64 | $ chmod +x install.sh 65 | $ ./install.sh 66 | ``` 67 | 68 | If it all went ok (no reason not to), the script will automatically execute `wplocal version` and expect something like this to come out: 69 | 70 | ```bash 71 | v0.2 by Marcel Schmitz @schmitzoide hellodev.us 72 | ALL DONE! 73 | ``` 74 | 75 | As a final step, you need to install all the components that WPLOCAL needs to run. Well, you just need to type a command, WPLOCAL will do all the dirty work for you: 76 | 77 | ```bash 78 | $ wplocal setup 79 | Going to check for installed compoments... 80 | 81 | 82 | ## Checking for 🍺 Brew 83 | Homebrew 1.7.1 84 | Homebrew/homebrew-core (git revision 92d57; last commit 2018-08-01) 85 | ✔︎ Check 86 | Update available? 87 | Already up-to-date. 88 | 89 | 90 | ## Checking for Composer 91 | Composer version 1.5.2 2017-09-11 16:59:25 92 | ✔︎ Check 93 | 94 | 95 | ## Checking for MySQL 96 | mysql Ver 15.1 Distrib 10.2.10-MariaDB, for osx10.13 (x86_64) using readline 5.1 97 | ✔︎ Check 98 | 99 | 100 | ## Checking for Laravel Valet 101 | Password: 102 | Laravel Valet 2.0.12 103 | ✔︎ Check 104 | 105 | 106 | ## Checking for WP-CLI 107 | WP-CLI 1.5.1 108 | ✔︎ Check 109 | 110 | 111 | ## Updating everything to the latest version 112 | Changed current directory to /Users/marcelschmitz/.composer 113 | Loading composer repositories with package information 114 | Updating dependencies (including require-dev) 115 | Nothing to install or update 116 | Generating autoload files 117 | ✔︎ Check 118 | 119 | 120 | ## Checking for dependencies 121 | Going to install... 122 | GEM dependencies... 123 | ✔︎ Installed 124 | 125 | 126 | Pinging .test... 127 | PING *.test (127.0.0.1): 56 data bytes 128 | 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.036 ms 129 | 130 | --- *.test ping statistics --- 131 | 1 packets transmitted, 1 packets received, 0.0% packet loss 132 | round-trip min/avg/max/stddev = 0.036/0.036/0.036/0.000 ms 133 | 134 | ✔︎ ALL GOOD! Hurray! 135 | 136 | CD into the dir where you want to install your local WordPress website and run `wplocal create -w NAME_OF_SITE` 137 | ``` 138 | 139 | ### Updating 140 | 141 | Well, this is probably the first thing to do if you want to contribute, build the update command. Shouldn't be difficult, right? Want to do it? Otherwise, repeat the install process with the newest release. 142 | 143 | ### More commands 144 | 145 | To checkout what else WPLOCAL can do (not that much yet), just type `wplocal`and hit ENTER. 146 | 147 | 148 | ## Contributing 149 | 150 | This is our first project on Github, open to the public, embracing all kinds of contributions to make this project get somewhere. Therefore, it is with a great pleasure that I invite YOU dearly to contribute! We need your support! Not only to write code, but also to test it and criticise and suggest new features and break it for us to fix it. 151 | 152 | This is yours! This is ours! 153 | 154 | 155 | ## Credits 156 | 157 | All the libraries used for this tool to work are done by a tone of awesome, out of the world, developers which contribution is why we exist today as developers that we are. The only thing we've done (actually, Marcel did it) is to code the wplocal.rb which we hope we can expand and start adding some names here. So for now, we thank your CTO for making our lives a tiny bit easier: 158 | 159 | [Marcel Schmitz](https://schmitzoi.de) 160 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 2016-07-05 - 0.2 2 | # new improved install script and procedure to update commands 3 | # added SSL support 4 | 5 | 2016-07-05 - 0.1 6 | # initial release -------------------------------------------------------------------------------- /classes/String.rb: -------------------------------------------------------------------------------- 1 | class String 2 | # colorization 3 | def colorize(color_code) 4 | "\e[#{color_code}m#{self}\e[0m" 5 | end 6 | 7 | def red 8 | colorize(31) 9 | end 10 | 11 | def green 12 | colorize(32) 13 | end 14 | 15 | def yellow 16 | colorize(33) 17 | end 18 | 19 | def blue 20 | colorize(34) 21 | end 22 | 23 | def pink 24 | colorize(35) 25 | end 26 | 27 | def light_blue 28 | colorize(36) 29 | end 30 | end -------------------------------------------------------------------------------- /includes/Arguments.rb: -------------------------------------------------------------------------------- 1 | def parse_options 2 | options = {} 3 | case ARGV[1] 4 | when "-p" 5 | options[:p] = ARGV[2] 6 | when "-w" 7 | options[:w] = ARGV[2] 8 | end 9 | options 10 | end 11 | 12 | v1 = ARGV[0] 13 | 14 | case v1 15 | when "setup" 16 | setup 17 | when "uninstall" 18 | uninstall 19 | when "create" 20 | if !parse_options[:w] 21 | puts "parameter -w (for website) is missing :-(".red 22 | abort 23 | end 24 | create parse_options[:w] 25 | when "destroy" 26 | if !parse_options[:w] 27 | puts "parameter -w (for website) is missing :-(".red 28 | abort 29 | end 30 | destroy parse_options[:w] 31 | when "fix" 32 | fix 33 | when "help" 34 | help 35 | when "version" 36 | puts 'v0.2'.green + ' by Marcel Schmitz'.blue + ' @schmitzoide'.yellow + ' hellodev.us'.red 37 | else 38 | help 39 | end 40 | -------------------------------------------------------------------------------- /includes/commands/Create.rb: -------------------------------------------------------------------------------- 1 | def create (cmd) 2 | 3 | site = cmd.to_s 4 | current = Dir.pwd 5 | 6 | puts 'Going to install WordPress on folder ' + current + '/' + site + ' accessible at http://' + site + '.test...' 7 | 8 | puts 'Creating folder...'.yellow 9 | system ("mkdir -p " + current + "/" + site) 10 | if $?.exitstatus != 0 11 | puts "✖︎︎ Error creating dir :-(".red 12 | abort 13 | end 14 | 15 | puts 'Installing WordPress here...'.yellow 16 | system("cd " + current + "/" + site + " && wp core download") 17 | if $?.exitstatus != 0 18 | puts "✖︎︎ Error downloading latest version of WordPress :-(".red 19 | abort 20 | end 21 | puts "✔︎ Done".green 22 | puts 'Creating database...'.yellow 23 | system("mysql.server start && mysql -u root -e 'create database " + site + "'") 24 | if $?.exitstatus != 0 25 | puts "✖︎︎ Error creating database :-(".red 26 | abort 27 | end 28 | puts "✔︎ Done".green 29 | puts 'Configuring WordPress...'.yellow 30 | system("cd " + current + "/" + site + " && wp core config --dbname='" + site + "' --dbuser='root' --dbhost='localhost'") 31 | if $?.exitstatus != 0 32 | puts "✖︎︎ Error creating wp-config.php :-(".red 33 | abort 34 | end 35 | puts 'Starting Valet...'.yellow 36 | system("cd " + current + "/" + site + " && valet link " + site + " --secure") 37 | if $?.exitstatus != 0 38 | puts "✖︎︎ Error creating wp-config.php :-(".red 39 | abort 40 | end 41 | puts "✔︎ All Done!".green 42 | system ("open http://" + site + ".test") 43 | 44 | if $?.exitstatus == 0 45 | puts "✔︎ Installed".green 46 | else 47 | puts "✖︎︎ Not installed".red 48 | end 49 | 50 | end -------------------------------------------------------------------------------- /includes/commands/Destroy.rb: -------------------------------------------------------------------------------- 1 | def destroy (cmd) 2 | 3 | site = cmd.to_s 4 | current = Dir.pwd 5 | 6 | puts 'Going to uninstall website on folder ' + current + '/' + site + ' and delete the database. Proceed? (y)es / (n)o' 7 | input = STDIN.gets.chomp 8 | if (input == "yes" or input == "y") 9 | puts 'Delete link to folder...'.yellow 10 | system("valet unlink " + site); 11 | if $?.exitstatus != 0 12 | puts "✖︎︎ Error unlinking site, aborting :-(".red 13 | abort 14 | end 15 | puts 'Deleting database...'.yellow 16 | system("mysql.server start && mysql -u root -e 'drop database " + site + " '"); 17 | if $?.exitstatus != 0 18 | puts "✖︎︎ Error deleting database, aborting :-(".red 19 | abort 20 | end 21 | puts "✔︎ Done".green 22 | puts 'Deleting folder...'.yellow 23 | system("cd " + current + " && rm -r " + site); 24 | if $?.exitstatus != 0 25 | puts "✖︎︎ Error deleting database, aborting :-(".red 26 | abort 27 | end 28 | puts "✔︎ Done".green 29 | else 30 | puts "✔︎ Aborted, nothing done.".green 31 | end 32 | end -------------------------------------------------------------------------------- /includes/commands/Fix.rb: -------------------------------------------------------------------------------- 1 | def fix 2 | 3 | system 'clear' 4 | 5 | puts ' ' 6 | puts 'Fixing instalation (if eventually asked for root access, please proceed)...'.green 7 | puts ' ' 8 | puts ' ' 9 | begin 10 | system("sudo apachectl stop") 11 | system("export PATH=\"$PATH:$HOME/.composer/vendor/bin\"") 12 | system("composer global update") 13 | system("composer global remove laravel/valet") 14 | system("composer global require laravel/valet") 15 | system("valet install") 16 | system("valet start") 17 | rescue 18 | system("composer global remove laravel/valet") 19 | system("composer global require laravel/valet") 20 | system("valet install") 21 | system("valet start") 22 | end 23 | puts "✔︎ ALL GOOD! Hurray!".green 24 | 25 | end -------------------------------------------------------------------------------- /includes/commands/Help.rb: -------------------------------------------------------------------------------- 1 | def help 2 | puts "wplocal - a simple script that helps you create a local WordPress development using Laravel Valet, MariaDB, PHP7, wp-cli and other optional components.".red 3 | puts "\twplocal setup\t\t- check for installed components, if not available, installs them"; 4 | puts "\twplocal create\t\t- installs a WordPress website and database, expexts -w parameter"; 5 | puts "\twplocal destroy\t\t- uninstalls a WordPress website, deletes folder and drops database, expexts -w parameter"; 6 | puts "\twplocal fix\t\t- should fix any instalation problem with valet"; 7 | puts "\twplocal version\t\t- show version info"; 8 | end -------------------------------------------------------------------------------- /includes/commands/Install.rb: -------------------------------------------------------------------------------- 1 | def install (mod) 2 | 3 | puts 'Going to install...' 4 | 5 | case mod 6 | when "valet" 7 | puts 'Laravel Valet...'.yellow 8 | system("export PATH=\"$PATH:$HOME/.composer/vendor/bin\"") 9 | system("export PATH=\"$PATH:$HOME/.composer/vendor/bin\"") 10 | system("sudo apachectl stop") 11 | system("composer global require laravel/valet") 12 | if $?.exitstatus == 0 13 | system("valet install") 14 | system("valet start") 15 | puts "✔︎ Installed".green 16 | else 17 | puts "✖︎︎ Not installed".red 18 | end 19 | when "composer" 20 | puts 'Composer...'.yellow 21 | system("curl -sS https://getcomposer.org/installer | php") 22 | system("sudo mv composer.phar /usr/local/bin/composer") 23 | if $?.exitstatus == 0 24 | puts "✔︎ Installed".green 25 | else 26 | puts "✖︎︎ Not installed".red 27 | end 28 | when "php" 29 | puts 'PHP...'.yellow 30 | system("brew install php") 31 | if $?.exitstatus == 0 32 | puts "✔︎ Installed".green 33 | else 34 | puts "✖︎︎ Not installed".red 35 | end 36 | when "mariadb" 37 | puts 'MariaDB...'.yellow 38 | system("brew install mariadb") 39 | system("mysql.server start") 40 | if $?.exitstatus == 0 41 | puts "✔︎ Installed".green 42 | else 43 | puts "✖︎︎ Not installed".red 44 | end 45 | when "brew" 46 | puts 'Homebrew...'.yellow 47 | system('/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"') 48 | if $?.exitstatus == 0 49 | puts "✔︎ Installed".green 50 | else 51 | puts "✖︎︎ Not installed".red 52 | end 53 | when "wpcli" 54 | puts 'WP-CLI'.yellow 55 | system('curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar') 56 | system('chmod +x wp-cli.phar') 57 | system('sudo mv wp-cli.phar /usr/local/bin/wp') 58 | if $?.exitstatus == 0 59 | puts "✔︎ Installed".green 60 | else 61 | puts "✖︎︎ Not installed".red 62 | end 63 | when "dep" 64 | puts 'GEM dependencies...'.yellow 65 | if $?.exitstatus == 0 66 | puts "✔︎ Installed".green 67 | else 68 | puts "✖︎︎ Not installed".red 69 | end 70 | end 71 | end -------------------------------------------------------------------------------- /includes/commands/Setup.rb: -------------------------------------------------------------------------------- 1 | def setup 2 | 3 | system 'clear' 4 | 5 | puts ' ' 6 | puts 'Going to check for installed compoments...'.yellow 7 | puts ' ' 8 | puts ' ' 9 | puts '## Checking for 🍺 Brew'.yellow 10 | system("brew -v") 11 | if $?.exitstatus == 0 12 | puts "✔︎ Check".green 13 | puts "Update available?".yellow 14 | system("brew update") 15 | else 16 | puts "✖︎︎ Not installed".red 17 | install 'brew' 18 | end 19 | puts ' ' 20 | puts ' ' 21 | puts '## Checking for PHP'.yellow 22 | system("php --version") 23 | if $?.exitstatus == 0 24 | puts "✔︎ Check".green 25 | else 26 | puts "✖︎︎ Not installed".red 27 | install 'php' 28 | end 29 | puts ' ' 30 | puts ' ' 31 | puts '## Checking for Composer'.yellow 32 | system("composer --version") 33 | if $?.exitstatus == 0 34 | puts "✔︎ Check".green 35 | else 36 | puts "✖︎︎ Not installed".red 37 | install 'composer' 38 | end 39 | puts ' ' 40 | puts ' ' 41 | puts '## Checking for MySQL'.yellow 42 | system("mysql -V") 43 | if $?.exitstatus == 0 44 | puts "✔︎ Check".green 45 | else 46 | puts "✖︎︎ Not installed".red 47 | install 'mariadb' 48 | end 49 | puts ' ' 50 | puts ' ' 51 | puts '## Checking for Laravel Valet'.yellow 52 | system("valet -V") 53 | if $?.exitstatus == 0 54 | puts "✔︎ Check".green 55 | else 56 | puts "✖︎︎ Not installed".red 57 | install 'valet' 58 | end 59 | puts ' ' 60 | puts ' ' 61 | puts '## Checking for WP-CLI'.yellow 62 | system("wp --version") 63 | if $?.exitstatus == 0 64 | puts "✔︎ Check".green 65 | else 66 | puts "✖︎︎ Not installed".red 67 | install 'wpcli' 68 | end 69 | puts ' ' 70 | puts ' ' 71 | puts '## Updating everything to the latest version'.yellow 72 | system("composer global update") 73 | if $?.exitstatus == 0 74 | puts "✔︎ Check".green 75 | else 76 | puts "✖︎? Unable to update...".red 77 | end 78 | puts ' ' 79 | puts ' ' 80 | puts '## Checking for dependencies'.yellow 81 | install 'dep' 82 | puts ' ' 83 | puts ' ' 84 | puts 'Pinging .test...'.yellow 85 | system('ping -c 1 *.test') 86 | puts ' ' 87 | puts "✔︎ ALL GOOD! Hurray!".green 88 | puts ' ' 89 | puts "CD into the dir where you want to install your local WordPress website and run `wplocal create -w NAME_OF_SITE`".green 90 | 91 | end -------------------------------------------------------------------------------- /includes/commands/Uninstall.rb: -------------------------------------------------------------------------------- 1 | def uninstall 2 | 3 | system 'clear' 4 | cp puts ' ' 5 | 6 | puts 'Going to uninstall everything component wplocal installed and delete the databases. Proceed? (y)es / (n)o' 7 | input = STDIN.gets.chomp 8 | if (input == "yes" or input == "y") 9 | system("valet uninstall") 10 | system("composer global remove laravel/valet") 11 | system("mysql.server stop") 12 | system("brew remove mariadb") 13 | system("brew cleanup") 14 | system("sudo rm /usr/local/bin/composer") 15 | system("sudo rm -r ~/.composer") 16 | puts "✔︎ Uninstalled. Thanks for trying wplocal!".green 17 | else 18 | puts "✖︎︎ Aborted".red 19 | end 20 | 21 | end -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # file: install.sh 3 | 4 | file="wplocal.rb" 5 | if [ ! -f "$file" ] 6 | then 7 | rm wplocal.rb 8 | fi 9 | 10 | touch wplocal.rb 11 | cat start.rb >> wplocal.rb 12 | echo '' >> wplocal.rb 13 | echo '' >> wplocal.rb 14 | cat classes/String.rb >> wplocal.rb 15 | echo '' >> wplocal.rb 16 | cat includes/commands/Setup.rb >> wplocal.rb 17 | echo '' >> wplocal.rb 18 | cat includes/commands/Fix.rb >> wplocal.rb 19 | echo '' >> wplocal.rb 20 | cat includes/commands/Install.rb >> wplocal.rb 21 | echo '' >> wplocal.rb 22 | cat includes/commands/Uninstall.rb >> wplocal.rb 23 | echo '' >> wplocal.rb 24 | cat includes/commands/Create.rb >> wplocal.rb 25 | echo '' >> wplocal.rb 26 | cat includes/commands/Destroy.rb >> wplocal.rb 27 | echo '' >> wplocal.rb 28 | cat includes/commands/Help.rb >> wplocal.rb 29 | echo '' >> wplocal.rb 30 | cat includes/Arguments.rb >> wplocal.rb 31 | 32 | chmod +x wplocal.rb 33 | sudo mv wplocal.rb /usr/local/bin/wplocal 34 | wplocal version 35 | echo "ALL DONE!" 36 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | All code in this repository, unless otherwise specified, is hereby licensed under the MIT Public License: 2 | ========================================================================================================= 3 | 4 | Copyright (C) 2011-2016 WP-CLI Development Group (https://github.com/wp-cli/wp-cli/contributors) 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /start.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'optparse' 4 | require 'json' 5 | require 'date' 6 | require 'fileutils' 7 | require 'rubygems' --------------------------------------------------------------------------------