mandy 0.4.92 → 0.4.93

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -10,13 +10,17 @@ Spec::Rake::SpecTask.new(:spec) do |t|
10
10
  t.spec_opts = %w{-f s -c -L mtime}
11
11
  end
12
12
 
13
- task :build do
14
- `gem build mandy.gemspec`
15
- `mkdir pkg; mv mandy-*.gem pkg/`
16
- end
17
-
18
- task :install do
19
- `sudo gem install pkg/mandy-*.gem`
20
- end
13
+ namespace :gem do
14
+ task :build do
15
+ `gem build mandy.gemspec`
16
+ `mkdir pkg; mv mandy-*.gem pkg/`
17
+ end
21
18
 
22
- task :gem => [:build, :install]
19
+ task :install => :build do
20
+ `sudo gem install pkg/mandy-*.gem`
21
+ end
22
+
23
+ task :push => :build do
24
+ `gem push pkg/mandy-#{File.read(File.join(File.dirname(__FILE__), 'VERSION'))}.gem`
25
+ end
26
+ end
data/bin/mandy CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
-
3
2
  require "rubygems"
4
3
  require "mandy"
5
4
 
data/bin/mandy-hadoop CHANGED
@@ -26,7 +26,7 @@ OptionParser.new do |opts|
26
26
  options.cmdenv = "json=#{CGI.escape(config)}"
27
27
  end
28
28
 
29
- opts.on("-g", '--gemfile filepath', "Path to your jobs Gemfile (defaults to ./Gemfile)") do |config|
29
+ opts.on("-g", '--gemfile filepath', "Path to your jobs gem yml file (defaults to ./gems.yml)") do |config|
30
30
  options.gemfile = config
31
31
  end
32
32
 
@@ -43,8 +43,8 @@ def absolute_path(path)
43
43
  end
44
44
 
45
45
  def gemfile(file)
46
- path = absolute_path(file || 'Gemfile')
47
- File.exist?(path) ? path : File.expand_path(File.join(File.dirname(__FILE__), '..', 'Gemfile'))
46
+ path = absolute_path(file || 'gems.yml')
47
+ File.exist?(path) ? path : nil
48
48
  end
49
49
 
50
50
  file = ARGV[0]
data/bin/mandy-map CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- throw File.dirname(__FILE__)
3
- environment = File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'environment.rb'))
4
- require File.exist?(environment) ? environment : "rubygems"
2
+ require "rubygems"
5
3
  require "mandy"
6
4
 
7
5
  if ARGV.size==0
data/bin/mandy-reduce CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- environment = File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'environment.rb'))
3
- require File.exist?(environment) ? environment : "rubygems"
2
+ require "rubygems"
4
3
  require "mandy"
5
4
 
6
5
  if ARGV.size==0
data/bootstrap.rb CHANGED
@@ -5,7 +5,7 @@ module Mandy
5
5
  def self.unpack(file)
6
6
  return false unless File.extname(file) == '.tar'
7
7
  `tar -xf #{file}`
8
- `gem bundle`
8
+ `geminstaller --sudo --silent --exceptions`
9
9
  end
10
10
  end
11
11
  end
data/lib/packer.rb CHANGED
@@ -3,19 +3,17 @@ require "fileutils"
3
3
  module Mandy
4
4
  class Packer
5
5
  TMP_DIR = '/tmp/mandy'
6
+ MANDY_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..'))
6
7
 
7
- def self.pack(script, dir, gemfile)
8
+ def self.pack(script, dir, gemfile=nil)
8
9
  tmp_path = "#{TMP_DIR}/packed-job-#{Time.now.to_i}"
9
10
  FileUtils.mkdir_p(tmp_path)
10
11
  to_be_copied = File.file?(dir) ? dir : File.join(dir, '*')
11
- FileUtils.cp_r(script, tmp_path)
12
+ FileUtils.cp(script, tmp_path)
12
13
  FileUtils.cp_r(Dir.glob(to_be_copied), tmp_path)
13
- FileUtils.cp_r(gemfile, tmp_path)
14
- Dir.chdir(tmp_path) do
15
- `gem bundle`
16
- `rm -r vendor/gems/gems`
17
- `tar -cf bundle.tar *`
18
- end
14
+ FileUtils.cp(File.join(MANDY_DIR, 'geminstaller.yml'), tmp_path)
15
+ FileUtils.cp(gemfile, File.join(tmp_path, 'gems.yml')) if gemfile and File.exists?(gemfile)
16
+ Dir.chdir(tmp_path) { `tar -cf bundle.tar *` }
19
17
  File.join(tmp_path, 'bundle.tar')
20
18
  end
21
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.92
4
+ version: 0.4.93
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Kent
@@ -13,16 +13,6 @@ cert_chain: []
13
13
  date: 2009-10-19 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: bundler
18
- type: :runtime
19
- version_requirement:
20
- version_requirements: !ruby/object:Gem::Requirement
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
25
- version:
26
16
  - !ruby/object:Gem::Dependency
27
17
  name: json
28
18
  type: :runtime
@@ -55,17 +45,23 @@ extensions: []
55
45
  extra_rdoc_files: []
56
46
 
57
47
  files:
48
+ - bin/mandy
58
49
  - bin/mandy-hadoop
59
50
  - bin/mandy-local
60
51
  - bin/mandy-map
52
+ - bin/mandy-put
61
53
  - bin/mandy-get
62
54
  - bin/mandy-cat
63
- - bin/mandy-put
64
55
  - bin/mandy-reduce
56
+ - bin/mandy-rm
57
+ - bin/mandy-mv
58
+ - bin/mandy-cp
59
+ - bin/mandy-mkdir
60
+ - bin/mandy-exists
61
+ - bin/mandy-install
65
62
  - readme.md
66
63
  - Rakefile
67
64
  - bootstrap.rb
68
- - Gemfile
69
65
  - lib/mandy.rb
70
66
  - lib/support/tuple.rb
71
67
  - lib/support/formatting.rb
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source "http://gemcutter.org"
2
- gem 'mandy'