rake-tui 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +20 -0
  3. data/README.md +72 -0
  4. data/VERSION +1 -0
  5. data/bin/rake-tui +3 -0
  6. data/lib/rake-tui.rb +44 -0
  7. metadata +162 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 49dc062ea430b2a65be5a69d587de76d0de3a87dacb7305c41d77db7ea55ddc4
4
+ data.tar.gz: d87e1c482e8abf53d5023c1a030493dc3816d3c621a225bfb68bc21a631bf427
5
+ SHA512:
6
+ metadata.gz: 1c89b628e3f77dff0fa3d33fc516243fd9724e4bce59cba7c98815b6f9fe8a15a48af42825b076931080a70e7f73d946d354f34fdc9959a60e6e33de2ab61892
7
+ data.tar.gz: ed063cf1785f5006ad6ddd5667e27c0ad7702e16dd658ce48774f772419cb2316db30df99d161f06f2746e1b103848878ceb8f4d53c029c619ec37a567e26b52
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2020 Andy Maleh
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,72 @@
1
+ # rake-tui
2
+ [![Gem Version](https://badge.fury.io/rb/rake-tui.svg)](https://badge.fury.io/rb/rake-tui)
3
+
4
+ [Rake](https://github.com/ruby/rake) Text-Based User Interface
5
+
6
+ ![Rake TUI Demo](rake-tui-demo.gif)
7
+
8
+ ## Pre-requisites
9
+
10
+ - [Ruby](https://www.ruby-lang.org/en/)
11
+
12
+ ## Setup Instructions
13
+
14
+ ### Vanilla Ruby
15
+
16
+ ```
17
+ gem install rake-tui
18
+ ```
19
+
20
+ ### Bundler
21
+
22
+ ```ruby
23
+ gem 'rake-tui'
24
+ ```
25
+
26
+ ### [RVM](https://rvm.io/)
27
+
28
+ ```
29
+ rvm @global do gem install rake-tui
30
+ ```
31
+
32
+ ### [JRuby](https://www.jruby.org/)
33
+
34
+ The `rake-tui` binary uses a `ruby` shebang: `#!/usr/bin/env ruby`
35
+
36
+ When using [JRuby](https://www.jruby.org/) with [RVM](https://rvm.io/), `ruby` is automatically symlinked as `jruby`, so `rake-tui` works fine.
37
+
38
+ To use `rake-tui` with [JRuby](https://www.jruby.org/) without [RVM](https://rvm.io/), you must create a symlink for `ruby` pointing to `jruby` as follows:
39
+
40
+ ```
41
+ ln -s $(which jruby) $(dirname $(which jruby))/ruby
42
+ ```
43
+
44
+ ## Usage
45
+
46
+ Simply run this command:
47
+
48
+ ```
49
+ rake-tui
50
+ ```
51
+
52
+ ## Contributing to rake-tui
53
+
54
+ - Check out the latest master to make sure the feature hasn't been
55
+ implemented or the bug hasn't been fixed yet.
56
+ - Check out the issue tracker to make sure someone already hasn't
57
+ requested it and/or contributed it.
58
+ - Fork the project.
59
+ - Start a feature/bugfix branch.
60
+ - Commit and push until you are happy with your contribution.
61
+ - Make sure to add tests for it. This is important so I don't break it
62
+ in a future version unintentionally.
63
+ - Please try not to mess with the Rakefile, version, or history. If
64
+ you want to have your own version, or is otherwise necessary, that
65
+ is fine, but please isolate to its own commit so I can cherry-pick
66
+ around it.
67
+
68
+ ## Copyright
69
+
70
+ [MIT](LICENSE.txt)
71
+
72
+ Copyright (c) 2020 Andy Maleh.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/rake-tui.rb'
@@ -0,0 +1,44 @@
1
+ $LOAD_PATH.unshift(File.expand_path('..', __FILE__))
2
+
3
+ version = File.read(File.expand_path('../../VERSION', __FILE__)).strip
4
+ puts "== rake-tui version #{version} =="
5
+
6
+ require 'tty-prompt'
7
+
8
+ prompt = TTY::Prompt.new
9
+
10
+ prompt.on(:keyescape) do |event|
11
+ puts # a new line is needed
12
+ puts "Exiting..."
13
+ exit(0)
14
+ end
15
+
16
+ begin
17
+ rake_task_lines = `rake -T`.split("\n")
18
+ unless rake_task_lines.detect {|l| l.start_with?('rake ')}
19
+ puts "No Rake tasks found!"
20
+ puts "Exiting..."
21
+ exit(0)
22
+ end
23
+ rake_task_lines = rake_task_lines.map do |line|
24
+ bound = TTY::Screen.width - 6
25
+ line.size <= bound ? line : "#{line[0..(bound - 3)]}..."
26
+ end
27
+ rake_task_line = prompt.select("Choose a Rake task: ", rake_task_lines, cycle: true, per_page: [TTY::Screen.height - 5, 1].max, filter: true, help: true, show_help: :always) do |list|
28
+ list.singleton_class.define_method(:keyspace) do |event|
29
+ return unless filterable?
30
+
31
+ if event.value = " "
32
+ @filter << event.value
33
+ @active = 1
34
+ end
35
+ end
36
+ end
37
+ rake_task = rake_task_line.split('#').first.strip
38
+ system rake_task
39
+ rescue TTY::Reader::InputInterrupt => e
40
+ # No Op
41
+ puts # a new line is needed
42
+ puts "Exiting..."
43
+ exit(0)
44
+ end
metadata ADDED
@@ -0,0 +1,162 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rake-tui
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - andy_maleh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-09-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: tty-prompt
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 3.5.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 3.5.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rdoc
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.12'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.12'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '1.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: juwelier
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 2.1.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 2.1.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: e2mmap
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.1.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.1.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: puts_debuggerer
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: Rake Text-based User Interface
126
+ email: andy.am@gmail.com
127
+ executables:
128
+ - rake-tui
129
+ extensions: []
130
+ extra_rdoc_files:
131
+ - LICENSE.txt
132
+ - README.md
133
+ files:
134
+ - LICENSE.txt
135
+ - README.md
136
+ - VERSION
137
+ - bin/rake-tui
138
+ - lib/rake-tui.rb
139
+ homepage: http://github.com/AndyObtiva/rake-tui
140
+ licenses:
141
+ - MIT
142
+ metadata: {}
143
+ post_install_message:
144
+ rdoc_options: []
145
+ require_paths:
146
+ - lib
147
+ required_ruby_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ required_rubygems_version: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: '0'
157
+ requirements: []
158
+ rubygems_version: 3.1.4
159
+ signing_key:
160
+ specification_version: 4
161
+ summary: Rake TUI
162
+ test_files: []