cake 0.1.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/cake +24 -26
  2. data/cake.gemspec +14 -0
  3. data/lib/cake.jar +0 -0
  4. metadata +6 -5
data/bin/cake CHANGED
@@ -1,34 +1,32 @@
1
- #!/usr/bin/env bash
1
+ #!/usr/bin/env ruby
2
2
  # Save your fork, there's cake!"
3
3
 
4
- function bake {
5
- java -cp "$CLASSPATH" clojure.main -e "(use 'cake)(-main)" /dev/null $@
6
- }
4
+ require 'open-uri'
7
5
 
8
- FILE="$(readlink $0)"
9
- FILE=${FILE:-$0}
10
- CAKE="$(dirname "$(dirname "$FILE")")"
11
- CLASSPATH="$CAKE/src/:$CAKE/lib/*"
6
+ def get(url, dest)
7
+ open("#{dest}/#{File.basename(url)}", "wb").write(open(url))
8
+ end
12
9
 
13
- JAR="http://github.com/downloads/ninjudd/cake-standalone/cake-standalone.jar"
10
+ def cake(*args)
11
+ system %Q( java -cp #{$classpath} clojure.main -e "(use 'cake)(-main)" /dev/null #{args.join(' ')} )
12
+ end
14
13
 
15
- if [ "$(which curl)" == "" ]; then
16
- GET="wget -qO"
17
- else
18
- GET="curl -Lso"
19
- fi
14
+ file = File.readlink(__FILE__) rescue __FILE__
15
+ root = File.dirname(File.dirname(file))
16
+ lib = "#{root}/lib"
17
+ jar = "#{root}/lib/cake.jar"
18
+ $classpath = File.exists?(jar) ? jar : "#{root}/src/:#{root}/lib/*"
20
19
 
21
- # Bootstap cake deps
22
- if [ ! -e "$CAKE/.deps" ]; then
23
- echo "fetching cake dependencies..."
24
- rm -rf $CAKE/lib
25
- mkdir -p $CAKE/lib
26
- $GET $CAKE/lib/$(basename $JAR) $JAR || exit
27
- touch "$CAKE/.deps"
28
- fi
20
+ # Bootstap cake dependencies.
21
+ if not File.exists?(lib)
22
+ url ="http://github.com/downloads/ninjudd/cake-standalone/cake.jar"
23
+ echo "fetching cake standalone jar from #{url}..."
24
+ File.makedirs(lib)
25
+ get(url, lib)
26
+ end
29
27
 
30
- if [ "project.clj" -nt "pom.xml" ] && [ "$1" != "deps" ]; then
31
- bake deps
32
- fi
28
+ if not File.exists?("pom.xml") or test(?>, "project.clj", "pom.xml") and ARGV.first != "deps"
29
+ cake("deps")
30
+ end
33
31
 
34
- bake $@
32
+ cake(*ARGV)
@@ -0,0 +1,14 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'cake'
3
+ s.rubyforge_project = 'cake'
4
+ s.version = ENV['CAKE_VERSION']
5
+ s.authors = ['Justin Balthrop', 'Lance Bradley']
6
+ s.date = Time.now
7
+ s.default_executable = 'cake'
8
+ s.summary = 'The cake stands alone.'
9
+ s.description = "Save your fork, there's cake!"
10
+ s.email = 'code@justinbalthrop.com'
11
+ s.executables = ['cake']
12
+ s.files = ['cake.gemspec', 'bin/cake', 'lib/cake.jar']
13
+ s.homepage = 'http://github.com/ninjudd/cake'
14
+ end
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: 25
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ - 3
10
+ version: 0.2.3
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-06-02 00:00:00 -07:00
19
+ date: 2010-06-03 00:00:00 -07:00
20
20
  default_executable: cake
21
21
  dependencies: []
22
22
 
@@ -29,6 +29,7 @@ extensions: []
29
29
  extra_rdoc_files: []
30
30
 
31
31
  files:
32
+ - cake.gemspec
32
33
  - bin/cake
33
34
  - lib/cake.jar
34
35
  has_rdoc: true