geet 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +25 -24
  4. data/bin/geet +21 -3
  5. data/geet.gemspec +2 -2
  6. data/lib/geet/commandline/configuration.rb +5 -5
  7. data/lib/geet/git/repository.rb +34 -15
  8. data/lib/geet/services/abstract_create_issue.rb +33 -0
  9. data/lib/geet/services/create_gist.rb +6 -4
  10. data/lib/geet/services/create_issue.rb +33 -87
  11. data/lib/geet/services/create_label.rb +7 -6
  12. data/lib/geet/services/create_pr.rb +42 -86
  13. data/lib/geet/services/list_issues.rb +13 -14
  14. data/lib/geet/services/list_labels.rb +4 -3
  15. data/lib/geet/services/list_milestones.rb +12 -11
  16. data/lib/geet/services/list_prs.rb +4 -3
  17. data/lib/geet/services/merge_pr.rb +12 -11
  18. data/lib/geet/shared/constants.rb +9 -0
  19. data/lib/geet/utils/attributes_selection_manager.rb +87 -0
  20. data/lib/geet/utils/manual_list_selection.rb +41 -27
  21. data/lib/geet/utils/string_matching_selection.rb +32 -0
  22. data/lib/geet/version.rb +1 -1
  23. data/spec/integration/create_gist_spec.rb +4 -4
  24. data/spec/integration/create_issue_spec.rb +6 -6
  25. data/spec/integration/create_label_spec.rb +3 -3
  26. data/spec/integration/create_pr_spec.rb +13 -13
  27. data/spec/integration/list_issues_spec.rb +5 -5
  28. data/spec/integration/list_labels_spec.rb +3 -3
  29. data/spec/integration/list_milestones_spec.rb +2 -2
  30. data/spec/integration/list_prs_spec.rb +2 -2
  31. data/spec/integration/merge_pr_spec.rb +2 -2
  32. data/spec/vcr_cassettes/create_issue_upstream.yml +1 -1
  33. data/spec/vcr_cassettes/create_pr.yml +181 -102
  34. data/spec/vcr_cassettes/create_pr_in_auto_mode_create_upstream.yml +1 -1
  35. data/spec/vcr_cassettes/create_pr_in_auto_mode_with_push.yml +1 -1
  36. data/spec/vcr_cassettes/create_pr_upstream.yml +2 -2
  37. metadata +8 -5
  38. data/lib/geet/utils/pattern_matching_selection.rb +0 -27
@@ -152,7 +152,7 @@ http_interactions:
152
152
  body:
153
153
  encoding: ASCII-8BIT
154
154
  string: '{"login":"donaldduck","id":1234566,"avatar_url":"https://avatars2.githubusercontent.com/u/123456?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,"name":"Donald
155
- Duck","company":"@ticketsolve","blog":"","location":"Berlin","email":"saverio.pub2@gmail.com","hireable":true,"bio":null,"public_repos":16,"public_gists":0,"followers":9,"following":0,"created_at":"2012-04-01T11:52:16Z","updated_at":"2018-01-19T08:36:16Z","private_gists":0,"total_private_repos":1,"owned_private_repos":0,"disk_usage":32519,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}'
155
+ Duck","company":"@mickeymouselaws","blog":"","location":"Berlin","email":"donald.pub2@gmail.com","hireable":true,"bio":null,"public_repos":16,"public_gists":0,"followers":9,"following":0,"created_at":"2012-04-01T11:52:16Z","updated_at":"2018-01-19T08:36:16Z","private_gists":0,"total_private_repos":1,"owned_private_repos":0,"disk_usage":32519,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}'
156
156
  http_version:
157
157
  recorded_at: Thu, 25 Jan 2018 21:18:54 GMT
158
158
  - request:
@@ -152,7 +152,7 @@ http_interactions:
152
152
  body:
153
153
  encoding: ASCII-8BIT
154
154
  string: '{"login":"donaldduck","id":1234560,"avatar_url":"https://avatars2.githubusercontent.com/u/3505400?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,"name":"Donald
155
- Duck","company":"@ticketsolve","blog":"","location":"Berlin","email":"saverio.pub2@gmail.com","hireable":true,"bio":null,"public_repos":16,"public_gists":0,"followers":9,"following":0,"created_at":"2012-04-01T11:52:16Z","updated_at":"2018-01-19T08:36:16Z","private_gists":0,"total_private_repos":1,"owned_private_repos":0,"disk_usage":32519,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}'
155
+ Duck","company":"@mickeymouselaws","blog":"","location":"Berlin","email":"donald.pub2@gmail.com","hireable":true,"bio":null,"public_repos":16,"public_gists":0,"followers":9,"following":0,"created_at":"2012-04-01T11:52:16Z","updated_at":"2018-01-19T08:36:16Z","private_gists":0,"total_private_repos":1,"owned_private_repos":0,"disk_usage":32519,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}'
156
156
  http_version:
157
157
  recorded_at: Thu, 25 Jan 2018 21:02:22 GMT
158
158
  - request:
@@ -75,7 +75,7 @@ http_interactions:
75
75
  body:
76
76
  encoding: ASCII-8BIT
77
77
  string: '{"login":"donaldduck","id":1234566,"avatar_url":"https://avatars2.githubusercontent.com/u/123456?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,"name":"Donald
78
- Duck","company":"@ticketsolve","blog":"","location":"Duckburg","email":"donald.pub2@gmail.com","hireable":true,"bio":null,"public_repos":13,"public_gists":0,"followers":7,"following":0,"created_at":"2012-04-01T11:52:16Z","updated_at":"2017-11-20T21:53:27Z","private_gists":0,"total_private_repos":1,"owned_private_repos":0,"disk_usage":32253,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}'
78
+ Duck","company":"@mickeymouselaws","blog":"","location":"Duckburg","email":"donald.pub2@gmail.com","hireable":true,"bio":null,"public_repos":13,"public_gists":0,"followers":7,"following":0,"created_at":"2012-04-01T11:52:16Z","updated_at":"2017-11-20T21:53:27Z","private_gists":0,"total_private_repos":1,"owned_private_repos":0,"disk_usage":32253,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}'
79
79
  http_version:
80
80
  recorded_at: Tue, 21 Nov 2017 09:42:47 GMT
81
81
  - request:
@@ -230,7 +230,7 @@ http_interactions:
230
230
  body:
231
231
  encoding: ASCII-8BIT
232
232
  string: '{"login":"donaldduck","id":1234566,"avatar_url":"https://avatars2.githubusercontent.com/u/123456?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,"name":"Donald
233
- Duck","company":"@ticketsolve","blog":"","location":"Duckburg","email":"donald.pub2@gmail.com","hireable":true,"bio":null,"public_repos":13,"public_gists":0,"followers":7,"following":0,"created_at":"2012-04-01T11:52:16Z","updated_at":"2017-11-20T21:53:27Z","private_gists":0,"total_private_repos":1,"owned_private_repos":0,"disk_usage":32253,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}'
233
+ Duck","company":"@mickeymouselaws","blog":"","location":"Duckburg","email":"donald.pub2@gmail.com","hireable":true,"bio":null,"public_repos":13,"public_gists":0,"followers":7,"following":0,"created_at":"2012-04-01T11:52:16Z","updated_at":"2017-11-20T21:53:27Z","private_gists":0,"total_private_repos":1,"owned_private_repos":0,"disk_usage":32253,"collaborators":0,"two_factor_authentication":true,"plan":{"name":"free","space":976562499,"collaborators":0,"private_repos":0}}'
234
234
  http_version:
235
235
  recorded_at: Tue, 21 Nov 2017 09:42:49 GMT
236
236
  - request:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-25 00:00:00.000000000 Z
11
+ date: 2018-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_scripting
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.9.3
19
+ version: 0.9.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.9.3
26
+ version: 0.9.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: temp-fork-tp-filter
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -95,6 +95,7 @@ files:
95
95
  - lib/geet/helpers/os_helper.rb
96
96
  - lib/geet/helpers/summary_helper.rb
97
97
  - lib/geet/resources/templates/edit_summary.md
98
+ - lib/geet/services/abstract_create_issue.rb
98
99
  - lib/geet/services/create_gist.rb
99
100
  - lib/geet/services/create_issue.rb
100
101
  - lib/geet/services/create_label.rb
@@ -104,9 +105,11 @@ files:
104
105
  - lib/geet/services/list_milestones.rb
105
106
  - lib/geet/services/list_prs.rb
106
107
  - lib/geet/services/merge_pr.rb
108
+ - lib/geet/shared/constants.rb
109
+ - lib/geet/utils/attributes_selection_manager.rb
107
110
  - lib/geet/utils/git_client.rb
108
111
  - lib/geet/utils/manual_list_selection.rb
109
- - lib/geet/utils/pattern_matching_selection.rb
112
+ - lib/geet/utils/string_matching_selection.rb
110
113
  - lib/geet/version.rb
111
114
  - spec/integration/create_gist_spec.rb
112
115
  - spec/integration/create_issue_spec.rb
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Geet
4
- module Utils
5
- class PatternMatchingSelection
6
- def select(entry_type, entries, raw_patterns, instance_method: nil)
7
- patterns = raw_patterns.split(',')
8
-
9
- patterns.map do |pattern|
10
- entries_found = entries.select do |entry|
11
- entry = entry.send(instance_method) if instance_method
12
- entry =~ /#{pattern}/i
13
- end
14
-
15
- case entries_found.size
16
- when 1
17
- entries_found.first
18
- when 0
19
- raise "No entry found for #{entry_type} pattern: #{pattern.inspect}"
20
- else
21
- raise "Multiple entries found for #{entry_type} pattern #{pattern.inspect}: #{entries_found}"
22
- end
23
- end
24
- end
25
- end
26
- end
27
- end