refinerycms-convertor 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/VERSION +1 -1
- data/lib/convertor-file.rb +1 -1
- data/lib/convertor-layout.rb +2 -2
- data/lib/refinerycms-convertor.rb +3 -3
- data/lib/tasks/refinerycms-convertor.rake +2 -2
- data/refinerycms-convertor.gemspec +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +2 -2
data/.gitignore
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/convertor-file.rb
CHANGED
data/lib/convertor-layout.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
class ConvertorLayout < ConvertorFile
|
2
2
|
|
3
3
|
def initialize(original_file)
|
4
|
-
super(Rails.root.join('themes',
|
5
|
-
copy(Rails.root.join('themes',
|
4
|
+
super(Rails.root.join('themes', $theme, 'original', original_file))
|
5
|
+
copy(Rails.root.join('themes', $theme, 'layouts', 'application.html.erb'))
|
6
6
|
end
|
7
7
|
|
8
8
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
|
3
|
-
require 'convertor-file'
|
4
|
-
require 'convertor-layout'
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + '/convertor-file.rb')
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + '/convertor-layout.rb')
|
5
5
|
|
6
6
|
class RefinerycmsConvertor
|
7
7
|
|
8
|
-
attr_reader :theme_dir, :original_dir
|
8
|
+
attr_reader :theme_dir, :original_dir, :theme
|
9
9
|
|
10
10
|
def initialize(theme)
|
11
11
|
raise ArgumentError, "Theme not found" unless File.directory?(@theme_dir = Rails.root.join('themes', theme))
|
@@ -4,8 +4,8 @@ namespace :refinery do
|
|
4
4
|
|
5
5
|
desc "Convert an existing html website to refinerycms"
|
6
6
|
task :convert do
|
7
|
-
if (theme = ENV["theme"]).present?
|
8
|
-
@theme = RefinerycmsConvertor.new(theme)
|
7
|
+
if ($theme = ENV["theme"]).present?
|
8
|
+
@theme = RefinerycmsConvertor.new($theme)
|
9
9
|
@theme.convert!
|
10
10
|
else
|
11
11
|
puts "Please specify the theme name"
|
data/spec/spec_helper.rb
CHANGED