-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from FundingCircle/fix-dependencies
Fix bundler dependency
- Loading branch information
Showing
7 changed files
with
63 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,13 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'pathname' | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath) | ||
# XXX: BUNDLE_GEMFILE should be provided because the internals of bundler require a 'Gemfile' or '.bundle' to | ||
# work properly. Without this the script will fail if there isn't a Gemfile somewhere up the directory chain | ||
ENV['BUNDLE_GEMFILE'] ||= File.join(File.expand_path('../..', Pathname.new(__FILE__).realpath), 'Gemfile') | ||
|
||
require 'rubygems' | ||
require 'bundler/setup' | ||
require 'find' | ||
|
||
require 'hellgrid' | ||
|
||
recursive_search = !!(ARGV.delete('-r')) | ||
folders = ARGV.empty? ? [Dir.pwd] : ARGV | ||
|
||
folders.each do |folder| | ||
matrix = Hellgrid::Matrix.new | ||
|
||
Find.find(folder) do |path| | ||
if File.directory?(path) && File.exists?(File.join(path, 'Gemfile.lock')) | ||
matrix.add_project(Hellgrid::Project.new(folder, path)) | ||
Find.prune unless recursive_search | ||
end | ||
end | ||
|
||
view = Hellgrid::Views::Console.new(matrix.sorted_by_most_used) | ||
|
||
view.render | ||
end | ||
Hellgrid::CLI.start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'pathname' | ||
# XXX: BUNDLE_GEMFILE should be provided because the internals of bundler require a 'Gemfile' or '.bundle' to | ||
# work properly. Without this the script will fail if there isn't a Gemfile somewhere up the directory chain | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath) | ||
|
||
require 'hellgrid' | ||
|
||
Hellgrid::CLI.start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,15 @@ Gem::Specification.new do |s| | |
s.summary = 'Gem version dependency matrix' | ||
s.authors = ['Deyan Dobrinov', 'Aleksandar Ivanov'] | ||
s.email = ['[email protected]'] | ||
s.files = Dir.chdir(project_root) { Dir['lib/**/*.rb'] + Dir['bin/*'] + Dir['spec/**/*.rb'] + %w(Gemfile Gemfile.lock README.md hellgrid.gemspec) } | ||
s.executables = s.files.grep(/^bin\//) { |f| File.basename(f) } | ||
s.files = Dir.chdir(project_root) { Dir['lib/**/*.rb'] + Dir['bin/*'] + Dir['exe/*'] + Dir['spec/**/*.rb'] + %w(Gemfile Gemfile.lock README.md hellgrid.gemspec) } | ||
s.bindir = 'exe' | ||
s.executables = s.files.grep(/^exe\//) { |f| File.basename(f) } | ||
s.test_files = s.files.grep(/^spec\//) | ||
s.require_paths = ['lib'] | ||
s.homepage = 'https://github.com/FundingCircle/hellgrid' | ||
s.license = 'BSD-3-Clause' | ||
|
||
s.add_runtime_dependency 'bundler', ['>= 1.11.0', '< 1.17'] | ||
|
||
s.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0' | ||
s.add_development_dependency 'bundler', '~> 1.11', '>= 1.11.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
require 'bundler' | ||
require 'find' | ||
require 'hellgrid/project' | ||
require 'hellgrid/matrix' | ||
require 'hellgrid/views/console' | ||
require 'hellgrid/cli' | ||
|
||
module Hellgrid | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module Hellgrid | ||
class CLI | ||
def self.start(argv = ARGV) | ||
new(argv).start | ||
end | ||
|
||
def initialize(argv = ARGV) | ||
@argv = argv | ||
end | ||
|
||
attr_reader :argv | ||
|
||
def start | ||
recursive_search = !!(argv.delete('-r')) | ||
folders = argv.empty? ? [Dir.pwd] : argv | ||
|
||
folders.each do |folder| | ||
matrix = Hellgrid::Matrix.new | ||
|
||
Find.find(folder) do |path| | ||
if File.directory?(path) && File.exists?(File.join(path, 'Gemfile.lock')) | ||
matrix.add_project(Hellgrid::Project.new(folder, path)) | ||
Find.prune unless recursive_search | ||
end | ||
end | ||
|
||
view = Hellgrid::Views::Console.new(matrix.sorted_by_most_used) | ||
|
||
view.render | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Hellgrid | ||
VERSION = '0.3.0' | ||
VERSION = '0.3.1' | ||
end |