refinerycms-convertor 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -23,3 +23,4 @@ rdoc
23
23
  pkg
24
24
 
25
25
  ## PROJECT::SPECIFIC
26
+ convertor-test
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -1,4 +1,4 @@
1
- require 'convertor-tags'
1
+ require File.expand_path(File.dirname(__FILE__) + '/convertor-tags.rb')
2
2
 
3
3
  class ConvertorFile
4
4
 
@@ -1,8 +1,8 @@
1
1
  class ConvertorLayout < ConvertorFile
2
2
 
3
3
  def initialize(original_file)
4
- super(Rails.root.join('themes', 'theme', 'original', original_file))
5
- copy(Rails.root.join('themes', 'theme', 'layouts', 'application.html.erb'))
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"
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{refinerycms-convertor}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["stevenheidel"]
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+
4
+ $theme = "theme"
5
+
3
6
  require 'refinerycms-convertor'
4
7
  require 'spec'
5
8
  require 'spec/autorun'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - stevenheidel