Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

Some whitespace removal #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/binary_gem_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

include Polisher::CLI

parse_args
parse_args
verify_args!

# require the gem's extconf
Expand Down
3 changes: 1 addition & 2 deletions bin/gem_dependency_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
require 'polisher/gem'
require 'polisher/gemfile'
require 'polisher/util/config'

require 'polisher/cli/all'
require 'polisher/cli/bin/gem_dependency_checker'

include Polisher::CLI

conf = gem_dependency_checker_conf
conf = gem_dependency_checker_conf
optparse = gem_dependency_checker_option_parser
optparse.parse!
validate_sources
Expand Down
5 changes: 2 additions & 3 deletions bin/gem_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@

require 'polisher/gemfile'
require 'polisher/util/config'

require 'polisher/cli/all'
require 'polisher/cli/bin/gem_mapper'

include Polisher::CLI

conf = gem_mapper_conf
conf = gem_mapper_conf
optparse = gem_mapper_parser
optparse.parse!

Expand All @@ -22,6 +21,6 @@
Polisher::Logging.level = conf[:log_level]
Polisher::Config.set
begin
print_tree conf
print_tree conf
rescue Exception => e
end
5 changes: 2 additions & 3 deletions bin/gems2update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

require 'polisher/util/logger'
require 'polisher/util/config'

require 'polisher/cli/all'
require 'polisher/cli/bin/gems2update'

include Polisher::CLI

conf = gems2update_conf
conf = gems2update_conf
optparse = gems2update_parser
optparse.parse!

Expand All @@ -23,6 +22,6 @@
configure_targets conf

begin
check_gems conf
check_gems conf
rescue Exception => e
end
2 changes: 1 addition & 1 deletion bin/git_gem_diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

include Polisher::CLI

conf = git_gem_diff_conf
conf = git_gem_diff_conf
optparse = git_gem_diff_option_parser
optparse.parse!

Expand Down
3 changes: 1 addition & 2 deletions bin/git_gem_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
# Copyright (C) 2013-2014 Red Hat, Inc.

require 'polisher/util/config'

require 'polisher/cli/all'
require 'polisher/cli/bin/git_gem_updater'

include Polisher::CLI

conf = git_gem_updater_conf
conf = git_gem_updater_conf
optparse = git_gem_updater_option_parser
optparse.parse!
validate_gems!
Expand Down
2 changes: 1 addition & 1 deletion bin/missing_deps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

include Polisher::CLI

conf = missing_deps_conf
conf = missing_deps_conf
optparse = missing_deps_parser
optparse.parse!

Expand Down
2 changes: 1 addition & 1 deletion lib/polisher/adaptors/checker_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ def should_check?(target)
@check_list.include?(target)
end
end # module CheckerLoader
end
end # module Polisher
3 changes: 0 additions & 3 deletions lib/polisher/adaptors/upstream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ class Upstream
def self.parse(source)
if source.gem?
Polisher::Gem.parse(:gem => source)

elsif source.gemspec?
Polisher::Gem.parse(:gemspec => source)

elsif source.gemfile?
Polisher::Gemfile.parse(source)

end
end
end
Expand Down
2 changes: 0 additions & 2 deletions lib/polisher/adaptors/version_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ class VersionChecker
# available for specified package
def self.versions_for(name, &bl)
versions = {}

all_targets.each do |target|
if should_check?(target)
target_versions = send target_method(target), name, &bl
versions.merge! target => target_versions
end
end

versions
end

Expand Down
2 changes: 0 additions & 2 deletions lib/polisher/cli/bin/binary_gem_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def extconf
break
end
end

ec
end
end
Expand Down Expand Up @@ -214,4 +213,3 @@ def find_executable(bin, path = nil)
:executable => bin unless success
success
end

2 changes: 0 additions & 2 deletions lib/polisher/cli/bin/gem_dependency_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,9 @@ def print_gemfile_deps(gemfile)
def print_deps(conf)
if conf_gem?
print_gem_deps(conf_source)

elsif conf_gemfile?
print_gemfile_deps(conf_source)
end

puts last_dep # XXX
end
end # module CLI
Expand Down
2 changes: 0 additions & 2 deletions lib/polisher/cli/bin/gems2update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@ def check_missing
def check_gems2update(source)
msg = 'processing dependencies'
waiting :msg => msg, :color => :red

source.dependency_tree(:recursive => true,
:dev_deps => dev_deps?) do |src, dep, resolved_dep|
waiting_msg "#{msg} #{src.is_a?(Polisher::Gemfile) ? "Gemfile" : src.name}(#{dep.name})"
check_missing_dep dep
end

end_waiting
check_missing
end
Expand Down
2 changes: 0 additions & 2 deletions lib/polisher/cli/bin/git_gem_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
###########################################################

require 'colored'

require 'polisher/gem'
require 'polisher/git/pkg'

Expand All @@ -30,7 +29,6 @@ def git_gem_updater_option_parser

def validate_gems!
conf[:gems] += user_gems

if conf[:gems].empty?
puts "must specify a gem or user name!".red
exit 1
Expand Down
1 change: 0 additions & 1 deletion lib/polisher/cli/targets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def configure_targets(conf)
Polisher::Koji.koji_tags conf[:koji_tags] if conf[:koji_tags]
Polisher::Koji.package_prefix conf[:prefix] if conf[:prefix]
end

# TODO other target config
end
end # module CLI
Expand Down
4 changes: 0 additions & 4 deletions lib/polisher/gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@

require 'polisher/util/conf_helpers'
require 'polisher/mixins/vendored_deps'

require 'polisher/gem/attributes'
require 'polisher/gem/dependencies'
require 'polisher/gem/files'
require 'polisher/gem/state'
require 'polisher/gem/versions'

require 'polisher/gem/parser'
require 'polisher/gem/retriever'
require 'polisher/gem/diff'
Expand All @@ -20,13 +18,11 @@ module Polisher
class Gem
include ConfHelpers
include HasVendoredDeps

include GemAttributes
include GemDependencies
include GemFiles
include GemState
include GemVersions

include GemParser
include GemRetriever
include GemDiff
Expand Down
1 change: 0 additions & 1 deletion lib/polisher/gem/attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module GemAttributes
attr_accessor :version
attr_accessor :deps
attr_accessor :dev_deps

attr_accessor :path

def file_name
Expand Down
1 change: 0 additions & 1 deletion lib/polisher/gem/dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def resolve_tree_deps(args = {}, &bl)
def resolve_tree_dep(args = {}, &bl)
dep = args[:dep]
matching = args[:matching]

resolved = nil
begin
resolved = Polisher::Gem.matching(dep, matching)
Expand Down
1 change: 0 additions & 1 deletion lib/polisher/gem/diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def diff(other)
FileUtils.rm_rf other_dir unless other_dir.nil? ||
!other.is_a?(Polisher::Gem)
end

out
end
end # module GemDiff
Expand Down
4 changes: 0 additions & 4 deletions lib/polisher/gem/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,11 @@ def from_gem(gem_path)
def parse(args = {})
if args.is_a?(String)
return from_json args

elsif args.key?(:gemspec)
return from_gemspec args[:gemspec]

elsif args.key?(:gem)
return from_gem args[:gem]

end

new
end
end # module ClassMethods
Expand Down
2 changes: 0 additions & 2 deletions lib/polisher/gem/retriever.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ def client
def download_gem(name, version)
cached = GemCache.get(name, version)
return cached unless cached.nil?

client.url = "https://rubygems.org/gems/#{name}-#{version}.gem"
client.follow_location = true
client.http_get
gemf = client.body_str

GemCache.set(name, version, gemf)
gemf
end
Expand Down
1 change: 0 additions & 1 deletion lib/polisher/gem/state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def distgit_state(args = {})
# the specified gem dependency requirements
def state(args = {})
return :available if koji_state(args) == :available

state = distgit_state(args)
return :needs_repo if state == :missing_repo
return :needs_branch if state == :missing_branch
Expand Down
4 changes: 0 additions & 4 deletions lib/polisher/gem/versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def dependency_versions(args = {}, &bl)

args[:versions] = versions
end

versions
end

Expand All @@ -115,16 +114,13 @@ def versions(args = {}, &bl)
recursive = local_args[:recursive]
dev_deps = local_args[:dev_deps]
versions = local_args[:versions] || {}

gem_versions = Polisher::VersionChecker.versions_for(name, &bl)
versions.merge! name => gem_versions
local_args[:versions] = versions

if recursive
versions.merge! dependency_versions local_args, &bl
versions.merge! dependency_versions local_args.merge(:dev => true), &bl if dev_deps
end

versions
end # module ClassMethods
end # module GemVersions
Expand Down
1 change: 0 additions & 1 deletion lib/polisher/gemfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
module Polisher
class Gemfile
include VersionedDependencies

include GemfileAttributes
include GemfileDeps
include GemfileParser
Expand Down
2 changes: 0 additions & 2 deletions lib/polisher/gemfile/attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ module Polisher
module GemfileAttributes
# always nil, for interface compatability
attr_accessor :version

attr_accessor :deps
attr_accessor :dev_deps

# always empty array, for interface compatability
attr_accessor :file_paths

attr_accessor :definition
end # module GemfileAttributes
end # module Polisher
3 changes: 0 additions & 3 deletions lib/polisher/gemfile/deps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,16 @@ def patched
# (path and alternate rubygems src)
next unless dep.source.is_a?(Bundler::Source::Git)
src = dep.source

# retrieve gem
gem = if src.version
Polisher::Gem.new(:name => dep.name, :version => src.version)
else
Polisher::Gem.retrieve(dep.name)
end

# retrieve dep
git = Polisher::Git::Repo.new :url => src.uri
git.clone unless git.cloned?
git.checkout src.ref if src.ref

# diff gem against git
gem.diff(git.path)
end.compact!
Expand Down
4 changes: 0 additions & 4 deletions lib/polisher/gemfile/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def parse(path, args = {})
require 'bundler'

groups = args[:groups]

definition = nil
path, gemfile = File.split(path)
Dir.chdir(path) do
Expand All @@ -28,16 +27,13 @@ def parse(path, args = {})
raise ArgumentError, "invalid gemfile: #{path}"
end
end

metadata = {}
metadata[:deps] = definition.dependencies.select do |d|
groups.nil? || groups.empty? || # groups not specified
groups.any? { |g| d.groups.include?(g.intern) } # dep in any group
end

metadata[:dev_deps] = [] # TODO
metadata[:definition] = definition

new metadata
end
end # module ClassMethods
Expand Down
1 change: 0 additions & 1 deletion lib/polisher/git/pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class Pkg < Repo
include PkgAttributes
include PkgRepo
include PkgVersions

include PkgBuilder
include PkgUpdater

Expand Down
Loading