bobross 0.1.10 → 0.1.11

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
  SHA256:
3
- metadata.gz: 63ef0cb122635818e6cc69251234efa339831f3b0194a26da51ae6ea3b6f3713
4
- data.tar.gz: 6250352f134d119b491d58a8410f11dcb724d393eb50eb2a557de07b3855c3d9
3
+ metadata.gz: c3fd6e0305cb28c9b361432e8cd72dd3e0fc77877be05bea74e07ab949413534
4
+ data.tar.gz: f4710b7f42466ee3a5cc1f7ed0528fa3eb14c4ca0bacf8068b9637b38eda4073
5
5
  SHA512:
6
- metadata.gz: 28c0c6a1be480daed2bcc0a5f16bf4c73c573036dc5c2f07720cad15eba6022a5e15079a20f087019fadb0c7402ee74e5c17c64ece7e415cbf9a8ec0539f806d
7
- data.tar.gz: 6291822063c3138654f8035b172773976e273a0039c5cadce0c1c428028b45bea95fc0889e92f3ea4e2d7c8049ed5c986b271aa09107b6abf7b50c88b76dbf68
6
+ metadata.gz: 200c9ff645f7a4eb1a190e178806a2cced342a3cc9db54e875d63cf01d26631c5d5239ac1f8274320eed4c3b45195016bcf0d63a7f17edc5b2d651c7aeabafb6
7
+ data.tar.gz: 36d1c70088edbfa213cfc7e821372724515b0a33cf3d2cbc5da8235e50971f613d717a59a45a0cc37a582e29f62d3c099fd2f81f070ece4f44a019ca5d34c89b
data/.DS_Store CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bobross (0.1.9)
4
+ bobross (0.1.11)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -57,7 +57,7 @@ DEPENDENCIES
57
57
  bearcat (~> 1.3.30)
58
58
  bobross!
59
59
  bundler (~> 2.0)
60
- forgery
60
+ forgery (~> 0.7)
61
61
  rake (~> 10.0)
62
62
  rspec (~> 3.0)
63
63
 
@@ -40,5 +40,5 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency "rake", "~> 10.0"
41
41
  spec.add_development_dependency "rspec", "~> 3.0"
42
42
  spec.add_development_dependency "bearcat", "~> 1.3.30"
43
- spec.add_development_dependency "forgery"
43
+ spec.add_development_dependency "forgery", "~> 0.7"
44
44
  end
@@ -1,3 +1,3 @@
1
1
  module Bobross
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
@@ -6,8 +6,10 @@ class CanvasAccount < Forgery
6
6
  end
7
7
 
8
8
  def to_csv
9
- row = [name, uid, parent_uid, root_uid, time_zone, sis_id, workflow]
9
+ #row = [name, uid, parent_uid, root_uid, time_zone, sis_id, workflow]
10
+ row = [uid, parent_uid, name, 'active', nil]
10
11
  end
12
+
11
13
  #future relase: Make fields reuired by canvas required here
12
14
  def initialize(opts = {})
13
15
  @name = opts[:name] if opts[:name]
@@ -35,18 +37,17 @@ class CanvasAccount < Forgery
35
37
  end
36
38
 
37
39
  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]
40
+ opts[:rows] ? rows = opts[:rows] : rows = 0
41
+ opts[:parent] ? parent = opts[:parent] : parent = 1
42
+ opts[:root] ? root = opts[:root] : root = 1
43
43
  accounts = []
44
44
  if(opts[:rows])
45
45
  rows.times do |x|
46
46
  accounts.push(CanvasAccount.random(parent, root))
47
47
  end
48
48
  end
49
- header = ["name", "uid", "parent_id", "root_id", "time_zone", "sis_id", "workflow"]
49
+ #header = ["name", "uid", "parent_id", "root_id", "time_zone", "sis_id", "workflow"]
50
+ header = ["account_id", "parent_account_id", "name", "status", "integration_id"]
50
51
  CSV.open("./accounts.csv", "wb", write_headers: true, headers: header) do |csv|
51
52
  accounts.each do |acc|
52
53
  csv << acc.to_csv
@@ -1,6 +1,6 @@
1
1
  class CanvasAssignment < Forgery
2
2
  attr_reader :name, :description, :course_uid, :assignment_group
3
- attr_accessor :due_at, :lock_at
3
+ attr_accessor :due_at, :lock_at, :host_info
4
4
 
5
5
  def to_s
6
6
  string = "#{name}, #{description}, #{due_at}, #{lock_at}, #{course_uid}, #{assignment_group}"
@@ -35,10 +35,9 @@ class CanvasAssignment < Forgery
35
35
 
36
36
  def self.gen_file(opts = {})
37
37
  course, group = 1
38
- rows = 0
38
+ opts[:rows] ? rows = opts[:rows] : rows = 0
39
39
  course = opts[:course] if opts[:course]
40
40
  group = opts[:group] if opts[:group]
41
- rows = opts[:rows] if opts[:rows]
42
41
  assignments = []
43
42
  if(opts[:rows])
44
43
  rows.times do |x|
@@ -1,5 +1,5 @@
1
1
  class CanvasCourse < Forgery
2
- attr_reader :name, :uid, :sis_id, :description
2
+ attr_reader :name, :uid, :sis_id, :description, :account_id, :term_id, :start_date, :end_date
3
3
  @@local_dictionaries = File.absolute_path("lib")
4
4
 
5
5
  def initialize(opts = {})
@@ -7,6 +7,10 @@ class CanvasCourse < Forgery
7
7
  @uid = opts[:uid] if opts[:uid]
8
8
  @sis_id = "#{opts[:sis]}" if opts[:sis]
9
9
  @description = opts[:desc] if opts[:desc]
10
+ @account_id = opts[:account] if opts[:account]
11
+ @term_id = opts[:term] if opts[:term]
12
+ @start_date = opts[:start] if opts[:start]
13
+ @end_date = opts[:end] if opts[:end]
10
14
  end
11
15
 
12
16
  def to_s
@@ -14,7 +18,8 @@ class CanvasCourse < Forgery
14
18
  end
15
19
 
16
20
  def to_csv
17
- row = [name, uid, sis_id, description]
21
+ #row = [name, uid, sis_id, description]
22
+ row = [sis_id, uid, name, account_id, term_id, "active", nil, start_date, end_date, "online", nil]
18
23
  end
19
24
 
20
25
  def self.set_prefix prefix
@@ -49,15 +54,15 @@ class CanvasCourse < Forgery
49
54
  end
50
55
 
51
56
  def self.gen_file(opts = {})
52
- rows = 0
53
- rows = opts[:rows] if opts[:rows]
57
+ opts[:rows] ? rows = opts[:rows] : rows = 0
54
58
  courses = []
55
59
  if(opts[:rows])
56
60
  rows.times do |x|
57
61
  courses.push(CanvasCourse.random)
58
62
  end
59
63
  end
60
- header = ["name", "uid", "sis_id", "description"]
64
+ #header = ["name", "uid", "sis_id", "description"]
65
+ header = ["course_id", "short_name", "long_name", "account_id", "term_id", "status", "integration_id", "start_date", "end_date", "course_format", "blueprint_course_id"]
61
66
  CSV.open("./courses.csv", "wb", write_headers: true, headers: header) do |csv|
62
67
  courses.each do |acc|
63
68
  csv << acc.to_csv
@@ -1,25 +1,46 @@
1
1
  class CanvasSection < Forgery
2
- attr_reader :name, :sis_id, :start_at, :end_at
2
+ attr_reader :name, :sis_id, :start_date, :end_date
3
3
  attr_accessor :course_uid, :course_sis_id
4
4
 
5
+ def to_csv
6
+ row = [sis_id, course_sis_id, name, "active", nil, start_date, end_date]
7
+ end
8
+
5
9
  def initialize(opts = {})
6
10
  @name = opts[:name] if opts[:name]
7
11
  @sis_id = opts[:sis_id] if opts[:sis_id]
8
12
  @course_id = opts[:course] if opts[:course]
9
- @start_at = opts[:start_at] if opts[:start_at]
10
- @end_at = opts[:end_at] if opts[:end_at]
13
+ @start_date = opts[:start_at] if opts[:start_at]
14
+ @end_date = opts[:end_at] if opts[:end_at]
11
15
  end
12
16
 
13
17
  def self.random(course=1)
14
18
  d = Forgery('date').date
15
- Section.new(
19
+ CanvasSection.new(
16
20
  {
17
21
  name: "#{Forgery('address').country} #{Forgery('basic').color}",
18
22
  sis_id: (21000+rand(1000000)),
19
23
  course: course,
20
- start_at: d,
21
- end_at: d+90.days
24
+ start_date: d,
25
+ end_date: d+90.days
22
26
  }
23
27
  )
24
28
  end
29
+
30
+ def self.gen_file(opts = {})
31
+ opts[:rows] ? rows = opts[:rows] : rows = 0
32
+ sections = []
33
+ if(opts[:rows])
34
+ rows.times do |x|
35
+ sections.push(CanvasSection.random)
36
+ end
37
+ end
38
+
39
+ header = ["section_id", "course_id", "name", "status", "integration_id", "start_date", "end_date"]
40
+ CSV.open("./sections.csv", "wb", write_headers: true, headers: header) do |csv|
41
+ sections.each do |acc|
42
+ csv << acc.to_csv
43
+ end
44
+ end
45
+ end
25
46
  end
@@ -6,7 +6,9 @@ class CanvasUser < Forgery
6
6
  end
7
7
 
8
8
  def to_csv
9
- row = [name, sis_id, login_id, email, time_zone]
9
+ names = name.split(' ')
10
+ #row = [name, sis_id, login_id, email, time_zone]
11
+ row = [sis_id, nil, login_id, nil, nil, nil, names.first, names.last, name, "#{names.last}, #{names.first}", "#{names.first[0].downcase}#{names.last.downcase}", email, "active"]
10
12
  end
11
13
 
12
14
  def initialize (opts = {})
@@ -17,14 +19,20 @@ class CanvasUser < Forgery
17
19
  @time_zone = opts[:time_zone] if opts[:time_zone]
18
20
  end
19
21
 
20
- def self.random
22
+ def self.random (opts = {})
21
23
  fn = Forgery('name').first_name
22
24
  ln = Forgery('name').last_name
23
- e = "tbyington+#{fn}.#{ln}@instructure.com"
25
+ domain = "instructure.com"
26
+ if opts
27
+ opts[:email_prefix] ? epre = "#{opts[:email_prefix]}+" : epre = ''
28
+ opts[:sis_prefix] ? sispre = "#{opts[:sis_prefix]}_" : sispre = ''
29
+ opts[:domain] ? domain = opts[:domain] : domain = 'instructure.com'
30
+ end
31
+ e = "#{epre}#{fn}.#{ln}@#{domain}"
24
32
  CanvasUser.new(
25
33
  {
26
34
  name: "#{fn} #{ln}",
27
- sis: (3000+rand(1000000)),
35
+ sis: "#{sispre}#{(3000+rand(1000000))}",
28
36
  login: e,
29
37
  email: e,
30
38
  time_zone: Forgery('time').zone
@@ -33,15 +41,16 @@ class CanvasUser < Forgery
33
41
  end
34
42
 
35
43
  def self.gen_file(opts = {})
36
- rows = 0
37
- rows = opts[:rows] if opts[:rows]
44
+ opts[:rows] ? rows = opts[:rows] : rows = 0
45
+ opts[:settings] ? settings = opts[:settings] : settings = nil
38
46
  users = []
39
47
  if(opts[:rows])
40
48
  rows.times do |x|
41
- users.push(CanvasUser.random)
49
+ users.push(CanvasUser.random(settings))
42
50
  end
43
51
  end
44
- header = ["name", "sis_id", "login_id", "email", "time_zone"]
52
+ #header = ["name", "sis_id", "login_id", "email", "time_zone"]
53
+ header = ["user_id", "integration_id", "login_id", "password", "ssha_password", "authentication_provider_id", "first_name", "last_name", "full_name", "sortable_name", "short_name", "email", "status"]
45
54
  CSV.open("./users.csv", "wb", write_headers: true, headers: header) do |csv|
46
55
  users.each do |acc|
47
56
  csv << acc.to_csv
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.10
4
+ version: 0.1.11
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-07-09 00:00:00.000000000 Z
12
+ date: 2019-07-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -71,16 +71,16 @@ dependencies:
71
71
  name: forgery
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ">="
74
+ - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '0'
76
+ version: '0.7'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ">="
81
+ - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '0'
83
+ version: '0.7'
84
84
  description: Generates data to put in your canvas instance. Data can be exported as
85
85
  CSV for uploading or sent directly via api call
86
86
  email: