githubris 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/.travis.yml +8 -2
  2. data/Gemfile +6 -3
  3. data/README.md +14 -0
  4. data/Rakefile +5 -11
  5. data/githubris.gemspec +2 -0
  6. data/lib/githubris.rb +18 -8
  7. data/lib/githubris/api.rb +89 -11
  8. data/lib/githubris/api/gist.rb +34 -15
  9. data/lib/githubris/api/http.rb +12 -0
  10. data/lib/githubris/api/user.rb +10 -4
  11. data/lib/githubris/base.rb +80 -0
  12. data/lib/githubris/comment.rb +1 -6
  13. data/lib/githubris/error.rb +5 -0
  14. data/lib/githubris/gist.rb +15 -60
  15. data/lib/githubris/gist/file.rb +1 -8
  16. data/lib/githubris/oauth.rb +36 -0
  17. data/lib/githubris/publicity.rb +13 -0
  18. data/lib/githubris/user.rb +13 -28
  19. data/lib/githubris/version.rb +1 -1
  20. data/spec/githubris/api/gist_spec.rb +8 -41
  21. data/spec/githubris/api/user_spec.rb +17 -2
  22. data/spec/githubris/api_spec.rb +99 -0
  23. data/spec/githubris/base_spec.rb +77 -0
  24. data/spec/githubris/gist_spec.rb +21 -76
  25. data/spec/githubris/oauth_spec.rb +71 -0
  26. data/spec/githubris/publicity_spec.rb +22 -0
  27. data/spec/githubris/user_spec.rb +50 -13
  28. data/spec/githubris_spec.rb +34 -40
  29. data/spec/spec_helper.rb +9 -6
  30. data/spec/support/fixtures.rb +115 -99
  31. data/spec/support/fixtures/vcr_cassettes/Githubris/_find_gist.yml +44 -0
  32. data/spec/support/fixtures/vcr_cassettes/Githubris/_find_user.yml +40 -0
  33. data/spec/support/fixtures/vcr_cassettes/Githubris/_public_gists.yml +55 -0
  34. data/spec/support/fixtures/vcr_cassettes/Githubris_API/_authenticated_/when_authenticated_with_bad_credentials.yml +40 -0
  35. data/spec/support/fixtures/vcr_cassettes/Githubris_API/_authenticated_/when_authenticated_with_good_credentials.yml +42 -0
  36. data/spec/support/fixtures/vcr_cassettes/Githubris_API/_authenticated_/when_there_are_no_credentials.yml +42 -0
  37. data/spec/support/fixtures/vcr_cassettes/Githubris_API_Gist/_get_gist.yml +44 -0
  38. data/spec/support/fixtures/vcr_cassettes/Githubris_API_Gist/_get_public_gists.yml +107 -0
  39. data/spec/support/fixtures/vcr_cassettes/Githubris_API_Gist/_get_user_gists.yml +43 -0
  40. data/spec/support/fixtures/vcr_cassettes/Githubris_API_User/_get_authenticated_user/without_credentials.yml +42 -0
  41. data/spec/support/fixtures/vcr_cassettes/Githubris_API_User/_get_user.yml +40 -0
  42. data/spec/support/fixtures/vcr_cassettes/Githubris_Gist/_save.yml +42 -0
  43. data/spec/support/fixtures/vcr_cassettes/Githubris_Gist/any_gist.yml +44 -0
  44. data/spec/support/fixtures/vcr_cassettes/Githubris_Gist/given_a_gist_full_of_data.yml +44 -0
  45. data/spec/support/fixtures/vcr_cassettes/Githubris_Gist/on_a_gist_with_an_id.yml +44 -0
  46. data/spec/support/fixtures/vcr_cassettes/Githubris_Gist/on_a_gist_with_an_id/_reload.yml +44 -0
  47. data/spec/support/fixtures/vcr_cassettes/Githubris_User/_gists.yml +43 -0
  48. data/spec/support/fixtures/vcr_cassettes/Githubris_User/_reload.yml +40 -0
  49. data/spec/support/fixtures/vcr_cassettes/Githubris_User/_reload/on_a_user_with_a_login.yml +40 -0
  50. data/spec/support/fixtures/vcr_cassettes/Githubris_User/_reload/on_a_user_without_a_login.yml +40 -0
  51. data/spec/support/fixtures/vcr_cassettes/Githubris_User/_starred_gists/on_an_authenticated_user.yml +82 -0
  52. data/spec/support/vcr.rb +6 -0
  53. metadata +57 -21
  54. data/features/get_a_gist.feature +0 -13
  55. data/features/get_a_user.feature +0 -8
  56. data/features/list_of_public_gists.feature +0 -12
  57. data/features/list_of_users_public_gists.feature +0 -13
  58. data/features/step_definitions/general_steps.rb +0 -32
  59. data/features/support/env.rb +0 -6
  60. data/features/support/fakeweb_responses.rb +0 -12
  61. data/features/support/fixtures.rb +0 -47
  62. data/lib/githubris/builder.rb +0 -28
  63. data/spec/githubris/builder_spec.rb +0 -28
  64. data/spec/support/custom_matchers.rb +0 -27
  65. data/spec/support/fakeweb_responses.rb +0 -12
  66. data/spec/support/gist.json +0 -335
  67. data/spec/support/public_gists_page_1.json +0 -884
  68. data/spec/support/public_gists_page_2.json +0 -898
  69. data/spec/support/user.json +0 -14
  70. data/spec/support/user_public_gists.json +0 -65
@@ -1,14 +0,0 @@
1
- {
2
- "public_gists": 2,
3
- "type": "User",
4
- "following": 0,
5
- "login": "GithubrisTestUser",
6
- "avatar_url": "https://secure.gravatar.com/avatar/20de3fd01e285d14de84067c34ab74d2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
7
- "public_repos": 1,
8
- "followers": 0,
9
- "html_url": "https://github.com/GithubrisTestUser",
10
- "url": "https://api.github.com/users/GithubrisTestUser",
11
- "created_at": "2012-02-24T12:23:28Z",
12
- "gravatar_id": "20de3fd01e285d14de84067c34ab74d2",
13
- "id": 1469392
14
- }
@@ -1,65 +0,0 @@
1
- [
2
- {
3
- "files": {
4
- "test.rb": {
5
- "type": "application/ruby",
6
- "raw_url": "https://gist.github.com/raw/1901849/618cb237464a83cba15c5c16e913679a2703f3e0/test.rb",
7
- "language": "Ruby",
8
- "size": 35,
9
- "filename": "test.rb"
10
- }
11
- },
12
- "public": true,
13
- "comments": 0,
14
- "updated_at": "2012-02-24T16:20:22Z",
15
- "user": {
16
- "login": "GithubrisTestUser",
17
- "url": "https://api.github.com/users/GithubrisTestUser",
18
- "gravatar_id": "20de3fd01e285d14de84067c34ab74d2",
19
- "avatar_url": "https://secure.gravatar.com/avatar/20de3fd01e285d14de84067c34ab74d2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
20
- "id": 1469392
21
- },
22
- "url": "https://api.github.com/gists/1901849",
23
- "created_at": "2012-02-24T16:20:22Z",
24
- "git_pull_url": "git://gist.github.com/1901849.git",
25
- "html_url": "https://gist.github.com/1901849",
26
- "id": "1901849",
27
- "description": "This is a test gist",
28
- "git_push_url": "git@gist.github.com:1901849.git"
29
- },
30
- {
31
- "files": {
32
- "slipsum.html": {
33
- "type": "text/html",
34
- "raw_url": "https://gist.github.com/raw/1901843/85d293b0fbc401adb58902fa24711e45e389fc3d/slipsum.html",
35
- "language": "HTML",
36
- "size": 555,
37
- "filename": "slipsum.html"
38
- },
39
- "example.md": {
40
- "type": "text/plain",
41
- "raw_url": "https://gist.github.com/raw/1901843/d9213baf064e7d4b9619143371172b49d97c29b8/example.md",
42
- "language": "Markdown",
43
- "size": 27,
44
- "filename": "example.md"
45
- }
46
- },
47
- "public": true,
48
- "comments": 0,
49
- "updated_at": "2012-02-24T16:19:48Z",
50
- "user": {
51
- "login": "GithubrisTestUser",
52
- "url": "https://api.github.com/users/GithubrisTestUser",
53
- "gravatar_id": "20de3fd01e285d14de84067c34ab74d2",
54
- "avatar_url": "https://secure.gravatar.com/avatar/20de3fd01e285d14de84067c34ab74d2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png",
55
- "id": 1469392
56
- },
57
- "url": "https://api.github.com/gists/1901843",
58
- "created_at": "2012-02-24T16:19:48Z",
59
- "git_pull_url": "git://gist.github.com/1901843.git",
60
- "html_url": "https://gist.github.com/1901843",
61
- "id": "1901843",
62
- "description": "This is a gist with many files",
63
- "git_push_url": "git@gist.github.com:1901843.git"
64
- }
65
- ]