gity 0.1.4 → 0.1.5

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: c93ccf96bb60fd989212947809f38159a3c5ccb6c57028674f43a6cd297cb35c
4
- data.tar.gz: 8bf176af3ce980d6e12df695485d67ede1cbb5ebe18f542a054392542229742e
3
+ metadata.gz: 76b2a42e4e87cd93fb6577c5925fbc7c9853951b2526154748b93e7de3a7ae65
4
+ data.tar.gz: df5cbc7f0ccfa5bb1fa74874de83b7fc2ac80f21457917394fc1e3a2fbb8ed24
5
5
  SHA512:
6
- metadata.gz: 78a4d1d582e553402dd24ce21fbdcfa9b6adf7fc737ad91d9971c76a39884eaa5b429e36f695fdf5e849c1e826801b668027a7395fa05a286deddf6ed918ff68
7
- data.tar.gz: 6b8247cfc6cfd3f8a2bea5a5979e586b6f48cd425558dcfd9c2a187803e2d35b60851fe5c626e371fd62970ba08cc9e536b201b3d118a7fd7c3b46a21c58156b
6
+ metadata.gz: f84ff37f37b4b4d2df541e4f46b69c01a7069ae6ca0291c743c7983200317c9d0c9cfd3ff449db786090e191af0f8cb0d1c28dca15aa3a42a1845187f01ee6c8
7
+ data.tar.gz: 293c22d0d2613a2c01de040cad6693f0507feb3186c1cd5ebae079427533c78321c043d22c0476f646fbb68caca4ef8bea534bd7a39faac3e37fe07bbf4e2cc1
data/lib/gity/landing.rb CHANGED
@@ -4,6 +4,7 @@ require 'git_cli'
4
4
  require_relative 'common'
5
5
  require_relative 'overview'
6
6
  require_relative 'operation'
7
+ require_relative 'push_workspace'
7
8
 
8
9
  module Gity
9
10
  class Landing
@@ -12,6 +13,7 @@ module Gity
12
13
  include Overview
13
14
  include Operation
14
15
  include Common
16
+ include PushWorkspace
15
17
 
16
18
  def run(root, opts = {}, &block)
17
19
 
@@ -40,6 +42,18 @@ module Gity
40
42
  rescue OperationCompleted
41
43
  end
42
44
 
45
+ _prmt.puts
46
+ push = _prmt.yes?(_fmt("Do you want to push the changes to remote repository? ", :cyan))
47
+ if push
48
+ begin
49
+
50
+ _cls
51
+ push_workspace(@ws, opts)
52
+
53
+ rescue OperationCompleted
54
+ end
55
+ end
56
+
43
57
  end
44
58
 
45
59
  def process_flash
@@ -45,6 +45,7 @@ module Gity
45
45
  end
46
46
  end
47
47
 
48
+ selOpts["Done"] = :done
48
49
  selOpts["Quit"] = :quit
49
50
 
50
51
  begin
@@ -90,6 +91,9 @@ module Gity
90
91
  _prmt.puts
91
92
  delete(ws, files, &block)
92
93
 
94
+ when :done
95
+ _operation_done(true)
96
+
93
97
  when :quit
94
98
  block.call(:before_quit) if block
95
99
  _operation_done(opts[:no_exit])
@@ -0,0 +1,51 @@
1
+
2
+
3
+
4
+ module Gity
5
+ module PushWorkspace
6
+ include TR::CondUtils
7
+
8
+ def push_workspace(ws, opts = {})
9
+
10
+ _prmt.puts
11
+ if not ws.has_remote_repos?
12
+ _prmt.puts(_fmt("There is no remote repository defined."))
13
+ add = _prmt.yes?(_fmt("Add new repository? "))
14
+
15
+ while(add)
16
+
17
+ return if not add
18
+
19
+ name = _prmt.ask("Name of the repository : ", required: true, value: "origin")
20
+ path = _prmt.ask("Path to the repository : ", required: true)
21
+
22
+ ws.add_remote(name, path)
23
+
24
+ add = _prmt.yes?("Done adding remote? ")
25
+
26
+ end
27
+
28
+ end
29
+
30
+
31
+ selRepos = _prmt.select(_fmt("Please select a repository to push : "), filter: true) do |m|
32
+
33
+ ws.repos.each do |re|
34
+ m.choice "#{re.name} - #{re.url}", re
35
+ end
36
+
37
+ m.choice "Abort", :abort
38
+
39
+ end
40
+
41
+ if selRepos != :abort
42
+ ws.push_changes_with_tags(selRepos.name)
43
+ _prmt.puts _fmt("\nChanges push to remote repository '#{selRepos.name}'.\n Have a good day.\n", :bright_green)
44
+ else
45
+ _prmt.puts _fmt("\nPush aborted\n", :bright_yellow)
46
+ end
47
+
48
+ end
49
+
50
+ end
51
+ end
data/lib/gity/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gity
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-18 00:00:00.000000000 Z
11
+ date: 2023-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toolrack
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.13'
89
+ version: 0.13.8
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.13'
96
+ version: 0.13.8
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: release-gem
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -134,6 +134,7 @@ files:
134
134
  - lib/gity/operation/ignore.rb
135
135
  - lib/gity/operation/remove_staged.rb
136
136
  - lib/gity/overview.rb
137
+ - lib/gity/push_workspace.rb
137
138
  - lib/gity/status.rb
138
139
  - lib/gity/status_list.rb
139
140
  - lib/gity/version.rb
@@ -141,7 +142,7 @@ files:
141
142
  homepage: ''
142
143
  licenses: []
143
144
  metadata: {}
144
- post_install_message:
145
+ post_install_message:
145
146
  rdoc_options: []
146
147
  require_paths:
147
148
  - lib
@@ -157,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
158
  version: '0'
158
159
  requirements: []
159
160
  rubygems_version: 3.4.6
160
- signing_key:
161
+ signing_key:
161
162
  specification_version: 4
162
163
  summary: ''
163
164
  test_files: []