bobross 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -6
- data/lib/bobross.rb +1 -0
- data/lib/bobross/version.rb +1 -1
- data/lib/models/account.rb +26 -2
- data/lib/models/assignment.rb +31 -2
- data/lib/models/course.rb +22 -1
- data/lib/models/section.rb +2 -2
- data/lib/models/user.rb +25 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb2cf3e5dc55a35ea9dca2f0775e1a07cbfff3bf9a32dd2383e506edbf05ef4f
|
4
|
+
data.tar.gz: b0d57f67791edbe9265797a15b1d3fce18830449aa3c0843ae1a37316e6fdb23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f944ab6c635285ccc812f7a6d38dea1249433eda7c6459423d71d531f6aed1f7267f3292a9719940311b1e1c25711b041eacc00f81219b2ea013c94e3f2b92
|
7
|
+
data.tar.gz: cc7e7d9e0b20b986d9941131f9ca5e68a0733d5e5b7425ab6f14d870bb1649ad9035f2c6f6095f1c99e18214387247ae5f0f2bf941ecb2343ecab197ef97eb38
|
data/.DS_Store
ADDED
Binary file
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bobross (0.1.
|
4
|
+
bobross (0.1.8)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -17,15 +17,12 @@ GEM
|
|
17
17
|
paul_walker (~> 0.1.1)
|
18
18
|
concurrent-ruby (1.1.5)
|
19
19
|
diff-lcs (1.3)
|
20
|
-
factory_bot (4.11.1)
|
21
|
-
activesupport (>= 3.0.0)
|
22
20
|
faraday (0.15.4)
|
23
21
|
multipart-post (>= 1.2, < 3)
|
24
22
|
footrest (0.5.3)
|
25
23
|
activesupport (>= 3.0.0)
|
26
24
|
faraday (>= 0.9.0, < 1)
|
27
25
|
link_header (>= 0.0.7)
|
28
|
-
forgery (0.7.0)
|
29
26
|
i18n (1.6.0)
|
30
27
|
concurrent-ruby (~> 1.0)
|
31
28
|
link_header (0.0.8)
|
@@ -59,8 +56,6 @@ DEPENDENCIES
|
|
59
56
|
bearcat (~> 1.3.30)
|
60
57
|
bobross!
|
61
58
|
bundler (~> 2.0)
|
62
|
-
factory_bot (~> 4.11.1)
|
63
|
-
forgery (~> 0.7.0)
|
64
59
|
rake (~> 10.0)
|
65
60
|
rspec (~> 3.0)
|
66
61
|
|
data/lib/bobross.rb
CHANGED
data/lib/bobross/version.rb
CHANGED
data/lib/models/account.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
class Account < Forgery
|
2
|
-
attr_reader :name, :uid, :
|
2
|
+
attr_reader :name, :uid, :parent_uid, :root_uid, :time_zone, :sis_id, :workflow
|
3
3
|
|
4
4
|
def to_s
|
5
|
-
string = "#{
|
5
|
+
string = "#{name}, #{uid}, #{parent_uid}, #{root_uid}, #{time_zone}, #{sis_id}, #{workflow}"
|
6
6
|
end
|
7
7
|
|
8
|
+
def to_csv
|
9
|
+
row = [name, uid, parent_uid, root_uid, time_zone, sis_id, workflow]
|
10
|
+
end
|
11
|
+
#future relase: Make fields reuired by canvas required here
|
8
12
|
def initialize(opts = {})
|
9
13
|
@name = opts[:name] if opts[:name]
|
10
14
|
@uid = opts[:uid] if opts[:uid]
|
@@ -29,4 +33,24 @@ class Account < Forgery
|
|
29
33
|
}
|
30
34
|
)
|
31
35
|
end
|
36
|
+
|
37
|
+
def self.gen_file(opts = {})
|
38
|
+
parent, root = 1
|
39
|
+
rows = 0
|
40
|
+
parent = opts[:parent] if opts[:parent]
|
41
|
+
root = opts[:root] if opts[:root]
|
42
|
+
rows = opts[:rows] if opts[:rows]
|
43
|
+
accounts = []
|
44
|
+
if(opts[:rows])
|
45
|
+
rows.times do |x|
|
46
|
+
accounts.push(Account.random(parent, root))
|
47
|
+
end
|
48
|
+
end
|
49
|
+
header = ["name", "uid", "parent_id", "root_id", "time_zone", "sis_id", "workflow"]
|
50
|
+
CSV.open("./accounts.csv", "wb", write_headers: true, headers: header) do |csv|
|
51
|
+
accounts.each do |acc|
|
52
|
+
csv << acc.to_csv
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
32
56
|
end
|
data/lib/models/assignment.rb
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
class Assignment < Forgery
|
2
|
-
attr_reader :name, :description, :
|
3
|
-
|
2
|
+
attr_reader :name, :description, :course_uid, :assignment_group
|
3
|
+
attr_accessor :due_at, :lock_at
|
4
|
+
|
5
|
+
def to_s
|
6
|
+
string = "#{name}, #{description}, #{due_at}, #{lock_at}, #{course_uid}, #{assignment_group}"
|
7
|
+
end
|
8
|
+
|
9
|
+
def to_csv
|
10
|
+
row = [name, description, due_at, lock_at, course_uid, assignment_group]
|
11
|
+
end
|
4
12
|
|
5
13
|
def initialize(opts = {})
|
6
14
|
@name = opts[:name] if opts[:name]
|
@@ -24,4 +32,25 @@ class Assignment < Forgery
|
|
24
32
|
}
|
25
33
|
)
|
26
34
|
end
|
35
|
+
|
36
|
+
def self.gen_file(opts = {})
|
37
|
+
course, group = 1
|
38
|
+
rows = 0
|
39
|
+
course = opts[:course] if opts[:course]
|
40
|
+
group = opts[:group] if opts[:group]
|
41
|
+
rows = opts[:rows] if opts[:rows]
|
42
|
+
assignments = []
|
43
|
+
if(opts[:rows])
|
44
|
+
rows.times do |x|
|
45
|
+
assignments.push(Assignment.random(course, group))
|
46
|
+
end
|
47
|
+
end
|
48
|
+
header = ["name", "description", "due_at", "lock_at", "course_id", "assignment_group"]
|
49
|
+
CSV.open("./assignments.csv", "wb", write_headers: true, headers: header) do |csv|
|
50
|
+
assignments.each do |acc|
|
51
|
+
csv << acc.to_csv
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
27
56
|
end
|
data/lib/models/course.rb
CHANGED
@@ -10,7 +10,11 @@ class Course < Forgery
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def to_s
|
13
|
-
s = "#{
|
13
|
+
s = "#{name}, #{uid}, #{sis_id}, #{description}"
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_csv
|
17
|
+
row = [name, uid, sis_id, description]
|
14
18
|
end
|
15
19
|
|
16
20
|
def self.set_prefix prefix
|
@@ -43,4 +47,21 @@ class Course < Forgery
|
|
43
47
|
def self.description
|
44
48
|
Forgery(:lorem_ipsum).words(2+rand(30))
|
45
49
|
end
|
50
|
+
|
51
|
+
def self.gen_file(opts = {})
|
52
|
+
rows = 0
|
53
|
+
rows = opts[:rows] if opts[:rows]
|
54
|
+
courses = []
|
55
|
+
if(opts[:rows])
|
56
|
+
rows.times do |x|
|
57
|
+
courses.push(Course.random)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
header = ["name", "uid", "sis_id", "description"]
|
61
|
+
CSV.open("./courses.csv", "wb", write_headers: true, headers: header) do |csv|
|
62
|
+
courses.each do |acc|
|
63
|
+
csv << acc.to_csv
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
46
67
|
end
|
data/lib/models/section.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Section < Forgery
|
2
|
-
attr_reader :name, :sis_id, :
|
3
|
-
|
2
|
+
attr_reader :name, :sis_id, :start_at, :end_at
|
3
|
+
attr_accessor :course_uid, :course_sis_id
|
4
4
|
|
5
5
|
def initialize(opts = {})
|
6
6
|
@name = opts[:name] if opts[:name]
|
data/lib/models/user.rb
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
class User < Forgery
|
2
2
|
attr_reader :name, :sis_id, :login_id, :email, :time_zone
|
3
3
|
|
4
|
+
def to_s
|
5
|
+
string = "#{name}, #{sis_id}, #{login_id}, #{email}, #{time_zone}"
|
6
|
+
end
|
7
|
+
|
8
|
+
def to_csv
|
9
|
+
row = [name, sis_id, login_id, email, time_zone]
|
10
|
+
end
|
11
|
+
|
4
12
|
def initialize (opts = {})
|
5
13
|
@name = opts[:name] if opts[:name]
|
6
14
|
@sis_id = opts[:sis] if opts[:sis]
|
@@ -23,4 +31,21 @@ class User < Forgery
|
|
23
31
|
}
|
24
32
|
)
|
25
33
|
end
|
34
|
+
|
35
|
+
def self.gen_file(opts = {})
|
36
|
+
rows = 0
|
37
|
+
rows = opts[:rows] if opts[:rows]
|
38
|
+
users = []
|
39
|
+
if(opts[:rows])
|
40
|
+
rows.times do |x|
|
41
|
+
users.push(User.random)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
header = ["name", "sis_id", "login_id", "email", "time_zone"]
|
45
|
+
CSV.open("./users.csv", "wb", write_headers: true, headers: header) do |csv|
|
46
|
+
users.each do |acc|
|
47
|
+
csv << acc.to_csv
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
26
51
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bobross
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Slack
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -77,6 +77,7 @@ executables: []
|
|
77
77
|
extensions: []
|
78
78
|
extra_rdoc_files: []
|
79
79
|
files:
|
80
|
+
- ".DS_Store"
|
80
81
|
- ".gitignore"
|
81
82
|
- ".rbenv-gemsets"
|
82
83
|
- ".rspec"
|