dbc_today 1.0.0 → 2.0.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.
- checksums.yaml +4 -4
- data/exe/dbctoday +25 -6
- data/lib/dbc_today/{controller.rb → controllers/events_controller.rb} +5 -5
- data/lib/dbc_today/controllers/topics_controller.rb +15 -0
- data/lib/dbc_today/{schedule.csv → data/schedule.csv} +0 -0
- data/lib/dbc_today/data/topics.csv +78 -0
- data/lib/dbc_today/{event.rb → models/event.rb} +1 -1
- data/lib/dbc_today/{timeable.rb → models/timeable.rb} +0 -0
- data/lib/dbc_today/models/topic.rb +37 -0
- data/lib/dbc_today/version.rb +1 -1
- data/lib/dbc_today/{view.rb → views/events_view.rb} +4 -3
- data/lib/dbc_today/views/topics_view.rb +8 -0
- metadata +11 -8
- data/lib/dbc_today/Gemfile +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6a8e58e4e02a14b674f97ab96e9f68502de0b74
|
4
|
+
data.tar.gz: 02cfad383a9a90010b280e569942cbd0f653ecee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9509bca5e5d250ae9d54d8021d2ebd14997a4039a569952d089b827d3915143c76d9058e0334b71c2f25f304201d9e495d5bd9561136a26b74c85fa3899a544c
|
7
|
+
data.tar.gz: 972d5256a27c70fde75c4d9f750ec367f85491a278a758eba81f8e1f5f7825db110d1c1cd140bb7a69afdb769a0837b81eca1f3278572a558dadcfee052f5a3c
|
data/exe/dbctoday
CHANGED
@@ -1,12 +1,31 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# ^ The above comment tells the system
|
3
3
|
# to read this file like a ruby file
|
4
|
-
require_relative '../lib/dbc_today/
|
4
|
+
require_relative '../lib/dbc_today/controllers/events_controller'
|
5
|
+
require_relative '../lib/dbc_today/controllers/topics_controller'
|
5
6
|
|
6
|
-
phase = ARGV
|
7
|
-
|
8
|
-
day = ARGV[2] || Date.today.wday.to_s
|
7
|
+
phase, week, day = ARGV.select { |arg| arg =~ /\A\d\z/ }
|
8
|
+
day ||= Date.today.wday.to_s
|
9
9
|
|
10
|
-
|
10
|
+
topics_controller = TopicsController.new
|
11
|
+
events_controller = EventsController.new
|
11
12
|
|
12
|
-
|
13
|
+
if ARGV.find { |arg| arg == '-h' }
|
14
|
+
puts
|
15
|
+
puts "To run dbctoday:".bold
|
16
|
+
puts
|
17
|
+
puts "Run " + "dbctoday [phase] [week] [day]".white.bold + " to show the topics and schedule for that day"
|
18
|
+
puts "For example " + "dbctoday 1 1 1".white.bold + " will show the topics and schedule for phase 1 on day 1 of week 1"
|
19
|
+
puts "You can leave out the day (e.g. " + "dbctoday 1 1".white.bold + "), and it will show you info for today's day of the week"
|
20
|
+
puts "Pass a "+ "-t".white.bold + " flag to show only topics"
|
21
|
+
puts "Pass a " + "-s".white.bold + " flag to show only the schedule"
|
22
|
+
puts
|
23
|
+
|
24
|
+
elsif ARGV.find { |arg| arg == '-t' }
|
25
|
+
topics_controller.show_topics(phase, week, day)
|
26
|
+
elsif ARGV.find { |arg| arg == '-s' }
|
27
|
+
events_controller.show_schedule(phase, week, day)
|
28
|
+
else
|
29
|
+
topics_controller.show_topics(phase, week, day)
|
30
|
+
events_controller.show_schedule(phase, week, day)
|
31
|
+
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
require 'date'
|
2
|
-
require_relative '
|
3
|
-
require_relative 'event'
|
2
|
+
require_relative '../views/events_view'
|
3
|
+
require_relative '../models/event'
|
4
4
|
|
5
|
-
class
|
5
|
+
class EventsController
|
6
6
|
attr_reader :view
|
7
7
|
|
8
8
|
def initialize
|
9
|
-
@view =
|
9
|
+
@view = EventsView.new
|
10
10
|
end
|
11
11
|
|
12
12
|
def show_schedule(phase, week, day)
|
13
13
|
events = Event.where(phase: phase, week: week, day: day)
|
14
|
-
view.
|
14
|
+
view.display(events)
|
15
15
|
end
|
16
16
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative '../views/topics_view'
|
2
|
+
require_relative '../models/topic'
|
3
|
+
|
4
|
+
class TopicsController
|
5
|
+
attr_reader :view
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@view = TopicsView.new
|
9
|
+
end
|
10
|
+
|
11
|
+
def show_topics(phase, week, day)
|
12
|
+
topics = Topic.where(phase: phase, week: week, day: day)
|
13
|
+
view.display(topics)
|
14
|
+
end
|
15
|
+
end
|
File without changes
|
@@ -0,0 +1,78 @@
|
|
1
|
+
phase,week,day,description
|
2
|
+
|
3
|
+
1,1,1,introduction to phase 1
|
4
|
+
1,1,1,how to work a challenge
|
5
|
+
1,1,2,code flow and logic
|
6
|
+
1,1,2,enumerable module
|
7
|
+
1,1,3,recursion and iteration
|
8
|
+
1,1,3,linear and binary search
|
9
|
+
1,1,4,nested data structures
|
10
|
+
1,1,4,nested iteration
|
11
|
+
1,1,5,sudoku project
|
12
|
+
|
13
|
+
1,2,1,creating classes
|
14
|
+
1,2,1,working with multiple classes
|
15
|
+
1,2,2,inheritance
|
16
|
+
1,2,2,composition
|
17
|
+
1,2,3,csv parsing
|
18
|
+
1,2,3,argv
|
19
|
+
1,2,3,csv writing
|
20
|
+
1,2,4,mvc
|
21
|
+
1,2,5,flash cards project
|
22
|
+
|
23
|
+
1,3,1,schema design
|
24
|
+
1,3,1,sql commands in psql
|
25
|
+
1,3,2,sql with Ruby
|
26
|
+
1,3,2,assessment preparation
|
27
|
+
1,3,3,activerecord intro
|
28
|
+
1,3,4,activerecord associations
|
29
|
+
1,3,4,activerecord validation
|
30
|
+
1,3,5,public api/raw data ruby
|
31
|
+
|
32
|
+
2,1,1,http intro
|
33
|
+
2,1,1,sinatra intro
|
34
|
+
2,1,2,activerecord
|
35
|
+
2,1,2,rest
|
36
|
+
2,1,3,rest/crud
|
37
|
+
2,1,4,sessions and cookies
|
38
|
+
2,1,4,user auth
|
39
|
+
2,1,5,git workflow
|
40
|
+
|
41
|
+
2,2,1,html and css
|
42
|
+
2,2,1,javascript
|
43
|
+
2,2,2,jquery and events
|
44
|
+
2,2,2,ajax
|
45
|
+
2,2,3,event delegation
|
46
|
+
2,2,3,polymorphic associations
|
47
|
+
2,2,4,project qa
|
48
|
+
2,2,5,project demos
|
49
|
+
|
50
|
+
2,3,1,js constructor functions
|
51
|
+
2,3,2,assessment preparation
|
52
|
+
2,3,3,assessment
|
53
|
+
2,3,4,apis
|
54
|
+
2,3,5,project demos
|
55
|
+
|
56
|
+
3,1,1,rails intro
|
57
|
+
3,1,2,model/conroller testing
|
58
|
+
3,1,2,feature testing
|
59
|
+
3,1,3,client project intro
|
60
|
+
3,1,3,project management
|
61
|
+
3,1,4,ajax in rails
|
62
|
+
3,1,5,client project demos
|
63
|
+
|
64
|
+
3,2,1,javascript mvc
|
65
|
+
3,2,1,js call apply and bind
|
66
|
+
3,2,2,jquery deferred objects
|
67
|
+
3,2,2,promises
|
68
|
+
3,2,3,front end to api
|
69
|
+
3,2,3,react intro
|
70
|
+
3,2,4,pitch projects
|
71
|
+
3,2,5,final project work
|
72
|
+
|
73
|
+
3,3,1,final project work
|
74
|
+
3,3,2,final project work
|
75
|
+
3,3,3,final project work
|
76
|
+
3,3,4,how to present
|
77
|
+
3,3,5,final project presentations
|
78
|
+
3,3,5,graduation
|
File without changes
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class Topic
|
2
|
+
attr_reader :phase, :week, :day, :description
|
3
|
+
|
4
|
+
def initialize(attributes)
|
5
|
+
@phase = attributes.fetch(:phase)
|
6
|
+
@week = attributes.fetch(:week)
|
7
|
+
@day = attributes.fetch(:day)
|
8
|
+
@description = attributes.fetch(:description)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.all
|
12
|
+
list = []
|
13
|
+
|
14
|
+
CSV.foreach(
|
15
|
+
"#{current_directory}/../data/topics.csv",
|
16
|
+
headers: true,
|
17
|
+
header_converters: :symbol,
|
18
|
+
skip_blanks: true
|
19
|
+
) do |row|
|
20
|
+
list << Topic.new(row)
|
21
|
+
end
|
22
|
+
|
23
|
+
list
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.where(phase:, week:, day:)
|
27
|
+
all.select { |topic|
|
28
|
+
topic.phase == phase &&
|
29
|
+
topic.week == week &&
|
30
|
+
topic.day == day
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.current_directory
|
35
|
+
File.expand_path File.dirname(__FILE__)
|
36
|
+
end
|
37
|
+
end
|
data/lib/dbc_today/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbc_today
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Stewart
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,13 +86,16 @@ files:
|
|
86
86
|
- dbc_today.gemspec
|
87
87
|
- exe/dbctoday
|
88
88
|
- lib/dbc_today.rb
|
89
|
-
- lib/dbc_today/
|
90
|
-
- lib/dbc_today/
|
91
|
-
- lib/dbc_today/
|
92
|
-
- lib/dbc_today/
|
93
|
-
- lib/dbc_today/
|
89
|
+
- lib/dbc_today/controllers/events_controller.rb
|
90
|
+
- lib/dbc_today/controllers/topics_controller.rb
|
91
|
+
- lib/dbc_today/data/schedule.csv
|
92
|
+
- lib/dbc_today/data/topics.csv
|
93
|
+
- lib/dbc_today/models/event.rb
|
94
|
+
- lib/dbc_today/models/timeable.rb
|
95
|
+
- lib/dbc_today/models/topic.rb
|
94
96
|
- lib/dbc_today/version.rb
|
95
|
-
- lib/dbc_today/
|
97
|
+
- lib/dbc_today/views/events_view.rb
|
98
|
+
- lib/dbc_today/views/topics_view.rb
|
96
99
|
homepage: https://github.com/Devbootcamp/dbc_today
|
97
100
|
licenses:
|
98
101
|
- MIT
|