bobross 0.1.6 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e9e56b1a5254d003834114c15b49dd05c96fbd25f882cca7ae98994244fad82
4
- data.tar.gz: 2bf8545b0fc64bc7eef0e0e83620be0676d08df992853b23277719ce86e78f2b
3
+ metadata.gz: 3588f5d7043a236752b70709f37b8989346ca29fbfedac927fd6a13c0295ba9c
4
+ data.tar.gz: 02fcde7d1672d5f79323994d6b299b13cb9feba7241ba8319aeccdb674ed0cd3
5
5
  SHA512:
6
- metadata.gz: 3d30865ca2d71747c755bdbfd3310c99e96e8e1b36f58c5e5308c5d5333eed1833b8d07de73c8a15d0819e6b9c7797c27933218291be66436f4f483b4d69c0b7
7
- data.tar.gz: 103a22b786837f3407b47d9e4a0f257fd79b78501acbb2fc5a1ccdc8b450dbedf33b46da8d4f3af347146d41ae17cf85525f330fdba1f38e238271b5d7b700f5
6
+ metadata.gz: b82a793cd349de4a2fc24463e2446c52996bf03b2be4e4f6fb2cf0cad84ae922933898e9b48188fb12ee50bc6b536f7128eddb35632fdab2b6903c5c39eac090
7
+ data.tar.gz: f8eab3ed1480245bfe5f8c6490b4ccd8ef1fbfdf491fa290404b8d1a3ab8d1204e4a9577d8b8b0c9e37141822dbd4fad26a94e41c1c70818020374ec380b2cee
data/bobross.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "bobross"
8
8
  spec.version = Bobross::VERSION
9
9
  spec.authors = ["Jacob Slack", "Trevor Byington"]
10
- spec.email = ["jacobs@instructure.com", "tbyington@instructure.com"]
10
+ spec.email = ["jacobs@instructure.com", "tbyington@instructure.com", "tabyington@gmail.com"]
11
11
 
12
12
  spec.summary = %q{Generates data to put in your canvas instance.}
13
13
  spec.description = %q{Generates data to put in your canvas instance. Data can be exported as CSV for uploading or sent directly via api call}
@@ -1,3 +1,3 @@
1
1
  module Bobross
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -5,25 +5,28 @@ class Account < Forgery
5
5
  string = "#{@name}, #{@uid}, #{@parent_id}, #{@root_id}, #{@time_zone}, #{@sis_id}, #{@workflow}"
6
6
  end
7
7
 
8
- def initialize(name, uid, parent, root, time_zone, sis, workflow)
9
- @name = name
10
- @uid = uid
11
- @parent_id = parent
12
- @root_id = root
13
- @time_zone = time_zone
14
- @sis_id = sis
15
- @workflow = workflow
8
+ def initialize(opts = {})
9
+ @name = opts[:name] if opts[:name]
10
+ @uid = opts[:uid] if opts[:uid]
11
+ @parent_id = opts[:parent] if opts[:parent]
12
+ @root_id = opts[:root] if opts[:root]
13
+ @time_zone = opts[:time_zone] if opts[:time_zone]
14
+ @sis_id = opts[:sis] if opts[:sis]
15
+ @workflow = opts[:workflow] if opts[:workflow]
16
16
  end
17
17
 
18
18
  def self.random (parent_id = 1 , root_id = 1)
19
19
  a = Forgery('name').company_name
20
20
  Account.new(
21
- a,
22
- "#{a}-#{rand(10000)}",
23
- parent_id,
24
- root_id,
25
- Forgery('time').zone,
26
- (10000+rand(10000000)),
27
- 'active')
21
+ {
22
+ name: a,
23
+ uid: "#{a}-#{rand(10000)}",
24
+ parent: parent_id,
25
+ root: root_id,
26
+ time_zone: Forgery('time').zone,
27
+ sis_id: (10000+rand(10000000)),
28
+ workflow: 'active'
29
+ }
30
+ )
28
31
  end
29
32
  end
@@ -2,23 +2,26 @@ class Assignment < Forgery
2
2
  attr_reader :name, :description, :due_at, :lock_at, :course_id, :assignment_group
3
3
  attr_writer :due_at, :lock_at
4
4
 
5
- def initialize(name, description, due_at, lock_at, course, group)
6
- @name = name
7
- @description = description
8
- @due_at = due_at
9
- @lock_at = lock_at
10
- @course_id = course_id
11
- @assignment_group = assignment_group
5
+ def initialize(opts = {})
6
+ @name = opts[:name] if opts[:name]
7
+ @description = opts[:description] if opts[:description]
8
+ @due_at = opts[:due_at] if opts[:due_at]
9
+ @lock_at = opts[:lock_at] if opts[:lock_at]
10
+ @course_id = opts[:course_id] if opts[:course_id]
11
+ @assignment_group = opts[:assignment_group] if opts[:assignment_group]
12
12
  end
13
13
 
14
14
  def self.random (course = 1, group = 1)
15
15
  d = Forgery('date').date
16
16
  Assignment.new(
17
- "What #{Forgery('name').job_title} #{Forgery('name').full_name} said about #{Forgery('name').industry}",
18
- "#{Forgery('lorem_ipsum').paragraphs}",
19
- d,
20
- d+10.days,
21
- course,
22
- group )
17
+ {
18
+ name: "What #{Forgery('name').job_title} #{Forgery('name').full_name} said about #{Forgery('name').industry}",
19
+ description: "#{Forgery('lorem_ipsum').paragraphs}",
20
+ due_at: d,
21
+ lock_at: d+10.days,
22
+ course_id: course,
23
+ assignment_group: group
24
+ }
25
+ )
23
26
  end
24
27
  end
data/lib/models/course.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  class Course < Forgery
2
2
  attr_reader :name, :uid, :sis_id, :description
3
3
  @@local_dictionaries = File.absolute_path("lib")
4
-
5
- def initialize(name, uid, sis, desc)
6
- @name = name
7
- @uid = uid
8
- @sis_id = sis
9
- @description = desc
4
+
5
+ def initialize(opts = {})
6
+ @name = opts[:name] if opts[:name]
7
+ @uid = opts[:uid] if opts[:uid]
8
+ @sis_id = "#{opts[:sis]}" if opts[:sis]
9
+ @description = opts[:desc] if opts[:desc]
10
10
  end
11
11
 
12
12
  def to_s
@@ -19,10 +19,12 @@ class Course < Forgery
19
19
 
20
20
  def self.random
21
21
  Course.new(
22
- Course.course_name,
23
- Course.course_code,
24
- (12000+rand(1000000)).to_s,
25
- Course.description
22
+ {
23
+ name: Course.course_name,
24
+ uid: Course.course_code,
25
+ sis: (12000+rand(1000000)).to_s,
26
+ desc: Course.description
27
+ }
26
28
  )
27
29
  end
28
30
 
@@ -2,22 +2,24 @@ class Section < Forgery
2
2
  attr_reader :name, :sis_id, :course_id, :course_sis_id, :start_at, :end_at
3
3
  attr_writer :course, :course_sis_id
4
4
 
5
- def initialize(name, sis_id, course, start_at, end_at)
6
- @name = name
7
- @sis_id = sis_id
8
- @course_id = course
9
- @start_at = start_at
10
- @end_at = end_at
5
+ def initialize(opts = {})
6
+ @name = opts[:name] if opts[:name]
7
+ @sis_id = opts[:sis_id] if opts[:sis_id]
8
+ @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]
11
11
  end
12
12
 
13
13
  def self.random(course=1)
14
14
  d = Forgery('date').date
15
15
  Section.new(
16
- "#{Forgery('address').country} #{Forgery('basic').color}",
17
- (21000+rand(1000000)),
18
- course,
19
- d,
20
- d+90.days
16
+ {
17
+ name: "#{Forgery('address').country} #{Forgery('basic').color}",
18
+ sis_id: (21000+rand(1000000)),
19
+ course: course,
20
+ start_at: d,
21
+ end_at: d+90.days
22
+ }
21
23
  )
22
24
  end
23
25
  end
data/lib/models/user.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  class User < Forgery
2
2
  attr_reader :name, :sis_id, :login_id, :email, :time_zone
3
3
 
4
- def initialize (name, sis, login, email, time_zone)
5
- @name = name
6
- @sis_id = sis
7
- @login_id = login
8
- @email = email
9
- @time_zone = time_zone
4
+ def initialize (opts = {})
5
+ @name = opts[:name] if opts[:name]
6
+ @sis_id = opts[:sis] if opts[:sis]
7
+ @login_id = opts[:login] if opts[:login]
8
+ @email = opts[:email] if opts[:email]
9
+ @time_zone = opts[:time_zone] if opts[:time_zone]
10
10
  end
11
11
 
12
12
  def self.random
@@ -14,11 +14,13 @@ class User < Forgery
14
14
  ln = Forgery('name').last_name
15
15
  e = "tbyington+#{fn}.#{ln}@instructure.com"
16
16
  User.new(
17
- "#{fn} #{ln}",
18
- (3000+rand(1000000)),
19
- e,
20
- e,
21
- Forgery('time').zone
17
+ {
18
+ name: "#{fn} #{ln}",
19
+ sis: (3000+rand(1000000)),
20
+ login: e,
21
+ email: e,
22
+ time_zone: Forgery('time').zone
23
+ }
22
24
  )
23
25
  end
24
26
  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.6
4
+ version: 0.1.7
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-06-27 00:00:00.000000000 Z
12
+ date: 2019-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -72,6 +72,7 @@ description: Generates data to put in your canvas instance. Data can be exported
72
72
  email:
73
73
  - jacobs@instructure.com
74
74
  - tbyington@instructure.com
75
+ - tabyington@gmail.com
75
76
  executables: []
76
77
  extensions: []
77
78
  extra_rdoc_files: []