WWW::Shopify::Tools::Themer

The core class that deals with theme management, pushing and pulling to and from a shopify store.

my $STC = new WWW::Shopify::Tools::Themer({url => $myurl, apikey => $myapikey, password => $mypassword, directory => $mypath});
OR
my $STC = new WWW::Shopify::Tools::Themer({url => $myurl, email => $myemail, password => $mypassword, directory => $mypath});

Can use either a private API key, or a password.

transfer_progress($self, $type, $theme, $files_transferred, $files_remaining, $file)

Called during theme pushes. Lets you easily log what's happening. Normally, simply makes formatted output to log.

read_exception

Spits out a nice exception message from all the underlying exception types that may be thrown.

get_themes

get_themes returns an array of all the themes present in the shop, with the active theme first.

pull_all

pull_all essentially pulls all themes from the remote site. Gets all themes using the API, and then calls pull on each of them. Also pulls on pages.

$STC = new WWW::Shopify::Tools::Themer($settings);
$STC->pull_all([$folder]);

pull_pages

Pulls all pages from a store and dumps them into the working/specified folder, in a directory named pages.

$STC->pull_pages([$folder]);

Files that are locally and remotely changed will be overwritten locally, so keep an eye out for this. Files that are locally not, and remotely chagned will be overritten locally. Files that are not present locally and remotely present will be pulled.

pull

Pulls all assets from a particular theme and then dumps them into the working/specified folder, in a directory named for the particular theme.

my @themes = $sa->get_all('ShopifyAPI::Model::Theme');
$STC->pull($themes[2], [$folder]);

Files that are locally and remotely changed will be overwritten locally, so keep an eye out for this. Files that are locally not, and remotely chagned will be overritten locally. Files that are not present locally and remotely present will be pulled.

push_all

Pushes all assets from all themes, if they need to be pushed, as well as pages.

push_pages

Pushes all pages that need to be pushed.

$STC->push_pages([$folder]);

Files that are locally changed, and remotely not, will be pushed. Files that are locally changed, and remotely changed, will not be pushed. Files that are locally unchanged will only be pushed if the file is missing on the server.

push

Pushes all assets from a particular theme that need to be pushed.

$STC->push($theme, [$folder]);

Files that are locally changed, and remotely not, will be pushed. Files that are locally changed, and remotely changed, will not be pushed. Files that are locally unchanged will only be pushed if the file is missing on the server.

activate

Sets the sepecified theme as the main shopify theme.

SEE ALSO

WWW::Shopify, WWW::Shopify::Private, WWW::Shopify::Model::Theme, WWW::Shopify::Model::Asset

AUTHOR

Adam Harrison (adamdharrison@gmail.com)

LICENSE

Copyright (C) 2013 Adam Harrison

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.