Class: Boom::Platform::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/kaboom/platform/base.rb

Direct Known Subclasses

Darwin, Linux

Instance Method Summary collapse

Instance Method Details

#copy(item) ⇒ Object



17
18
19
20
# File 'lib/kaboom/platform/base.rb', line 17

def copy item
  IO.popen(copy_command,"w") {|cc|  cc.write(item.value)}
  item.value
end

#edit(json_file) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/kaboom/platform/base.rb', line 7

def edit json_file
  if $EDITOR
    return yield if block_given?

    system "`echo $EDITOR` #{json_file} &"
  else
    open_file json_file
  end
end

#open_file(file) ⇒ Object



3
4
5
# File 'lib/kaboom/platform/base.rb', line 3

def open_file file
  system("#{open_command} #{file}")
end