![Wordless logo](https://raw.githubusercontent.com/welaika/wordless_gem/master/assets/images/wordless_gem.png) A command line tool to help manage your [Wordless](http://welaika.github.com/wordless/)-based WordPress sites. [![Build Status](https://semaphoreapp.com/api/v1/projects/1b1be0c0-b8aa-4778-a644-675ca3f7b9e4/303149/shields_badge.svg)](https://semaphoreapp.com/welaika/wordless_gem) ## Premise This is a ruby-gem, so we expect you have already installed _ruby_; if it isn't the case, probably you'll like to take a look to [rbenv](https://github.com/sstephenson/rbenv). Wordless ~~can't~~ can recognize if you are inside a wordpress' dirtree if you ~~won't be in the root dir~~ are in any subdirectory, starting from [commit df5e408](https://github.com/welaika/wordless_gem/commit/df5e408fcdcb54cccdf2e08c9a0c1873fbc675c4). ~~so use it from the root dir.~~ Easy peasy. ## Installation gem install wordless ## Usage wordless help Tasks: wordless clean # Clean static assets wordless compile # Compile static assets wordless deploy # Deploy your WordPress site using the deploy_command defined in your Wordfile wordless help [TASK] # Describe available tasks or one specific task wordless install # Install the Wordless plugin into an existing WordPress installation wordless new [NAME] # Download WordPress in specified directory, install the Wordless plugin and create a Wordless theme wordless theme [NAME] # Create a new Wordless theme NAME #### new Create a new Wordless-enabled WordPress site in directory `mysite`. This downloads the latest stable release of WordPress (you can also specify a locale): wordless new mysite ```bash Options: [--force] # Overwrite existing WP-CLI / WP-CLI Server installation -l, [--locale=LOCALE] # WordPress locale # Default: en_US -b, [--bare=BARE] # Remove default themes and plugins # Default: true [--admin-user=ADMIN_USER] # WordPress admin user # Default: admin [--admin-email=ADMIN_EMAIL] # WordPress admin email # Default: admin@example.com [--admin-password=ADMIN_PASSWORD] # WordPress admin password # Default: password [--db-user=DB_USER] # MySQL database user # Default: root [--db-password=DB_PASSWORD] # MySQL database pasword [--site-url=SITE_URL] # Wordpress site URL # Default: http://localhost:8080 ``` ##### caveats - Default db-password is no password #### install If you already have WordPress installed, you can install the Wordless plugin (this currently installs from the master branch on GitHub): wordless install #### theme Once Wordless is installed, you can create a new Wordless theme: wordless theme mytheme Note: don't try at home to use `wordless theme .`: it won't work! So call it within the `wp-content/themes` dir and pass a theme name as argument. #### compile Note: if you have no idea why the need to compile assets, you should read the Wordless' README. Compile your site's static assets: wordless compile #### clean Clean your compiled static assets: wordless clean #### deploy Deploy your wordless installation using the `deploy_command` specified in your Wordfile: wordless deploy You can also use the refresh option `-r` to compile your assets before deploying and clean your assets after: wordless deploy -r ## Configuration You can, **optionally**, create a `Wordfile` to customize the behaviour of wordless: ```yaml wordless_repo: 'git://github.com/welaika/wordless.git' static_css: - 'wp-content/themes/mytheme/assets/stylesheets/screen.css' - 'wp-content/themes/mytheme/assets/stylesheets/print.css' static_js: - 'wp-content/themes/mytheme/assets/javascripts/application.js' - 'wp-content/themes/mytheme/assets/javascripts/mobile.js' deploy_command: 'wordmove push -t' ``` **Note**: remember to add `screen.css` and/or `application.js` if you want to define `static_css` or `static_js` ## Caveats - If you attempt to download a WordPress localization that's outdated, the latest English version will be downloaded instead. - Not tested on Windows ## Running specs ```bash bundle install && ./setup_tests.sh && rspec ``` We've noticed problems running tests while using `rvm`; all of them solved using `rbenv`. We have some clues about the problem, but we are ignoring it at the moment. We have switched the CI tool to _sempaphore_, which use rbenv, so pull requests will be tested in a working environement. ## Need more tools? Visit [Wordpress Tools](http://wptools.it). ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Add some specs 4. Commit your changes (`git commit -am 'Added some feature'`) 5. Push to the branch (`git push origin my-new-feature`) 6. Create new Pull Request ## Author made with ❤️ and ☕️ by [weLaika](http://dev.welaika.com)