-
Notifications
You must be signed in to change notification settings - Fork 2
/
scratch.rb
129 lines (77 loc) · 2.61 KB
/
scratch.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
require './lib/inports'
$r.kill_keys
# #puts EzPub::File.mine?('./input/curriculum-support/Teacher-Education/PTTER-framework/E1/E1A2.htm')
# str = StringFromPath.get_case_insensitive('./input/curriculum-support/Teacher-Education/PTTER-framework/E1/E1A2.htm')
# doc = Nokogiri::HTML(str)
# include FieldParsers
# puts get_title(doc)
# include IsARedirect
# redirect?('./input/curriculum-support/CSP/index.htm')
# DatabaseImporters::Question.run
# include PostProcessor
# post_process
# @p = Processor.new
# puts @p.list
# path = @p.to_xml :name => 'techlink-content'
# str = StringFromPath.get_case_insensitive('./input/Case-studies/Technological-practice/Soft-Materials/Conscious-Cloth/index.htm')
# puts to_ezp(str, :config => Sanitize::InportConfig::EZXML)
# module EzPub
# class Handler
# class << self
# def parent_id(path)
# 'abc'
# end
# end
# end
# end
# @p = Processor.new
# FasterCSV.read(CONFIG['directories']['dbs'] + "/CourseOutlines.csv").each do |row|
# puts row[0]
# end
paths = [
'./input/navigation',
# './input/teaching-snapshot/Y01-06-Junior/',
# './input/teaching-snapshot/Y07-10-Middle/',
# './input/teaching-snapshot/Y12-13-Senior/',
]
paths.each do |path|
puts EzPub::Ignorable.mine?(path)
# EzPub::DBSmallGallery.store(path)
# include PostProcessor
# post_process
# puts $r.hget(path, 'field_title')
# puts $r.hget(path, 'field_body')
# puts $r.hget(path, 'field_image')
#puts $r.hget(path, 'field_curriculum_links')
end
# include ActsAsIndex
# puts acts_as_index? './input/teaching-snapshot/ts.htm'
# puts has_remote_index? './input/student-showcase/Materials/'
# @p = Processor.new
# @p.to_xml :name => 'techlink-content-only.xml'
# SanityCheck.render_as_list './output/xml/techlink-content-only.xml'
# paths.each do |path|
# puts @p.handle path
# end
# SanityCheck.summary './output/xml/techlink-content.xml'
# puts $r.hget(path, 'field_body')
# Processor.new.list.each do |path|
# puts path
# str = StringFromPath.get_case_insensitive(path)
# path.gsub!('./input', 'http://www.techlink.org.nz')
# Sanitize.clean(str, :transformers => [ClassAttributeInspector], :path => path)
# end
# puts $r.hget(path, 'field_category')
# puts $r.hget(path, 'field_case_study_date')
# puts $r.hget(path, 'field_year_level')
# puts $r.hget(path, 'field_cover_image')
# File.open('classes.txt', 'a') do |f|
# $r.smembers('classes').each do |line|
# f.write(line + "\n")
# end
# end
# File.open('examples.txt', 'a') do |f|
# $r.smembers('examples').each do |line|
# f.write(line + "\n")
# end
# end