geet 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +2 -0
  3. data/Gemfile +10 -0
  4. data/Gemfile.lock +31 -0
  5. data/README.md +0 -2
  6. data/bin/geet +50 -39
  7. data/geet.gemspec +1 -1
  8. data/lib/geet/commandline/commands.rb +14 -0
  9. data/lib/geet/{helpers/configuration_helper.rb → commandline/configuration.rb} +4 -12
  10. data/lib/geet/git/repository.rb +93 -44
  11. data/lib/geet/{git_hub → github}/abstract_issue.rb +13 -13
  12. data/lib/geet/github/account.rb +19 -0
  13. data/lib/geet/{git_hub/api_helper.rb → github/api_interface.rb} +21 -19
  14. data/lib/geet/github/collaborator.rb +17 -0
  15. data/lib/geet/{git_hub → github}/gist.rb +4 -4
  16. data/lib/geet/{git_hub → github}/issue.rb +10 -10
  17. data/lib/geet/github/label.rb +17 -0
  18. data/lib/geet/{git_hub → github}/milestone.rb +11 -11
  19. data/lib/geet/github/pr.rb +61 -0
  20. data/lib/geet/services/create_gist.rb +4 -4
  21. data/lib/geet/services/create_issue.rb +30 -25
  22. data/lib/geet/services/create_pr.rb +28 -27
  23. data/lib/geet/services/list_issues.rb +2 -2
  24. data/lib/geet/services/list_labels.rb +2 -2
  25. data/lib/geet/services/list_milestones.rb +10 -10
  26. data/lib/geet/services/list_prs.rb +2 -2
  27. data/lib/geet/services/merge_pr.rb +8 -7
  28. data/lib/geet/version.rb +1 -1
  29. data/spec/integration/create_gist_spec.rb +46 -0
  30. data/spec/integration/create_issue_spec.rb +66 -0
  31. data/spec/integration/create_pr_spec.rb +68 -0
  32. data/spec/integration/list_issues_spec.rb +52 -0
  33. data/spec/integration/list_labels_spec.rb +28 -0
  34. data/spec/integration/list_milestones_spec.rb +43 -0
  35. data/spec/integration/list_prs_spec.rb +52 -0
  36. data/spec/integration/merge_pr_spec.rb +30 -0
  37. data/spec/spec_helper.rb +121 -0
  38. data/spec/vcr_cassettes/create_gist_private.yml +80 -0
  39. data/spec/vcr_cassettes/create_gist_public.yml +80 -0
  40. data/spec/vcr_cassettes/create_issue.yml +534 -0
  41. data/spec/vcr_cassettes/create_issue_upstream.yml +235 -0
  42. data/spec/vcr_cassettes/create_pr.yml +693 -0
  43. data/spec/vcr_cassettes/create_pr_upstream.yml +313 -0
  44. data/spec/vcr_cassettes/list_issues.yml +82 -0
  45. data/spec/vcr_cassettes/list_issues_upstream.yml +84 -0
  46. data/spec/vcr_cassettes/list_labels.yml +78 -0
  47. data/spec/vcr_cassettes/list_milestones.yml +468 -0
  48. data/spec/vcr_cassettes/list_prs.yml +84 -0
  49. data/spec/vcr_cassettes/list_prs_upstream.yml +80 -0
  50. data/spec/vcr_cassettes/merge_pr.yml +156 -0
  51. metadata +36 -11
  52. data/lib/geet/git_hub/account.rb +0 -19
  53. data/lib/geet/git_hub/pr.rb +0 -57
  54. data/lib/geet/git_hub/remote_repository.rb +0 -65
@@ -0,0 +1,52 @@
1
+ require 'spec_helper'
2
+
3
+ require_relative '../../lib/geet/git/repository'
4
+ require_relative '../../lib/geet/services/list_issues'
5
+
6
+ describe Geet::Services::ListIssues do
7
+ let(:repository) { Geet::Git::Repository.new(ENV.fetch('GITHUB_API_TOKEN')) }
8
+ let(:upstream_repository) { Geet::Git::Repository.new(ENV.fetch('GITHUB_API_TOKEN'), upstream: true) }
9
+
10
+ it 'should list the issues' do
11
+ allow(repository).to receive(:remote).with('origin').and_return('git@github.com:donaldduck/testrepo')
12
+
13
+ expected_output = <<~STR
14
+ 5. Title 2 (https://github.com/donaldduck/testrepo/issues/5)
15
+ 4. Title 1 (https://github.com/donaldduck/testrepo/issues/4)
16
+ STR
17
+ expected_issue_numbers = [5, 4]
18
+
19
+ actual_output = StringIO.new
20
+
21
+ service_result = VCR.use_cassette("list_issues") do
22
+ described_class.new.execute(repository, output: actual_output)
23
+ end
24
+
25
+ actual_issue_numbers = service_result.map(&:number)
26
+
27
+ expect(actual_output.string).to eql(expected_output)
28
+ expect(actual_issue_numbers).to eql(expected_issue_numbers)
29
+ end
30
+
31
+ it 'should list the upstream issues' do
32
+ allow(upstream_repository).to receive(:remote).with('origin').and_return('git@github.com:donaldduck/testrepo_2f')
33
+ allow(upstream_repository).to receive(:remote).with('upstream').and_return('git@github.com:donald-fr/testrepo_u')
34
+
35
+ expected_output = <<~STR
36
+ 2. Title 2 U (https://github.com/donald-fr/testrepo_u/issues/2)
37
+ 1. Title 1 U (https://github.com/donald-fr/testrepo_u/issues/1)
38
+ STR
39
+ expected_issue_numbers = [2, 1]
40
+
41
+ actual_output = StringIO.new
42
+
43
+ service_result = VCR.use_cassette("list_issues_upstream") do
44
+ described_class.new.execute(upstream_repository, output: actual_output)
45
+ end
46
+
47
+ actual_issue_numbers = service_result.map(&:number)
48
+
49
+ expect(actual_output.string).to eql(expected_output)
50
+ expect(actual_issue_numbers).to eql(expected_issue_numbers)
51
+ end
52
+ end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ require_relative '../../lib/geet/git/repository'
4
+ require_relative '../../lib/geet/services/list_labels'
5
+
6
+ describe Geet::Services::ListLabels do
7
+ let(:repository) { Geet::Git::Repository.new(ENV.fetch('GITHUB_API_TOKEN')) }
8
+
9
+ it 'should list the labels' do
10
+ allow(repository).to receive(:remote).with('origin').and_return('git@github.com:donaldduck/geet')
11
+
12
+ expected_output = <<~STR
13
+ - bug
14
+ - enhancement
15
+ - technical_debt
16
+ - top_priority
17
+ STR
18
+ expected_labels = %w[bug enhancement technical_debt top_priority]
19
+
20
+ actual_output = StringIO.new
21
+ actual_labels = VCR.use_cassette("list_labels") do
22
+ described_class.new.execute(repository, output: actual_output)
23
+ end
24
+
25
+ expect(actual_output.string).to eql(expected_output)
26
+ expect(actual_labels).to eql(expected_labels)
27
+ end
28
+ end
@@ -0,0 +1,43 @@
1
+ require 'spec_helper'
2
+
3
+ require_relative '../../lib/geet/git/repository'
4
+ require_relative '../../lib/geet/services/list_milestones'
5
+
6
+ describe Geet::Services::ListMilestones do
7
+ let(:repository) { Geet::Git::Repository.new(ENV.fetch('GITHUB_API_TOKEN')) }
8
+
9
+ it 'should list the milestones' do
10
+ allow(repository).to receive(:remote).with('origin').and_return('git@github.com:donaldduck/geet')
11
+
12
+ expected_output = <<~STR
13
+ Finding milestones...
14
+ Finding issues...
15
+
16
+ 6. 0.2.1
17
+ 51. Services should take repository in the initializer (https://github.com/donaldduck/geet/issues/51)
18
+ 49. Add issue list --assigned (https://github.com/donaldduck/geet/issues/49)
19
+ 29. Edit Issue/PR properties in a single request after creation (https://github.com/donaldduck/geet/issues/29)
20
+ 8. 0.2.3
21
+ 16. Implement issue opening (https://github.com/donaldduck/geet/issues/16)
22
+ 7. 0.2.2
23
+ 43. PR Merging: add support for upstream and branch autodelete (https://github.com/donaldduck/geet/issues/43)
24
+ 35. Improve design of repository-independent actions (https://github.com/donaldduck/geet/issues/35)
25
+ 5. 0.3.0
26
+ 4. Allow writing description in an editor (https://github.com/donaldduck/geet/issues/4)
27
+ 4. 0.2.0
28
+ 41. Add test suites (https://github.com/donaldduck/geet/issues/41)
29
+ STR
30
+ expected_milestone_numbers = [6, 8, 7, 5, 4]
31
+
32
+ actual_output = StringIO.new
33
+
34
+ service_result = VCR.use_cassette("list_milestones") do
35
+ described_class.new.execute(repository, output: actual_output)
36
+ end
37
+
38
+ actual_milestone_numbers = service_result.map(&:number)
39
+
40
+ expect(actual_output.string).to eql(expected_output)
41
+ expect(actual_milestone_numbers).to eql(expected_milestone_numbers)
42
+ end
43
+ end
@@ -0,0 +1,52 @@
1
+ require 'spec_helper'
2
+
3
+ require_relative '../../lib/geet/git/repository'
4
+ require_relative '../../lib/geet/services/list_prs'
5
+
6
+ describe Geet::Services::ListPrs do
7
+ let(:repository) { Geet::Git::Repository.new(ENV.fetch('GITHUB_API_TOKEN')) }
8
+ let(:upstream_repository) { Geet::Git::Repository.new(ENV.fetch('GITHUB_API_TOKEN'), upstream: true) }
9
+
10
+ it 'should list the PRs' do
11
+ allow(repository).to receive(:remote).with('origin').and_return('git@github.com:donaldduck/testrepo')
12
+
13
+ expected_output = <<~STR
14
+ 6. Title 2 (https://github.com/donaldduck/testrepo/pull/6)
15
+ 3. Title (https://github.com/donaldduck/testrepo/pull/3)
16
+ STR
17
+ expected_pr_numbers = [6, 3]
18
+
19
+ actual_output = StringIO.new
20
+
21
+ service_result = VCR.use_cassette("list_prs") do
22
+ described_class.new.execute(repository, output: actual_output)
23
+ end
24
+
25
+ actual_pr_numbers = service_result.map(&:number)
26
+
27
+ expect(actual_output.string).to eql(expected_output)
28
+ expect(actual_pr_numbers).to eql(expected_pr_numbers)
29
+ end
30
+
31
+ it 'should list the upstream PRs' do
32
+ allow(upstream_repository).to receive(:remote).with('origin').and_return('git@github.com:donaldduck/testrepo_2f')
33
+ allow(upstream_repository).to receive(:remote).with('upstream').and_return('git@github.com:donald-fr/testrepo_u')
34
+
35
+ expected_output = <<~STR
36
+ 5. Title 2 (https://github.com/donald-fr/testrepo_u/pull/5)
37
+ 4. Title (https://github.com/donald-fr/testrepo_u/pull/4)
38
+ STR
39
+ expected_pr_numbers = [5, 4]
40
+
41
+ actual_output = StringIO.new
42
+
43
+ service_result = VCR.use_cassette("list_prs_upstream") do
44
+ described_class.new.execute(upstream_repository, output: actual_output)
45
+ end
46
+
47
+ actual_pr_numbers = service_result.map(&:number)
48
+
49
+ expect(actual_output.string).to eql(expected_output)
50
+ expect(actual_pr_numbers).to eql(expected_pr_numbers)
51
+ end
52
+ end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ require_relative '../../lib/geet/git/repository'
4
+ require_relative '../../lib/geet/services/merge_pr'
5
+
6
+ describe Geet::Services::MergePr do
7
+ let(:repository) { Geet::Git::Repository.new(ENV.fetch('GITHUB_API_TOKEN')) }
8
+
9
+ it 'should merge the PR for the current branch' do
10
+ allow(repository).to receive(:current_branch).and_return('mybranch1')
11
+ allow(repository).to receive(:remote).with('origin').and_return('git@github.com:donaldduck/testrepo')
12
+
13
+ expected_output = <<~STR
14
+ Finding PR with head (mybranch1)...
15
+ Merging PR #3...
16
+ STR
17
+ expected_pr_number = 3
18
+
19
+ actual_output = StringIO.new
20
+
21
+ service_result = VCR.use_cassette("merge_pr") do
22
+ described_class.new.execute(repository, output: actual_output)
23
+ end
24
+
25
+ actual_pr_number = service_result.number
26
+
27
+ expect(actual_output.string).to eql(expected_output)
28
+ expect(actual_pr_number).to eql(expected_pr_number)
29
+ end
30
+ end
@@ -0,0 +1,121 @@
1
+ # User-defined
2
+
3
+ require 'vcr'
4
+ require 'base64'
5
+
6
+ VCR.configure do |config|
7
+ config.cassette_library_dir = "spec/vcr_cassettes"
8
+ config.hook_into :webmock
9
+
10
+ # See https://github.com/vcr/vcr/issues/201
11
+ config.filter_sensitive_data('<GITHUB_CREDENTIALS>') do
12
+ user = ""
13
+ api_token = ENV.fetch('GITHUB_API_TOKEN')
14
+
15
+ Base64.strict_encode64("#{user}:#{api_token}")
16
+ end
17
+ end
18
+
19
+ # This file was generated by the `rspec --init` command. Conventionally, all
20
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
21
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
22
+ # this file to always be loaded, without a need to explicitly require it in any
23
+ # files.
24
+ #
25
+ # Given that it is always loaded, you are encouraged to keep this file as
26
+ # light-weight as possible. Requiring heavyweight dependencies from this file
27
+ # will add to the boot time of your test suite on EVERY test run, even for an
28
+ # individual file that may not need all of that loaded. Instead, consider making
29
+ # a separate helper file that requires the additional dependencies and performs
30
+ # the additional setup, and require it from the spec files that actually need
31
+ # it.
32
+ #
33
+ # The `.rspec` file also contains a few flags that are not defaults but that
34
+ # users commonly want.
35
+ #
36
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
37
+ RSpec.configure do |config|
38
+ # rspec-expectations config goes here. You can use an alternate
39
+ # assertion/expectation library such as wrong or the stdlib/minitest
40
+ # assertions if you prefer.
41
+ config.expect_with :rspec do |expectations|
42
+ # This option will default to `true` in RSpec 4. It makes the `description`
43
+ # and `failure_message` of custom matchers include text for helper methods
44
+ # defined using `chain`, e.g.:
45
+ # be_bigger_than(2).and_smaller_than(4).description
46
+ # # => "be bigger than 2 and smaller than 4"
47
+ # ...rather than:
48
+ # # => "be bigger than 2"
49
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
50
+ end
51
+
52
+ # rspec-mocks config goes here. You can use an alternate test double
53
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
54
+ config.mock_with :rspec do |mocks|
55
+ # Prevents you from mocking or stubbing a method that does not exist on
56
+ # a real object. This is generally recommended, and will default to
57
+ # `true` in RSpec 4.
58
+ mocks.verify_partial_doubles = true
59
+ end
60
+
61
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
62
+ # have no way to turn it off -- the option exists only for backwards
63
+ # compatibility in RSpec 3). It causes shared context metadata to be
64
+ # inherited by the metadata hash of host groups and examples, rather than
65
+ # triggering implicit auto-inclusion in groups with matching metadata.
66
+ config.shared_context_metadata_behavior = :apply_to_host_groups
67
+
68
+ # The settings below are suggested to provide a good initial experience
69
+ # with RSpec, but feel free to customize to your heart's content.
70
+ =begin
71
+ # This allows you to limit a spec run to individual examples or groups
72
+ # you care about by tagging them with `:focus` metadata. When nothing
73
+ # is tagged with `:focus`, all examples get run. RSpec also provides
74
+ # aliases for `it`, `describe`, and `context` that include `:focus`
75
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
76
+ config.filter_run_when_matching :focus
77
+
78
+ # Allows RSpec to persist some state between runs in order to support
79
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
80
+ # you configure your source control system to ignore this file.
81
+ config.example_status_persistence_file_path = "spec/examples.txt"
82
+
83
+ # Limits the available syntax to the non-monkey patched syntax that is
84
+ # recommended. For more details, see:
85
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
86
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
87
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
88
+ config.disable_monkey_patching!
89
+
90
+ # This setting enables warnings. It's recommended, but in some cases may
91
+ # be too noisy due to issues in dependencies.
92
+ config.warnings = true
93
+
94
+ # Many RSpec users commonly either run the entire suite or an individual
95
+ # file, and it's useful to allow more verbose output when running an
96
+ # individual spec file.
97
+ if config.files_to_run.one?
98
+ # Use the documentation formatter for detailed output,
99
+ # unless a formatter has already been configured
100
+ # (e.g. via a command-line flag).
101
+ config.default_formatter = 'doc'
102
+ end
103
+
104
+ # Print the 10 slowest examples and example groups at the
105
+ # end of the spec run, to help surface which specs are running
106
+ # particularly slow.
107
+ config.profile_examples = 10
108
+
109
+ # Run specs in random order to surface order dependencies. If you find an
110
+ # order dependency and want to debug it, you can fix the order by providing
111
+ # the seed, which is printed after each run.
112
+ # --seed 1234
113
+ config.order = :random
114
+
115
+ # Seed global randomization in this process using the `--seed` CLI option.
116
+ # Setting this allows you to use `--seed` to deterministically reproduce
117
+ # test failures related to randomization by passing the same `--seed` value
118
+ # as the one that triggered the failure.
119
+ Kernel.srand config.seed
120
+ =end
121
+ end
@@ -0,0 +1,80 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.github.com/gists
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"public":false,"files":{"geet_gist20171120-21351-1voyg7d":{"content":"testcontent"}},"description":"testdescription"}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/vnd.github.v3+json
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - api.github.com
18
+ Authorization:
19
+ - Basic <GITHUB_CREDENTIALS>
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Server:
26
+ - GitHub.com
27
+ Date:
28
+ - Mon, 20 Nov 2017 19:49:52 GMT
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Content-Length:
32
+ - '3296'
33
+ Status:
34
+ - 201 Created
35
+ X-Ratelimit-Limit:
36
+ - '5000'
37
+ X-Ratelimit-Remaining:
38
+ - '4995'
39
+ X-Ratelimit-Reset:
40
+ - '1511208417'
41
+ Cache-Control:
42
+ - private, max-age=60, s-maxage=60
43
+ Vary:
44
+ - Accept, Authorization, Cookie, X-GitHub-OTP
45
+ Etag:
46
+ - '"0b40ee11ec02481c8d1ec1b78eb0a8fd"'
47
+ X-Oauth-Scopes:
48
+ - admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook,
49
+ delete_repo, gist, notifications, repo, user
50
+ X-Accepted-Oauth-Scopes:
51
+ - ''
52
+ Location:
53
+ - https://api.github.com/gists/deadbeef
54
+ X-Github-Media-Type:
55
+ - github.v3; format=json
56
+ Access-Control-Expose-Headers:
57
+ - ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining,
58
+ X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
59
+ Access-Control-Allow-Origin:
60
+ - "*"
61
+ Content-Security-Policy:
62
+ - default-src 'none'
63
+ Strict-Transport-Security:
64
+ - max-age=31536000; includeSubdomains; preload
65
+ X-Content-Type-Options:
66
+ - nosniff
67
+ X-Frame-Options:
68
+ - deny
69
+ X-Xss-Protection:
70
+ - 1; mode=block
71
+ X-Runtime-Rack:
72
+ - '1.220669'
73
+ X-Github-Request-Id:
74
+ - EDF2:2E340:1203894:22EE1C4:5A1331DE
75
+ body:
76
+ encoding: UTF-8
77
+ string: '{"url":"https://api.github.com/gists/deadbeef","forks_url":"https://api.github.com/gists/deadbeef/forks","commits_url":"https://api.github.com/gists/deadbeef/commits","id":"deadbeef","git_pull_url":"https://gist.github.com/deadbeef.git","git_push_url":"https://gist.github.com/deadbeef.git","html_url":"https://gist.github.com/deadbeef","files":{"geet_gist20171120-21351-1voyg7d":{"filename":"geet_gist20171120-21351-1voyg7d","type":"text/plain","language":null,"raw_url":"https://gist.githubusercontent.com/donaldduck/deadbeef/raw/otherhex1/geet_gist20171120-21351-1voyg7d","size":11,"truncated":false,"content":"testcontent"}},"public":false,"created_at":"2017-11-20T19:49:52Z","updated_at":"2017-11-20T19:49:52Z","description":"testdescription","comments":0,"user":null,"comments_url":"https://api.github.com/gists/deadbeef/comments","owner":{"login":"donaldduck","id":1595356,"avatar_url":"https://avatars2.githubusercontent.com/u/1595356?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"forks":[],"history":[{"user":{"login":"donaldduck","id":1595356,"avatar_url":"https://avatars2.githubusercontent.com/u/1595356?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"version":"otherhex2","committed_at":"2017-11-20T19:49:51Z","change_status":{"total":1,"additions":1,"deletions":0},"url":"https://api.github.com/gists/deadbeef/otherhex2"}],"truncated":false}'
78
+ http_version:
79
+ recorded_at: Mon, 20 Nov 2017 19:49:52 GMT
80
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,80 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.github.com/gists
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"public":true,"files":{"geet_gist20171120-21351-vhp23e":{"content":"testcontent"}},"description":"testdescription"}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/vnd.github.v3+json
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - api.github.com
18
+ Authorization:
19
+ - Basic <GITHUB_CREDENTIALS>
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Server:
26
+ - GitHub.com
27
+ Date:
28
+ - Mon, 20 Nov 2017 19:49:48 GMT
29
+ Content-Type:
30
+ - application/json; charset=utf-8
31
+ Content-Length:
32
+ - '3292'
33
+ Status:
34
+ - 201 Created
35
+ X-Ratelimit-Limit:
36
+ - '5000'
37
+ X-Ratelimit-Remaining:
38
+ - '4996'
39
+ X-Ratelimit-Reset:
40
+ - '1511208417'
41
+ Cache-Control:
42
+ - private, max-age=60, s-maxage=60
43
+ Vary:
44
+ - Accept, Authorization, Cookie, X-GitHub-OTP
45
+ Etag:
46
+ - '"406a805c544144f845c5d4d7eaf99cae"'
47
+ X-Oauth-Scopes:
48
+ - admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook,
49
+ delete_repo, gist, notifications, repo, user
50
+ X-Accepted-Oauth-Scopes:
51
+ - ''
52
+ Location:
53
+ - https://api.github.com/gists/b01dface
54
+ X-Github-Media-Type:
55
+ - github.v3; format=json
56
+ Access-Control-Expose-Headers:
57
+ - ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining,
58
+ X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
59
+ Access-Control-Allow-Origin:
60
+ - "*"
61
+ Content-Security-Policy:
62
+ - default-src 'none'
63
+ Strict-Transport-Security:
64
+ - max-age=31536000; includeSubdomains; preload
65
+ X-Content-Type-Options:
66
+ - nosniff
67
+ X-Frame-Options:
68
+ - deny
69
+ X-Xss-Protection:
70
+ - 1; mode=block
71
+ X-Runtime-Rack:
72
+ - '1.145249'
73
+ X-Github-Request-Id:
74
+ - EDC4:2E342:EBAD46:266D076:5A1331DA
75
+ body:
76
+ encoding: UTF-8
77
+ string: '{"url":"https://api.github.com/gists/b01dface","forks_url":"https://api.github.com/gists/b01dface/forks","commits_url":"https://api.github.com/gists/b01dface/commits","id":"b01dface","git_pull_url":"https://gist.github.com/b01dface.git","git_push_url":"https://gist.github.com/b01dface.git","html_url":"https://gist.github.com/b01dface","files":{"geet_gist20171120-21351-vhp23e":{"filename":"geet_gist20171120-21351-vhp23e","type":"text/plain","language":null,"raw_url":"https://gist.githubusercontent.com/donaldduck/b01dface/raw/otherhex1/geet_gist20171120-21351-vhp23e","size":11,"truncated":false,"content":"testcontent"}},"public":true,"created_at":"2017-11-20T19:49:47Z","updated_at":"2017-11-20T19:49:47Z","description":"testdescription","comments":0,"user":null,"comments_url":"https://api.github.com/gists/b01dface/comments","owner":{"login":"donaldduck","id":1595356,"avatar_url":"https://avatars2.githubusercontent.com/u/1595356?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"forks":[],"history":[{"user":{"login":"donaldduck","id":1595356,"avatar_url":"https://avatars2.githubusercontent.com/u/1595356?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"version":"otherhex2","committed_at":"2017-11-20T19:49:47Z","change_status":{"total":1,"additions":1,"deletions":0},"url":"https://api.github.com/gists/b01dface/otherhex2"}],"truncated":false}'
78
+ http_version:
79
+ recorded_at: Mon, 20 Nov 2017 19:49:48 GMT
80
+ recorded_with: VCR 3.0.3