gvcsfx 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/Gemfile +24 -0
- data/README.md +71 -0
- data/bin/gvcsfx +13 -0
- data/bin/gvcsfx.rb +97 -0
- data/config/warble.rb +212 -0
- data/fx/add_workspace.fxml +90 -0
- data/fx/diff.fxml +51 -0
- data/fx/float.fxml +29 -0
- data/fx/main.fxml +637 -0
- data/fx/show_text.fxml +50 -0
- data/fx/stash_select.fxml +59 -0
- data/gvcs_fx.rb +85 -0
- data/handlers/add_workspace_controller.rb +88 -0
- data/handlers/event_handler.rb +58 -0
- data/handlers/float_win_controller.rb +68 -0
- data/handlers/fx_alert.rb +120 -0
- data/handlers/listener.rb +59 -0
- data/handlers/main_win_controller.rb +191 -0
- data/handlers/notification.rb +113 -0
- data/handlers/show_text_controller.rb +38 -0
- data/handlers/stash_select_controller.rb +86 -0
- data/handlers/tab_branches.rb +312 -0
- data/handlers/tab_files.rb +27 -0
- data/handlers/tab_ignore_rules.rb +40 -0
- data/handlers/tab_logs.rb +222 -0
- data/handlers/tab_repos.rb +277 -0
- data/handlers/tab_state.rb +571 -0
- data/handlers/tab_tags.rb +224 -0
- data/handlers/tray.rb +128 -0
- data/handlers/workspace.rb +547 -0
- data/javafx_test.rb +81 -0
- data/lib/global.rb +56 -0
- data/lib/log_helper.rb +40 -0
- data/lib/store.rb +152 -0
- data/lib/version.rb +21 -0
- data/res/accept.png +0 -0
- data/res/cross.png +0 -0
- data/res/tick.png +0 -0
- data/res/version-control.png +0 -0
- data/res/warn.png +0 -0
- data/res/world.png +0 -0
- metadata +156 -0
data/javafx_test.rb
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
require 'jrubyfx'
|
5
|
+
|
6
|
+
# manually create the class
|
7
|
+
|
8
|
+
fxml_root File.join(File.dirname(__FILE__),"fx")
|
9
|
+
|
10
|
+
class Main
|
11
|
+
include JRubyFX::Controller
|
12
|
+
fxml "main.fxml"
|
13
|
+
end
|
14
|
+
|
15
|
+
class Main2
|
16
|
+
include JRubyFX::Controller
|
17
|
+
end
|
18
|
+
|
19
|
+
class FloatWin
|
20
|
+
include JRubyFX::Controller
|
21
|
+
fxml "float.fxml"
|
22
|
+
|
23
|
+
def show_context_menu(evt)
|
24
|
+
init_ctxmenu.show(@imgFloat, evt.screen_x, evt.screen_y)
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
private
|
29
|
+
def init_ctxmenu
|
30
|
+
|
31
|
+
if @ctx.nil?
|
32
|
+
|
33
|
+
@ctx = ContextMenu.new
|
34
|
+
mnuItems = []
|
35
|
+
@mnuMain = MenuItem.new("G-VCS")
|
36
|
+
@mnuMain.on_action do |evt|
|
37
|
+
#ctrl = MainWinController.new
|
38
|
+
#mainWin = JRubyFX::Controller.get_fxml_loader("main.fxml",ctrl)
|
39
|
+
#root = mainWin.load
|
40
|
+
|
41
|
+
stage = javafx.stage.Stage.new
|
42
|
+
stage.title = "G-VCS"
|
43
|
+
#stage.initModality(javafx.stage.Modality::WINDOW_MODAL)
|
44
|
+
#stage.initOwner(@imgFloat.scene.window)
|
45
|
+
ctrl = Main.load_into(stage)
|
46
|
+
#ctrl = FloatWin.load_into(stage)
|
47
|
+
#stage.scene = javafx.scene.Scene.new(root)
|
48
|
+
|
49
|
+
stage.show
|
50
|
+
end
|
51
|
+
mnuItems << @mnuMain
|
52
|
+
|
53
|
+
@mnuExit = MenuItem.new("Exit")
|
54
|
+
@mnuExit.on_action do |evt|
|
55
|
+
@imgFloat.scene.window.close
|
56
|
+
end
|
57
|
+
mnuItems << @mnuExit
|
58
|
+
|
59
|
+
@ctx.items.add_all(mnuItems)
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
@ctx
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
class MainApp < JRubyFX::Application
|
71
|
+
def start(stage)
|
72
|
+
with(stage) do
|
73
|
+
fxml FloatWin
|
74
|
+
show
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
MainApp.launch
|
80
|
+
|
81
|
+
|
data/lib/global.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# Copyright (C) 2020 Chris Liaw <chrisliaw@antrapol.com>
|
2
|
+
# Author: Chris Liaw <chrisliaw@antrapol.com>
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
|
18
|
+
require 'tlogger'
|
19
|
+
require 'singleton'
|
20
|
+
|
21
|
+
require 'gvcs'
|
22
|
+
require 'git_cli'
|
23
|
+
|
24
|
+
require_relative 'store'
|
25
|
+
|
26
|
+
module GvcsFx
|
27
|
+
class Global
|
28
|
+
include Singleton
|
29
|
+
|
30
|
+
attr_reader :logger
|
31
|
+
def initialize
|
32
|
+
@logger = Tlogger.new
|
33
|
+
end
|
34
|
+
|
35
|
+
def storage(reload = true)
|
36
|
+
if @store.nil? or reload
|
37
|
+
@store = GvcsFx::DataStore::DefaultDataStore.load
|
38
|
+
end
|
39
|
+
|
40
|
+
@store
|
41
|
+
end
|
42
|
+
|
43
|
+
def vcs
|
44
|
+
if @vcs.nil?
|
45
|
+
@vcs = Gvcs::Vcs.new
|
46
|
+
end
|
47
|
+
|
48
|
+
@vcs
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class GvcsFxException < StandardError; end
|
53
|
+
|
54
|
+
GVCSFX_STORE_ROOT = File.join(Dir.home,".gvcsfx")
|
55
|
+
|
56
|
+
end
|
data/lib/log_helper.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright (C) 2020 Chris Liaw <chrisliaw@antrapol.com>
|
2
|
+
# Author: Chris Liaw <chrisliaw@antrapol.com>
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
|
18
|
+
require_relative 'global'
|
19
|
+
|
20
|
+
module GvcsFx
|
21
|
+
module LogHelper
|
22
|
+
|
23
|
+
def log_debug(msg, tag = "")
|
24
|
+
if tag.nil? or tag.empty?
|
25
|
+
Global.instance.logger.debug msg
|
26
|
+
else
|
27
|
+
Global.instance.logger.tdebug tag, msg
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def log_error(msg, tag = "")
|
32
|
+
if tag.nil? or tag.empty?
|
33
|
+
Global.instance.logger.error msg
|
34
|
+
else
|
35
|
+
Global.instance.logger.terror tag, msg
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
data/lib/store.rb
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
# Copyright (C) 2020 Chris Liaw <chrisliaw@antrapol.com>
|
2
|
+
# Author: Chris Liaw <chrisliaw@antrapol.com>
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
require 'yaml'
|
20
|
+
require 'fileutils'
|
21
|
+
|
22
|
+
require_relative 'global'
|
23
|
+
|
24
|
+
module GvcsFx
|
25
|
+
module DataStore
|
26
|
+
|
27
|
+
class Workspace
|
28
|
+
attr_accessor :path, :last_access, :parent
|
29
|
+
def initialize(path, parent)
|
30
|
+
@path = path
|
31
|
+
@parent = parent
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class DefaultDataStore
|
36
|
+
|
37
|
+
include Antrapol::ToolRack::ExceptionUtils
|
38
|
+
|
39
|
+
FILENAME = "workspaces_tr.yml"
|
40
|
+
DEFPATH = File.join(GvcsFx::GVCSFX_STORE_ROOT, FILENAME)
|
41
|
+
|
42
|
+
attr_reader :workspaces
|
43
|
+
attr_reader :parent, :paths, :wsList
|
44
|
+
def initialize
|
45
|
+
@workspaces = { }
|
46
|
+
@wsRef = { }
|
47
|
+
@paths = []
|
48
|
+
@parent = []
|
49
|
+
end
|
50
|
+
|
51
|
+
def store(path = DEFPATH)
|
52
|
+
if not (path.nil? or path.empty?)
|
53
|
+
if not File.exist?(File.dirname(path))
|
54
|
+
FileUtils.mkdir_p File.dirname(path)
|
55
|
+
end
|
56
|
+
|
57
|
+
@parent = @workspaces.keys.sort
|
58
|
+
|
59
|
+
File.open(path,"w") do |f|
|
60
|
+
f.write YAML.dump(self)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.load(path = DEFPATH)
|
66
|
+
if not (path.nil? or path.empty?)
|
67
|
+
begin
|
68
|
+
File.open(path,"r") do |f|
|
69
|
+
@cont = f.read
|
70
|
+
end
|
71
|
+
|
72
|
+
obj = YAML.load(@cont)
|
73
|
+
|
74
|
+
obj.parent.sort!
|
75
|
+
|
76
|
+
# sort the workspace's path
|
77
|
+
obj.workspaces.each do |k,v|
|
78
|
+
obj.workspaces[k] = v.sort_by(&:path)
|
79
|
+
end
|
80
|
+
|
81
|
+
obj
|
82
|
+
|
83
|
+
rescue Exception => ex
|
84
|
+
Global.instance.logger.error ex.message
|
85
|
+
Global.instance.logger.error "Failed to load store from '#{path}'. Returning new instance."
|
86
|
+
DefaultDataStore.new
|
87
|
+
end
|
88
|
+
else
|
89
|
+
DefaultDataStore.new
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def new_project(proj)
|
94
|
+
if not_empty?(proj)
|
95
|
+
@workspaces[proj] = []
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def delete_project(proj)
|
100
|
+
if not_empty?(proj) and @workspaces.keys.include?(proj)
|
101
|
+
@workspaces.delete(proj)
|
102
|
+
@parent.delete(proj)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
def is_project_registered?(proj)
|
107
|
+
if not_empty?(proj)
|
108
|
+
@workspaces.keys.include?(proj)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def add_workspace(parent, path)
|
113
|
+
raise GvcsFxException, "Parent cannot be empty" if parent.nil? or parent.empty?
|
114
|
+
raise GvcsFxException, "Path cannot be empty" if path.nil? or path.empty?
|
115
|
+
|
116
|
+
|
117
|
+
if not @paths.include?(path)
|
118
|
+
if not @workspaces.keys.include?(parent)
|
119
|
+
@workspaces[parent] = []
|
120
|
+
end
|
121
|
+
|
122
|
+
ws = Workspace.new(path, parent)
|
123
|
+
@workspaces[parent] << ws
|
124
|
+
# todo sort the array of parent... but the array contains object
|
125
|
+
# custom sorter is required
|
126
|
+
@paths << path
|
127
|
+
@wsRef[path] = ws
|
128
|
+
end
|
129
|
+
end # add_workspace
|
130
|
+
|
131
|
+
def remove_workspace(path)
|
132
|
+
raise GvcsFxException, "Path cannot be empty" if path.nil? or path.empty?
|
133
|
+
|
134
|
+
ws = @wsRef[path]
|
135
|
+
@workspaces[ws.parent].delete(ws)
|
136
|
+
@paths.delete(path)
|
137
|
+
@wsRef.delete(path)
|
138
|
+
|
139
|
+
end # remove_workspace
|
140
|
+
|
141
|
+
def is_workspace_registered?(path)
|
142
|
+
@paths.include?(path.strip)
|
143
|
+
end # is workspace_registered?
|
144
|
+
|
145
|
+
def is_project_empty?(proj)
|
146
|
+
@workspaces[proj].length == 0
|
147
|
+
end
|
148
|
+
|
149
|
+
end # DefaultDataStore
|
150
|
+
|
151
|
+
end # DataStore
|
152
|
+
end # GvcsFx
|
data/lib/version.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Copyright (C) 2020 Chris Liaw <chrisliaw@antrapol.com>
|
2
|
+
# Author: Chris Liaw <chrisliaw@antrapol.com>
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
module GvcsFx
|
20
|
+
VERSION = "0.3"
|
21
|
+
end
|
data/res/accept.png
ADDED
Binary file
|
data/res/cross.png
ADDED
Binary file
|
data/res/tick.png
ADDED
Binary file
|
Binary file
|
data/res/warn.png
ADDED
Binary file
|
data/res/world.png
ADDED
Binary file
|
metadata
ADDED
@@ -0,0 +1,156 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gvcsfx
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.3'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-11-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '0.21'
|
19
|
+
name: tlogger
|
20
|
+
prerelease: false
|
21
|
+
type: :runtime
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.21'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.2.0
|
33
|
+
name: jrubyfx
|
34
|
+
prerelease: false
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.2.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.4'
|
47
|
+
name: toolrack
|
48
|
+
prerelease: false
|
49
|
+
type: :runtime
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0.1'
|
61
|
+
name: gvcs
|
62
|
+
prerelease: false
|
63
|
+
type: :runtime
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0.1'
|
75
|
+
name: git_cli
|
76
|
+
prerelease: false
|
77
|
+
type: :runtime
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.1'
|
83
|
+
description: Simple and effective VCS workflow management
|
84
|
+
email:
|
85
|
+
- chrisliaw@antrapol.com
|
86
|
+
executables:
|
87
|
+
- gvcsfx
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- ".gitignore"
|
92
|
+
- Gemfile
|
93
|
+
- README.md
|
94
|
+
- bin/gvcsfx
|
95
|
+
- bin/gvcsfx.rb
|
96
|
+
- config/warble.rb
|
97
|
+
- fx/add_workspace.fxml
|
98
|
+
- fx/diff.fxml
|
99
|
+
- fx/float.fxml
|
100
|
+
- fx/main.fxml
|
101
|
+
- fx/show_text.fxml
|
102
|
+
- fx/stash_select.fxml
|
103
|
+
- gvcs_fx.rb
|
104
|
+
- handlers/add_workspace_controller.rb
|
105
|
+
- handlers/event_handler.rb
|
106
|
+
- handlers/float_win_controller.rb
|
107
|
+
- handlers/fx_alert.rb
|
108
|
+
- handlers/listener.rb
|
109
|
+
- handlers/main_win_controller.rb
|
110
|
+
- handlers/notification.rb
|
111
|
+
- handlers/show_text_controller.rb
|
112
|
+
- handlers/stash_select_controller.rb
|
113
|
+
- handlers/tab_branches.rb
|
114
|
+
- handlers/tab_files.rb
|
115
|
+
- handlers/tab_ignore_rules.rb
|
116
|
+
- handlers/tab_logs.rb
|
117
|
+
- handlers/tab_repos.rb
|
118
|
+
- handlers/tab_state.rb
|
119
|
+
- handlers/tab_tags.rb
|
120
|
+
- handlers/tray.rb
|
121
|
+
- handlers/workspace.rb
|
122
|
+
- javafx_test.rb
|
123
|
+
- lib/global.rb
|
124
|
+
- lib/log_helper.rb
|
125
|
+
- lib/store.rb
|
126
|
+
- lib/version.rb
|
127
|
+
- res/accept.png
|
128
|
+
- res/cross.png
|
129
|
+
- res/tick.png
|
130
|
+
- res/version-control.png
|
131
|
+
- res/warn.png
|
132
|
+
- res/world.png
|
133
|
+
homepage: https://github.com/chrisliaw/gvcsfx
|
134
|
+
licenses: []
|
135
|
+
metadata: {}
|
136
|
+
post_install_message:
|
137
|
+
rdoc_options: []
|
138
|
+
require_paths:
|
139
|
+
- lib
|
140
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: 2.3.0
|
145
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
requirements: []
|
151
|
+
rubyforge_project:
|
152
|
+
rubygems_version: 2.7.10
|
153
|
+
signing_key:
|
154
|
+
specification_version: 4
|
155
|
+
summary: Generic Version Control System - JavaFX
|
156
|
+
test_files: []
|