Commit d4a6db0
Changed files (12)
exe
lib
scim
kit
spec
bin/cibuild
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# script/cibuild: Setup environment for CI to run tests. This is primarily
+# designed to run on the continuous integration server.
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+echo [$(date "+%H:%M:%S")] "==> Started at…"
+
+# GC customizations
+export RUBY_GC_MALLOC_LIMIT=79000000
+export RUBY_GC_HEAP_INIT_SLOTS=800000
+export RUBY_HEAP_FREE_MIN=100000
+export RUBY_HEAP_SLOTS_INCREMENT=400000
+export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
+
+ruby -v
+gem install bundler --no-ri --no-rdoc --conservative
+bin/test
bin/console
@@ -1,7 +1,8 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
-require "bundler/setup"
-require "scim/kit"
+require 'bundler/setup'
+require 'saml/kit'
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "scim/kit"
# require "pry"
# Pry.start
-require "irb"
+require 'irb'
IRB.start(__FILE__)
bin/lint
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+[ -z "$DEBUG" ] || set -x
+
+echo [$(date "+%H:%M:%S")] "==> Running setup…"
+bin/setup
+
+echo [$(date "+%H:%M:%S")] "==> Running linters…"
+bundle exec rake lint
bin/setup
@@ -3,6 +3,4 @@ set -euo pipefail
IFS=$'\n\t'
set -vx
-bundle install
-
-# Do any other automated setup that you need to do here
+bundle check || bundle install --jobs $(nproc)
bin/test
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# script/test: Run test suite for application. Optionally pass in a path to an
+# individual test file to run a single test.
+
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+[ -z "$DEBUG" ] || set -x
+
+echo [$(date "+%H:%M:%S")] "==> Running setup…"
+bin/setup
+
+echo [$(date "+%H:%M:%S")] "==> Running tests…"
+bundle exec rake spec
exe/scim-kit
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require "scim/kit"
+require 'scim/kit'
lib/scim/kit/version.rb
@@ -1,5 +1,5 @@
module Scim
module Kit
- VERSION = "0.1.0"
+ VERSION = '0.1.0'.freeze
end
end
lib/scim/kit.rb
@@ -1,4 +1,4 @@
-require "scim/kit/version"
+require 'scim/kit/version'
module Scim
module Kit
spec/spec_helper.rb
@@ -1,9 +1,9 @@
-require "bundler/setup"
-require "scim/kit"
+require 'bundler/setup'
+require 'scim/kit'
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
+ config.example_status_persistence_file_path = '.rspec_status'
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
Gemfile
@@ -1,6 +1,6 @@
-source "https://rubygems.org"
+source 'https://rubygems.org'
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
+git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
# Specify your gem's dependencies in scim-kit.gemspec
gemspec
Rakefile
@@ -1,6 +1,13 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
+# frozen_string_literal: true
+
+require 'bundler/audit/task'
+require 'bundler/gem_tasks'
+require 'rspec/core/rake_task'
+require 'rubocop/rake_task'
RSpec::Core::RakeTask.new(:spec)
+RuboCop::RakeTask.new(:rubocop)
+Bundler::Audit::Task.new
-task :default => :spec
+task lint: [:rubocop, 'bundle:audit']
+task default: :spec
scim-kit.gemspec
@@ -1,29 +1,36 @@
-
-lib = File.expand_path("../lib", __FILE__)
+lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "scim/kit/version"
+require 'scim/kit/version'
Gem::Specification.new do |spec|
- spec.name = "scim-kit"
+ spec.name = 'scim-kit'
spec.version = Scim::Kit::VERSION
- spec.authors = ["mo"]
- spec.email = ["mo@mokhan.ca"]
+ spec.authors = ['mo']
+ spec.email = ['mo@mokhan.ca']
- spec.summary = %q{A SCIM library.}
- spec.description = %q{A SCIM library.}
- spec.homepage = "https://www.mokhan.ca/"
- spec.license = "MIT"
+ spec.summary = 'A SCIM library.'
+ spec.description = 'A SCIM library.'
+ spec.homepage = 'https://www.mokhan.ca/'
+ spec.license = 'MIT'
# Specify which files should be added to the gem when it is released.
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
+ # The `git ls-files -z` loads the files that have been added into git.
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
+ `git ls-files -z`.split("\x0").reject do |file|
+ file.match(%r{^(test|spec|features)/})
+ end
+ end
+ spec.bindir = 'exe'
+ spec.executables = spec.files.grep(%r{^exe/}) do |file|
+ File.basename(file)
end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
+ spec.require_paths = ['lib']
- spec.add_development_dependency "bundler", "~> 1.17"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rspec", "~> 3.0"
+ spec.add_development_dependency 'bundler', '~> 1.17'
+ spec.add_development_dependency 'bundler-audit', '~> 0.6'
+ spec.add_development_dependency 'ffaker', '~> 2.7'
+ spec.add_development_dependency 'rake', '~> 10.0'
+ spec.add_development_dependency 'rspec', '~> 3.0'
+ spec.add_development_dependency 'rubocop', '~> 0.52'
+ spec.add_development_dependency 'rubocop-rspec', '~> 1.22'
end