idl_erep 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -9
  3. data/bin/idl_erep +20 -3
  4. data/idl_erep.gemspec +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09b89110b61aebae25523e6043d4ce31dc0036b4
4
- data.tar.gz: ff0245e783fd069b4b5745c197aba9c981045b50
3
+ metadata.gz: a1efb24bc5e8942fefb2939314e3476d019a7b8c
4
+ data.tar.gz: 0c63364f0e59fb6a9b9ab2ef38063fe573eb2c31
5
5
  SHA512:
6
- metadata.gz: 7172a41b11ebdc64f3b74b5c555c1336ecb4067190a84718e1b62293e2260e27e062cb39d98026e9bf25e2aef5da1959df57a947ca1e599fe12360029ca38c2b
7
- data.tar.gz: 8502058d4b7859e38328b7c5d056c519613069d178df63e49742663f1aa4990525d785d71c0f8007edf5b1bb4c9127c7424731553414692e464592d3f99b5249
6
+ metadata.gz: eaa6d71977da7199a22d6bfe04adecfc4d557f359efc8f05bdab8ab23ed1ddd9ebbc3a6a03eb1262d007c5bacf950578c829f063179995f27b00ef9e90368c22
7
+ data.tar.gz: 4d1a3285f041331d468ef757f6eb662a8df8dff588b8a80f4025aeec268211e5d31bb8f83ebdb2e1ad221b90006ab89a9c90a634f2073a7d36ef38851bde350a
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  IDL-EREP
2
2
  ===
3
+ [![Gem Version](https://badge.fury.io/rb/idl_erep.png)](http://badge.fury.io/rb/idl_erep)
4
+
3
5
  An enhanced interactive environment for IDL (Interactive Data Language).
4
6
 
5
7
  It provides stronger command history, tab-completion, and key shortcuts.
@@ -62,14 +64,41 @@ Configurations
62
64
 
63
65
  In `~/.idl_profile`, you can set some configurations of this environment.
64
66
 
65
- | variable | default | description |
66
- |:-----------|:--------------------------|:-----------------------------------------------------|
67
- | `idlbin` | 'idl' | PATH of IDL executable file |
68
- | `prompt` | 'IDL-EREP> ' | prompt string of this environment |
69
- | `idlhist` | '~/.idl/idl/rbuf/history' | PATH of default IDL history file (used only reading) |
70
- | `homehist` | '~/.idl\_history' | PATH of IDL-EREP history file in home directory |
71
- | `currhist` | './.idl\_history' | PATH of IDL-EREP history file in current directory |
72
- | `histlim` | 10000 | limit number of IDL-EREP history file elements |
73
- | `defcomp` | ['help,', 'plot,', etc..] | default completion list |
67
+ | variable | default | description |
68
+ |:---------------|:--------------------------|:-----------------------------------------------------|
69
+ | `idlbin` | 'idl' | PATH of IDL executable file |
70
+ | `prompt` | 'IDL-EREP> ' | prompt string of this environment |
71
+ | `idlhist` | '~/.idl/idl/rbuf/history' | PATH of default IDL history file (used only reading) |
72
+ | `homehist` | '~/.idl\_history' | PATH of IDL-EREP history file in home directory |
73
+ | `currhist` | './.idl\_history' | PATH of IDL-EREP history file in current directory |
74
+ | `histlim` | 10000 | limit number of IDL-EREP history file elements |
75
+ | `defcomplist` | ['help', 'plot', etc..] | default completion keywords list |
76
+ | `compfuncs` | ['defcomplist', etc...] | completion functions |
77
+
78
+
79
+ About Completion Functions
80
+ ---
81
+
82
+ You can add completion functions in `~/.idl_profile`.
83
+ The functions must return array of completion keywords like following:
84
+
85
+ ```ruby
86
+ compfuncs = ["defcomplist", "get_dir_elems", "get_dir_pros"]
87
+
88
+ def get_dir_elems()
89
+ Dir::entries(Dir::pwd)
90
+ end
91
+
92
+ def get_dir_pros()
93
+ pros = Dir::entries(Dir::pwd).select do |i|
94
+ i =~ /\.pro$/
95
+ end
96
+ pros.map! do |i|
97
+ i.gsub(/\.pro$/, '')
98
+ end
99
+ pros
100
+ end
101
+ ```
102
+
74
103
 
75
104
 
data/bin/idl_erep CHANGED
@@ -14,7 +14,22 @@ idlhist = '~/.idl/idl/rbuf/history'
14
14
  homehist = '~/.idl_history'
15
15
  currhist = './.idl_history'
16
16
  histlim = 10000
17
- defcomplist = ['help,', 'plot,', 'print,', 'window,']
17
+ defcomplist = ['help', 'plot', 'print', 'window']
18
+ compfuncs = ["defcomplist", "get_dir_elems", "get_dir_pros"]
19
+
20
+ def get_dir_elems()
21
+ Dir::entries(Dir::pwd)
22
+ end
23
+
24
+ def get_dir_pros()
25
+ pros = Dir::entries(Dir::pwd).select do |i|
26
+ i =~ /\.pro$/
27
+ end
28
+ pros.map! do |i|
29
+ i.gsub(/\.pro$/, '')
30
+ end
31
+ pros
32
+ end
18
33
 
19
34
  def extract_idl_command(line)
20
35
  line.gsub(/ <!--.*-->$/, '')
@@ -43,8 +58,10 @@ def readline_hist_management(prompt)
43
58
  end
44
59
 
45
60
  comp = proc do |s|
46
- complist = defcomplist
47
- complist += Dir::entries(Dir::pwd)
61
+ complist = []
62
+ compfuncs.map do |f|
63
+ complist += eval(f)
64
+ end
48
65
  complist.grep(/^#{Regexp.escape(s)}/)
49
66
  end
50
67
 
data/idl_erep.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "idl_erep"
7
- spec.version = "0.0.2"
7
+ spec.version = "0.0.3"
8
8
  spec.authors = ["Rintaro Okamura"]
9
9
  spec.email = ["rintaro.okamura+github@gmail.com"]
10
10
  spec.summary = %q{An enhanced interactive environment for IDL}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idl_erep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rintaro Okamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-23 00:00:00.000000000 Z
11
+ date: 2015-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler