Module: RakeJavaUtil
- Included in:
- JarFiles, RakeJava::JarTask, RakeJava::JavacTask
- Defined in:
- lib/rakejava.rb
Instance Method Summary collapse
- #path_esc(str_ary) ⇒ Object
- #path_sep(str_ary) ⇒ Object
- #popd ⇒ Object
- #pushd(dir) ⇒ Object
- #pushd_stack ⇒ Object
- #separate(str_ary, sep) ⇒ Object
- #space_sep(str_ary) ⇒ Object
Instance Method Details
#path_esc(str_ary) ⇒ Object
43 44 45 |
# File 'lib/rakejava.rb', line 43 def path_esc str_ary str_ary.map { |str| str.gsub('$', '\$').gsub(' ', '\ ') } end |
#path_sep(str_ary) ⇒ Object
47 48 49 |
# File 'lib/rakejava.rb', line 47 def path_sep str_ary separate(str_ary, File::PATH_SEPARATOR) end |
#popd ⇒ Object
32 33 34 |
# File 'lib/rakejava.rb', line 32 def popd cd pushd_stack.shift end |
#pushd(dir) ⇒ Object
27 28 29 30 |
# File 'lib/rakejava.rb', line 27 def pushd dir pushd_stack.unshift(Dir.pwd) cd dir end |
#pushd_stack ⇒ Object
36 37 38 39 40 41 |
# File 'lib/rakejava.rb', line 36 def pushd_stack unless defined?(@pushd_stack) @pushd_stack = [] end @pushd_stack end |
#separate(str_ary, sep) ⇒ Object
55 56 57 58 59 |
# File 'lib/rakejava.rb', line 55 def separate str_ary, sep result = "" str_ary.each { |str| result << "#{str}#{sep}" } result.chop! end |
#space_sep(str_ary) ⇒ Object
51 52 53 |
# File 'lib/rakejava.rb', line 51 def space_sep str_ary separate(str_ary, ' ') end |