Class: Joe

Inherits:
Object
  • Object
show all
Defined in:
lib/joe.rb

Instance Method Summary collapse

Instance Method Details

#archiveObject



32
33
34
35
36
# File 'lib/joe.rb', line 32

def archive
  if git_archive && pkg(archive_file)
    status :created, "pkg/#{archive_file}"
  end
end

#buildObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/joe.rb', line 16

def build
  gemspec if File.exist?("%s.erb" % spec_file)

  gem("build", spec_file)

  if pkg(gem_file)
    status :created, "pkg/#{gem_file}"
  else
    fail "Unable to build #{gem_file}"
  end
end

#gemspecObject



6
7
8
9
10
11
12
13
14
# File 'lib/joe.rb', line 6

def gemspec
  File.open(spec_file, "w") do |f|
    f.write ERB.new(File.read("%s.erb" % spec_file), nil, "-").result

    status :write, spec_file
  end
rescue SyntaxError
  fail "Parsing your gemspec failed. Please check its syntax."
end

#installObject



28
29
30
# File 'lib/joe.rb', line 28

def install
  build and gem("install", "pkg/#{gem_file}")
end

#releaseObject



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

def release
  build
  status :releasing, gem_file
  gem("push", "pkg/#{gem_file}")
end