From bbf1c61aea298a9b3ccd2545d3a503ebe8797cc4 Mon Sep 17 00:00:00 2001 From: Joe Weakley Date: Fri, 6 Apr 2018 11:58:44 -0700 Subject: [PATCH] Updated documentation and add rubocop. --- Gemfile | 6 ++++-- Gemfile.lock | 20 ++++++++++++++++++++ README.md | 4 +++- Rakefile | 19 +++++++++++++------ syspro-ruby.gemspec | 41 +++++++++++++++++++++++------------------ 5 files changed, 63 insertions(+), 27 deletions(-) diff --git a/Gemfile b/Gemfile index d2fceab..b1ce43f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,7 @@ -source "https://rubygems.org" +# frozen_string_literal: true -git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } +source 'https://rubygems.org' + +git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } gemspec diff --git a/Gemfile.lock b/Gemfile.lock index e351129..e436223 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,20 +3,39 @@ PATH specs: syspro-ruby (0.1.0) faraday (~> 0.10) + nokogiri (~> 1.8.2) GEM remote: https://rubygems.org/ specs: + ast (2.4.0) coderay (1.1.2) faraday (0.14.0) multipart-post (>= 1.2, < 3) method_source (0.9.0) + mini_portile2 (2.3.0) minitest (5.11.3) multipart-post (2.0.0) + nokogiri (1.8.2) + mini_portile2 (~> 2.3.0) + parallel (1.12.1) + parser (2.5.0.5) + ast (~> 2.4.0) + powerpack (0.1.1) pry (0.11.3) coderay (~> 1.1.0) method_source (~> 0.9.0) + rainbow (3.0.0) rake (10.5.0) + rubocop (0.54.0) + parallel (~> 1.10) + parser (>= 2.5) + powerpack (~> 0.1) + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.9.0) + unicode-display_width (1.3.0) PLATFORMS ruby @@ -26,6 +45,7 @@ DEPENDENCIES minitest (~> 5.0) pry (~> 0.11) rake (~> 10.0) + rubocop (~> 0.54.0) syspro-ruby! BUNDLED WITH diff --git a/README.md b/README.md index 010eec6..8dc4375 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,8 @@ To install this gem onto your local machine, run `bundle exec rake install`. To ## Contributing +Run `bundle exec rake` and ensure everything looks good. + Bug reports and pull requests are welcome on GitHub at https://github.com/ike/syspro-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License @@ -185,4 +187,4 @@ The gem is available as open source under the terms of the [MIT License](https:/ ## Code of Conduct -Everyone interacting in the Syspro project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ike/syspro-ruby/blob/master/CODE_OF_CONDUCT.md). +Everyone interacting in the Syspro project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/wildland/code-of-conduct). diff --git a/Rakefile b/Rakefile index d433a1e..1ae4b59 100644 --- a/Rakefile +++ b/Rakefile @@ -1,10 +1,17 @@ -require "bundler/gem_tasks" -require "rake/testtask" +# frozen_string_literal: true + +require 'bundler/gem_tasks' +require 'rake/testtask' +require 'rubocop/rake_task' Rake::TestTask.new(:test) do |t| - t.libs << "test" - t.libs << "lib" - t.test_files = FileList["test/**/*_test.rb"] + t.libs << 'test' + t.libs << 'lib' + t.test_files = FileList['test/**/*_test.rb'] end -task :default => :test +task default: %i[test rubocop] + +RuboCop::RakeTask.new(:rubocop) do |t| + t.options = ['--display-cop-names'] +end diff --git a/syspro-ruby.gemspec b/syspro-ruby.gemspec index b63b0d8..fa30b5f 100644 --- a/syspro-ruby.gemspec +++ b/syspro-ruby.gemspec @@ -1,36 +1,41 @@ -lib = File.expand_path("../lib", __FILE__) +# frozen_string_literal: true + +lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "syspro/version" +require 'syspro/version' Gem::Specification.new do |spec| - spec.name = "syspro-ruby" + spec.name = 'syspro-ruby' spec.version = Syspro::VERSION - spec.authors = ["Isaac Lewis"] - spec.email = ["isaac@ike.io"] + spec.authors = ['Isaac Lewis'] + spec.email = ['isaac@ike.io'] - spec.summary = %q{SYSPRO 7 Api Ruby adapter} - spec.license = "MIT" + spec.summary = 'SYSPRO 7 Api Ruby adapter' + spec.license = 'MIT' # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' # to allow pushing to a single host or delete this section to allow pushing to any host. if spec.respond_to?(:metadata) - spec.metadata["allowed_push_host"] = "http://rubygems.org" + spec.metadata['allowed_push_host'] = 'http://rubygems.org' else - raise "RubyGems 2.0 or newer is required to protect against " \ - "public gem pushes." + raise 'RubyGems 2.0 or newer is required to protect against ' \ + 'public gem pushes.' end + spec.required_ruby_version = '>= 1.9.0' - spec.files = `git ls-files -z`.split("\x0").reject do |f| + spec.files = `git ls-files -z`.split("\x0").reject do |f| f.match(%r{^(test|spec|features)/}) end - spec.bindir = "exe" + spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] + spec.require_paths = ['lib'] - spec.add_dependency("faraday", "~> 0.10") + spec.add_dependency('faraday', '~> 0.10') + spec.add_dependency('nokogiri', '~> 1.8.2') - spec.add_development_dependency "bundler", "~> 1.16" - spec.add_development_dependency "pry", "~> 0.11" - spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "minitest", "~> 5.0" + spec.add_development_dependency 'bundler', '~> 1.16' + spec.add_development_dependency 'minitest', '~> 5.0' + spec.add_development_dependency 'pry', '~> 0.11' + spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rubocop', '~> 0.54.0' end -- libgit2 0.21.4