twenty_sixteen 0.9.0 → 1.0.0

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
  SHA1:
3
- metadata.gz: 7c0f8396faf3213e9ce1257c8b56dd2df75d1716
4
- data.tar.gz: bd40b35faad4ea021ac2c535dd039c6eed5ff316
3
+ metadata.gz: 0bf610af898bdd2262930dfae9714c42940e5b8b
4
+ data.tar.gz: d5147631d777c0c1b552ea93a24aa121793a24f2
5
5
  SHA512:
6
- metadata.gz: 20d419d9020f7ff469206fb8d36851c06aba581ea9f9184211459c47def2603d9f6438d4363dce911a6950767b086a0d50a4015d7c121370b8461542ff01b27f
7
- data.tar.gz: 172d6204fa8fc6d10aaf0370d811b2d335554c17e5bee409025865faf90d05ae813b8e32d55647ec384a9683ba938344cd5ff8876934e30698f0bc63ae6a5725
6
+ metadata.gz: 1b6b2ef304bda044d7f32a247e6390ec1d70ae30a48df4c763fa80036eec161ca0afb6cac2e43b52a8c4d23b60dc3862b5b0a52a6ff0278d72af7b574145c3dc
7
+ data.tar.gz: f8f3e2f6314e8a92f1203c1622a95bd1c93d82f3f94a034a1eedbd7c8ac97c4145a7feb543eaa137e65da18598f33da6cf4f939af8de4add139ef3c91e6050a0
@@ -39,5 +39,9 @@ module TwentySixteen
39
39
  def self.where(options)
40
40
  all.select{|candidate| candidate.merge(options) == candidate}
41
41
  end
42
+
43
+ def self.party_nominee
44
+ all.select{|candidate| candidate[:party_nominee] == true}
45
+ end
42
46
  end
43
47
  end
@@ -26,7 +26,10 @@
26
26
  "url":"https://www.hillaryclinton.com/",
27
27
  "campaign_name":"Hillary for America",
28
28
  "campaign_status":"active",
29
- "slogans":[],
29
+ "slogans":[
30
+ "I'm With Her",
31
+ "Stronger Together"
32
+ ],
30
33
  "social_urls":[
31
34
  "https://www.facebook.com/hillaryclinton",
32
35
  "https://twitter.com/hillaryclinton",
@@ -37,7 +40,12 @@
37
40
  {"name":"Ready PAC (Ready for Hillary)", "url":"https://www.readyforhillary.com/"},
38
41
  {"name":"Priorities USA Action", "url":"http://www.prioritiesusaaction.org/"},
39
42
  {"name":"American Bridge 21st Century", "url":"https://americanbridgepac.org/"}
40
- ]
43
+ ],
44
+ "running_mate":{
45
+ "first_name":"Tim",
46
+ "last_name":"Kane"
47
+ },
48
+ "party_nominee":true
41
49
  },
42
50
  {
43
51
  "party":"Democrat",
@@ -81,8 +89,11 @@
81
89
  "last_name":"Sanders",
82
90
  "url":"https://berniesanders.com/",
83
91
  "campaign_name":"Bernie 2016",
84
- "campaign_status":"active",
85
- "slogans":[],
92
+ "campaign_status":"inactive",
93
+ "slogans":[
94
+ "A Future To Believe In",
95
+ "Feel the Bern"
96
+ ],
86
97
  "social_urls":[
87
98
  "https://www.facebook.com/berniesanders",
88
99
  "https://twitter.com/BernieSanders",
@@ -141,7 +152,14 @@
141
152
  "https://instagram.com/realdonaldtrump/",
142
153
  "https://www.youtube.com/user/trump"
143
154
  ],
144
- "support_groups":[]
155
+ "support_groups":[
156
+ {"name": "Rebuilding America Now", "url":"https://rebuildingamericanow.com/"}
157
+ ],
158
+ "running_mate":{
159
+ "first_name":"Mike",
160
+ "last_name":"Pence"
161
+ },
162
+ "party_nominee":true
145
163
  },
146
164
  {
147
165
  "party":"Republican",
@@ -329,7 +347,11 @@
329
347
  "https://twitter.com/tedcruz",
330
348
  "https://www.youtube.com/user/TedCruzforSenate"
331
349
  ],
332
- "support_groups":[]
350
+ "support_groups":[],
351
+ "running_mate":{
352
+ "first_name":"Carly",
353
+ "last_name":"Fiorina"
354
+ }
333
355
  },
334
356
  {
335
357
  "party":"Republican",
@@ -368,5 +390,49 @@
368
390
  "https://twitter.com/johnkasich"
369
391
  ],
370
392
  "support_groups":[]
393
+ },
394
+ {
395
+ "party":"Libertarian",
396
+ "first_name":"Gary",
397
+ "last_name":"Johnson",
398
+ "url":"https://www.johnsonweld.com/",
399
+ "campaign_name":"Gary Johnson 2016",
400
+ "campaign_status":"active",
401
+ "slogans":[
402
+ "Credible. Proven. Capable. Honest."
403
+ ],
404
+ "social_urls":[
405
+ "https://www.facebook.com/govgaryjohnson/",
406
+ "https://twitter.com/GovGaryJohnson",
407
+ "https://www.youtube.com/c/govgaryjohnson",
408
+ "https://www.instagram.com/govgaryjohnson/",
409
+ "https://plus.google.com/+GovGaryJohnson/",
410
+ "https://www.linkedin.com/company/johnson-weld-2016",
411
+ "https://www.pinterest.com/govgaryjohnson"
412
+ ],
413
+ "support_groups":[
414
+ ],
415
+ "running_mate":{
416
+ "first_name":"Bill",
417
+ "last_name":"Weld"
418
+ },
419
+ "party_nominee":true
420
+ },
421
+ {
422
+ "party":"Green",
423
+ "first_name":"Jill",
424
+ "last_name":"Stein",
425
+ "url":"http://www.jill2016.com/",
426
+ "campaign_name":"Jill Stein for President",
427
+ "campaign_status":"active",
428
+ "slogans":[
429
+ "Keep the Revolution Going"
430
+ ],
431
+ "social_urls":[
432
+ "https://www.facebook.com/drjillstein/",
433
+ "https://twitter.com/DrJillStein"
434
+ ],
435
+ "support_groups":[],
436
+ "party_nominee":true
371
437
  }
372
438
  ]
@@ -1,5 +1,5 @@
1
1
  # version should be bumped to 1.0.0 when the primaries are over and the general begins
2
2
 
3
3
  module TwentySixteen
4
- VERSION = "0.9.0"
4
+ VERSION = "1.0.0"
5
5
  end
@@ -46,8 +46,7 @@ module TwentySixteen
46
46
  describe '.active' do
47
47
  it "returns an array of candidates having a campaign_status of 'active'" do
48
48
  expect(active_dems.map{|c| c[:last_name]}.sort).to eql([
49
- "Clinton",
50
- "Sanders"
49
+ "Clinton"
51
50
  ])
52
51
  expect(active_gops.map{|c| c[:last_name]}.sort).to eql([
53
52
  "Trump"
@@ -75,5 +74,13 @@ module TwentySixteen
75
74
  expect(parties).to eql(["Democrat"])
76
75
  end
77
76
  end
77
+
78
+ describe '.party_nominee' do
79
+ it "returns candidates who have won their party's nominating process" do
80
+ nominees = TwentySixteen::Candidate.party_nominee
81
+ parties = nominees.map{|c| c[:party] }.uniq.sort
82
+ expect(parties).to eql(["Democrat", "Green", "Libertarian","Republican"])
83
+ end
84
+ end
78
85
  end
79
86
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twenty_sixteen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MJ Rossetti (@s2t2)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-05 00:00:00.000000000 Z
11
+ date: 2016-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler