coursegen 0.5.0 → 0.7.0

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
- SHA1:
3
- metadata.gz: 95d19a204722d46d2b449d337e27120f1a5695c7
4
- data.tar.gz: e01e950e3f56726062f896af924837cdc8785636
2
+ SHA256:
3
+ metadata.gz: f25c5692cc76fdaf8d3aebcc1c5d09b4a3adf99b9afb762839a6b9d58d94108d
4
+ data.tar.gz: 6c2546ac48c2285f7ccb03104a4adba4bd0416dbb7603f2ee856b6b5a462f2e2
5
5
  SHA512:
6
- metadata.gz: '089b8cc554d0cf6ddb255d62611de872aba7a4d39958ac9b906c9892a2c619c1ed84595e634cb0e8f3fd88683f527eaadd1c09b6197204663793de485e1ef901'
7
- data.tar.gz: 8d743322068f0fc4349627c009dbae91249266cf03c1274435bfaaaa26afb301ed1cb8805343c3c3bb049ef5489fa5eaa3fb02e646fe5132fabf19f5a563acd7
6
+ metadata.gz: 2485f4f287a7fc8336d9be1f0d21163cf8b10c88212b26fad4526656edd99e021f1da7583309ffa69bf5591f0bea6bc3381dc3a6e2600d0a4913ad37b3269860
7
+ data.tar.gz: a375c0c8805d09a25902b6219f05abc6d578a7404d3b3ae25abcd1f89e369b56de8a0bda6116f91a2527ffc7587481dca4cfabd73bd9086e9cbbf4e2e1642c97
data/.DS_Store ADDED
Binary file
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coursegen (0.4.2)
4
+ coursegen (0.6.2)
5
5
  activesupport
6
6
  adsf
7
7
  byebug
@@ -19,26 +19,32 @@ PATH
19
19
  GEM
20
20
  remote: https://rubygems.org/
21
21
  specs:
22
- activesupport (5.1.3)
22
+ activesupport (5.2.0)
23
23
  concurrent-ruby (~> 1.0, >= 1.0.2)
24
- i18n (~> 0.7)
24
+ i18n (>= 0.7, < 2)
25
25
  minitest (~> 5.1)
26
26
  tzinfo (~> 1.1)
27
- adsf (1.2.1)
28
- rack (>= 1.0.0)
29
- byebug (9.0.6)
30
- coderay (1.1.1)
27
+ addressable (2.5.2)
28
+ public_suffix (>= 2.0.2, < 4.0)
29
+ adsf (1.4.0)
30
+ rack (>= 1.0.0, < 3.0.0)
31
+ byebug (10.0.2)
32
+ coderay (1.1.2)
31
33
  colored (1.2)
32
34
  concurrent-ruby (1.0.5)
33
- cri (2.9.1)
35
+ cri (2.10.1)
34
36
  colored (~> 1.2)
37
+ ddmemoize (1.0.0a3)
38
+ ddtelemetry (= 1.0.0a2)
39
+ ref (~> 2.0)
35
40
  ddplugin (1.0.1)
36
- ffi (1.9.18)
41
+ ddtelemetry (1.0.0a2)
42
+ ffi (1.9.25)
37
43
  formatador (0.2.5)
38
- guard (2.14.1)
44
+ guard (2.14.2)
39
45
  formatador (>= 0.2.4)
40
46
  listen (>= 2.7, < 4.0)
41
- lumberjack (~> 1.0)
47
+ lumberjack (>= 1.0.12, < 2.0)
42
48
  nenv (~> 0.1)
43
49
  notiffany (~> 0.0)
44
50
  pry (>= 0.9.12)
@@ -50,49 +56,54 @@ GEM
50
56
  guard-compat (~> 1.0)
51
57
  hamster (3.0.0)
52
58
  concurrent-ruby (~> 1.0)
53
- i18n (0.8.6)
59
+ i18n (1.0.1)
60
+ concurrent-ruby (~> 1.0)
54
61
  icalendar (2.4.1)
55
- json (1.8.6)
56
- kramdown (1.14.0)
62
+ json (2.1.0)
63
+ kramdown (1.16.2)
57
64
  listen (3.1.5)
58
65
  rb-fsevent (~> 0.9, >= 0.9.4)
59
66
  rb-inotify (~> 0.9, >= 0.9.7)
60
67
  ruby_dep (~> 1.2)
61
68
  lumberjack (1.0.12)
62
- method_source (0.8.2)
63
- mini_portile2 (2.2.0)
64
- minitest (5.10.3)
65
- nanoc (4.8.2)
69
+ method_source (0.9.0)
70
+ mini_portile2 (2.3.0)
71
+ minitest (5.11.3)
72
+ nanoc (4.8.19)
73
+ addressable (~> 2.5)
66
74
  cri (~> 2.8)
75
+ ddmemoize (= 1.0.0a3)
67
76
  ddplugin (~> 1.0)
77
+ ddtelemetry (= 1.0.0a2)
68
78
  hamster (~> 3.0)
69
79
  ref (~> 2.0)
80
+ slow_enumerator_tools (~> 1.0)
70
81
  nenv (0.3.0)
71
- nokogiri (1.8.0)
72
- mini_portile2 (~> 2.2.0)
82
+ nokogiri (1.8.4)
83
+ mini_portile2 (~> 2.3.0)
73
84
  notiffany (0.1.1)
74
85
  nenv (~> 0.1)
75
86
  shellany (~> 0.0)
76
- pry (0.10.4)
87
+ pry (0.11.3)
77
88
  coderay (~> 1.1.0)
78
- method_source (~> 0.8.1)
79
- slop (~> 3.4)
80
- rack (2.0.3)
89
+ method_source (~> 0.9.0)
90
+ public_suffix (3.0.2)
91
+ rack (2.0.5)
81
92
  rake (11.3.0)
82
- rb-fsevent (0.10.2)
93
+ rb-fsevent (0.10.3)
83
94
  rb-inotify (0.9.10)
84
95
  ffi (>= 0.5.0, < 2)
85
96
  ref (2.0.0)
86
97
  ruby_dep (1.5.0)
87
- rubytree (0.9.7)
88
- json (~> 1.8)
89
- structured_warnings (~> 0.2)
98
+ rubytree (1.0.0)
99
+ json (~> 2.1)
100
+ structured_warnings (~> 0.3)
90
101
  shellany (0.0.1)
91
- slop (3.6.0)
102
+ slow_enumerator_tools (1.1.0)
92
103
  structured_warnings (0.3.0)
93
104
  thor (0.20.0)
94
105
  thread_safe (0.3.6)
95
- tzinfo (1.2.3)
106
+ tzinfo (1.2.5)
96
107
  thread_safe (~> 0.1)
97
108
 
98
109
  PLATFORMS
@@ -104,4 +115,4 @@ DEPENDENCIES
104
115
  rake
105
116
 
106
117
  BUNDLED WITH
107
- 1.15.3
118
+ 1.16.1
@@ -37,7 +37,7 @@ class Section
37
37
 
38
38
  def previous_for(citem)
39
39
  index = @citems.find_index(citem)
40
- byebug if index.nil?
40
+ byebug if index.nil?
41
41
  raise ArgumentError, "invalid citem in previous_for" if index.nil?
42
42
  new_index = [index, 1].max
43
43
  @citems[new_index - 1]
@@ -3,8 +3,10 @@ class BootstrapMarkup
3
3
  @str = ""
4
4
  end
5
5
 
6
- def table_begin(css_class="table-condensed")
7
- @str << "<table class=\"table #{css_class}\">"
6
+ def table_begin(css_class = "table-condensed")
7
+ puts css_class.class
8
+ @str << "<table class=\"table x #{css_class}\">"
9
+ puts @str
8
10
  end
9
11
 
10
12
  def table_end
@@ -107,11 +107,17 @@ HTMLSTRING
107
107
  end
108
108
 
109
109
  def important string = ":"
110
- "**Important#{string}**{: style=\"color: red\"}"
110
+ <<-HTMLSTRING
111
+ <div class="cg-important">
112
+ #{string}
113
+ </div>
114
+ HTMLSTRING
111
115
  end
112
116
 
113
- def nb string = ""
114
- "*NB: #{string}*{: style=\"color: green\"}"
117
+ def nb string = ":"
118
+ <<-HTMLSTRING
119
+ <div class="label label-info">#{string}</div>
120
+ HTMLSTRING
115
121
  end
116
122
 
117
123
  def tbd string = ""
@@ -199,16 +205,35 @@ HTMLSTRING
199
205
  "~~~~~~\n {: .language-ruby}"
200
206
  end
201
207
 
208
+ def python_begin
209
+ "\n~~~~~~"
210
+ end
211
+
212
+ def python_end
213
+ "~~~~~~\n {: .language-python}"
214
+ end
215
+
202
216
  def ruby_string str
203
217
  ruby_begin + "\n" + str + "\n" + ruby_end
204
218
  end
205
219
 
220
+ def python_string str
221
+ python_begin + "\n" + str + "\n" + python_end
222
+ end
223
+
206
224
  def include_ruby name
207
225
  filename = Dir.pwd + "/content/content/topics/scripts/" + name.to_s + ".rb"
208
226
  filecontents = File.new(filename).read
209
227
  ruby_string filecontents
210
228
  end
211
229
 
230
+ def include_python name
231
+ filename = Dir.pwd + "/content/content/topics/robotcode/" + name.to_s + ".py"
232
+ filecontents = File.new(filename).read
233
+ ruby_string filecontents
234
+ end
235
+
236
+
212
237
  def code_begin
213
238
  "\n~~~~~~"
214
239
  end
@@ -0,0 +1,21 @@
1
+ # Helpers to be used to format content
2
+ module FormattingHelpers
3
+
4
+ def list_begin
5
+ "<dl class=\"dl-horizontal\" style=\"font-size: 125%;\">"
6
+ end
7
+
8
+ def list_end
9
+ "</dd></dl>"
10
+ end
11
+
12
+ def le (name, first_entry=false)
13
+ str = ""
14
+ if !first_entry
15
+ str += "</dd><br/>"
16
+ end
17
+ str += "<dt>#{name}</dt><dd>"
18
+ str
19
+ end
20
+
21
+ end
@@ -1,11 +1,13 @@
1
1
  class TableHelper
2
- def initialize(property)
2
+ def initialize(*property)
3
3
  @prop = property
4
4
  @bm = BootstrapMarkup.new
5
5
  end
6
6
 
7
7
  def headers(*labels)
8
- css_style = @prop == :normal ? "table-condensed" : ""
8
+ css_style = ""
9
+ css_style += " table-condensed" if @prop.include? :normal
10
+ css_style += " table-bordered" if @prop.include? :bordered
9
11
  @bm.table_begin(css_style)
10
12
  @bm.headers_begin
11
13
  labels.each do |h|
@@ -5,6 +5,7 @@ include LectureHelpers
5
5
  include SidebarHelpers
6
6
  include ListOfHelpers
7
7
  include ICalFeedHelpers
8
+ include FormattingHelpers
8
9
  include Nanoc::Helpers::Rendering
9
10
  include Nanoc::Helpers::LinkTo
10
11
  include Nanoc::Helpers::Tagging
@@ -78,8 +78,8 @@ class Scheduler
78
78
  raise ArgumentError, "Scheduler: Start date is not on one of the weekdays" unless @weekdays.include? @start_date.cwday
79
79
  raise ArgumentError, "Scheduler: Skip date is not on a valid weekday" if !@skips.reduce(true) { |accum, skip| accum && @weekdays.include?(skip.cwday) }
80
80
 
81
- @start_time = time_span_to_seconds(start_time)
82
- @end_time = time_span_to_seconds(end_time)
81
+ @start_time = time_span_to_seconds(start_time) rescue raise(ArgumentError, "error converting start time. Use hh:mm: #{start_time} ")
82
+ @end_time = time_span_to_seconds(end_time) rescue raise(ArgumentError, "error converting end time. Use hh:mm: #{end_time}")
83
83
  @start_times = start_times.map { |x| time_span_to_seconds(x)}
84
84
  @end_times = end_times.map { |x| time_span_to_seconds(x)}
85
85
  end
@@ -1,3 +1,3 @@
1
1
  module Coursegen
2
- VERSION = "0.5.0"
2
+ VERSION = "0.7.0"
3
3
  end
data/lib/coursegen.rb CHANGED
@@ -6,6 +6,7 @@ require 'coursegen/course/helpers/lecture_helpers'
6
6
  require 'coursegen/course/helpers/content_helpers'
7
7
  require 'coursegen/course/helpers/logging_helpers'
8
8
  require 'coursegen/course/helpers/list_of_helpers'
9
+ require 'coursegen/course/helpers/formatting_helpers'
9
10
  require 'coursegen/course/helpers/bootstrap_markup'
10
11
  require 'coursegen/course/helpers/table_helpers'
11
12
  require 'coursegen/course/helpers/navigation_helpers'
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coursegen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pito Salas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-09 00:00:00.000000000 Z
11
+ date: 2018-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -228,6 +228,7 @@ executables:
228
228
  extensions: []
229
229
  extra_rdoc_files: []
230
230
  files:
231
+ - ".DS_Store"
231
232
  - ".gitignore"
232
233
  - Gemfile
233
234
  - Gemfile.lock
@@ -247,6 +248,7 @@ files:
247
248
  - lib/coursegen/course/data/toc.rb
248
249
  - lib/coursegen/course/helpers/bootstrap_markup.rb
249
250
  - lib/coursegen/course/helpers/content_helpers.rb
251
+ - lib/coursegen/course/helpers/formatting_helpers.rb
250
252
  - lib/coursegen/course/helpers/ical_feed_helpers.rb
251
253
  - lib/coursegen/course/helpers/lecture_helpers.rb
252
254
  - lib/coursegen/course/helpers/list_of.rb
@@ -271,6 +273,7 @@ files:
271
273
  - spec/spec_helper.rb
272
274
  - spec/toc_spec.rb
273
275
  - tech_debt.md
276
+ - templates/.DS_Store
274
277
  - templates/.gitignore
275
278
  - templates/Guardfile
276
279
  - templates/Rules
@@ -330,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
333
  version: '0'
331
334
  requirements: []
332
335
  rubyforge_project:
333
- rubygems_version: 2.6.11
336
+ rubygems_version: 2.7.3
334
337
  signing_key:
335
338
  specification_version: 4
336
339
  summary: Use Nanoc to build courses and deploy them to S3