From 57d4964164ac6c2216179db7a7cd71a8c32e1cbd Mon Sep 17 00:00:00 2001 From: Peter Boling Date: Sun, 11 Dec 2022 22:21:19 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9E=95=20Switch=20from=20autotest=20to=20gua?= =?UTF-8?q?rd-rspec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove autotest junk --- .autotest | 14 -------------- .document | 5 ----- Gemfile.lock | 35 +++++++++++++++++++++++++++++++++++ Guardfile | 18 ++++++++++++++++++ README.md | 21 ++++++++++++++++++++- Rakefile | 28 ---------------------------- VERSION | 1 - autotest/discover.rb | 1 - os.gemspec | 15 +-------------- 9 files changed, 74 insertions(+), 64 deletions(-) delete mode 100644 .autotest delete mode 100644 .document create mode 100644 Guardfile delete mode 100644 VERSION delete mode 100644 autotest/discover.rb diff --git a/.autotest b/.autotest deleted file mode 100644 index c183961..0000000 --- a/.autotest +++ /dev/null @@ -1,14 +0,0 @@ -# autotest config for rspec -# see: https://github.com/rspec/rspec/wiki/autotest -Autotest.add_hook(:initialize) {|at| - at.add_exception %r{^\.git} # ignore Version Control System - at.add_exception %r{^pkg} # ignore gem pkg dir - # at.add_exception %r{^./tmp} # ignore temp files, lest autotest will run again, and again... - # at.clear_mappings # take out the default (test/test*rb) - ## include specs - at.add_mapping(%r{^lib/.*\.rb$}) {|f, _| - Dir['spec/**/*_spec.rb'] - } - nil -} - diff --git a/.document b/.document deleted file mode 100644 index ecf3673..0000000 --- a/.document +++ /dev/null @@ -1,5 +0,0 @@ -README.rdoc -lib/**/*.rb -bin/* -features/**/*.feature -LICENSE diff --git a/Gemfile.lock b/Gemfile.lock index 2e6efd0..935aa3a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,9 +6,41 @@ PATH GEM remote: http://rubygems.org/ specs: + coderay (1.1.3) diff-lcs (1.5.0) + ffi (1.15.5) + formatador (1.1.0) + guard (2.18.0) + formatador (>= 0.2.4) + listen (>= 2.7, < 4.0) + lumberjack (>= 1.0.12, < 2.0) + nenv (~> 0.1) + notiffany (~> 0.0) + pry (>= 0.13.0) + shellany (~> 0.0) + thor (>= 0.18.1) + guard-compat (1.2.1) + guard-rspec (4.7.3) + guard (~> 2.1) + guard-compat (~> 1.1) + rspec (>= 2.99.0, < 4.0) + listen (3.7.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + lumberjack (1.2.8) + method_source (1.0.0) + nenv (0.3.0) + notiffany (0.1.3) + nenv (~> 0.1) + shellany (~> 0.0) power_assert (2.0.2) + pry (0.14.1) + coderay (~> 1.1) + method_source (~> 1.0) rake (10.5.0) + rb-fsevent (0.11.2) + rb-inotify (0.10.1) + ffi (~> 1.0) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -22,13 +54,16 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-support (3.12.0) + shellany (0.0.1) test-unit (3.5.5) power_assert + thor (1.2.1) PLATFORMS x86_64-darwin-19 DEPENDENCIES + guard-rspec (~> 4.7) os! rake (~> 10.5) rspec (~> 3.12) diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..db914c1 --- /dev/null +++ b/Guardfile @@ -0,0 +1,18 @@ +# More info at https://github.com/guard/guard#readme + +guard :rspec, cmd: "bundle exec rspec" do + require "guard/rspec/dsl" + dsl = Guard::RSpec::Dsl.new(self) + + # Feel free to open issues for suggestions and improvements + + # RSpec files + rspec = dsl.rspec + watch(rspec.spec_helper) { rspec.spec_dir } + watch(rspec.spec_support) { "#{rspec.spec_dir}/config" } + watch(rspec.spec_files) + + # Ruby files + ruby = dsl.ruby + dsl.watch_spec_files_for(ruby.lib_files) +end diff --git a/README.md b/README.md index aea9a01..5964d09 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ The OS gem allows for some easy telling if you're on windows or not. +## Install + +```shell +bundle add os +``` + +## Usage + ```ruby require 'os' @@ -80,7 +88,7 @@ If there are any other features you'd like, let me know, I'll do what I can to a http://github.com/rdp/os for feedback et al -Related projects: +## Alternatives rubygems: @@ -104,4 +112,15 @@ the ["platform" gem](http://rubydoc.info/github/ffi/ffi/master/FFI/Platform), it FFI::Platform::OS ``` +## Contributing + +Develop locally: + +```shell +bundle install +bundle exec guard +``` + +## License + License: MIT (see LICENSE file) diff --git a/Rakefile b/Rakefile index b0200bf..b537520 100644 --- a/Rakefile +++ b/Rakefile @@ -1,33 +1,5 @@ require 'rubygems' if RUBY_VERSION < '1.9.0' -# HOW TO DEPLOY -# bump VERSION file manually -# rake release -# Don't forget to run rake gemspec with each release! ... I think...or rake release might be same thing -# then manually edit os.gemspec remove duplicatee rspecs, circular dependency on os? HUH? -# # then gem build os.gemspec -# rake build doesn't work??? -# sooo... -# ...gem push os-1.1.2.gem - -begin - require 'jeweler' - Jeweler::Tasks.new do |gem| - gem.name = "os" - gem.summary = %Q{Simple and easy way to know if you're on windows or not (reliably), as well as how many bits the OS is, etc.} - gem.description = %Q{The OS gem allows for some useful and easy functions, like OS.windows? (=> true or false) OS.bits ( => 32 or 64) etc"} - gem.email = "rogerpack2005@gmail.com" - gem.homepage = "https://github.com/rdp/os" - gem.authors = ["rdp", "David McCullars"] - gem.license = "MIT" - # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings - # gem.add_development_dependency "fast_require" - # gem.add_development_dependency "rspec", ">= 2.0" - end -rescue LoadError => e - puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler #{e}" -end - require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) task :default => :spec diff --git a/VERSION b/VERSION deleted file mode 100644 index 65087b4..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.1.4 diff --git a/autotest/discover.rb b/autotest/discover.rb deleted file mode 100644 index cd6892c..0000000 --- a/autotest/discover.rb +++ /dev/null @@ -1 +0,0 @@ -Autotest.add_discovery { "rspec2" } diff --git a/os.gemspec b/os.gemspec index 269517c..6c2cdd6 100644 --- a/os.gemspec +++ b/os.gemspec @@ -14,28 +14,14 @@ Gem::Specification.new do |s| s.date = "2021-11-07" s.description = "The OS gem allows for some useful and easy functions, like OS.windows? (=> true or false) OS.bits ( => 32 or 64) etc\"".freeze s.email = "rogerpack2005@gmail.com".freeze - s.extra_rdoc_files = [ - "ChangeLog", - "LICENSE", - "README.md" - ] s.files = [ - ".autotest", - ".document", "ChangeLog", "Gemfile", - "Gemfile.lock", "LICENSE", "README.md", "Rakefile", - "VERSION", - "autotest/discover.rb", "lib/os.rb", "os.gemspec", - "spec/linux_spec.rb", - "spec/os_spec.rb", - "spec/osx_spec.rb", - "spec/spec_helper.rb" ] s.homepage = "https://github.com/rdp/os".freeze s.licenses = ["MIT".freeze] @@ -45,4 +31,5 @@ Gem::Specification.new do |s| s.add_development_dependency(%q.freeze, ["~> 10.5"]) s.add_development_dependency(%q.freeze, ["~> 3.5"]) s.add_development_dependency(%q.freeze, ["~> 3.12"]) + s.add_development_dependency(%q.freeze, ["~> 4.7"]) end