Skip to content

Commit

Permalink
Merge pull request #83 from lagged/lint
Browse files Browse the repository at this point in the history
lint
  • Loading branch information
till authored Feb 11, 2023
2 parents 4618fab + 4ae8dc4 commit 2413700
Show file tree
Hide file tree
Showing 22 changed files with 327 additions and 195 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gemspec
22 changes: 22 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ PATH
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
colored (1.2)
docile (1.4.0)
json (2.6.3)
Expand All @@ -18,8 +19,27 @@ GEM
nokogiri (1.14.1)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
parallel (1.22.1)
parser (3.2.1.0)
ast (~> 2.4.1)
racc (1.6.2)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.7.0)
rexml (3.2.5)
rubocop (1.45.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.24.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.24.1)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
Expand All @@ -28,6 +48,7 @@ GEM
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.3)
thor (1.2.1)
unicode-display_width (2.4.2)

PLATFORMS
ruby
Expand All @@ -37,6 +58,7 @@ DEPENDENCIES
bundler (~> 2.0)
minitest (~> 5.15.0)
rake
rubocop
simplecov (~> 0.18)
simplecov-lcov (~> 0.8.0)

Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ install:
release:
bundle exec rake release

lint:
bundle exec rubocop .

test: install
bundle exec rake test

docker-build:
docker build -t $(IMAGE) .

Expand Down
27 changes: 10 additions & 17 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
require "bundler/gem_tasks"
require "minitest/autorun"
require "simplecov"
require "simplecov-lcov"
# frozen_string_literal: true

require 'bundler/gem_tasks'
require 'rake/testtask'

Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8

task :test do
Rake::TestTask.new do |t|
ENV['COVERAGE'] = 'true'
t.pattern = 'tests/*_test.rb'

SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
SimpleCov::Formatter::LcovFormatter.config do |c|
c.output_directory = './coverage'
c.report_with_single_file = true
c.single_report_path = './coverage/lcov.info'
end
SimpleCov.start

$LOAD_PATH.unshift('lib', 'tests')
Dir.glob('./tests/*_test.rb') do |f|
require f
end
# $LOAD_PATH.unshift('lib', 'tests')
# Dir.glob('./tests/*_test.rb').sort.each do |f|
# require f
# end
end
35 changes: 19 additions & 16 deletions apt-spy2.gemspec
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
# frozen_string_literal: true

# require 'English'
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'apt/spy2/version'

Gem::Specification.new do |spec|
spec.name = "apt-spy2"
spec.name = 'apt-spy2'
spec.version = Apt::Spy2::VERSION
spec.authors = ["till"]
spec.email = ["[email protected]"]
spec.description = "Keep your /etc/apt/sources.list up to date"
spec.summary = "apt-spy2, or apt-spy for ubuntu"
spec.homepage = "https://github.com/lagged/apt-spy2"
spec.authors = ['till']
spec.email = ['[email protected]']
spec.description = 'Keep your /etc/apt/sources.list up to date'
spec.summary = 'apt-spy2, or apt-spy for ubuntu'
spec.homepage = 'https://github.com/lagged/apt-spy2'
spec.license = 'BSD-2-Clause'

spec.required_ruby_version = '>= 2.7', '< 3.3'

spec.files = `git ls-files`.split($/)
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
spec.require_paths = ['lib']

spec.add_dependency 'thor', '>= 0.18.1'
spec.add_dependency 'colored', '>= 1.2'
spec.add_dependency 'json'
spec.add_dependency 'nokogiri', '~> 1.14.1'
spec.add_dependency 'thor', '>= 0.18.1'

spec.add_development_dependency "bundler", "~> 2.0"
spec.add_development_dependency "rake"
spec.add_development_dependency "minitest", "~> 5.15.0"
spec.add_development_dependency "simplecov", "~> 0.18"
spec.add_development_dependency "simplecov-lcov", "~> 0.8.0"
spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'minitest', '~> 5.15.0'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'simplecov', '~> 0.18'
spec.add_development_dependency 'simplecov-lcov', '~> 0.8.0'
end
5 changes: 3 additions & 2 deletions bin/apt-spy2
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'apt/spy2'
require 'colored'
Expand All @@ -8,7 +9,7 @@ Encoding.default_internal = Encoding::UTF_8

begin
AptSpy2.start
rescue => the_error
puts the_error.to_s.white_on_red
rescue StandardError => e
puts e.to_s.white_on_red
exit 1
end
Loading

0 comments on commit 2413700

Please sign in to comment.