working_set 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +11 -1
- data/assets/video.png +0 -0
- data/lib/set_viewer_actor.rb +10 -26
- data/lib/user_input_actor.rb +4 -0
- data/lib/view_router_actor.rb +39 -0
- data/lib/working_set.rb +1 -1
- data/lib/working_set_cli.rb +1 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 206cdf716829db1ef95c8098067f726c389318b6b791ebecfb00c62bd23a87f5
|
4
|
+
data.tar.gz: 490b5875cdab2984e8a244ed851af4f732b73bcfb2e0c2d369a620950d438ba9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ada452dfbbc66b062f073654256b0f9aa5670f55d0fb6b554a05c292191200d6dff00637c9e15c0a171e3340743c68b13077cafc1e8077649924ebe2c11c0ad
|
7
|
+
data.tar.gz: b59fb38299ddfed66968a700dbccb862eb0a3a70d99a7079fbc57f12d4f71591c6e356c94343bed3e265f9045b810813159ad970f3203574700da1ab86c6725e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,12 +3,18 @@
|
|
3
3
|
Companion to your editor that makes searching, and using search results for
|
4
4
|
jumping around, super nice.
|
5
5
|
|
6
|
+
[![Working Set Demo](https://github.com/coderifous/working_set/blob/master/assets/video.png)](https://vimeo.com/455633260)
|
7
|
+
|
6
8
|
## Installation
|
7
9
|
|
8
10
|
Installing the gem adds the working_set command to your path.
|
9
11
|
|
10
12
|
$ gem install working_set
|
11
13
|
|
14
|
+
Working Set uses `ag` "the silver searcher" for super fast searching power:
|
15
|
+
|
16
|
+
$ brew install ag
|
17
|
+
|
12
18
|
Install the plugin for your editor.
|
13
19
|
|
14
20
|
* [Vim Plugin](https://github.com/coderifous/working-set.vim)
|
@@ -91,9 +97,13 @@ You can press '?' in working_set to see key bindings:
|
|
91
97
|
* Add support for bookmarks.
|
92
98
|
* Add support for search history.
|
93
99
|
* Add support for customizing key bindings.
|
94
|
-
* Document protocol so other plugin editors can exist.
|
95
100
|
* Document adapter so other search tools can be used.
|
96
101
|
|
102
|
+
## API for Editor Integration
|
103
|
+
|
104
|
+
Information for integrating Working Set with your editor can be found
|
105
|
+
[here](https://github.com/coderifous/working_set/blob/master/API_FOR_EDITOR_INTEGRATION.md).
|
106
|
+
|
97
107
|
## Development
|
98
108
|
|
99
109
|
1) Fork the repo, clone the source code.
|
data/assets/video.png
ADDED
Binary file
|
data/lib/set_viewer_actor.rb
CHANGED
@@ -5,7 +5,8 @@ class SetViewerActor
|
|
5
5
|
subscribe "tell_selected_item", :tell_selected_item
|
6
6
|
subscribe "copy_selected_item", :copy_selected_item
|
7
7
|
subscribe "tell_selected_item_content", :tell_selected_item_content
|
8
|
-
subscribe "
|
8
|
+
subscribe "render_working_set", :render_working_set
|
9
|
+
subscribe "set_build_finished", :render_working_set
|
9
10
|
subscribe "set_build_failed", :show_error
|
10
11
|
subscribe "scroll_changed", :scroll
|
11
12
|
subscribe "context_lines_changed", :update_context_lines
|
@@ -15,34 +16,17 @@ class SetViewerActor
|
|
15
16
|
subscribe "select_prev_file", :select_prev_file
|
16
17
|
subscribe "select_next_item", :select_next_item
|
17
18
|
subscribe "select_prev_item", :select_prev_item
|
18
|
-
subscribe "welcome_user", :welcome_user
|
19
|
-
subscribe "display_help", :display_help
|
20
|
-
subscribe "display_working_set", :display_working_set
|
21
|
-
welcome_user
|
22
19
|
end
|
23
20
|
|
24
|
-
def
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
View::Help.render
|
32
|
-
end
|
33
|
-
|
34
|
-
def display_working_set(_)
|
35
|
-
debug_message "displaying working_set!"
|
36
|
-
@working_set_view&.render
|
37
|
-
end
|
38
|
-
|
39
|
-
def refresh_view(_, working_set)
|
40
|
-
prev_wsv = @working_set_view
|
41
|
-
@working_set_view = View::WorkingSet.new(working_set)
|
42
|
-
if prev_wsv&.working_set&.search == working_set.search
|
43
|
-
@working_set_view.restore_selection_state(prev_wsv)
|
21
|
+
def render_working_set(_, working_set = nil)
|
22
|
+
if working_set
|
23
|
+
prev_wsv = @working_set_view
|
24
|
+
@working_set_view = View::WorkingSet.new(working_set)
|
25
|
+
if prev_wsv&.working_set&.search == working_set.search
|
26
|
+
@working_set_view.restore_selection_state(prev_wsv)
|
27
|
+
end
|
44
28
|
end
|
45
|
-
@working_set_view
|
29
|
+
publish "render_view", @working_set_view
|
46
30
|
end
|
47
31
|
|
48
32
|
def items_present?
|
data/lib/user_input_actor.rb
CHANGED
@@ -57,6 +57,10 @@ class UserInputActor
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def handle_modal_input(ch)
|
60
|
+
if ch == Ncurses::KEY_RESIZE # window resize
|
61
|
+
publish "window_resized"
|
62
|
+
return
|
63
|
+
end
|
60
64
|
case user_input_mode
|
61
65
|
when :welcome_user then handle_welcome_user_input(ch)
|
62
66
|
when :help then handle_help_input(ch)
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class ViewRouterActor
|
2
|
+
include BasicActor
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
subscribe "welcome_user", :welcome_user
|
6
|
+
subscribe "display_help", :display_help
|
7
|
+
subscribe "display_working_set", :display_working_set
|
8
|
+
subscribe "window_resized", :render_current_view
|
9
|
+
subscribe "render_view", :render_view
|
10
|
+
welcome_user
|
11
|
+
end
|
12
|
+
|
13
|
+
def welcome_user(_=nil)
|
14
|
+
debug_message "displaying welcome_user!"
|
15
|
+
render_view nil, View::WelcomeUser
|
16
|
+
end
|
17
|
+
|
18
|
+
def display_help(_)
|
19
|
+
debug_message "displaying help!"
|
20
|
+
render_view nil, View::Help
|
21
|
+
end
|
22
|
+
|
23
|
+
def display_working_set(_)
|
24
|
+
debug_message "displaying working_set!"
|
25
|
+
publish "render_working_set"
|
26
|
+
end
|
27
|
+
|
28
|
+
def render_view(_, view)
|
29
|
+
@current_view = view
|
30
|
+
render_current_view
|
31
|
+
end
|
32
|
+
|
33
|
+
def render_current_view(_=nil)
|
34
|
+
debug_message "rendering view: #{@current_view.inspect}"
|
35
|
+
@current_view&.render
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
data/lib/working_set.rb
CHANGED
data/lib/working_set_cli.rb
CHANGED
@@ -99,6 +99,7 @@ class WorkingSetCli
|
|
99
99
|
end
|
100
100
|
|
101
101
|
class AppSupervisor < Celluloid::Supervision::Container
|
102
|
+
supervise type: ViewRouterActor, as: :view_router
|
102
103
|
supervise type: SetViewerActor, as: :set_viewer
|
103
104
|
supervise type: SetBuilderActor, as: :set_builder
|
104
105
|
supervise type: ApiInputActor, as: :api_input
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: working_set
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Garvin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -182,6 +182,7 @@ files:
|
|
182
182
|
- LICENSE.txt
|
183
183
|
- README.md
|
184
184
|
- Rakefile
|
185
|
+
- assets/video.png
|
185
186
|
- bin/working_set
|
186
187
|
- lib/api_input_actor.rb
|
187
188
|
- lib/basic_actor.rb
|
@@ -196,6 +197,7 @@ files:
|
|
196
197
|
- lib/view/help.rb
|
197
198
|
- lib/view/welcome_user.rb
|
198
199
|
- lib/view/working_set.rb
|
200
|
+
- lib/view_router_actor.rb
|
199
201
|
- lib/working_set.rb
|
200
202
|
- lib/working_set_cli.rb
|
201
203
|
- lib/working_set_item.rb
|
@@ -219,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
221
|
- !ruby/object:Gem::Version
|
220
222
|
version: '0'
|
221
223
|
requirements: []
|
222
|
-
rubygems_version: 3.1.
|
224
|
+
rubygems_version: 3.1.4
|
223
225
|
signing_key:
|
224
226
|
specification_version: 4
|
225
227
|
summary: Companion for your terminal-based text editor.
|