geet 0.13.0 → 0.15.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
  SHA256:
3
- metadata.gz: 9e3fb8be731151a44f97d99825b4635046f3a52d444709ade0b538f6df5f9032
4
- data.tar.gz: a643e30c0e1be8851f051593b29d64296e6c8ec7fdcdfb8548bb98a8412fd20b
3
+ metadata.gz: f79d89578fca34fafcc206ab8e821849d67f0caaf2462670617d6bdba5e6dbeb
4
+ data.tar.gz: 9b61f3d999540e14a04888a3a612a3cd4e911adbe52962812b0ca3741316858c
5
5
  SHA512:
6
- metadata.gz: 3b26b8dddfe4ce9af0cd97e43a0e3f36165c101fb7b468882397be364880ef110124b1ea2c1364510b78f3f638395a75691b291ad199791da8480c17be715a68
7
- data.tar.gz: 0ba381a84d8e6ddad6e0cbd8e1ac498c5b51447019ff091e8509f5902785083fa56b461ce0537c75a3ad221571fa4a8ee9b1d5c2d59aedde832767e65b449875
6
+ metadata.gz: '067489ba58c5c32fa4958ec6f43603b2f5746a7526a2918a0869641d654443e42223ec28876a1d13a3b900513563517200fd2933d5b0f01fdb2d8758cd526fb4'
7
+ data.tar.gz: 78d9fcc96abc7670b6802a4b3eeccbfd90258e0206da0914d9a845fd2b739f43d1e968791d89cce4a8ea3a2409035cd8d8909747bb9007fa2ff51e9e474cad5d
data/Gemfile CHANGED
@@ -4,13 +4,18 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
+ gem 'sorbet-runtime'
8
+
9
+ group :development do
10
+ gem 'sorbet'
11
+ gem 'byebug'
12
+ gem 'rubocop', '~> 1.35.0', require: :false
13
+ gem 'spoom', require: false
14
+ gem 'tapioca', require: false
15
+ end
16
+
7
17
  group :test do
8
18
  gem 'rspec', '~> 3.7.0'
9
19
  gem 'vcr', '~> 3.0.3'
10
20
  gem 'webmock', '~> 3.1.1'
11
21
  end
12
-
13
- group :tools do
14
- gem 'byebug', '~> 9.1.0'
15
- gem 'rubocop', '~> 1.35.0'
16
- end
data/bin/tapioca ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'tapioca' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require "pathname"
12
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ bundle_binstub = File.expand_path("../bundle", __FILE__)
16
+
17
+ if File.file?(bundle_binstub)
18
+ if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19
+ load(bundle_binstub)
20
+ else
21
+ abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22
+ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23
+ end
24
+ end
25
+
26
+ require "rubygems"
27
+ require "bundler/setup"
28
+
29
+ load Gem.bin_path("tapioca", "tapioca")
data/geet.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.required_ruby_version = '>= 2.6.0'
12
12
  s.authors = ['Saverio Miroddi']
13
- s.date = '2022-08-18'
13
+ s.date = '2022-12-18'
14
14
  s.email = ['saverio.pub2@gmail.com']
15
15
  s.homepage = 'https://github.com/saveriomiroddi/geet'
16
16
  s.summary = 'Commandline interface for performing SCM host operations, eg. create a PR on GitHub'
@@ -12,6 +12,7 @@ module Geet
12
12
 
13
13
  GIST_CREATE_OPTIONS = [
14
14
  ['-p', '--public'],
15
+ ['-s', '--stdin', "Read content from stdin"],
15
16
  ['-B', '--no-browse', "Don't open the gist link in the browser after creation"],
16
17
  'filename',
17
18
  '[description]'
@@ -62,10 +62,6 @@ module Geet
62
62
  attempt_provider_call(:Milestone, :create, title, api_interface)
63
63
  end
64
64
 
65
- def milestone(number)
66
- attempt_provider_call(:Milestone, :find, number, api_interface)
67
- end
68
-
69
65
  def milestones
70
66
  attempt_provider_call(:Milestone, :list, api_interface)
71
67
  end
@@ -37,20 +37,6 @@ module Geet
37
37
  new(number, title, due_on, api_interface)
38
38
  end
39
39
 
40
- # See https://developer.github.com/v3/issues/milestones/#get-a-single-milestone
41
- #
42
- def self.find(number, api_interface, **)
43
- api_path = "milestones/#{number}"
44
-
45
- response = api_interface.send_request(api_path)
46
-
47
- number = response.fetch('number')
48
- title = response.fetch('title')
49
- due_on = parse_iso_8601_timestamp(raw_due_on)
50
-
51
- new(number, title, due_on, api_interface)
52
- end
53
-
54
40
  # See https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository
55
41
  #
56
42
  def self.list(api_interface, **)
@@ -24,8 +24,8 @@ module Geet
24
24
  # :publik: defaults to false
25
25
  # :no_browse defaults to false
26
26
  #
27
- def execute(full_filename, description: nil, publik: false, no_browse: false)
28
- content = IO.read(full_filename)
27
+ def execute(full_filename, stdin: false, description: nil, publik: false, no_browse: false)
28
+ content = stdin ? $stdin.read : IO.read(full_filename)
29
29
 
30
30
  gist_access = publik ? 'public' : 'private'
31
31
  @out.puts "Creating a #{gist_access} gist..."
@@ -123,7 +123,22 @@ module Geet
123
123
 
124
124
  @out.puts "Creating remote branch #{remote_branch.inspect}..."
125
125
 
126
- @git_client.push(remote_branch: remote_branch)
126
+ begin
127
+ @git_client.push(remote_branch: remote_branch)
128
+ rescue
129
+ # A case where this helps is if a push hook fails.
130
+ #
131
+ @out.print "Error while pushing; retry (Y/N*)?"
132
+ input = $stdin.getch
133
+ @out.puts
134
+
135
+ case input.downcase.rstrip
136
+ when 'n', ''
137
+ # exit the cycle
138
+ else
139
+ retry
140
+ end
141
+ end
127
142
  end
128
143
  end
129
144
 
@@ -24,7 +24,7 @@ module Geet
24
24
 
25
25
  # Initialize the instance, and starts the background threads.
26
26
  #
27
- def initialize(repository, out: output)
27
+ def initialize(repository, out: $stdout)
28
28
  @repository = repository
29
29
  @out = out
30
30
  @selections_data = []
data/lib/geet/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Geet
4
- VERSION = '0.13.0'
4
+ VERSION = '0.15.0'
5
5
  end
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.13.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-18 00:00:00.000000000 Z
11
+ date: 2022-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_scripting
@@ -71,6 +71,7 @@ files:
71
71
  - README.md
72
72
  - Rakefile
73
73
  - bin/geet
74
+ - bin/tapioca
74
75
  - extra/anonymize_vcr_data
75
76
  - extra/issue_editing.png
76
77
  - extra/pr_editing.png