jimothy 0.0.007

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a106bf43c4feb4a745a9ec9bf8de2fc3e19d25c95cdd39fb35d29c18d3c6f4a7
4
+ data.tar.gz: d97ff0e5c392e2371a0c81f3c290b6e7c763d8a925492a0b33ec8ed8fd7b8b93
5
+ SHA512:
6
+ metadata.gz: 92bffbda7860e69ab84d67410d293b704fbc246bfc9d6d45ac4d382d41181c4912803d835c2a7bb856f0ab3f97c9abf3b3af77bab3f74ecdc9b5d4941f31b307
7
+ data.tar.gz: fd5036b07c046367e2d501ca58f2b957252ad60027df234ab13b636abeedbd64f44ccf746be97920d231f655ceae467908c2ea165a7760a1f348a09df1ce4c0c
@@ -0,0 +1,112 @@
1
+ {
2
+ "users": [
3
+ {
4
+ "firstname": "Michael",
5
+ "lastname": "Scott",
6
+ "email": "michaelscott@dundermifflin.com",
7
+ "image": "michael-scott.png"
8
+ },
9
+ {
10
+ "firstname": "Jim",
11
+ "lastname": "Halpert",
12
+ "email": "jimhalpert@dundermifflin.com",
13
+ "image": "jim-halpert.png"
14
+ },
15
+ {
16
+ "firstname": "Dwight",
17
+ "lastname": "Schrute",
18
+ "email": "dwightschrute@dundermifflin.com",
19
+ "image": "dwight-schrute.png"
20
+ },
21
+ {
22
+ "firstname": "Pam",
23
+ "lastname": "Beesly",
24
+ "email": "pambeesly@dundermifflin.com",
25
+ "image": "pam-beesly.png"
26
+ },
27
+ {
28
+ "firstname": "Ryan",
29
+ "lastname": "Howard",
30
+ "email": "ryanhoward@dundermifflin.com",
31
+ "image": "ryan-howard.png"
32
+ },
33
+ {
34
+ "firstname": "Andy",
35
+ "lastname": "Bernard",
36
+ "email": "andybernard@dundermifflin.com",
37
+ "image": "andy-bernard.png"
38
+ },
39
+ {
40
+ "firstname": "Kevin",
41
+ "lastname": "Malone",
42
+ "email": "kevinmalone@dundermifflin.com",
43
+ "image": "kevin-malone.png"
44
+ },
45
+ {
46
+ "firstname": "Erin",
47
+ "lastname": "Hannon",
48
+ "email": "erinhannon@dundermifflin.com",
49
+ "image": "erin-hannon.png"
50
+ },
51
+ {
52
+ "firstname": "Angela",
53
+ "lastname": "Martin",
54
+ "email": "angelamartin@dundermifflin.com",
55
+ "image": "angela-martin.png"
56
+ },
57
+ {
58
+ "firstname": "Toby",
59
+ "lastname": "Flenderson",
60
+ "email": "tobyflenderson@dundermifflin.com",
61
+ "image": "toby-flenderson.png"
62
+ },
63
+ {
64
+ "firstname": "Kelly",
65
+ "lastname": "Kapoor",
66
+ "email": "kellykapoor@dundermifflin.com",
67
+ "image": "kelly-kapoor.png"
68
+ },
69
+ {
70
+ "firstname": "Phyllis",
71
+ "lastname": "Vance",
72
+ "email": "phyllisvance@dundermifflin.com",
73
+ "image": "phyllis-vance.png"
74
+ },
75
+ {
76
+ "firstname": "Darryl",
77
+ "lastname": "Philbin",
78
+ "email": "darrylphilbin@dundermifflin.com",
79
+ "image": "darryl-philbin.png"
80
+ },
81
+ {
82
+ "firstname": "Oscar",
83
+ "lastname": "Martinez",
84
+ "email": "oscarmartinez@dundermifflin.com",
85
+ "image": "oscar-martinez.png"
86
+ },
87
+ {
88
+ "firstname": "Ryan",
89
+ "lastname": "Howard",
90
+ "email": "ryanhoward@dundermifflin.com",
91
+ "image": "ryan-howard.png"
92
+ },
93
+ {
94
+ "firstname": "Stanley",
95
+ "lastname": "Hudson",
96
+ "email": "stanleyhudson@dundermifflin.com",
97
+ "image": "stanley-hudson.png"
98
+ },
99
+ {
100
+ "firstname": "Meredith",
101
+ "lastname": "Palmer",
102
+ "email": "meredithpalmer@dundermifflin.com",
103
+ "image": "meredith-palmer.png"
104
+ },
105
+ {
106
+ "firstname": "Creed",
107
+ "lastname": "Bratton",
108
+ "email": "creedbratton@dundermifflin.com",
109
+ "image": "creed-bratton.png"
110
+ }
111
+ ]
112
+ }
data/lib/jimothy.rb ADDED
@@ -0,0 +1,19 @@
1
+ require 'json'
2
+
3
+ GEM_ROOT = File.expand_path("../..", __FILE__)
4
+
5
+ class Jimothy
6
+ def self.get_users
7
+ # users = JSON.parse(File.read('./lib/jimothy/the-office-characters.json'))['users'] # works in simple ruby app but not in a rails app
8
+ # users = JSON.parse(IO.read("#{GEM_ROOT}/lib/vendor/assets/the-office-characters.json"))['users'] # this works
9
+ users = JSON.parse(IO.read("#{GEM_ROOT}/lib/jimothy/the-office-characters.json"))['users'] # this works
10
+ end
11
+
12
+ def self.seed_users
13
+ users = get_users
14
+ users.each do |user|
15
+ User.create(name: user['firstname'] + " " + user['lastname'], email: user['email'], image: user['image'])
16
+ end
17
+ end
18
+
19
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jimothy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.007
5
+ platform: ruby
6
+ authors:
7
+ - Mark McDermott
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-02-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Placeholder Rails users from The Office
14
+ email: mark@markmcdermott.io
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/jimothy.rb
20
+ - lib/jimothy/the-office-characters.json
21
+ homepage: https://rubygems.org/gems/jimothy
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.3.7
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Placeholder Rails users from The Office
44
+ test_files: []