-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gemfile
49 lines (41 loc) · 1.18 KB
/
Gemfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require 'json'
source 'https://rubygems.org'
gem 'activesupport'
gem 'eventmachine'
gem 'git'
gem 'mechanize'
gem 'nokogiri'
gem 'open_uri_redirections'
gem 'rest-client'
gem 'sequel'
gem 'sinatra'
gem 'sqlite3'
gem 'thin'
group :development, :test do
gem 'rake'
gem 'rspec'
gem 'rubocop'
end
# Adapter Gemfiles
# rubocop:disable Security/Eval
adapters_path = File.join(File.dirname(__FILE__), 'lib', 'adapters', '**', 'Gemfile')
Dir.glob(adapters_path) do |gemfile|
# Dangerous! However, if we want to load additional `Gemfile`s we need to `eval`...
eval(IO.read(gemfile), binding)
end
# Plugin Gemfiles
plugins_path = File.join(File.dirname(__FILE__), 'lib', 'plugins', '**', 'Gemfile')
external_plugins_path = File.join(File.dirname(__FILE__), 'lib', 'external_plugins', '**')
Dir.glob(plugins_path) do |gemfile|
# Dangerous!
eval(IO.read(gemfile), binding)
end
Dir.glob(external_plugins_path) do |dir|
path = File.join(dir, 'manifest.json')
next if !File.file? path
manifest = JSON.parse(File.read(path), symbolize_names: true)
has_dependencies = manifest[:has_dependencies]
# Dangerous!
eval(IO.read(gemfile), binding) if has_dependencies
end
# rubocop:enable Security/Eval