terminal-file-picker 0.0.3 → 0.0.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: f07dbb5a7aa9a96128b360a8c326301aac7cad3783a9962bf7a99b9921f769bb
4
- data.tar.gz: 49164b98d2645238d09777eda25d28272089a7e2d7f6cc12c6d2b2352e1ccfba
3
+ metadata.gz: af483ed650624caf3dc074f752cf63a969826b3da2f86b340071adcc6bc2329b
4
+ data.tar.gz: 9e63b9d7878d86f96827b3fc4f267ba3e07fa81049c30a76d8c63b49dfad2e9f
5
5
  SHA512:
6
- metadata.gz: ca6b198dada64c7612e21130f9a01b6f960008c91eacdd5a4b6315d845bc7f6d2da64b28fe4cec4ca72e5be3be097d6788ff2a2b4214c5f0736e7d071cedf814
7
- data.tar.gz: 032e125883ceac5aeb4ab844602640aff05c02026b30a1b1f04d12cfaaaccfdd303592bc7aa93e132d18945af00a37142a3e81763aa660f09f4d59621038c490
6
+ metadata.gz: 8cd35ad0a76eba5eb98693d7360ad2f783efb2b1306ee2509f8850b9679fc54c25b6a3462d9cf3bdc27398b2b8c1d6ce0b972cf80e11b0e69f4b4c91a1cb609b
7
+ data.tar.gz: cf4fffc39d5e39ffcb8a8b8026f3de032e5a4487776afe732b957de5207838d705323c827a86242c86d42c8b0b9a4afff922506adeea034db2d13ab373304078
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 ilkutkutlar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -10,7 +10,7 @@ The gem is useful when your program needs to accept a file path as input and you
10
10
 
11
11
  The gem does not rely on the Curses library and instead uses the [TTY toolkit](https://github.com/piotrmurach/tty), which has cross platform support and support for many types of terminals/terminal emulators. Therefore this gem should also have the same level of support.
12
12
 
13
- # Installation
13
+ ## Installation
14
14
 
15
15
  ```rb
16
16
  gem install 'terminal-file-picker'
@@ -22,9 +22,11 @@ or add it to your project's `Gemfile`:
22
22
  gem 'terminal-file-picker'
23
23
  ```
24
24
 
25
- # Simple Usage
25
+ ## Simple Usage
26
26
 
27
27
  ```rb
28
+ require 'terminal-file-picker'
29
+
28
30
  # Only required argument is the "root path". The user will
29
31
  # start navigating from the root path once file picker is invoked.
30
32
  # Root path can be either absolute or relative.
@@ -39,7 +41,7 @@ picker = FilePicker.new('.')
39
41
  puts(picker.pick_file)
40
42
  ```
41
43
 
42
- # Options
44
+ ## Options
43
45
 
44
46
  There are some options to customise the look and feel of the file picker (all options do have default values, so all are optional)
45
47
 
@@ -89,3 +91,9 @@ You can change the date and time format of date modified and time modified colum
89
91
  ```rb
90
92
  FilePicker.new('.', date_format: '%d-%m-%Y', time_format: '%H.%m')
91
93
  ```
94
+
95
+ ## Development
96
+
97
+ - Officially, this gem supports Ruby versions >= 2.0.0 and such a Ruby version should be used during development as well.
98
+ - Tests are written with [Rspec](https://github.com/rspec/rspec), version ~3.9. Run the tests on terminal with `rspec` in the project directory (need to install rspec first).
99
+ - [Rubocop](https://github.com/rubocop-hq/rubocop) version ~0.8.2 is used to check for use of best practices and standard styling. Run Rubocop on the terminal with `rubocop` in the project directory (need to install Rubocop first). Currently, there are a couple of failing Rubocop checks which will be fixed soon.
@@ -1,5 +1,3 @@
1
- require 'pry'
2
-
3
1
  # Functions related to retrieving and formatting
4
2
  # information related to directories and their contents.
5
3
  class FileBrowserModel
@@ -35,6 +33,8 @@ class FileBrowserModel
35
33
  # Order files such that '.' and '..' come before
36
34
  # all the other files.
37
35
  def order_files(files)
36
+ # Pre-sort files.
37
+ files.sort!{|a,b| a[0]<=>b[0]}
38
38
  # Put "." and ".." at the start
39
39
  groups = files.group_by do |f|
40
40
  if f.first == './' || f.first == '../'
@@ -1,4 +1,3 @@
1
- require 'pry'
2
1
  require 'tty-cursor'
3
2
  require 'tty-reader'
4
3
  require_relative 'file_browser_view'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terminal-file-picker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilkut Kutlar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-08 00:00:00.000000000 Z
11
+ date: 2023-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pastel
@@ -101,8 +101,11 @@ email:
101
101
  - ilkutkutlar@gmail.com
102
102
  executables: []
103
103
  extensions: []
104
- extra_rdoc_files: []
104
+ extra_rdoc_files:
105
+ - README.md
106
+ - LICENSE
105
107
  files:
108
+ - LICENSE
106
109
  - README.md
107
110
  - lib/terminal-file-picker.rb
108
111
  - lib/terminal-file-picker/file_browser_model.rb
@@ -129,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
132
  - !ruby/object:Gem::Version
130
133
  version: '0'
131
134
  requirements: []
132
- rubygems_version: 3.0.3
135
+ rubygems_version: 3.3.5
133
136
  signing_key:
134
137
  specification_version: 4
135
138
  summary: Interactive terminal file picker