red5 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -0
  3. data/README.md +55 -1
  4. data/Rakefile +3 -1
  5. data/lib/red_5.rb +19 -0
  6. data/lib/red_5/exceptions/red_5_exception.rb +9 -0
  7. data/lib/red_5/helpers.rb +8 -0
  8. data/lib/red_5/models/entities.rb +54 -0
  9. data/lib/{red5 → red_5/models}/films.rb +1 -1
  10. data/lib/{red5 → red_5/models}/people.rb +1 -1
  11. data/lib/{red5 → red_5/models}/planets.rb +1 -1
  12. data/lib/{red5 → red_5/models}/species.rb +1 -1
  13. data/lib/{red5 → red_5/models}/starships.rb +1 -1
  14. data/lib/{red5 → red_5/models}/vehicles.rb +1 -1
  15. data/lib/{red5 → red_5}/root.rb +1 -1
  16. data/lib/red_5/version.rb +3 -0
  17. data/red5.gemspec +4 -1
  18. data/spec/cassettes/Failure/404s/raises_an_exception_on_a_ludicrous_request.yml +96 -0
  19. data/spec/cassettes/Failure/404s/raises_an_exception_on_a_non-existent_thing.yml +96 -0
  20. data/spec/cassettes/Failure/Non-existent_attributes/raises_an_exception_on_a_bogus_lookup.yml +101 -0
  21. data/spec/cassettes/Red5_Films/finds_a_particular_film.yml +111 -0
  22. data/spec/cassettes/Red5_Films/has_OpenStruct-type_lookups.yml +111 -0
  23. data/spec/cassettes/Red5_Films/returns_a_film.yml +111 -0
  24. data/spec/cassettes/Red5_People/fetches_the_species_for_a_person.yml +155 -0
  25. data/spec/cassettes/{Red_5_People/should_find_a_person.yml → Red5_People/finds_a_particular_person.yml} +13 -13
  26. data/spec/cassettes/Red5_People/has_an_id.yml +101 -0
  27. data/spec/cassettes/Red5_People/returns_a_person.yml +101 -0
  28. data/spec/cassettes/{Red_5_Planets/should_find_a_planet.yml → Red5_Planets/finds_a_planet.yml} +18 -18
  29. data/spec/cassettes/Red5_Species/fetches_the_homeworld_for_a_species.yml +157 -0
  30. data/spec/cassettes/Red5_Species/finds_a_homeworld_for_a_species.yml +101 -0
  31. data/spec/cassettes/Red5_Species/finds_a_species.yml +101 -0
  32. data/spec/cassettes/Red5_Starships/Failure/raises_an_exception_on_a_ludicrous_request.yml +96 -0
  33. data/spec/cassettes/Red5_Starships/Failure/raises_an_exception_on_a_non-existent_thing.yml +96 -0
  34. data/spec/cassettes/Red5_Starships/finds_a_starship.yml +102 -0
  35. data/spec/cassettes/Red5_Vehicles/finds_a_vehicle.yml +102 -0
  36. data/spec/cassettes/Red_5_Films/finds_a_particular_film.yml +111 -0
  37. data/spec/cassettes/Red_5_Films/returns_a_film.yml +111 -0
  38. data/spec/cassettes/Red_5_People/fetches_the_species_for_a_person.yml +155 -0
  39. data/spec/cassettes/Red_5_People/finds_a_particular_person.yml +101 -0
  40. data/spec/cassettes/Red_5_People/gets_the_species_for_a_person.yml +252 -0
  41. data/spec/cassettes/Red_5_People/has_an_id.yml +101 -0
  42. data/spec/cassettes/Red_5_People/returns_a_person.yml +101 -0
  43. data/spec/cassettes/Red_5_Species/fetches_the_homeworld_for_a_species.yml +157 -0
  44. data/spec/cassettes/Red_5_Species/finds_a_homeworld_for_a_species.yml +101 -0
  45. data/spec/cassettes/Red_5_Species/gets_the_homeworld_for_a_species.yml +157 -0
  46. data/spec/cassettes/Red_5_Starships/Failure/raises_an_exception_on_a_non-existent_thing.yml +96 -0
  47. data/spec/failure_spec.rb +31 -0
  48. data/spec/models/films_spec.rb +15 -0
  49. data/spec/models/people_spec.rb +25 -0
  50. data/spec/models/planets_spec.rb +10 -0
  51. data/spec/models/species_spec.rb +20 -0
  52. data/spec/models/starships_spec.rb +10 -0
  53. data/spec/models/vehicles_spec.rb +10 -0
  54. data/spec/red5_spec.rb +2 -45
  55. data/spec/spec_helper.rb +1 -1
  56. metadata +129 -17
  57. data/lib/red5.rb +0 -14
  58. data/lib/red5/entities.rb +0 -9
  59. data/lib/red5/version.rb +0 -3
@@ -1,14 +0,0 @@
1
- require 'rest_client'
2
- require 'json'
3
-
4
- require 'red5/version'
5
-
6
- require 'red5/root'
7
- require 'red5/entities'
8
-
9
- require 'red5/films'
10
- require 'red5/people'
11
- require 'red5/planets'
12
- require 'red5/species'
13
- require 'red5/starships'
14
- require 'red5/vehicles'
@@ -1,9 +0,0 @@
1
- module Red_5
2
- class Entities
3
- def self.find id
4
- slug = self.name.split('::').last.downcase
5
- resource = RestClient::Resource.new "http://swapi.co/api/#{slug}/#{id}"
6
- JSON.parse resource.get.body
7
- end
8
- end
9
- end
@@ -1,3 +0,0 @@
1
- module Red5
2
- VERSION = "0.0.2"
3
- end