Skip to content

Commit

Permalink
Re-organize gemspecs and add brakeman-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
presidentbeef committed Jun 3, 2016
1 parent eb2e9a1 commit fa310a9
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 14 deletions.
22 changes: 22 additions & 0 deletions brakeman-lib.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require './lib/brakeman/version'
require './gem_common'
gem_priv_key = File.expand_path("~/.ssh/gem-private_key.pem")

Gem::Specification.new do |s|
s.name = %q{brakeman-lib}
s.version = Brakeman::Version
s.authors = ["Justin Collins"]
s.email = "[email protected]"
s.summary = "Security vulnerability scanner for Ruby on Rails."
s.description = "Brakeman detects security vulnerabilities in Ruby on Rails applications via static analysis. This package declares gem dependencies instead of bundling them."
s.homepage = "http://brakemanscanner.org"
s.files = ["bin/brakeman", "CHANGES", "WARNING_TYPES", "FEATURES", "README.md"] + Dir["lib/**/*"]
s.executables = ["brakeman"]
s.license = "MIT"
s.cert_chain = ['brakeman-public_cert.pem']
s.signing_key = gem_priv_key if File.exist? gem_priv_key and $0 =~ /gem\z/

Brakeman::GemDependencies.dev_dependencies(s)
Brakeman::GemDependencies.base_dependencies(s)
Brakeman::GemDependencies.extended_dependencies(s)
end
8 changes: 4 additions & 4 deletions brakeman-min.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require './lib/brakeman/version'
require './gem_common'
gem_priv_key = File.expand_path("~/.ssh/gem-private_key.pem")

Gem::Specification.new do |s|
Expand All @@ -14,8 +15,7 @@ Gem::Specification.new do |s|
s.license = "MIT"
s.cert_chain = ['brakeman-public_cert.pem']
s.signing_key = gem_priv_key if File.exist? gem_priv_key and $0 =~ /gem\z/
s.add_development_dependency "test-unit"
s.add_dependency "ruby_parser", "~>3.8.1"
s.add_dependency "ruby2ruby", "~>2.3.0"
s.add_dependency "safe_yaml", ">= 1.0"

Brakeman::GemDependencies.dev_dependencies(s)
Brakeman::GemDependencies.base_dependencies(s)
end
14 changes: 4 additions & 10 deletions brakeman.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require './lib/brakeman/version'
require './gem_common'
gem_priv_key = File.expand_path("~/.ssh/gem-private_key.pem")

Gem::Specification.new do |s|
Expand All @@ -18,15 +19,8 @@ Gem::Specification.new do |s|
if File.exist? 'bundle/load.rb'
s.files += Dir['bundle/ruby/*/gems/**/*'] + ['bundle/load.rb']
else
s.add_development_dependency "test-unit" unless ENV['BM_PACKAGE']
s.add_dependency "ruby_parser", "~>3.8.1"
s.add_dependency "ruby2ruby", "~>2.3.0"
s.add_dependency "terminal-table", "~>1.4"
s.add_dependency "highline", ">=1.6.20", "<2.0"
s.add_dependency "erubis", "~>2.6"
s.add_dependency "haml", ">=3.0", "<5.0"
s.add_dependency "sass", "~>3.0"
s.add_dependency "slim", ">=1.3.6", "<4.0"
s.add_dependency "safe_yaml", ">= 1.0"
Brakeman::GemDependencies.dev_dependencies(s) unless ENV['BM_PACKAGE']
Brakeman::GemDependencies.base_dependencies(s)
Brakeman::GemDependencies.extended_dependencies(s)
end
end
22 changes: 22 additions & 0 deletions gem_common.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module Brakeman
module GemDependencies
def self.dev_dependencies spec
spec.add_development_dependency "test-unit"
end

def self.base_dependencies spec
spec.add_dependency "ruby_parser", "~>3.8.1"
spec.add_dependency "ruby2ruby", "~>2.3.0"
spec.add_dependency "safe_yaml", ">= 1.0"
end

def self.extended_dependencies spec
spec.add_dependency "terminal-table", "~>1.4"
spec.add_dependency "highline", ">=1.6.20", "<2.0"
spec.add_dependency "erubis", "~>2.6"
spec.add_dependency "haml", ">=3.0", "<5.0"
spec.add_dependency "sass", "~>3.0"
spec.add_dependency "slim", ">=1.3.6", "<4.0"
end
end
end

0 comments on commit fa310a9

Please sign in to comment.