cetus 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/cetus +26 -4
  2. data/cetus.gemspec +1 -1
  3. metadata +4 -4
data/bin/cetus CHANGED
@@ -6,7 +6,7 @@
6
6
  # Author: rkumar http://github.com/rkumar/cetus/
7
7
  # Date: 2013-02-17 - 17:48
8
8
  # License: GPL
9
- # Last update: 2013-03-12 21:02
9
+ # Last update: 2013-03-19 19:44
10
10
  # ----------------------------------------------------------------------------- #
11
11
  # cetus.rb Copyright (C) 2012-2013 rahul kumar
12
12
  # == TODO
@@ -1660,6 +1660,7 @@ def enhance_file_list
1660
1660
  f = `zsh -c 'print -rl -- #{d}*(omM)'`.split("\n")
1661
1661
  if f && f.size > 0
1662
1662
  $files.concat f
1663
+ $files.concat get_important_files(d)
1663
1664
  return
1664
1665
  end
1665
1666
  else
@@ -1674,6 +1675,7 @@ def enhance_file_list
1674
1675
  if $files.index("Gemfile") || $files.grep(/\.gemspec/).size > 0
1675
1676
  # usually the lib dir has only one file and one dir
1676
1677
  flg = false
1678
+ $files.concat get_important_files(Dir.pwd)
1677
1679
  if $files.index("lib/")
1678
1680
  f = `zsh -c 'print -rl -- lib/*(om[1,5]M)'`.split("\n")
1679
1681
  if f && f.size() > 0
@@ -1727,9 +1729,29 @@ def enhance_file_list
1727
1729
  end
1728
1730
  end
1729
1731
  def insert_into_list dir, file
1730
- ix = $files.index(dir)
1731
- raise "something wrong can find #{dir}." unless ix
1732
- $files.insert ix, *file
1732
+ #ix = $files.index(dir)
1733
+ #raise "something wrong can find #{dir}." unless ix
1734
+ #$files.insert ix, *file
1735
+ # 2013-03-19 - 19:42 adding at end to avoid confusion
1736
+ $files.concat file
1737
+ end
1738
+ def get_important_files dir
1739
+ # checks various lists like visited_files and bookmarks
1740
+ # to see if files from this dir or below are in it.
1741
+ # More to be used in a dir with few files.
1742
+ list = []
1743
+ l = dir.size + 1
1744
+ $visited_files.each do |e|
1745
+ if e.index(dir) == 0
1746
+ list << e[l..-1]
1747
+ end
1748
+ end
1749
+ # bookmarks have : which needs to be removed
1750
+ #list1 = $bookmarks.values.select do |e|
1751
+ #e.index(dir) == 0
1752
+ #end
1753
+ #list.concat list1
1754
+ return list
1733
1755
  end
1734
1756
 
1735
1757
  run if __FILE__ == $PROGRAM_NAME
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "cetus"
8
- spec.version = "0.1.10"
8
+ spec.version = "0.1.11"
9
9
  spec.authors = ["Rahul Kumar"]
10
10
  spec.email = ["sentinel1879@gmail.com"]
11
11
  spec.description = %q{lightning fast file navigator}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cetus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-12 00:00:00.000000000 Z
12
+ date: 2013-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -73,7 +73,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
73
73
  version: '0'
74
74
  segments:
75
75
  - 0
76
- hash: 1859142435036201987
76
+ hash: -4588293448021153396
77
77
  required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  none: false
79
79
  requirements:
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  version: '0'
83
83
  segments:
84
84
  - 0
85
- hash: 1859142435036201987
85
+ hash: -4588293448021153396
86
86
  requirements: []
87
87
  rubyforge_project:
88
88
  rubygems_version: 1.8.25