coursegen 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f6fafa449aaa1c612bd2ceee93620309658a577
4
- data.tar.gz: 3944ddf885fdc20f3981aafc64f5eda9e5f68fa8
3
+ metadata.gz: 1e2f6c2ea67094e8ba7dc3414f042a73ace63c19
4
+ data.tar.gz: d7a51110c869df0830ba913f09ade795cc3563ca
5
5
  SHA512:
6
- metadata.gz: a51af70545c7dad4360845bc63c04fe211c2742988cb2295d8ac4ca2fe8daba44ff383df733e582bb2d44ded1d760937c68fc0816abae5a2938dbc70cfa958a4
7
- data.tar.gz: 885fbdf8a783e77379114d906b573a4a2761e6896b69f127877000a9e8a00cb4783b2ddb586bb44fa96a2cea32ef430473f39a444f3a6788474364d04979d3c1
6
+ metadata.gz: 72e610d9fd4f2ad960e95ee29d85b5fdc13592234819621db31e1f7caa8b1044fb1ed7f0d16251a8098ef86b7c945a4ff04f50ca14e54fcf6972f20e190de99c
7
+ data.tar.gz: 4f17949ef7bf29d45d7b15cccb8cbf3334c4e74813a7f26f8d15b879bb680da2952c98c18af13c1c2da08a0ebc1dbd03414df164c2acf4612021c4acd6d53374
@@ -30,5 +30,9 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency "pry"
31
31
  spec.add_dependency "nokogiri"
32
32
  spec.add_dependency "activesupport"
33
+ spec.add_dependency "kramdown"
34
+ spec.add_dependency "adsf"
35
+ spec.add_dependency "guard"
36
+ spec.add_dependency "guard-shell"
33
37
 
34
38
  end
@@ -23,10 +23,10 @@ class Lectures < Section
23
23
  i.lecture_number = lecture_num
24
24
  i.lecture_date = @schedule.event_date_by_index(lecture_num - 1) # Lecture numbers are base 1
25
25
  if i.type == "subsection"
26
- @root.add(Tree::TreeNode.new(i.subsection, i)) rescue binding.pry
26
+ @root.add(Tree::TreeNode.new(i.subsection, i))
27
27
  elsif i.type == "page"
28
28
  parent_tree_node = parent_node_of(i)
29
- parent_tree_node.add(Tree::TreeNode.new(i.identifier, i)) rescue binding.pry
29
+ parent_tree_node.add(Tree::TreeNode.new(i.identifier, i))
30
30
  lecture_num += 1
31
31
  else
32
32
  raise ArgumentError, "invalid lecture page type of #{i.type}for #{i.title}"
@@ -36,7 +36,6 @@ class Lectures < Section
36
36
 
37
37
  def parent_node_of citem
38
38
  parent_node = @root[citem.subsection]
39
- # binding.pry if parent_node.nil?
40
39
  raise RuntimeError, "Cant find section for item: #{citem.identifier}" if parent_node.nil?
41
40
  parent_node
42
41
  end
@@ -57,7 +56,7 @@ class Lectures < Section
57
56
  end
58
57
 
59
58
  def next_for(citem)
60
- next_node = treenode_of(citem).next_sibling rescue binding.pry
59
+ next_node = treenode_of(citem).next_sibling
61
60
  if !next_node.nil?
62
61
  next_node.content
63
62
  else
@@ -74,16 +73,8 @@ class Lectures < Section
74
73
  end
75
74
  end
76
75
 
77
- # def citem_lecture_number citem
78
- # citem.lecture_number
79
- # end
80
-
81
76
  protected
82
77
 
83
- # def sort_items
84
- # @citems.sort_by { |i| [ i.type == "subsection" ? "A" : "B", i.order ] }
85
- # end
86
-
87
78
  def sort_items
88
79
  @citems.sort_by! { |i| [ lookup_citem_by_identifier(i.subsection).order, ((i.type == "page" ? 100 : 1 ) * i.order) ] }
89
80
  end
@@ -19,7 +19,6 @@ class Section
19
19
 
20
20
  def find_by_short_name(sname)
21
21
  matches = @citems.select { |c| sname == c.short_name}
22
- binding.pry if matches.length != 1
23
22
  raise RuntimeError,"#{sname}: invalid reference in section \"#{@section}\"" if matches.length == 0
24
23
  raise RunimeError, "#{sname}: duplicate referenced in section \"#{@section}\"" if matches.length != 1
25
24
  matches[0]
@@ -59,7 +58,6 @@ class Section
59
58
 
60
59
  def lookup_citem_by_identifier identifier
61
60
  res = @citems.select { |i| i.identifier == identifier }
62
- binding.pry if res.length != 1
63
61
  raise RuntimeError, "lookup by identifier failed #{identifier}" if res.length != 1
64
62
  res[0]
65
63
  end
@@ -74,6 +72,6 @@ class Section
74
72
  end
75
73
 
76
74
  def sort_pages
77
- @citems.sort! { |a,b| a.order <=> b.order } rescue binding.pry
75
+ @citems.sort! { |a,b| a.order <=> b.order } rescue fail "sort_pages in section.rb"
78
76
  end
79
77
  end
@@ -64,13 +64,13 @@ class Toc
64
64
 
65
65
  def find_next_forn(nitem)
66
66
  p = find_next_for(n2c(nitem))
67
- binding.pry if p.nil?
67
+ fail "find_next_forn" if p.nil?
68
68
  p
69
69
  end
70
70
 
71
71
  def find_previous_forn(nitem)
72
72
  p = find_previous_for(n2c(nitem))
73
- binding.pry if p.nil?
73
+ fail "find_previous_forn" if p.nil?
74
74
  p
75
75
  end
76
76
 
@@ -82,12 +82,6 @@ class Toc
82
82
  section(citem.section).previous_for(citem)
83
83
  end
84
84
 
85
- # def section_for nitem
86
- # sec = @sections[n2c(nitem).section]
87
- # binding.pry if sec.nil?
88
- # sec
89
- # end
90
-
91
85
  def citem_section citem
92
86
  @sections[citem.section]
93
87
  end
@@ -47,7 +47,7 @@ HTMLSTRING
47
47
  template_string = <<-HTMLSTRING
48
48
  <div class="row">
49
49
  <div class="col-md-offset-2 col-md-#{width}">
50
- <img src="../#{filename_string}" class="img-responsive img-thumbnail" />
50
+ <img src="#{filename_string}" class="img-responsive img-thumbnail" />
51
51
  </div>
52
52
  </div>
53
53
  HTMLSTRING
@@ -64,13 +64,13 @@ class Toc
64
64
 
65
65
  def find_next_forn(nitem)
66
66
  p = find_next_for(n2c(nitem))
67
- binding.pry if p.nil?
67
+ fail "find_next_forn in toc.rb" if p.nil?
68
68
  p
69
69
  end
70
70
 
71
71
  def find_previous_forn(nitem)
72
72
  p = find_previous_for(n2c(nitem))
73
- binding.pry if p.nil?
73
+ fail "find_prev_forn in toc.rb" if p.nil?
74
74
  p
75
75
  end
76
76
 
@@ -82,12 +82,6 @@ class Toc
82
82
  section(citem.section).previous_for(citem)
83
83
  end
84
84
 
85
- # def section_for nitem
86
- # sec = @sections[n2c(nitem).section]
87
- # binding.pry if sec.nil?
88
- # sec
89
- # end
90
-
91
85
  def citem_section citem
92
86
  @sections[citem.section]
93
87
  end
@@ -72,6 +72,7 @@ class Scheduler
72
72
  private
73
73
 
74
74
  def string_to_date(string_date)
75
- Date.strptime(string_date, "%b-%d-%Y") rescue binding.pry
75
+ Date.strptime(string_date, "%b-%d-%Y") rescue fail "string to date in scheduler.rb"
76
+
76
77
  end
77
78
  end
@@ -1,3 +1,3 @@
1
1
  module Coursegen
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -3,7 +3,7 @@ require 'active_support/core_ext/date/conversions'
3
3
  require_relative "./spec_helper.rb"
4
4
 
5
5
  def s2d(string_date)
6
- Date.strptime(string_date, "%b-%d-%Y") rescue binding.pry
6
+ Date.strptime(string_date, "%b-%d-%Y")
7
7
  end
8
8
 
9
9
  describe Scheduler do
@@ -89,9 +89,9 @@ route '*' do
89
89
  raise RuntimeError, "Missing required extension: \".#{item.identifier}\""
90
90
  elsif item.binary?
91
91
  # Write item with identifier /foo/ to /foo.ext
92
- item.identifier.chop + '.' + item[:extension] rescue binding.pry
92
+ item.identifier.chop + '.' + item[:extension] rescue fail "in route * in Rules"
93
93
  elsif item.identifier == "/search_logic/tipuesearch_content/"
94
- item.identifier.chop + '.' + item[:extension] rescue binding.pry
94
+ item.identifier.chop + '.' + item[:extension] rescue fail "in route * in Rules"
95
95
  elsif item[:status] == "hidden"
96
96
  nil
97
97
  elsif item[:type] == "subsection"
metadata CHANGED
@@ -1,139 +1,195 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coursegen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pito Salas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-11 00:00:00.000000000 Z
11
+ date: 2014-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.6'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nanoc
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.6.11
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.6.11
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubytree
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: cri
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: nokogiri
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: activesupport
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: kramdown
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: adsf
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: guard
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: guard-shell
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
137
193
  - !ruby/object:Gem::Version
138
194
  version: '0'
139
195
  description: Use Nanoc to build courses and deploy them to S3
@@ -144,7 +200,7 @@ executables:
144
200
  extensions: []
145
201
  extra_rdoc_files: []
146
202
  files:
147
- - .gitignore
203
+ - ".gitignore"
148
204
  - Gemfile
149
205
  - Gemfile.lock
150
206
  - LICENSE.txt
@@ -215,17 +271,17 @@ require_paths:
215
271
  - lib
216
272
  required_ruby_version: !ruby/object:Gem::Requirement
217
273
  requirements:
218
- - - '>='
274
+ - - ">="
219
275
  - !ruby/object:Gem::Version
220
276
  version: '0'
221
277
  required_rubygems_version: !ruby/object:Gem::Requirement
222
278
  requirements:
223
- - - '>='
279
+ - - ">="
224
280
  - !ruby/object:Gem::Version
225
281
  version: '0'
226
282
  requirements: []
227
283
  rubyforge_project:
228
- rubygems_version: 2.0.14
284
+ rubygems_version: 2.2.2
229
285
  signing_key:
230
286
  specification_version: 4
231
287
  summary: Use Nanoc to build courses and deploy them to S3
@@ -236,4 +292,3 @@ test_files:
236
292
  - spec/section_spec.rb
237
293
  - spec/spec_helper.rb
238
294
  - spec/toc_spec.rb
239
- has_rdoc: