Skip to content
Merged
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
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
**/*~
*.rbc
doc/**/*
.yardoc
.bundle
lib/bibtex/parser.output
lib/bibtex/name_parser.output
coverage
.byebug_history

.DS_Store
.ruby-version

Gemfile.lock
pkg
3 changes: 0 additions & 3 deletions .yardopts

This file was deleted.

4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
source 'https://rubygems.org', cooldown: 7
gemspec

gem 'json', '~>2.0', platforms: :jruby

gem 'rdf', '~>3.0'
gem 'rdf-vocab', '~>3.0'

Expand All @@ -21,7 +19,6 @@ end

group :profile do
gem 'memory_profiler', platforms: [:mri]
gem 'ruby-prof', platforms: [:mri]
end

group :coverage do
Expand All @@ -34,5 +31,4 @@ group :development do
gem 'rubocop-minitest', '~> 0.41', require: false
gem 'rubocop-performance', '~> 1.27', require: false
gem 'rubocop-rake', '~> 0.7', require: false
gem 'yard'
end
77 changes: 7 additions & 70 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,79 +1,33 @@
# frozen_string_literal: true

require 'bundler'
begin
Bundler.setup
rescue Bundler::BundlerError => e
warn e.message
warn 'Run `bundle install` to install missing gems'
exit e.status_code
end

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), './lib'))

require 'bundler/gem_tasks'
require 'rake/clean'
require 'rake/testtask'
require 'cucumber/rake/task'

require 'bibtex/version'

require 'yard'
YARD::Rake::YardocTask.new

Rake::TestTask.new(:test_task) do |t|
Rake::TestTask.new(:test) do |t|
t.deps = [:racc]
t.libs << 'lib' << 'test'
t.test_files = FileList['test/**/test_*.rb']
# t.verbose = true
end

begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = ['--format progress']
end
rescue LoadError
desc 'Cucumber rake task not available'
task :features do
abort 'Cucumber rake task is not available. Please install cucumber as a gem or plugin'
end
end
Cucumber::Rake::Task.new(:features)

task default: %i[test features]

desc 'Generates the BibTeX parser'
task racc: ['lib/bibtex/parser.rb', 'lib/bibtex/name_parser.rb']

task test: %w[racc test_task]
task build: %w[clean racc]

file 'lib/bibtex/parser.output' => ['lib/bibtex/parser.rb']
file 'lib/bibtex/parser.rb' => ['lib/bibtex/bibtex.y'] do
# sh 'racc -v -g -o lib/bibtex/parser.rb lib/bibtex/bibtex.y'
sh 'bundle exec racc -F -l -o lib/bibtex/parser.rb lib/bibtex/bibtex.y'
end

file 'lib/bibtex/name_parser.rb' => ['lib/bibtex/names.y'] do
# sh 'racc -v -g -o lib/bibtex/name_parser.rb lib/bibtex/names.y'
sh 'bundle exec racc -F -l -o lib/bibtex/name_parser.rb lib/bibtex/names.y'
end

desc 'Run an IRB session with BibTeX-Ruby loaded'
task :console, [:script] do |_t, args|
ARGV.clear

require 'irb'
require 'bibtex'

IRB.conf[:SCRIPT] = args.script
IRB.start
end

desc 'Loads BibTeX-Ruby with warnings enabled and prints its version'
task :check_warnings do
$VERBOSE = true
require 'bibtex'

puts BibTeX::Version::STRING
end

desc 'Benchmarks speed and allocations (N=1000 ITERATIONS=5 WORKLOADS=a,b MEM=1 JSON=out.json COMPARE=base.json)'
task bench: ['racc'] do
sh Gem.ruby, '-W0', 'benchmark/run.rb'
Expand All @@ -99,25 +53,8 @@ namespace :bench do
end
end

desc 'Runs the profiler'
task profile: ['racc'] do
require File.expand_path('test/profile.rb', __dir__)
end

desc 'Builds the gem file'
task build: %w[clean racc] do
system 'gem build bibtex-ruby.gemspec'
end

desc 'Pushes the gem file to rubygems.org'
task release: ['build'] do
system %(git tag "#{BibTeX::Version::STRING}")
system 'git push --tags'
system "gem push bibtex-ruby-#{BibTeX::Version::STRING}.gem"
end

CLEAN.include('lib/bibtex/parser.rb')
CLEAN.include('lib/bibtex/parser.output')
CLEAN.include('lib/bibtex/name_parser.rb')
CLEAN.include('lib/bibtex/name_parser.output')
CLEAN.include('*.gem')
CLEAN.include('pkg')
1 change: 1 addition & 0 deletions cucumber.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default: --publish-quiet --format progress
30 changes: 0 additions & 30 deletions test/profile.rb

This file was deleted.

Loading