cake 0.4.9 → 0.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/bin/cake +15 -26
  2. data/lib/bake.jar +0 -0
  3. data/lib/cake.jar +0 -0
  4. metadata +4 -4
data/bin/cake CHANGED
@@ -2,7 +2,6 @@
2
2
  # Save your fork, there's cake!"
3
3
  require 'find'
4
4
  require 'open-uri'
5
- require 'rexml/document'
6
5
  require 'socket'
7
6
  require 'timeout'
8
7
  require 'fileutils'
@@ -11,6 +10,7 @@ require 'pp'
11
10
 
12
11
  if RUBY_PLATFORM =~ /(mingw|mswin)(32|64)$/
13
12
  begin
13
+ require 'rubygems' rescue nil
14
14
  require 'win32/process'
15
15
  rescue LoadError
16
16
  puts 'cake requires win32/process. use "gem install win32-process" to install'
@@ -95,6 +95,7 @@ class Object
95
95
  case self
96
96
  when Array then return collect {|i| i.to_clj(true)}.join(' ')
97
97
  when String then return self
98
+ when nil then return ''
98
99
  end
99
100
  end
100
101
  case self
@@ -242,12 +243,12 @@ def download(url, path)
242
243
  end
243
244
 
244
245
  def get_cake(version, dest = nil, opts = {})
245
- jar = version =~ /(.*)-SNAPSHOT/ ? "cake-#{$1}-#{snapshot(version)}.jar" : "cake-#{version}.jar"
246
+ jar = "cake-#{version}.jar"
246
247
  repo = File.expand_path("~/.m2/repository/cake/cake/#{version}")
247
248
  path = "#{repo}/#{jar}"
248
249
 
249
250
  if not File.exists?(path)
250
- url = "#{$repo}/#{version}/#{jar}"
251
+ url = "#{$repo}/#{jar}"
251
252
  log(:deps, "fetching cake libraries. this may take a moment...") unless @logged; @logged = true
252
253
  FileUtils.makedirs(repo)
253
254
  download(url, path)
@@ -266,24 +267,11 @@ rescue OpenURI::HTTPError => e
266
267
  end
267
268
 
268
269
  def current_version
269
- version = open("#{$repo}/maven-metadata.xml") do |file|
270
- doc = REXML::Document.new file
271
- doc.elements['metadata'].elements['versioning'].elements['versions'].elements.to_a('version').last.get_text.to_s
272
- end
273
- log(:deps, "most recent clojars version is #{version}") if debug?
270
+ version = open("#{$repo}/version").gets
271
+ log(:deps, "most recent standalone version is #{version}") if debug?
274
272
  version
275
273
  end
276
274
 
277
- def snapshot(version)
278
- open("#{$repo}/#{version}/maven-metadata.xml") do |file|
279
- doc = REXML::Document.new file
280
- snapshot = doc.elements['metadata'].elements['versioning'].elements['snapshot'].elements
281
- timestamp = snapshot['timestamp'].get_text
282
- build_num = snapshot['buildNumber'].get_text
283
- "#{timestamp}-#{build_num}"
284
- end
285
- end
286
-
287
275
  def extract(jar, file, dest = File.dirname(jar))
288
276
  if not File.exists?("#{dest}/#{file}")
289
277
  log(:deps, "extracting #{file} from #{jar}") if verbose?
@@ -397,8 +385,8 @@ class JVM
397
385
  end
398
386
 
399
387
  def vm_opts
400
- opts = '-client'
401
- opts << ' -d32' unless $win
388
+ `java -d32 -version 2>&1`
389
+ '-client -d32' if $? == 0
402
390
  end
403
391
 
404
392
  MIN_PORT = 2**14
@@ -499,7 +487,7 @@ class JVM
499
487
  forms = forms.collect do |form|
500
488
  form == '-' ? $stdin.gets(nil) : form
501
489
  end.join(' ')
502
- forms = "(doall (map println [#{forms}]))" if $opts[:p]
490
+ forms = "(doall (map println [#{forms}]))" unless $opts[:q]
503
491
  with_socket do |socket|
504
492
  log(:eval, forms) if debug?
505
493
  socket.write(":eval #{$vars} #{forms} :cake/EOF ")
@@ -512,7 +500,7 @@ class JVM
512
500
  with_socket do |socket|
513
501
  socket.write %(:filter #{$vars} "#{EOL}")
514
502
  while line = $stdin.gets
515
- socket.write [line, ~forms].to_clj
503
+ socket.write [line.chomp, ~forms].to_clj
516
504
  while (line = socket.gets)
517
505
  break if line.start_with?(EOL)
518
506
  puts line
@@ -668,9 +656,10 @@ private
668
656
  output = `stty -echo 2>&1`
669
657
  log($command, output) if verbose?
670
658
  echo_off = $?.exitstatus == 0
671
- prompt << " (WARNING, input will be visible on console!)" unless echo_off
659
+ prompt << ' (WARNING, input will be visible on console!)' unless echo_off
660
+ prompt << ':'
672
661
  end
673
- input = Readline.readline(prompt + ": ") || ''
662
+ input = Readline.readline(prompt + ' ') || ''
674
663
  input + "\n"
675
664
  ensure
676
665
  if echo_off
@@ -716,7 +705,7 @@ $script = File.expand_path($opts[:run].first) if $opts[:run]
716
705
  $pwd = Dir.getwd
717
706
  $bakedir = project_dir($pwd)
718
707
  $cakedir = File.dirname(File.dirname(readlink(__FILE__)))
719
- $repo = "http://clojars.org/repo/cake/cake"
708
+ $repo = "http://github.com/ninjudd/cake-standalone/raw/master"
720
709
  $confdir = ".cake"
721
710
  $config = Configuration.new("#{$home}/.cake/config", ".cake/config")
722
711
  $timeout = ($config['connect.timeout'] || 20).to_i
@@ -738,7 +727,7 @@ if File.exists?("#{$cakedir}/.gitignore") and File.exists?(project)
738
727
  log(:cake, "running from git checkout") if verbose?
739
728
  if $command == :upgrade
740
729
  log(:upgrade, "pulling latest code from git")
741
- system('git pull')
730
+ Dir.chdir($cakedir) { system('git pull') }
742
731
  end
743
732
 
744
733
  $version = IO.read(project).split("\n").first.match(/defproject cake \"(.*)\"/)[1]
data/lib/bake.jar CHANGED
Binary file
data/lib/cake.jar CHANGED
Binary file
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cake
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 9
10
- version: 0.4.9
9
+ - 10
10
+ version: 0.4.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Balthrop
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-08-25 00:00:00 -07:00
19
+ date: 2010-08-30 00:00:00 -07:00
20
20
  default_executable: cake
21
21
  dependencies: []
22
22