Skip to content
This repository
Browse code

allow installing edge versions of next to all dependencies

  • Loading branch information...
commit 77629891d0858a3d470a6b395c7c4136bf7d1f24 1 parent f604013
Konstantin Haase authored July 04, 2011

Showing 1 changed file with 54 additions and 47 deletions. Show diff stats Hide diff stats

  1. 101  Gemfile
101  Gemfile
@@ -9,60 +9,67 @@
9 9
 RUBY_ENGINE = 'ruby' unless defined? RUBY_ENGINE
10 10
 source :rubygems unless ENV['QUICK']
11 11
 
12  
-gem 'rake'
13  
-gem 'rack-test', '>= 0.5.6'
14  
-gem 'ci_reporter', :group => :ci
  12
+GH = "git://github.com/%s/%s.git"
15 13
 
16  
-# Allows stuff like `tilt=1.2.2 bundle install` or `tilt=master ...`.
17  
-# Used by the CI.
18  
-github = "git://github.com/%s.git"
19  
-repos = { 'tilt' => github % "rtomayko/tilt", 'rack' => github % "rack/rack" }
20  
-%w[tilt rack].each do |lib|
21  
-  dep = (ENV[lib] || 'stable').sub "#{lib}-", ''
22  
-  dep = nil if dep == 'stable'
23  
-  dep = {:git => repos[lib], :branch => dep} if dep and dep !~ /(\d+\.)+\d+/
24  
-  gem lib, dep
  14
+def self.ruby?(list)
  15
+  Array(list).map(&:to_s).any? do |v|
  16
+    v.to_s == RUBY_ENGINE or v.to_s == RUBY_VERSION
  17
+  end
25 18
 end
26 19
 
27  
-gem 'haml', '>= 3.0'
28  
-gem 'sass'
29  
-gem 'builder'
30  
-gem 'erubis'
31  
-gem 'less', '~> 1.0'
32  
-gem 'liquid' unless RUBY_ENGINE == 'maglev'
33  
-gem 'slim'
34  
-gem 'RedCloth' if RUBY_VERSION < "1.9.3" and not RUBY_ENGINE.start_with? 'ma'
35  
-gem 'coffee-script', '>= 2.0' unless RUBY_ENGINE == 'maglev'
36  
-gem 'rdoc'
37  
-gem 'kramdown'
38  
-gem 'maruku'
39  
-gem 'creole'
  20
+def self.gh(name, github_user = name, options = {})
  21
+  github_user, options = name, github_user if Hash === github_user
40 22
 
41  
-gem 'nokogiri' if RUBY_ENGINE != 'maglev'
  23
+  return if options[:exept] and     ruby? options[:exept]
  24
+  return if options[:on]    and not ruby? options[:on]
42 25
 
43  
-unless RUBY_ENGINE == 'jruby' && JRUBY_VERSION < "1.6.1"
44  
-  # C extensions
45  
-  gem 'rdiscount'
46  
-  gem 'redcarpet'
  26
+  lib = options[:lib] || name.to_s
  27
+  dep = (ENV[lib] || ENV['dependencies'] || 'stable').sub "#{lib}-", ''
  28
+  dep = nil if dep == 'stable'
47 29
 
48  
-  ## bluecloth is broken
49  
-  #gem 'bluecloth'
50  
-end
  30
+  if dep and dep !~ /(\d+\.)+\d+/
  31
+    return unless github_user
  32
+    dep = { :git => GH % [github_user, name], :branch => dep }
  33
+  end
51 34
 
52  
-if RUBY_ENGINE == 'maglev'
53  
-  gem 'json'
54  
-  gem 'markaby'
55  
-  gem 'radius'
  35
+  group = options[:group] || name
  36
+  if Hash === dep
  37
+    dep[:group] = group
  38
+    gem lib, dep
  39
+  elsif dep
  40
+    gem lib, dep, :group => group
  41
+  else
  42
+    gem lib, :group => group
  43
+  end
56 44
 end
57 45
 
58  
-platforms :ruby_18, :jruby do
59  
-  gem 'json'
60  
-  gem 'markaby'
61  
-  gem 'radius'
62  
-end
  46
+gh :tilt, :rtomayko
  47
+gh :rack
63 48
 
64  
-platforms :mri_18 do
65  
-  # bundler platforms are broken
66  
-  next if RUBY_ENGINE != 'ruby' or RUBY_VERSION > "1.8"
67  
-  gem 'rcov'
68  
-end
  49
+gh :builder, :jimweirich
  50
+gh :creole, :larsch
  51
+gh :erubis, false
  52
+gh :haml, :nex3
  53
+gh :json, :flori, :on => %w[1.8.7 1.8.8 jruby maglev]
  54
+gh :kramdown, false #:gettalong
  55
+gh :liquid, :Shopify, :except => :maglev
  56
+gh :markaby, :on => %w[1.8.7 1.8.8 jruby maglev]
  57
+gh :maruku, false #:nex3
  58
+gh :nokogiri, false #:tenderlove, :except => :maglev
  59
+gh :radius, :jlong
  60
+gh :rdiscount, :rtomayko
  61
+gh :rdoc, false #:rdoc
  62
+gh :redcarpet, :tanoku
  63
+gh :redcloth, :jgarber, :lib => 'RedCloth', :except => %w[1.9.3 maglev macruby]
  64
+gh :'ruby-coffee-script', :josh, :lib => 'coffee-script', :except => :maglev
  65
+gh :sass, :nex3
  66
+gh :slim, :stonean
  67
+
  68
+gem 'less', '~> 1.0', :group => :less
  69
+
  70
+gem 'rake'
  71
+gem 'rack-test', '>= 0.5.6'
  72
+gem 'ci_reporter', :group => :ci
  73
+
  74
+## bluecloth is broken
  75
+#gem 'bluecloth'

0 notes on commit 7762989

Please sign in to comment.
Something went wrong with that request. Please try again.