reparcs 0.2.0 → 0.2.1
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/History.txt +4 -0
- data/lib/reparcs.rb +1 -1
- data/lib/reparcs/projects.rb +8 -7
- metadata +1 -1
data/History.txt
CHANGED
data/lib/reparcs.rb
CHANGED
data/lib/reparcs/projects.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
include Base
|
3
3
|
|
4
|
+
path = __FILE__.gsub("projects.rb", "")
|
5
|
+
JAVASCRIPT_LIB_PATH = "#{path}../../javascript"
|
6
|
+
|
4
7
|
#The Projects module contains the classes that act as good starting points for
|
5
8
|
#reparcs projects.
|
6
9
|
module Projects
|
@@ -15,8 +18,7 @@ module Projects
|
|
15
18
|
@lang = "en"
|
16
19
|
@xmlns = "http://www.w3.org/1999/xhtml"
|
17
20
|
@charset = "utf-8"
|
18
|
-
@start_element = %{<!DOCTYPE html PUBLIC
|
19
|
-
"-//W3C//DTD XHTML 1.0 Transitional//EN"
|
21
|
+
@start_element = %{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
20
22
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
21
23
|
<html
|
22
24
|
xml:lang=\"#{@xml_lang}\"
|
@@ -43,7 +45,7 @@ module Projects
|
|
43
45
|
#the files when published.
|
44
46
|
#Unless you intend to create a javascript directory and include them yourself!
|
45
47
|
def include_scriptaculous
|
46
|
-
Dir.foreach(
|
48
|
+
Dir.foreach(JAVASCRIPT_LIB_PATH) { |f|
|
47
49
|
unless f[0,1] == "."
|
48
50
|
s = Script.new({:src => "javascript/#{f}"})
|
49
51
|
@head.append(s)
|
@@ -82,9 +84,9 @@ module Projects
|
|
82
84
|
end
|
83
85
|
#Automatically includes the required javascript files, for the effects.
|
84
86
|
def include_scriptaculous_files
|
85
|
-
Dir.foreach(
|
87
|
+
Dir.foreach(JAVASCRIPT_LIB_PATH) { |f|
|
86
88
|
unless f[0,1] == "."
|
87
|
-
@javascript_files << "
|
89
|
+
@javascript_files << "#{JAVASCRIPT_LIB_PATH}/#{f}"
|
88
90
|
end
|
89
91
|
}
|
90
92
|
end
|
@@ -112,8 +114,7 @@ module Projects
|
|
112
114
|
def append(name, page)
|
113
115
|
@pages << [name, page]
|
114
116
|
end
|
115
|
-
#Publishes the entire website to the given directory
|
116
|
-
#have any files in the given directory, they may be replaced!
|
117
|
+
#Publishes the entire website to the given directory.
|
117
118
|
def publish(directory)
|
118
119
|
root = directory
|
119
120
|
unless @javascript_files.length == 0
|