|
1 | | -paths = Gem.find_files('configoro/simple') |
2 | | -if paths.empty? |
3 | | - puts "NOTE: Because Configoro is not installed, only required gems will be", |
4 | | - "installed. Re-run 'bundle' again to install additional gems." |
5 | | - # not necessary; make conditionally a noop |
6 | | - def conditionally(*) end |
7 | | -else |
8 | | - paths.each { |p| require p } |
9 | | - |
10 | | - rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) |
11 | | - Configoro.paths << File.join(rails_root, 'config', 'environments') |
12 | | - |
13 | | - def traverse_hash(hsh, *keys) |
14 | | - if keys.size == 1 |
15 | | - hsh[keys.first] |
16 | | - else |
17 | | - traverse_hash hsh[keys.shift], *keys |
18 | | - end |
19 | | - end |
20 | | - |
21 | | - def conditionally(configuration_path, *values, &block) |
22 | | - groups = [] |
23 | | - dev = Configoro.load_environment('development') |
24 | | - test = Configoro.load_environment('test') |
25 | | - prod = Configoro.load_environment('production') |
26 | | - |
27 | | - configuration_path = configuration_path.split('.') |
28 | | - groups << :development if values.include?(traverse_hash(dev, *configuration_path)) |
29 | | - groups << :test if values.include?(traverse_hash(test, *configuration_path)) |
30 | | - groups << :production if values.include?(traverse_hash(prod, *configuration_path)) |
31 | | - |
32 | | - groups.each { |g| group g, &block } |
33 | | - end |
34 | | -end |
35 | | - |
36 | 1 | source 'https://rubygems.org' |
37 | 2 |
|
38 | | -# FRAMEWORK |
39 | | -gem 'rails', github: 'rails/rails', branch: '3-2-stable' |
40 | | -# We need to use this branch of Rails because it includes fixes for ActiveRecord |
41 | | -# and concurrency that we need for our thread-spawning background job paradigm |
42 | | -# to work |
43 | | -gem 'configoro', '>= 1.2.4' |
44 | | -gem 'rack-cors', require: 'rack/cors' |
45 | | - |
46 | | -# MODELS |
47 | | -gem 'pg', platform: :mri |
48 | | -# Version 1.2.6 introduces a bug relating to SQL binds |
49 | | -gem 'activerecord-jdbc-adapter', '1.2.5', platform: :jruby |
50 | | -gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby |
51 | | -gem 'has_metadata_column', github: 'RISCfuture/has_metadata_column' |
52 | | -gem 'slugalicious' |
53 | | -gem 'email_validation' |
54 | | -gem 'url_validation' |
55 | | -gem 'json_serialize' |
56 | | -gem 'validates_timeliness' |
57 | | -gem 'find_or_create_on_scopes', '>= 1.2.1' |
58 | | -gem 'composite_primary_keys', github: 'RISCfuture/composite_primary_keys' |
59 | | -gem 'activerecord-postgresql-cursors' |
60 | | - |
61 | | -# VIEWS |
62 | | -gem 'erector' |
63 | | -gem 'jquery-rails' |
64 | | -gem 'kramdown' |
65 | | - |
66 | | -# UTILITIES |
67 | | -gem 'json' |
68 | | -gem 'git', github: 'RISCfuture/ruby-git' |
69 | | -gem 'user-agent' |
70 | | - |
71 | | -# AUTH |
72 | | -conditionally('authentication.strategy', 'ldap') do |
73 | | - gem 'net-ldap', github: 'RoryO/ruby-net-ldap', require: 'net/ldap' |
74 | | -end |
75 | | - |
76 | | -# INTEGRATION |
77 | | -conditionally('jira.disabled', false, nil) do |
78 | | - gem 'jira-ruby', require: 'jira' |
79 | | -end |
80 | | - |
81 | | -# DOGFOOD |
82 | | -gem 'squash_ruby', require: 'squash/ruby' |
83 | | -gem 'squash_rails', require: 'squash/rails' |
84 | | -gem 'squash_ios_symbolicator', require: 'squash/symbolicator' |
85 | | -gem 'squash_javascript', require: 'squash/javascript' |
86 | | -gem 'squash_java', require: 'squash/java' |
| 3 | +# Load all files under the Gemfile.d directory. |
87 | 4 |
|
88 | | -# BACKGROUND JOBS |
89 | | -conditionally('concurrency.background_runner', 'Resque') do |
90 | | - gem 'resque' |
91 | | - gem 'resque-pool' |
| 5 | +Dir.glob(File.join(File.dirname(__FILE__), 'Gemfile.d', '*.rb')).each do |file| |
| 6 | + eval File.read(file), binding, file |
92 | 7 | end |
93 | | - |
94 | | -group :assets do |
95 | | - gem 'sass-rails' |
96 | | - gem 'libv8', '~> 3.11.8', platform: :mri |
97 | | - gem 'therubyracer', '>= 0.11.1', platform: :mri |
98 | | - # Version 2.0 of TheRubyRhino breaks asset compilation |
99 | | - gem 'therubyrhino', platform: :jruby |
100 | | - gem 'less-rails' |
101 | | - |
102 | | - gem 'coffee-rails' |
103 | | - gem 'uglifier' |
104 | | - |
105 | | - gem 'font-awesome-rails' |
106 | | -end |
107 | | - |
108 | | -group :development do |
109 | | - # DOCS |
110 | | - gem 'yard', require: nil |
111 | | - gem 'redcarpet', require: nil, platform: :mri |
112 | | - gem 'fdoc' |
113 | | -end |
114 | | - |
115 | | - |
116 | | -group :test do |
117 | | - # SPECS |
118 | | - gem 'rspec-rails' |
119 | | - gem 'factory_girl_rails' |
120 | | - gem 'fakeweb' |
121 | | -end |
122 | | - |
123 | | -gem 'sql_origin', groups: [:development, :test] |
124 | | - |
125 | | -Configoro.paths.clear if defined?(Configoro) |
0 commit comments