terminal-file-picker 0.0.4 → 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: 9c4303d4be790d6f3c6b153505e2ccb1cd5818497970bf281724b2030d10ec00
4
- data.tar.gz: 6e3d3e28c55b13a93de15558494ae6a75df49def0f2fcae05153715edefbe96c
3
+ metadata.gz: af483ed650624caf3dc074f752cf63a969826b3da2f86b340071adcc6bc2329b
4
+ data.tar.gz: 9e63b9d7878d86f96827b3fc4f267ba3e07fa81049c30a76d8c63b49dfad2e9f
5
5
  SHA512:
6
- metadata.gz: 369b4e2e019f3ff1778f9382d7e9268f260f3a01ecbd6ae4eb670e2ec77b612825c67fa275b372950e1d012e0e0290c8b7c48f2fe7c2df40dee5aa84a8ceb0e6
7
- data.tar.gz: 91f994203c95083aaa4c3bcc80d1d9bd64287f2e6f8412dd72690683a6fb66ee7102050657309c1f2ac45241761237665b0615da7a98815acf337f6546c31b13
6
+ metadata.gz: 8cd35ad0a76eba5eb98693d7360ad2f783efb2b1306ee2509f8850b9679fc54c25b6a3462d9cf3bdc27398b2b8c1d6ce0b972cf80e11b0e69f4b4c91a1cb609b
7
+ data.tar.gz: cf4fffc39d5e39ffcb8a8b8026f3de032e5a4487776afe732b957de5207838d705323c827a86242c86d42c8b0b9a4afff922506adeea034db2d13ab373304078
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.
@@ -33,6 +33,8 @@ class FileBrowserModel
33
33
  # Order files such that '.' and '..' come before
34
34
  # all the other files.
35
35
  def order_files(files)
36
+ # Pre-sort files.
37
+ files.sort!{|a,b| a[0]<=>b[0]}
36
38
  # Put "." and ".." at the start
37
39
  groups = files.group_by do |f|
38
40
  if f.first == './' || f.first == '../'
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.4
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-24 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
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  requirements: []
135
- rubygems_version: 3.0.3
135
+ rubygems_version: 3.3.5
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: Interactive terminal file picker