-
Notifications
You must be signed in to change notification settings - Fork 1
how to setup theme development
First you need to install File Watchers for RubyMine This can be done from: RubyMine > Preferences > Plugins > Install JetBrains Plugins
There search for File Watchers, install and restart RubyMine
Now you're all set on using file watchers
Go to RubyMine > Preferences > File Watchers
Click plus button to add new watcher
Fill in name and description to your liking These are the settings to use:
Show console: error (will throw up the console when there are parse errors)
File Type: SCSS
Scope: Project Files
Program: /bin/bash
Arguments:
-login -c "rvm use 2.1.1@shoperb && scss --no-cache --update $ProjectFileDir$/app/themes/default/scss/style.css.scss:$ProjectFileDir$/app/themes/default/stylesheets/style.css"
The safest ruby version and gemset to use here is the one that Shoperb uses. Of course adjust the source and target directories to the theme that you are developing.
Working directory:
Output paths to refresh:
These instructions can be found in .irbrc in the Shoperb project folder
add next lines into ~/.irbrc
def load_irbrc(path)
return if (path == ENV["HOME"]) || (path == '/')
load_irbrc(File.dirname path)
irbrc = File.join(path, ".irbrc")
load irbrc if File.exists?(irbrc)
end
load_irbrc Dir.pwd # probably should stay at the bottom
And in the .irbrc folder in the Shoperb project root there is this: Shop.current = Shop.first
If the shop you want to load is not this, then adjust it.
This will automatically load the current store in the rails console.
If you did everything in the previous step. Then updating the current theme is done with: Shop.current.theme.send(:import)
You need to run this every time you change stylesheets or javascript files.