Module: RakeJavaUtil

Includes:
Rake::DSL
Included in:
JarFiles, RakeJava::JarTask, RakeJava::JavacTask
Defined in:
lib/rakejava.rb

Instance Method Summary collapse

Instance Method Details

#path_esc(str_ary) ⇒ Object



49
50
51
52
53
54
55
# File 'lib/rakejava.rb', line 49

def path_esc str_ary
   if !winderz?
      str_ary.map { |str| str.gsub('$', '\$').gsub(' ', '\ ') }
   else
      str_ary
   end
end

#path_sep(str_ary) ⇒ Object



57
58
59
# File 'lib/rakejava.rb', line 57

def path_sep str_ary
   separate(str_ary, File::PATH_SEPARATOR)
end

#popdObject



34
35
36
# File 'lib/rakejava.rb', line 34

def popd
   cd pushd_stack.shift
end

#pushd(dir) ⇒ Object



29
30
31
32
# File 'lib/rakejava.rb', line 29

def pushd dir
   pushd_stack.unshift(Dir.pwd)
   cd dir
end

#pushd_stackObject



38
39
40
41
42
43
# File 'lib/rakejava.rb', line 38

def pushd_stack
   unless defined?(@pushd_stack)
      @pushd_stack = []
   end
   @pushd_stack
end

#separate(str_ary, sep) ⇒ Object



65
66
67
68
69
# File 'lib/rakejava.rb', line 65

def separate str_ary, sep
   result = ""
   str_ary.each { |str| result << "#{str}#{sep}" }
   result.chop!
end

#space_sep(str_ary) ⇒ Object



61
62
63
# File 'lib/rakejava.rb', line 61

def space_sep str_ary
   separate(str_ary, ' ')
end

#winderz?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/rakejava.rb', line 45

def winderz?
   RUBY_PLATFORM =~ /(win|w)32$/
end