aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/themes.rake2
-rw-r--r--lib/theme.rb3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/tasks/themes.rake b/lib/tasks/themes.rake
index a8d16f108..1eed92f1e 100644
--- a/lib/tasks/themes.rake
+++ b/lib/tasks/themes.rake
@@ -85,7 +85,7 @@ namespace :themes do
def install_theme(theme_url, verbose, deprecated=false)
deprecation_string = deprecated ? " using deprecated THEME_URL" : ""
- theme_name = File.basename(theme_url, '.git')
+ theme_name = theme_url_to_theme_name theme_url
puts "Installing theme #{theme_name}#{deprecation_string} from #{theme_url}"
uninstall(theme_name, verbose) if installed?(theme_name)
install_theme_using_git(theme_name, theme_url, verbose)
diff --git a/lib/theme.rb b/lib/theme.rb
new file mode 100644
index 000000000..4f03b5d99
--- /dev/null
+++ b/lib/theme.rb
@@ -0,0 +1,3 @@
+def theme_url_to_theme_name(theme_url)
+ File.basename theme_url, '.git'
+end