Hello community,
here is the log from the commit of package rubygem-launchy for openSUSE:Factory
checked in at 2020-05-11 13:41:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-launchy (Old)
and /work/SRC/openSUSE:Factory/.rubygem-launchy.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-launchy"
Mon May 11 13:41:23 2020 rev:8 rq:802342 version:2.5.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-launchy/rubygem-launchy.changes
2015-02-11 16:45:41.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-launchy.new.2738/rubygem-launchy.changes
2020-05-11 13:41:28.653135236 +0200
@@ -1,0 +2,14 @@
+Thu May 7 20:59:59 UTC 2020 - Stephan Kulow <[email protected]>
+
+- updated to version 2.5.0
+ see installed HISTORY.md
+
+ ## Version 2.5.0 - 2020-02-27
+ * Update depedencies
+ * Update minimum ruby level
+ * Move to `kde-open` on KDE -
<https://github.com/copiousfreetime/launchy/pull/105> - wstephenson
+ * Applied some grammer / spelling fixes -
<https://github.com/copiousfreetime/launchy/pull/130> - jeremymoritz
+ * `Pathname` instances do not raise exceptions when opening local files -
<https://github.com/copiousfreetime/launchy/issues/101> - dmke
+ * Add a fallback console browsers -
<https://github.com/copiousfreetime/launchy/issues/93> - trejkaz
+
+-------------------------------------------------------------------
Old:
----
launchy-2.4.3.gem
New:
----
launchy-2.5.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-launchy.spec ++++++
--- /var/tmp/diff_new_pack.oBQbYl/_old 2020-05-11 13:41:29.465136959 +0200
+++ /var/tmp/diff_new_pack.oBQbYl/_new 2020-05-11 13:41:29.469136967 +0200
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-launchy
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@@ -24,18 +24,18 @@
#
Name: rubygem-launchy
-Version: 2.4.3
+Version: 2.5.0
Release: 0
%define mod_name launchy
%define mod_full_name %{mod_name}-%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: %{ruby >= 2.4.0}
BuildRequires: %{rubygem gem2rpm}
BuildRequires: %{rubygem rdoc > 3.10}
-BuildRequires: %{ruby}
BuildRequires: ruby-macros >= 5
BuildRequires: update-alternatives
-Url: http://github.com/copiousfreetime/launchy
-Source: http://rubygems.org/gems/%{mod_full_name}.gem
+URL: http://github.com/copiousfreetime/launchy
+Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: gem2rpm.yml
Summary: Launchy is helper class for launching cross-platform
applications in
License: ISC
@@ -47,7 +47,7 @@
and forget manner. There are application concepts (browser, email client, etc)
that are common across all platforms, and they may be launched differently on
each platform. Launchy is here to make a common approach to launching external
-application from within ruby programs.
+applications from within ruby programs.
%prep
++++++ launchy-2.4.3.gem -> launchy-2.5.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CONTRIBUTING.md new/CONTRIBUTING.md
--- old/CONTRIBUTING.md 2014-11-03 03:44:35.000000000 +0100
+++ new/CONTRIBUTING.md 2020-02-28 03:55:22.000000000 +0100
@@ -27,9 +27,9 @@
* Fork the [repo][].
* Create a new branch for your issue: `git checkout -b issue/my-issue`
* Lovingly craft your contribution:
- * `rake develop` to get started, or if you prefer bundler `rake
develop:using_bundler && bundle`.
- * `rake test` to run tests
-* Make sure that `rake test` passes. It's important, I said it twice.
+ * `rake develop` to get started
+ * `bundle exec rake test` to run tests
+* Make sure that `bundle exec rake test` passes. It's important, I said it
twice.
* Add yourself to the contributors section below.
* Submit your [pull request][].
@@ -50,6 +50,7 @@
* [Cédric Félizard](https://github.com/infertux)
* [Daniel Farina](https://github.com/fdr)
* [Jack Turnbull](https://github.com/jackturnbull)
+* [Jeremy Moritz](https://github.com/jeremymoritz)
[GitHub Account]: https://github.com/signup/free "GitHub Signup"
[GitHub Issues]: https://github.com/copiousfreetime/launchy/issues "Launchy
Issues"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/HISTORY.md new/HISTORY.md
--- old/HISTORY.md 2014-11-03 03:44:35.000000000 +0100
+++ new/HISTORY.md 2020-02-28 03:55:22.000000000 +0100
@@ -1,5 +1,13 @@
# Launchy Changelog
+## Version 2.5.0 - 2020-02-27
+* Update depedencies
+* Update minimum ruby level
+* Move to `kde-open` on KDE -
<https://github.com/copiousfreetime/launchy/pull/105> - wstephenson
+* Applied some grammer / spelling fixes -
<https://github.com/copiousfreetime/launchy/pull/130> - jeremymoritz
+* `Pathname` instances do not raise exceptions when opening local files -
<https://github.com/copiousfreetime/launchy/issues/101> - dmke
+* Add a fallback console browsers -
<https://github.com/copiousfreetime/launchy/issues/93> - trejkaz
+
## Version 2.4.3 - 2014-11-03
* Update documentation - <https://github.com/copiousfreetime/launchy/pull/81>
- supremebeing7
* Fix launching of `exo-open` for XFCE -
<https://github.com/copiousfreetime/launchy/issues/82> - dsandstrom
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/LICENSE new/LICENSE
--- old/LICENSE 2014-11-03 03:44:35.000000000 +0100
+++ new/LICENSE 2020-02-28 03:55:22.000000000 +0100
@@ -1,6 +1,6 @@
ISC LICENSE - http://opensource.org/licenses/isc-license.txt
-Copyright (c) 2007-2013 Jeremy Hinegardner
+Copyright (c) 2007-2020 Jeremy Hinegardner
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2014-11-03 03:44:35.000000000 +0100
+++ new/README.md 2020-02-28 03:55:22.000000000 +0100
@@ -1,8 +1,10 @@
# launchy
+[](https://travis-ci.org/copiousfreetime/launchy)
+
+
* [Homepage](https://github.com/copiousfreetime/launchy)
* [Github Project](https://github.com/copiousfreetime/launchy)
-* email jeremy at hinegardner dot org
## DESCRIPTION
@@ -11,7 +13,7 @@
There are application concepts (browser, email client, etc) that are common
across all platforms, and they may be launched differently on each platform.
-Launchy is here to make a common approach to launching external application
from
+Launchy is here to make a common approach to launching external applications
from
within ruby programs.
## FEATURES
@@ -20,26 +22,55 @@
## SYNOPSIS
-You can use launchy on the commandline, within the Capybara and Rspec-rails
testing environment, or via its API.
+You can use launchy on the commandline, within the Capybara and Rspec-rails
+testing environment, or via its API.
### Commandline
% launchy http://www.ruby-lang.org/
-There are additional commandline options, use `launchy --help` to see them.
+There are additional command line options, use `launchy --help` to see them.
+
+### Using the `BROWSER` environment variable
+
+Launchy has a predefined set of common browsers on each platform that it
+attempts to use, and of course it is not exhaustive. As a fallbabck you can
make
+use of the somewhat standard `BROWSER` environment variable.
+
+`BROWSER` works in a similar same way to `PATH`. It is a colon (`:`) separated
+list of commands to try. You can also put in a `%s` in the command and the URL
+you are attempting to open will be substituted there.
+
+As an example if you set `BROWSER=/usr/local/bin/firefox-bin -new-tab
+'%s':/usr/local/bin/google-chrome-stable` and you call
+`Launchy.open("http://www.ruby-lang.org/")` then Launchy will try, in order:
+
+* `/usr/local/bin/firefox-bin -new-tab 'http://www.ruby-lang.org'`
+* `/usr/local/bin/google-chrome-stable http://www.ruby-lang.org`
+
+Additional links on the use of `BROWSER` as an environment variable.
+
+* http://www.catb.org/esr/BROWSER/index.html
+* https://help.ubuntu.com/community/EnvironmentVariables
+* https://wiki.archlinux.org/index.php/environment_variables
### Capybara Testing
-First, install [Capybara](https://github.com/jnicklas/capybara) and [Rspec for
Rails](https://github.com/rspec/rspec-rails). Capybara provides the following
method:
+First, install [Capybara](https://github.com/jnicklas/capybara) and [Rspec for
+Rails](https://github.com/rspec/rspec-rails). Capybara provides the following
+method:
save_and_open_page
-When inserted into your code at the place where you would like to open your
program, and when rspec is run, Capybara displays this message:
+When inserted into your code at the place where you would like to open your
+program, and when rspec is run, Capybara displays this message:
Page saved to
/home/code/my_app_name/tmp/capybara/capybara-current-date-and-time.html with
save_and_open_page.
Please install the launchy gem to open page automatically.
-With Launchy installed, when rspec is run again, it will launch an unstyled
instance of the specific page. It can be especially useful when debugging
errors in integration tests. For example:
+With Launchy installed, when rspec is run again, it will launch an unstyled
+instance of the specific page. It can be especially useful when debugging
errors
+in integration tests. For example:
context "signin" do
it "lets a user sign in" do
@@ -119,7 +150,7 @@
http://opensource.org/licenses/isc-license.txt
-Copyright (c) 2007-2013 Jeremy Hinegardner
+Copyright (c) 2007-2020 Jeremy Hinegardner
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Rakefile new/Rakefile
--- old/Rakefile 2014-11-03 03:44:35.000000000 +0100
+++ new/Rakefile 2020-02-28 03:55:22.000000000 +0100
@@ -7,19 +7,21 @@
This.homepage = "http://github.com/copiousfreetime/#{ This.name }"
This.ruby_gemspec do |spec|
- spec.add_dependency( 'addressable', '~> 2.3')
+ spec.add_dependency( 'addressable', '~> 2.7')
- spec.add_development_dependency( 'rake' , '~> 10.1')
- spec.add_development_dependency( 'minitest' , '~> 5.0' )
- spec.add_development_dependency( 'rdoc' , '~> 4.1' )
-
- spec.licenses = ['ISC']
-end
-
-This.java_gemspec( This.ruby_gemspec ) do |spec|
- spec.add_dependency( 'spoon', '~> 0.0.1' )
+ spec.add_development_dependency( 'rake' , '~> 13.0')
+ spec.add_development_dependency( 'minitest' , '~> 5.14' )
+ spec.add_development_dependency( 'rdoc' , '~> 6.2' )
+ spec.add_development_dependency( 'simplecov', '~> 0.18' )
spec.licenses = ['ISC']
+
+ spec.metadata = {
+ "bug_tracker_uri" => "https://github.com/copiousfreetime/launchy/issues",
+ "changelog_uri" =>
"https://github.com/copiousfreetime/launchy/blob/master/README.md",
+ "homepage_uri" => "https://github.com/copiousfreetime/launchy",
+ "source_code_uri" => "https://github.com/copiousfreetime/launchy",
+ }
end
load 'tasks/default.rake'
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/launchy/application.rb
new/lib/launchy/application.rb
--- old/lib/launchy/application.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/lib/launchy/application.rb 2020-02-28 03:55:22.000000000 +0100
@@ -27,7 +27,7 @@
#
# Find the given executable in the available paths
def find_executable( bin, *paths )
- paths = ENV['PATH'].split( File::PATH_SEPARATOR ) if paths.empty?
+ paths = Launchy.path.split( File::PATH_SEPARATOR ) if paths.empty?
paths.each do |path|
file = File.join( path, bin )
if File.executable?( file ) then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/launchy/detect/nix_desktop_environment.rb
new/lib/launchy/detect/nix_desktop_environment.rb
--- old/lib/launchy/detect/nix_desktop_environment.rb 2014-11-03
03:44:35.000000000 +0100
+++ new/lib/launchy/detect/nix_desktop_environment.rb 2020-02-28
03:55:22.000000000 +0100
@@ -19,7 +19,7 @@
end
def self.fallback_browsers
- %w[ firefox iceweasel seamonkey opera mozilla netscape galeon ].map {
|x| ::Launchy::Argv.new( x ) }
+ %w[ firefox iceweasel seamonkey opera mozilla netscape galeon links lynx
].map { |x| ::Launchy::Argv.new( x ) }
end
def self.browsers
@@ -32,11 +32,12 @@
class Kde < NixDesktopEnvironment
def self.is_current_desktop_environment?
- ENV['KDE_FULL_SESSION']
+ ENV['KDE_FULL_SESSION'] &&
+ Launchy::Application.find_executable( 'kde-open' )
end
def self.browser
- ::Launchy::Argv.new( %w[ kfmclient openURL ] )
+ ::Launchy::Argv.new( 'kde-open' )
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/launchy/detect/runner.rb
new/lib/launchy/detect/runner.rb
--- old/lib/launchy/detect/runner.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/lib/launchy/detect/runner.rb 2020-02-28 03:55:22.000000000 +0100
@@ -108,8 +108,8 @@
class Jruby < Runner
def wet_run( cmd, *args )
- require 'spoon'
- Spoon.spawnp( *shell_commands( cmd, *args ) )
+ child_pid = spawn( *shell_commands( cmd, *args ) )
+ Process.detach( child_pid )
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/launchy/version.rb new/lib/launchy/version.rb
--- old/lib/launchy/version.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/lib/launchy/version.rb 2020-02-28 03:55:22.000000000 +0100
@@ -1,5 +1,5 @@
module Launchy
- VERSION = "2.4.3"
+ VERSION = "2.5.0"
module Version
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/launchy.rb new/lib/launchy.rb
--- old/lib/launchy.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/lib/launchy.rb 2020-02-28 03:55:22.000000000 +0100
@@ -8,7 +8,8 @@
# The currently defined global options are:
#
# :debug Turn on debugging output
-# :application Explicitly state what application class is going to be used
+# :application Explicitly state what application class is going to be used.
+# This must be a child class of Launchy::Application
# :host_os Explicitly state what host operating system to pretend to be
# :ruby_engine Explicitly state what ruby engine to pretend to be under
# :dry_run Do nothing and print the command that would be executed on
$stdout
@@ -48,6 +49,7 @@
end
def string_to_uri( s )
+ s = s.to_s
uri = Addressable::URI.parse( s )
Launchy.log "URI parsing pass 1 : #{s} -> #{uri.to_hash}"
if not uri.scheme then
@@ -64,6 +66,7 @@
Launchy.host_os = nil
Launchy.ruby_engine = nil
Launchy.dry_run = false
+ Launchy.path = ENV['PATH']
end
def extract_global_options( options )
@@ -125,6 +128,14 @@
$stderr.puts "LAUNCHY_DEBUG: #{msg}" if Launchy.debug?
end
+ def path
+ @path
+ end
+
+ def path=(path)
+ @path = path
+ end
+
private
def to_bool( arg )
if arg.is_a? String
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2014-11-03 03:44:35.000000000 +0100
+++ new/metadata 2020-02-28 03:55:22.000000000 +0100
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: launchy
version: !ruby/object:Gem::Version
- version: 2.4.3
+ version: 2.5.0
platform: ruby
authors:
- Jeremy Hinegardner
autorequire:
bindir: bin
cert_chain: []
-date: 2014-11-03 00:00:00.000000000 Z
+date: 2020-02-28 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: addressable
@@ -16,61 +16,75 @@
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '2.3'
+ version: '2.7'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '2.3'
+ version: '2.7'
- !ruby/object:Gem::Dependency
name: rake
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '10.1'
+ version: '13.0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '10.1'
+ version: '13.0'
- !ruby/object:Gem::Dependency
name: minitest
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '5.0'
+ version: '5.14'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '5.0'
+ version: '5.14'
- !ruby/object:Gem::Dependency
name: rdoc
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '4.1'
+ version: '6.2'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '4.1'
+ version: '6.2'
+- !ruby/object:Gem::Dependency
+ name: simplecov
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - "~>"
+ - !ruby/object:Gem::Version
+ version: '0.18'
+ type: :development
+ prerelease: false
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - "~>"
+ - !ruby/object:Gem::Version
+ version: '0.18'
description: Launchy is helper class for launching cross-platform applications
in
a fire and forget manner. There are application concepts (browser, email
client,
etc) that are common across all platforms, and they may be launched
differently
on each platform. Launchy is here to make a common approach to launching
external
- application from within ruby programs.
+ applications from within ruby programs.
email: [email protected]
executables:
- launchy
@@ -122,7 +136,11 @@
homepage: http://github.com/copiousfreetime/launchy
licenses:
- ISC
-metadata: {}
+metadata:
+ bug_tracker_uri: https://github.com/copiousfreetime/launchy/issues
+ changelog_uri:
https://github.com/copiousfreetime/launchy/blob/master/README.md
+ homepage_uri: https://github.com/copiousfreetime/launchy
+ source_code_uri: https://github.com/copiousfreetime/launchy
post_install_message:
rdoc_options:
- "--main"
@@ -135,15 +153,14 @@
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '0'
+ version: 2.4.0
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubyforge_project:
-rubygems_version: 2.2.2
+rubygems_version: 3.0.3
signing_key:
specification_version: 4
summary: Launchy is helper class for launching cross-platform applications in
a fire
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/application_spec.rb new/spec/application_spec.rb
--- old/spec/application_spec.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/spec/application_spec.rb 2020-02-28 03:55:22.000000000 +0100
@@ -14,30 +14,30 @@
uri.scheme == "junk2"
end
end
- Launchy::Application.children.must_include( Junk2App )
+ _(Launchy::Application.children).must_include( Junk2App )
Launchy::Application.children.delete( Junk2App )
end
it "can find an app" do
- Launchy::Application.children.must_include( JunkApp )
- Launchy::Application.children.size.must_equal 3
+ _(Launchy::Application.children).must_include( JunkApp )
+ _(Launchy::Application.children.size).must_equal 3
uri = Addressable::URI.parse( "junk:///foo" )
- Launchy::Application.handling( uri ).must_equal( JunkApp )
+ _(Launchy::Application.handling( uri )).must_equal( JunkApp )
end
it "raises an error if an application cannot be found for the given scheme"
do
uri = Addressable::URI.parse( "foo:///bar" )
- lambda { Launchy::Application.handling( uri ) }.must_raise(
Launchy::ApplicationNotFoundError )
+ _(lambda { Launchy::Application.handling( uri ) }).must_raise(
Launchy::ApplicationNotFoundError )
end
it "can find open or curl or xdg-open" do
found = %w[ open curl xdg-open ].any? do |app|
Launchy::Application.find_executable( app )
end
- found.must_equal true
+ _(found).must_equal true
end
it "does not find xyzzy" do
- Launchy::Application.find_executable( "xyzzy" ).must_equal nil
+ _(Launchy::Application.find_executable( "xyzzy" )).must_be_nil
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/applications/browser_spec.rb
new/spec/applications/browser_spec.rb
--- old/spec/applications/browser_spec.rb 2014-11-03 03:44:35.000000000
+0100
+++ new/spec/applications/browser_spec.rb 2020-02-28 03:55:22.000000000
+0100
@@ -14,15 +14,22 @@
end
{ 'windows' => 'start "launchy" /b' ,
- 'darwin' => '/usr/bin/open',
+ 'darwin' => [ '/usr/bin/open', '/bin/open' ], # because running tests on
linux
'cygwin' => 'cmd /C start "launchy" /b',
-
- # when running these tests on a linux box, this test will fail
- 'linux' => nil }.each do |host_os, cmdline|
+ 'linux' => [nil, "xdg-open"], # because running tests on linux
+ }.each do |host_os, expected|
it "when host_os is '#{host_os}' the appropriate 'app_list' method is
called" do
Launchy.host_os = host_os
browser = Launchy::Application::Browser.new
- browser.app_list.first.must_equal cmdline
+
+ item = browser.app_list.first
+ item = item.to_s if item.kind_of?(::Launchy::Argv)
+ case expected
+ when Array
+ _(expected).must_include item
+ when String
+ _(item).must_equal expected
+ end
end
end
@@ -32,14 +39,14 @@
Launchy.host_os = host_os
browser = Launchy::Application::Browser.new
cmd, args = browser.cmd_and_args( @test_url )
- cmd.must_equal "my_special_browser --new-tab 'http://example.com/'"
- args.must_equal []
+ _(cmd).must_equal "my_special_browser --new-tab 'http://example.com/'"
+ _(args).must_equal []
end
end
it "handles a file on the file system when there is no file:// scheme" do
uri = Addressable::URI.parse( __FILE__ )
- Launchy::Application::Browser.handles?( uri ).must_equal true
+ _(Launchy::Application::Browser.handles?( uri )).must_equal true
end
it "handles the case where $BROWSER is set and no *nix desktop environment
is found" do
@@ -48,21 +55,24 @@
ENV['BROWSER'] = "do-this-instead"
Launchy.host_os = 'linux'
browser = Launchy::Application::Browser.new
- browser.browser_cmdline.must_equal "do-this-instead"
+ _(browser.browser_cmdline).must_equal "do-this-instead"
end
# NOTE: Unable to figure out how capture the stderr from the child which has
# moved it at least once. This test just serves the purpose of noting why
- # something happens, and the proble we are attempting to fix.
- it "When BROWSER is set to something that is not executable, error still
appears on stderr" do
- ENV['BROWSER'] = "not-an-app"
- url = "http://example.com/"
-
- _, err = capture_subprocess_io do
- Launchy.open( url )
- end
- #err.must_match( /wibble/m )
- err # something
- end
+ # something happens, and the problem we are attempting to fix.
+ #it "When BROWSER is set to something that is not executable, error still
appears on stderr" do
+ # ENV['BROWSER'] = "not-an-app"
+ # url = "http://example.com/"
+
+ # _, err = capture_subprocess_io do
+ # begin
+ # Launchy.open( url )
+ # rescue => nil
+ # end
+ # end
+ # #_(err).must_match( /wibble/m )
+ # err # something
+ #end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/cli_spec.rb new/spec/cli_spec.rb
--- old/spec/cli_spec.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/spec/cli_spec.rb 2020-02-28 03:55:22.000000000 +0100
@@ -21,9 +21,9 @@
begin
Launchy::Cli.new.run( argv, env )
rescue SystemExit => se
- se.status.must_equal exit_val
- $stderr.string.must_match stderr_regex if stderr_regex
- $stdout.string.must_match stdout_regex if stdout_regex
+ _(se.status).must_equal exit_val
+ _($stderr.string).must_match stderr_regex if stderr_regex
+ _($stdout.string).must_match stdout_regex if stdout_regex
end
end
@@ -47,14 +47,14 @@
l = Launchy::Cli.new
argv = %w[ --debug --dry-run http://github.com/copiousfreetime/launchy ]
l.parse( argv , {} )
- argv.size.must_equal 1
- argv[0].must_equal "http://github.com/copiousfreetime/launchy"
+ _(argv.size).must_equal 1
+ _(argv[0]).must_equal "http://github.com/copiousfreetime/launchy"
end
it "prints the command on stdout when using --dry-run" do
argv = %w[ --debug --dry-run http://github.com/copiousfreetime/launchy ]
Launchy::Cli.new.good_run( argv, {} )
- $stdout.string.must_match %r[github.com]
+ _($stdout.string).must_match %r[github.com]
end
{
@@ -65,10 +65,10 @@
argv = [ opt, val[1], "http://github.com/copiousfreetime/launchy" ]
l = Launchy::Cli.new
rc = l.parse( argv, {} )
- rc.must_equal true
- argv.size.must_equal 1
- argv[0].must_equal "http://github.com/copiousfreetime/launchy"
- l.options[val[0]].must_equal val[1]
+ _(rc).must_equal true
+ _(argv.size).must_equal 1
+ _(argv[0]).must_equal "http://github.com/copiousfreetime/launchy"
+ _(l.options[val[0]]).must_equal val[1]
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/detect/host_os_family_spec.rb
new/spec/detect/host_os_family_spec.rb
--- old/spec/detect/host_os_family_spec.rb 2014-11-03 03:44:35.000000000
+0100
+++ new/spec/detect/host_os_family_spec.rb 2020-02-28 03:55:22.000000000
+0100
@@ -13,7 +13,8 @@
YAML::load( IO.read( File.expand_path( "../../tattle-host-os.yaml", __FILE__
) ) )['host_os'].keys.sort.each do |os|
it "OS family of #{os} is detected" do
- Launchy::Detect::HostOsFamily.detect( os ).must_be_kind_of
Launchy::Detect::HostOsFamily
+ os_family = Launchy::Detect::HostOsFamily.detect( os )
+ _(os_family).must_be_kind_of Launchy::Detect::HostOsFamily
end
end
@@ -22,19 +23,20 @@
'linux' => :nix?,
'cygwin' => :cygwin? }.each_pair do |os, method|
it "#{method} returns true for #{os} " do
- Launchy::Detect::HostOsFamily.detect( os ).send( method ).must_equal true
+ r = Launchy::Detect::HostOsFamily.detect( os ).send( method )
+ _(r).must_equal true
end
end
it "uses the global host_os overrides" do
ENV['LAUNCHY_HOST_OS'] = "fake-os-2"
- lambda { Launchy::Detect::HostOsFamily.detect }.must_raise
Launchy::Detect::HostOsFamily::NotFoundError
+ _(lambda { Launchy::Detect::HostOsFamily.detect }).must_raise
Launchy::Detect::HostOsFamily::NotFoundError
ENV.delete('LAUNCHY_HOST_OS')
end
it "does not find an os of 'dos'" do
- lambda { Launchy::Detect::HostOsFamily.detect( 'dos' ) }.must_raise
Launchy::Detect::HostOsFamily::NotFoundError
+ _(lambda { Launchy::Detect::HostOsFamily.detect( 'dos' ) }).must_raise
Launchy::Detect::HostOsFamily::NotFoundError
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/detect/host_os_spec.rb
new/spec/detect/host_os_spec.rb
--- old/spec/detect/host_os_spec.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/spec/detect/host_os_spec.rb 2020-02-28 03:55:22.000000000 +0100
@@ -3,16 +3,16 @@
describe Launchy::Detect::HostOs do
it "uses the defult host os from ruby's config" do
- Launchy::Detect::HostOs.new.host_os.must_equal RbConfig::CONFIG['host_os']
+ _(Launchy::Detect::HostOs.new.host_os).must_equal
RbConfig::CONFIG['host_os']
end
it "uses the passed in value as the host os" do
- Launchy::Detect::HostOs.new( "fake-os-1").host_os.must_equal "fake-os-1"
+ _(Launchy::Detect::HostOs.new( "fake-os-1").host_os).must_equal "fake-os-1"
end
it "uses the environment variable LAUNCHY_HOST_OS to override ruby's config"
do
ENV['LAUNCHY_HOST_OS'] = "fake-os-2"
- Launchy::Detect::HostOs.new.host_os.must_equal "fake-os-2"
+ _(Launchy::Detect::HostOs.new.host_os).must_equal "fake-os-2"
ENV.delete('LAUNCHY_HOST_OS')
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/detect/nix_desktop_environment_spec.rb
new/spec/detect/nix_desktop_environment_spec.rb
--- old/spec/detect/nix_desktop_environment_spec.rb 2014-11-03
03:44:35.000000000 +0100
+++ new/spec/detect/nix_desktop_environment_spec.rb 2020-02-28
03:55:22.000000000 +0100
@@ -10,27 +10,18 @@
Launchy.reset_global_options
end
- it "can detect the desktop environment of a KDE machine using
ENV['KDE_FULL_SESSION']" do
- ENV.delete( "KDE_FULL_SESSION" )
- ENV["KDE_FULL_SESSION"] = "launchy-test"
- kde = Launchy::Detect::NixDesktopEnvironment::Kde
- nix_env = Launchy::Detect::NixDesktopEnvironment.detect
- nix_env.must_equal( kde )
- nix_env.browser.must_equal( kde.browser )
- ENV.delete( 'KDE_FULL_SESSION' )
- end
-
it "returns false for XFCE if xprop is not found" do
Launchy.host_os = "linux"
-
Launchy::Detect::NixDesktopEnvironment::Xfce.is_current_desktop_environment?.must_equal(
false )
+
_(Launchy::Detect::NixDesktopEnvironment::Xfce.is_current_desktop_environment?).must_equal(
false )
end
it "returns NotFound if it cannot determine the *nix desktop environment" do
Launchy.host_os = "linux"
ENV.delete( "KDE_FULL_SESSION" )
ENV.delete( "GNOME_DESKTOP_SESSION_ID" )
+ Launchy.path = %w[ / /tmp ].join(File::PATH_SEPARATOR)
not_found = Launchy::Detect::NixDesktopEnvironment.detect
- not_found.must_equal( Launchy::Detect::NixDesktopEnvironment::NotFound )
- not_found.browser.must_equal( Launchy::Argv.new )
+ _(not_found).must_equal( Launchy::Detect::NixDesktopEnvironment::NotFound )
+ _(not_found.browser).must_equal( Launchy::Argv.new )
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/detect/ruby_engine_spec.rb
new/spec/detect/ruby_engine_spec.rb
--- old/spec/detect/ruby_engine_spec.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/spec/detect/ruby_engine_spec.rb 2020-02-28 03:55:22.000000000 +0100
@@ -12,18 +12,18 @@
%w[ ruby jruby rbx macruby ].each do |ruby|
it "detects the #{ruby} RUBY_ENGINE" do
- Launchy::Detect::RubyEngine.detect( ruby ).ancestors.must_include
Launchy::Detect::RubyEngine
+ _(Launchy::Detect::RubyEngine.detect( ruby ).ancestors).must_include
Launchy::Detect::RubyEngine
end
end
it "uses the global ruby_engine overrides" do
ENV['LAUNCHY_RUBY_ENGINE'] = "rbx"
- Launchy::Detect::RubyEngine.detect.must_equal
Launchy::Detect::RubyEngine::Rbx
+ _(Launchy::Detect::RubyEngine.detect).must_equal
Launchy::Detect::RubyEngine::Rbx
ENV.delete('LAUNCHY_RUBY_ENGINE')
end
it "does not find a ruby engine of 'foo'" do
- lambda { Launchy::Detect::RubyEngine.detect( 'foo' ) }.must_raise
Launchy::Detect::RubyEngine::NotFoundError
+ _(lambda { Launchy::Detect::RubyEngine.detect( 'foo' ) }).must_raise
Launchy::Detect::RubyEngine::NotFoundError
end
{ 'rbx' => :rbx?,
@@ -31,7 +31,7 @@
'macruby' => :macruby?,
'jruby' => :jruby? }.each_pair do |engine, method|
it "#{method} returns true for #{engine} " do
- Launchy::Detect::RubyEngine.detect( engine ).send( method ).must_equal
true
+ _(Launchy::Detect::RubyEngine.detect( engine ).send( method
)).must_equal true
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/detect/runner_spec.rb
new/spec/detect/runner_spec.rb
--- old/spec/detect/runner_spec.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/spec/detect/runner_spec.rb 2020-02-28 03:55:22.000000000 +0100
@@ -13,17 +13,17 @@
it "raises an error when there is an unknown host os" do
Launchy.host_os = "foo"
- lambda{ Launchy::Detect::Runner.detect }.must_raise
Launchy::Detect::HostOsFamily::NotFoundError
+ _(lambda{ Launchy::Detect::Runner.detect }).must_raise
Launchy::Detect::HostOsFamily::NotFoundError
end
it "raises an error when there is an unknown ruby engine" do
Launchy.ruby_engine = "wibble"
- lambda{ Launchy::Detect::Runner.detect }.must_raise
Launchy::Detect::RubyEngine::NotFoundError
+ _(lambda{ Launchy::Detect::Runner.detect }).must_raise
Launchy::Detect::RubyEngine::NotFoundError
end
it "raises and error when there is no command found" do
runner = Launchy::Detect::Runner.detect
- lambda{ runner.run( nil, *%w[ arg1 arg2 arg 3] ) }.must_raise
Launchy::CommandNotFoundError
+ _(lambda{ runner.run( nil, *%w[ arg1 arg2 arg 3] ) }).must_raise
Launchy::CommandNotFoundError
end
# On anything that has fork, use Forkable
@@ -33,7 +33,7 @@
Launchy.host_os = host_os
Launchy.ruby_engine = engine_name
engine = Launchy::Detect::Runner.detect
- engine.must_be_instance_of Launchy::Detect::Runner::Forkable
+ _(engine).must_be_instance_of Launchy::Detect::Runner::Forkable
end
end
end
@@ -48,7 +48,7 @@
Launchy.host_os = host_os
Launchy.ruby_engine = 'jruby'
engine = Launchy::Detect::Runner.detect
- engine.must_be_instance_of runner
+ _(engine).must_be_instance_of runner
end
end
@@ -58,14 +58,14 @@
Launchy.host_os = "mingw"
Launchy.ruby_engine = engine_name
e = Launchy::Detect::Runner.detect
- e.must_be_instance_of Launchy::Detect::Runner::Windows
+ _(e).must_be_instance_of Launchy::Detect::Runner::Windows
end
end
it "Windows launches use the 'cmd' command" do
win = Launchy::Detect::Runner::Windows.new
cmd = win.dry_run( "not-really", [ "http://example.com" ] )
- cmd.must_equal 'cmd /c not-really http://example.com'
+ _(cmd).must_equal 'cmd /c not-really http://example.com'
end
%w[ & | ( ) < > ^ ].each do |reserved_char|
@@ -75,29 +75,29 @@
url = parts.join( reserved_char )
output_url = parts.join( "^#{reserved_char}" )
- win.all_args( "not-really", [ url ] ).must_equal [ 'cmd', '/c',
'not-really', output_url ]
+ _(win.all_args( "not-really", [ url ] )).must_equal [ 'cmd', '/c',
'not-really', output_url ]
cmd = win.dry_run( "not-really", [ url ] )
- cmd.must_equal "cmd /c not-really #{output_url}"
+ _(cmd).must_equal "cmd /c not-really #{output_url}"
end
end
it "Jruby doesnot escapes '&' in urls" do
jruby = Launchy::Detect::Runner::Jruby.new
cmd = jruby.dry_run( "not-really", [ @test_url ])
- cmd.must_equal 'not-really http://example.com/?foo=bar&baz=wibble'
+ _(cmd).must_equal 'not-really http://example.com/?foo=bar&baz=wibble'
end
it "does not escape %38 items in urls" do
l = Launchy::Detect::Runner::Forkable.new
cmd = l.dry_run( "not-really", [ "http://ja.wikipedia.org/wiki/%E3%81%82"
] )
- cmd.must_equal( 'not-really http://ja.wikipedia.org/wiki/%E3%81%82' )
+ _(cmd).must_equal( 'not-really http://ja.wikipedia.org/wiki/%E3%81%82' )
end
it "can launch a utf8 url" do
url = "http://ja.wikipedia.org/wiki/あ"
l = Launchy::Detect::Runner::Forkable.new
cmd = l.dry_run( "not-really", [ url ] )
- cmd.must_equal( "not-really #{url}" )
+ _(cmd).must_equal( "not-really #{url}" )
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/launchy_spec.rb new/spec/launchy_spec.rb
--- old/spec/launchy_spec.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/spec/launchy_spec.rb 2020-02-28 03:55:22.000000000 +0100
@@ -1,4 +1,5 @@
require 'spec_helper'
+require 'pathname'
describe Launchy do
@@ -22,7 +23,7 @@
old_stderr = $stderr
$stderr = StringIO.new
Launchy.log "This is a test log message"
- $stderr.string.strip.must_equal "LAUNCHY_DEBUG: This is a test log message"
+ _($stderr.string.strip).must_equal "LAUNCHY_DEBUG: This is a test log
message"
$stderr = old_stderr
ENV["LAUNCHY_DEBUG"] = nil
end
@@ -30,81 +31,89 @@
it "sets the global option :dry_run to true if LAUNCHY_DRY_RUN environment
variable is 'true'" do
ENV['LAUNCHY_DRY_RUN'] = 'true'
Launchy.extract_global_options({})
- Launchy.dry_run?.must_equal true
+ _(Launchy.dry_run?).must_equal true
ENV['LAUNCHY_DRY_RUN'] = nil
end
it "sets the global option :debug to true if LAUNCHY_DEBUG environment
variable is 'true'" do
ENV['LAUNCHY_DEBUG'] = 'true'
Launchy.extract_global_options({})
- Launchy.debug?.must_equal true
+ _(Launchy.debug?).must_equal true
ENV['LAUNCHY_DEBUG'] = nil
end
it "has the global option :debug" do
Launchy.extract_global_options( { :debug => 'true' } )
- Launchy.debug?.must_equal true
+ _(Launchy.debug?).must_equal true
Launchy.extract_global_options( { :debug => true } )
- Launchy.debug?.must_equal true
+ _(Launchy.debug?).must_equal true
end
it "has the global option :dry_run" do
Launchy.extract_global_options( { :dry_run => 'true' } )
- Launchy.dry_run?.must_equal true
+ _(Launchy.dry_run?).must_equal true
Launchy.extract_global_options( { :dry_run => true } )
- Launchy.dry_run?.must_equal true
+ _(Launchy.dry_run?).must_equal true
end
it "has the global option :application" do
Launchy.extract_global_options( { :application => "wibble" } )
- Launchy.application.must_equal 'wibble'
+ _(Launchy.application).must_equal 'wibble'
end
it "has the global option :host_os" do
Launchy.extract_global_options( { :host_os => "my-special-os-v2" } )
- Launchy.host_os.must_equal 'my-special-os-v2'
+ _(Launchy.host_os).must_equal 'my-special-os-v2'
end
it "has the global option :ruby_engine" do
Launchy.extract_global_options( { :ruby_engine => "myruby" } )
- Launchy.ruby_engine.must_equal 'myruby'
+ _(Launchy.ruby_engine).must_equal 'myruby'
end
it "raises an exception if no scheme is found for the given uri" do
- lambda { Launchy.open( @invalid_url ) }.must_raise
Launchy::ApplicationNotFoundError
+ _(lambda { Launchy.open( @invalid_url ) }).must_raise
Launchy::ApplicationNotFoundError
end
it "asssumes we open a local file if we have an exception if we have an
invalid scheme and a valid path" do
uri = "blah://example.com/#{__FILE__}"
Launchy.open( uri , :dry_run => true )
- $stdout.string.strip.must_equal "/usr/bin/open #{uri}"
+ parts = $stdout.string.strip.split
+ _(parts.size).must_be :>, 1
+ _(parts.last).must_equal uri
end
it "opens a local file if we have a drive letter and a valid path on
windows" do
uri = "C:#{__FILE__}"
Launchy.open( uri, :dry_run => true, :host_os => 'windows' )
- $stdout.string.strip.must_equal 'cmd /c start "launchy" /b ' + uri
+ _($stdout.string.strip).must_equal 'cmd /c start "launchy" /b ' + uri
end
it "calls the block if instead of raising an exception if there is an error"
do
Launchy.open( @invalid_url ) { $stderr.puts "oops had an error opening
#{@invalid_url}" }
- $stderr.string.strip.must_equal "oops had an error opening #{@invalid_url}"
+ _($stderr.string.strip).must_equal "oops had an error opening
#{@invalid_url}"
end
it "calls the block with the values passed to launchy and the error" do
options = { :dry_run => true }
Launchy.open( @invalid_url, :dry_run => true ) { |e| $stderr.puts "had an
error opening #{@invalid_url} with options #{options}: #{e}" }
- $stderr.string.strip.must_equal "had an error opening #{@invalid_url} with
options #{options}: No application found to handle '#{@invalid_url}'"
+ _($stderr.string.strip).must_equal "had an error opening #{@invalid_url}
with options #{options}: No application found to handle '#{@invalid_url}'"
end
it "raises the error in the called block" do
- lambda { Launchy.open( @invalid_url ) { raise StandardError, "KABOOM!" }
}.must_raise StandardError
+ _(lambda { Launchy.open( @invalid_url ) { raise StandardError, "KABOOM!" }
}).must_raise StandardError
end
[ 'www.example.com', 'www.example.com/foo/bar', "C:#{__FILE__}" ].each do |x|
it "picks a Browser for #{x}" do
app = Launchy.app_for_uri_string( x )
- app.must_equal( Launchy::Application::Browser )
+ _(app).must_equal( Launchy::Application::Browser )
end
end
+
+ it "can use a Pathname as the URI" do
+ path = Pathname.new( Dir.pwd )
+ app = Launchy.app_for_uri_string( path )
+ _(app).must_equal( Launchy::Application::Browser )
+ end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/version_spec.rb new/spec/version_spec.rb
--- old/spec/version_spec.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/spec/version_spec.rb 2020-02-28 03:55:22.000000000 +0100
@@ -2,10 +2,10 @@
describe 'Launchy::VERSION' do
it "should have a #.#.# format" do
- Launchy::VERSION.must_match( /\d+\.\d+\.\d+/ )
- Launchy::Version.to_s.must_match( /\d+\.\d+\.\d+/ )
+ _(Launchy::VERSION).must_match( /\d+\.\d+\.\d+/ )
+ _(Launchy::Version.to_s).must_match( /\d+\.\d+\.\d+/ )
Launchy::Version.to_a.each do |n|
- n.to_i.must_be :>=, 0
+ _(n.to_i).must_be :>=, 0
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tasks/default.rake new/tasks/default.rake
--- old/tasks/default.rake 2014-11-03 03:44:35.000000000 +0100
+++ new/tasks/default.rake 2020-02-28 03:55:22.000000000 +0100
@@ -10,41 +10,26 @@
# Install all the development and runtime dependencies of this gem using the
# gemspec.
- task :default do
+ task :default => 'Gemfile' do
require 'rubygems/dependency_installer'
installer = ::Gem::DependencyInstaller.new
-
- This.set_coverage_gem
-
- puts "Installing gem depedencies needed for development"
- This.platform_gemspec.dependencies.each do |dep|
- if dep.matching_specs.empty? then
- puts "Installing : #{dep}"
- installer.install dep
- else
- puts "Skipping : #{dep} -> already installed
#{dep.matching_specs.first.full_name}"
- end
- end
+ puts "Installing bundler..."
+ installer.install 'bundler'
+ sh 'bundle install'
puts "\n\nNow run 'rake test'"
end
# Create a Gemfile that just references the gemspec
file 'Gemfile' => :gemspec do
File.open( "Gemfile", "w+" ) do |f|
- f.puts 'source "https://rubygems.org/"'
+ f.puts "# DO NOT EDIT - This file is automatically generated"
+ f.puts "# Make changes to Manifest.txt and/or Rakefile and regenerate"
+ f.puts 'source "https://rubygems.org"'
f.puts 'gemspec'
end
end
-
- desc "Create a bundler Gemfile"
- task :using_bundler => 'Gemfile' do
- puts "Now you can 'bundle'"
- end
-
- # Gemfiles are build artifacts
- CLOBBER << FileList['Gemfile*']
end
-desc "Boostrap development"
+desc "Bootstrap development"
task :develop => "develop:default"
#------------------------------------------------------------------------------
@@ -53,7 +38,7 @@
begin
require 'rake/testtask'
Rake::TestTask.new( :test ) do |t|
- t.ruby_opts = %w[ -w -rubygems ]
+ t.ruby_opts = %w[ -w ]
t.libs = %w[ lib spec test ]
t.pattern = "{test,spec}/**/{test_*,*_spec}.rb"
end
@@ -88,31 +73,16 @@
# Coverage - optional code coverage, rcov for 1.8 and simplecov for 1.9, so
# for the moment only rcov is listed.
#------------------------------------------------------------------------------
-if RUBY_VERSION < "1.9.0"
- begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new( 'coverage' ) do |t|
- t.libs << 'spec'
- t.pattern = 'spec/**/*_spec.rb'
- t.verbose = true
- t.rcov_opts << "-x ^/" # remove all the global files
- t.rcov_opts << "--sort coverage" # so we see the worst files at the top
- end
- rescue LoadError
- This.task_warning( 'rcov' )
- end
-else
- begin
- require 'simplecov'
- desc 'Run tests with code coverage'
- task :coverage do
- ENV['COVERAGE'] = 'true'
- Rake::Task[:test].execute
- end
- CLOBBER << FileList["coverage"]
- rescue LoadError
- This.task_warning( 'simplecov' )
+begin
+ require 'simplecov'
+ desc 'Run tests with code coverage'
+ task :coverage do
+ ENV['COVERAGE'] = 'true'
+ Rake::Task[:test].execute
end
+ CLOBBER << 'coverage' if File.directory?( 'coverage' )
+rescue LoadError
+ This.task_warning( 'simplecov' )
end
#------------------------------------------------------------------------------
@@ -177,9 +147,10 @@
end
def outdated_fixme_files
- local_fixme_files.reject do |local|
+ local_fixme_files.select do |local|
upstream = fixme_project_path( local )
- Digest::SHA256.file( local ) == Digest::SHA256.file( upstream )
+ upstream.exist? &&
+ ( Digest::SHA256.file( local ) != Digest::SHA256.file( upstream ) )
end
end
@@ -223,13 +194,12 @@
desc "Build the #{This.name}.gemspec file"
task :gemspec do
File.open( This.gemspec_file, "wb+" ) do |f|
+ f.puts "# DO NOT EDIT - This file is automatically generated"
+ f.puts "# Make changes to Manifest.txt and/or Rakefile and regenerate"
f.write This.platform_gemspec.to_ruby
end
end
-# the gemspec is also a dev artifact and should not be kept around.
-CLOBBER << This.gemspec_file.to_s
-
# .rbc files from ruby 2.0
CLOBBER << FileList["**/*.rbc"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tasks/this.rb new/tasks/this.rb
--- old/tasks/this.rb 2014-11-03 03:44:35.000000000 +0100
+++ new/tasks/this.rb 2020-02-28 03:55:22.000000000 +0100
@@ -13,7 +13,7 @@
attr_accessor :email
# The homepage of this project
- attr_accessor :homepage
+ attr_accessor :homepage
# The regex of files to exclude from the manifest
attr_accessor :exclude_from_manifest
@@ -25,7 +25,11 @@
#
# Yields self
def initialize(&block)
- @exclude_from_manifest =
%r/\.(git|DS_Store)|^(doc|coverage|pkg|tmp|Gemfile(\.lock)?)|^[^\/]+\.gemspec|\.(swp|jar|bundle|so|rvmrc)$|~$/
+ @exclude_from_manifest = Regexp.union(/\.(git|DS_Store)/,
+
/^(doc|coverage|pkg|tmp|Gemfile(\.lock)?)/,
+ /^[^\/]+\.gemspec/,
+
/\.(swp|jar|bundle|so|rvmrc|travis.yml|byebug_history)$/,
+ /~$/)
@gemspecs = Hash.new
yield self if block_given?
end
@@ -119,7 +123,7 @@
# Internal: Returns the gemspace associated with the current ruby platform
def platform_gemspec
- gemspecs[platform]
+ gemspecs.fetch(platform) { This.ruby_gemspec }
end
def core_gemspec
@@ -132,6 +136,7 @@
spec.summary = summary
spec.description = description
+ spec.license = license
spec.files = manifest
spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
@@ -140,6 +145,8 @@
spec.extra_rdoc_files += spec.files.grep(/(txt|rdoc|md)$/)
spec.rdoc_options = [ "--main" , 'README.md',
"--markup", "tomdoc" ]
+
+ spec.required_ruby_version = '>= 2.4.0'
end
end
@@ -166,20 +173,6 @@
return spec
end
- # Internal: Set the recovery gem development dependency
- #
- # These are dynamically set since they cannot be hard coded as there is
- # no way to ship them correctly in the gemspec
- #
- # Returns nothing.
- def set_coverage_gem
- if RUBY_VERSION < "1.9.0"
- platform_gemspec.add_development_dependency( 'rcov', '~> 1.0.0' )
- else
- platform_gemspec.add_development_dependency( 'simplecov', '~> 0.8' )
- end
- end
-
# Internal: Return the platform of ThisProject at the current moment in time.
def platform
(RUBY_PLATFORM == "java") ? 'java' : Gem::Platform::RUBY
@@ -189,17 +182,23 @@
def description_section
section_of( 'README.md', 'DESCRIPTION')
end
-
- # Internal: Return the summary text from the README
+
+ # Internal: Return the summary text from the README
def summary
description_section.first
end
- # Internal: Return the full description text from the READEM
+ # Internal: Return the full description text from the README
def description
description_section.join(" ").tr("\n", '
').gsub(/[{}]/,'').gsub(/\[[^\]]+\]/,'') # strip rdoc
end
+ def license
+ license_file = project_path("LICENSE")
+ line = license_file.readlines.first
+ line.split(/\s+/).first
+ end
+
# Internal: The path to the gemspec file
def gemspec_file
project_path( "#{ name }.gemspec" )