Sha256: 09bb72de235289aa1d3f3957dd780624e339a392f722691ad74d1d261d36fb64

Contents?: true

Size: 1.67 KB

Versions: 5

Compression:

Stored size: 1.67 KB

Contents

$ext_path = File.split(__FILE__).first
$js_path = File.expand_path( 'js', File.split( $ext_path ).first )

def git_pull(url,proj_path)
  if File.exist? proj_path
    `cd "#{proj_path}"; git pull`
  else
    `git clone #{url} "#{proj_path}"`
  end
end

def ext_path( dir_name )
  File.expand_path( dir_name, $ext_path )
end

def cp_rsrc( proj_path, proj_file, target_path )
  src = File.expand_path( proj_file, proj_path )
  tgt = File.expand_path( target_path, $js_path )
  cp( src, tgt )
end

task :momentjs do
  moment_url = 'https://github.com/timrwood/moment.git'
  moment_path = ext_path( 'moment' )
  git_pull( moment_url, moment_path )
  cp_rsrc( moment_path, 'moment.js', 'datetime/momentjs/momentjs.js' )
end

task :mediaelement do
  mediaelement_url = 'https://github.com/jammi/mediaelement.git'
  mediaelement_path = ext_path( 'mediaelement' )
  git_pull( mediaelement_url, mediaelement_path )
  cp_rsrc( mediaelement_path, 'build/mediaelement.js', 'media/mediaelement/mediaelement.js' )
  cp_rsrc( mediaelement_path, 'build/flashmediaelement.swf', 'media/mediaelement_resources/themes/mejs/flashmediaelement.swf' )
  cp_rsrc( mediaelement_path, 'build/silverlightmediaelement.xap', 'media/mediaelement_resources/themes/mejs/silverlightmediaelement.xap' )
end

task :codemirror do
  codemirror_url = 'https://github.com/marijnh/CodeMirror.git'
  codemirror_path = ext_path( 'codemirror' )
  git_pull( codemirror_url, codemirror_path )
  cp_rsrc( codemirror_path, 'lib/codemirror.js', 'code/codemirror/codemirror.js' )
  cp_rsrc( codemirror_path, 'lib/codemirror.css', 'code/codemirror/themes/codemirror/codemirror.css' )
end

task :all => [ :momentjs, :mediaelement, :codemirror ]
task :default => :all

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rsence-pre-3.0.0.16 client/ext/Rakefile
rsence-pre-3.0.0.15 client/ext/Rakefile
rsence-pre-3.0.0.14 client/ext/Rakefile
rsence-pre-3.0.0.12 client/ext/Rakefile
rsence-pre-3.0.0.11 client/ext/Rakefile