launchy 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CONTRIBUTING.md +8 -8
- data/{HISTORY.rdoc → HISTORY.md} +34 -29
- data/Manifest.txt +2 -2
- data/{README.rdoc → README.md} +38 -24
- data/lib/launchy.rb +20 -10
- data/lib/launchy/applications/browser.rb +1 -1
- data/lib/launchy/cli.rb +1 -3
- data/lib/launchy/version.rb +1 -1
- data/spec/launchy_spec.rb +21 -1
- data/tasks/default.rake +69 -11
- data/tasks/this.rb +14 -7
- metadata +11 -20
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NDc4OTYyY2FlMDJjZGIzM2Q2Zjg3MWI4MDdlMjg1MzU4Zjc5ZmI1OA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZjJjMDQ3ZmFmNDE3NDNmZWY4NWUwZGM3M2Y3NGJkYmZmMWFkYWIxMw==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YmY4YTlhMmEyMWRjZTA0OTRjYTZiNTNlMDFmN2Q0NDY3NjMxOTI0NmFmMmQ3
|
10
|
+
YzMyY2NiODRkZjFjZGQzMTE0YzUxODc5ZGQ1OWNiYTc4MmY2MzgzMmQyYjNm
|
11
|
+
MTQ0M2Y1ZjZkZGRiMjY3OThkOTlkZGRmNmVjM2M0NzI2OTkyODA=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OWM0ZTI2YTk4NzMxZjg4ZGI1YWQ5NzVmMDg0MzExNjM3ZjI0ODI5OGViY2My
|
14
|
+
NDFmNjkzMzdmYTdhZDAxMjFmZWRiYzE5MzYyYTc5NzdhM2FmYzYxMDFkYmNi
|
15
|
+
MGI3YmFiOWE2ZGVlODViOGNhODEzY2VlZmFhZWUzNjNmMzA3YTg=
|
data/CONTRIBUTING.md
CHANGED
@@ -35,14 +35,14 @@ easiest way to contribute.
|
|
35
35
|
|
36
36
|
# Contributors
|
37
37
|
|
38
|
-
* [Jeremy Hinegardner]
|
39
|
-
* [Mike Farmer]
|
40
|
-
* [Suraj N. Kurapati]
|
41
|
-
* [Postmodern]
|
42
|
-
* [Stephen Judkins]
|
43
|
-
* [Mariusz Pietrzyk]
|
44
|
-
* [Bogdan Gusiev]
|
45
|
-
* [Miquel Rodríguez Telep]
|
38
|
+
* [Jeremy Hinegardner](https://github.com/copiousfreetime)
|
39
|
+
* [Mike Farmer](https://github.com/mikefarmer)
|
40
|
+
* [Suraj N. Kurapati](https://github.com/sunaku)
|
41
|
+
* [Postmodern](https://github.com/postmodern)
|
42
|
+
* [Stephen Judkins](https://github.com/stephenjudkins)
|
43
|
+
* [Mariusz Pietrzyk](https://github.com/wijet)
|
44
|
+
* [Bogdan Gusiev](https://github.com/bogdan)
|
45
|
+
* [Miquel Rodríguez Telep](https://github.com/mrtorrent)
|
46
46
|
|
47
47
|
[GitHub Account]: https://github.com/signup/free "GitHub Signup"
|
48
48
|
[GitHub Issues]: https://github.com/copiousfreetime/launchy/issues "Launchy Issues"
|
data/{HISTORY.rdoc → HISTORY.md}
RENAMED
@@ -1,33 +1,38 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# Launchy Changelog
|
2
|
+
|
3
|
+
## Version 2.3.0 - 2013-04-11
|
4
|
+
|
5
|
+
* Add the option to call a block on error instead of raising an exception
|
6
|
+
|
7
|
+
## Version 2.2.0 - 2013-02-06
|
3
8
|
|
4
9
|
* Change XFCE detection to not depend on grep (copiousfreetime/launchy#52 - thanks bogdan)
|
5
10
|
* Suppress forked process output (copiousfreetime/launchy#51)
|
6
11
|
* Display help/usage if no url is given (copiousfreetime/launchy#54)
|
7
12
|
* Detect the fluxbox environment (copiousfreetime/launchy#53)
|
8
|
-
* Automatically detect
|
13
|
+
* Automatically detect `http` url's if they are missing the `http://` (copiousfreetime/launchy#55)
|
9
14
|
* Update to latest project management rake tasks
|
10
15
|
|
11
|
-
|
16
|
+
## Version 2.1.2 - 2012-08-06
|
12
17
|
|
13
18
|
* Fix where HostOS would fail to convert to string on JRuby in 1.9 mode (copiousfreetime/launchy#45)
|
14
19
|
|
15
|
-
|
20
|
+
## Version 2.1.1 - 2012-07-28
|
16
21
|
|
17
22
|
* Update addressable runtime dependency (copiousfreetime/launchy#47)
|
18
23
|
* Bring minitest and ffi development dependencies up to date
|
19
24
|
|
20
|
-
|
25
|
+
## Version 2.1.0 - 2012-03-18
|
21
26
|
|
22
27
|
* Fix raising exception when no browser program found (copiousfreetime/launchy#42)
|
23
28
|
* Add LAUNCHY_DRY_RUN environment variable (thanks Mariusz Pietrzyk / wijet)
|
24
29
|
* Update dependencies
|
25
30
|
|
26
|
-
|
31
|
+
## Version 2.0.5 - 2011-07-24
|
27
32
|
|
28
33
|
* Fix the case where $BROWSER is set and no *nix desktop was found (copiousfreetime/launchy#33)
|
29
34
|
|
30
|
-
|
35
|
+
## Version 2.0.4 - 2011-07-23
|
31
36
|
|
32
37
|
* Fix windows 'start' commandline (copiousfreetime/launchy#5)
|
33
38
|
* Add capability to open local files with no file: scheme present (copiousfreetime/launchy#29)
|
@@ -35,24 +40,24 @@
|
|
35
40
|
* Make better decisions on when to do shell escaping (copiousfreetime/launchy#31)
|
36
41
|
* Switch to Addressable::URI so UTF-8 urls may be parsed. (copiousfreetime/launchy#32)
|
37
42
|
|
38
|
-
|
43
|
+
## Version 2.0.3 - 2011-07-17
|
39
44
|
|
40
45
|
* Add in Deprecated API wrappers that warn the user
|
41
46
|
|
42
|
-
|
47
|
+
## Version 2.0.2 - 2011-07-17
|
43
48
|
|
44
49
|
* Typo fixes from @mtorrent
|
45
50
|
* Documentation updates explicitly stating the Public API
|
46
51
|
* Increase test coverage
|
47
52
|
|
48
|
-
|
53
|
+
## Version 2.0.1 - 2011-07-16
|
49
54
|
|
50
55
|
* Almost a complete rewrite
|
51
56
|
* JRuby Support
|
52
57
|
* Organization is such that it will be easier to add additional applications
|
53
58
|
* Windows behavior possibly fixed, again
|
54
59
|
|
55
|
-
|
60
|
+
## Version 1.0.0 - 2011-03-17
|
56
61
|
|
57
62
|
* Add JRuby support (Stephen Judkins)
|
58
63
|
* Remove unused Paths module
|
@@ -60,51 +65,51 @@
|
|
60
65
|
* Switch to use minitest
|
61
66
|
* NOTE, this version was never released.
|
62
67
|
|
63
|
-
|
68
|
+
## Version 0.4.0 - 2011-01-27
|
64
69
|
|
65
|
-
* Add support for file
|
70
|
+
* Add support for `file:///` schema (postmodern)
|
66
71
|
|
67
|
-
|
72
|
+
## Version 0.3.7 - 2010-07-19
|
68
73
|
|
69
74
|
* Fix launchy on windows (mikefarmer)
|
70
75
|
|
71
|
-
|
76
|
+
## Version 0.3.6 - 2010-02-22
|
72
77
|
|
73
78
|
* add a test:spec task to run tests without rcov support
|
74
|
-
* added
|
79
|
+
* added `testing` os family for running tests
|
75
80
|
|
76
|
-
|
81
|
+
## Version 0.3.5 - 2009-12-17
|
77
82
|
|
78
83
|
* clarify that launchy is under ISC license
|
79
84
|
* fix missing data file in released gem needed for running specs
|
80
85
|
|
81
|
-
|
86
|
+
## Version 0.3.3 - 2009-02-19
|
82
87
|
|
83
88
|
* pass command line as discrete items to system() to avoid string
|
84
89
|
interpretation by the system shell. (Suraj N. Kurapati)
|
85
90
|
* rework project layout and tasks
|
86
91
|
|
87
|
-
|
92
|
+
## Version 0.3.2 - 2008-05-21
|
88
93
|
|
89
94
|
* detect aix and mingw as known operating systems.
|
90
95
|
|
91
|
-
|
96
|
+
## Version 0.3.1 - 2007-09-08
|
92
97
|
|
93
98
|
* finalize the command line wrapper around the launchy library.
|
94
99
|
* added more tests
|
95
100
|
|
96
|
-
|
101
|
+
## Version 0.3.0 - 2007-08-30
|
97
102
|
|
98
103
|
* reorganize the code structure, removing Spawnable namespace
|
99
104
|
* removed 'do_magic' method, changed it to 'open'
|
100
105
|
* added override environment variable LAUNCHY_HOST_OS for testing
|
101
106
|
* fix broken cygwin support [Bug #13472]
|
102
107
|
|
103
|
-
|
108
|
+
## Version 0.2.1 - 2007-08-18
|
104
109
|
|
105
110
|
* fix inability to find windows executables [Bug #13132]
|
106
111
|
|
107
|
-
|
112
|
+
## Version 0.2.0 - 2007-08-11
|
108
113
|
|
109
114
|
* rework browser finding
|
110
115
|
* manual override with LAUNCHY_BROWSER environment variable
|
@@ -113,23 +118,23 @@
|
|
113
118
|
* removed win32 gem
|
114
119
|
* Add debug output by setting LAUNCHY_DEBUG environment variable to 'true'
|
115
120
|
|
116
|
-
|
121
|
+
## Version 0.1.2 - 2007-08-11
|
117
122
|
|
118
123
|
* forked child exits without calling at_exit handlers
|
119
124
|
|
120
|
-
|
125
|
+
## Version 0.1.1
|
121
126
|
|
122
127
|
* fixed rubyforge task to release mswin32 gem also
|
123
128
|
|
124
|
-
|
129
|
+
## Version 0.1.0
|
125
130
|
|
126
131
|
* Initial public release
|
127
132
|
* switched to using fork to spawn process and require 'win32/process' if on windows
|
128
133
|
|
129
|
-
|
134
|
+
## Version 0.0.2
|
130
135
|
|
131
136
|
* First attempt at using systemu to spawn processes
|
132
137
|
|
133
|
-
|
138
|
+
## Version 0.0.1
|
134
139
|
|
135
140
|
* Initially working release
|
data/Manifest.txt
CHANGED
data/{README.rdoc → README.md}
RENAMED
@@ -1,39 +1,39 @@
|
|
1
|
-
|
1
|
+
# launchy
|
2
2
|
|
3
|
-
* Homepage
|
4
|
-
*
|
3
|
+
* [Homepage](https://github.com/copiousfreetime/launchy)
|
4
|
+
* [Github Project](https://github.com/copiousfreetime/launchy)
|
5
5
|
* email jeremy at hinegardner dot org
|
6
6
|
|
7
|
-
|
7
|
+
## DESCRIPTION
|
8
8
|
|
9
|
-
Launchy is helper class for launching cross-platform applications in a
|
10
|
-
|
9
|
+
Launchy is helper class for launching cross-platform applications in a fire and
|
10
|
+
forget manner.
|
11
11
|
|
12
|
-
There are application concepts (browser, email client, etc) that are
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
There are application concepts (browser, email client, etc) that are common
|
13
|
+
across all platforms, and they may be launched differently on each platform.
|
14
|
+
Launchy is here to make a common approach to launching external application from
|
15
|
+
within ruby programs.
|
16
16
|
|
17
|
-
|
17
|
+
## FEATURES
|
18
18
|
|
19
19
|
Currently only launching a browser is supported.
|
20
20
|
|
21
|
-
|
21
|
+
## SYNOPSIS
|
22
22
|
|
23
23
|
You can use launchy on the commandline, or via its API.
|
24
24
|
|
25
|
-
|
25
|
+
### Commandline
|
26
26
|
|
27
27
|
% launchy http://www.ruby-lang.org/
|
28
28
|
|
29
|
-
There are additional commandline options, use
|
29
|
+
There are additional commandline options, use `launchy --help` to see them.
|
30
30
|
|
31
|
-
|
31
|
+
### Public API
|
32
32
|
|
33
|
-
In the vein of
|
34
|
-
|
33
|
+
In the vein of [Semantic Versioning](http://semver.org), this is the sole
|
34
|
+
supported public API.
|
35
35
|
|
36
|
-
Launchy.open( uri, options = {} )
|
36
|
+
Launchy.open( uri, options = {} ) { |exception| }
|
37
37
|
|
38
38
|
At the moment, the only available options are:
|
39
39
|
|
@@ -43,15 +43,26 @@ At the moment, the only available options are:
|
|
43
43
|
:ruby_engine Explicitly state what ruby engine to pretend to be under
|
44
44
|
:dry_run Do nothing and print the command that would be executed on $stdout
|
45
45
|
|
46
|
-
|
46
|
+
If `Launchy.open` is invoked with a block, then no exception will be thrown, and
|
47
|
+
the block will be called with the parameters passed to `#open` along with the
|
48
|
+
exception that was raised.
|
49
|
+
|
50
|
+
### An example of using the public API:
|
47
51
|
|
48
52
|
Launchy.open( "http://www.ruby-lang.org" )
|
49
53
|
|
50
|
-
|
54
|
+
### An example of using the public API and using the error block:
|
55
|
+
|
56
|
+
uri = "http://www.ruby-lang.org"
|
57
|
+
Launchy.open( uri ) do |exception|
|
58
|
+
puts "Attempted to open #{uri} and failed because #{exception}"
|
59
|
+
end
|
51
60
|
|
52
|
-
|
53
|
-
|
54
|
-
|
61
|
+
## UPGRADING from versions before 2.0.0
|
62
|
+
|
63
|
+
The previously published versino of Launchy before the 2.0.0 series was 0.4.0.
|
64
|
+
There have been so many changes, and a mistaken tag at 1.0.0, that I have
|
65
|
+
decided to bump all the way to 2.x.y.
|
55
66
|
|
56
67
|
I have attempted to keep backward compatibility with the previous examples. The
|
57
68
|
previous API examples of:
|
@@ -79,7 +90,10 @@ in the github gem if it was updated to use 2.0.x but not use the supported API.
|
|
79
90
|
WARNING:
|
80
91
|
WARNING: If this is not the case, please file a bug. Please file a bug at https://github.com/copiousfreetime/launchy/issues/new
|
81
92
|
|
82
|
-
|
93
|
+
These deprecation notices will go away with version 3.0 and the only availabel
|
94
|
+
API will be the documented one.
|
95
|
+
|
96
|
+
## ISC LICENSE
|
83
97
|
|
84
98
|
http://opensource.org/licenses/isc-license.txt
|
85
99
|
|
data/lib/launchy.rb
CHANGED
@@ -22,16 +22,21 @@ module Launchy
|
|
22
22
|
#
|
23
23
|
# Launch an application for the given uri string
|
24
24
|
#
|
25
|
-
def open(uri_s, options = {} )
|
26
|
-
extract_global_options( options )
|
25
|
+
def open(uri_s, options = {}, &error_block )
|
26
|
+
leftover = extract_global_options( options )
|
27
27
|
uri = string_to_uri( uri_s )
|
28
28
|
app = app_for_uri( uri )
|
29
|
-
app.new.open( uri,
|
29
|
+
app.new.open( uri, leftover )
|
30
30
|
rescue Launchy::Error => le
|
31
31
|
raise le
|
32
32
|
rescue Exception => e
|
33
33
|
msg = "Failure in opening uri #{uri_s.inspect} with options #{options.inspect}: #{e}"
|
34
34
|
raise Launchy::Error, msg
|
35
|
+
ensure
|
36
|
+
if $! and block_given? then
|
37
|
+
yield $!
|
38
|
+
return # explicitly swallow the errors
|
39
|
+
end
|
35
40
|
end
|
36
41
|
|
37
42
|
def app_for_uri( uri )
|
@@ -39,12 +44,16 @@ module Launchy
|
|
39
44
|
end
|
40
45
|
|
41
46
|
def app_for_uri_string( s )
|
42
|
-
app_for_uri(
|
47
|
+
app_for_uri( string_to_uri( s ) )
|
43
48
|
end
|
44
49
|
|
45
50
|
def string_to_uri( s )
|
46
51
|
uri = Addressable::URI.parse( s )
|
47
|
-
|
52
|
+
Launchy.log "URI parsing pass 1 : #{s} -> #{uri.to_hash}"
|
53
|
+
if not uri.scheme then
|
54
|
+
uri = Addressable::URI.heuristic_parse( s )
|
55
|
+
Launchy.log "URI parsing pass 2 : #{s} -> #{uri.to_hash}"
|
56
|
+
end
|
48
57
|
raise Launchy::ArgumentError, "Invalid URI given: #{s.inspect}" unless uri
|
49
58
|
return uri
|
50
59
|
end
|
@@ -58,11 +67,12 @@ module Launchy
|
|
58
67
|
end
|
59
68
|
|
60
69
|
def extract_global_options( options )
|
61
|
-
|
62
|
-
Launchy.
|
63
|
-
Launchy.
|
64
|
-
Launchy.
|
65
|
-
Launchy.
|
70
|
+
leftover = options.dup
|
71
|
+
Launchy.debug = leftover.delete( :debug ) || ENV['LAUNCHY_DEBUG']
|
72
|
+
Launchy.application = leftover.delete( :application ) || ENV['LAUNCHY_APPLICATION']
|
73
|
+
Launchy.host_os = leftover.delete( :host_os ) || ENV['LAUNCHY_HOST_OS']
|
74
|
+
Launchy.ruby_engine = leftover.delete( :ruby_engine ) || ENV['LAUNCHY_RUBY_ENGINE']
|
75
|
+
Launchy.dry_run = leftover.delete( :dry_run ) || ENV['LAUNCHY_DRY_RUN']
|
66
76
|
end
|
67
77
|
|
68
78
|
def debug=( d )
|
data/lib/launchy/cli.rb
CHANGED
@@ -65,13 +65,11 @@ module Launchy
|
|
65
65
|
|
66
66
|
def good_run( argv, env )
|
67
67
|
if parse( argv, env ) then
|
68
|
-
Launchy.open( argv.shift, options )
|
68
|
+
Launchy.open( argv.shift, options ) { |e| error_output( e ) }
|
69
69
|
return true
|
70
70
|
else
|
71
71
|
return false
|
72
72
|
end
|
73
|
-
rescue StandardError => e
|
74
|
-
error_output( e )
|
75
73
|
end
|
76
74
|
|
77
75
|
def error_output( error )
|
data/lib/launchy/version.rb
CHANGED
data/spec/launchy_spec.rb
CHANGED
@@ -6,6 +6,7 @@ describe Launchy do
|
|
6
6
|
Launchy.reset_global_options
|
7
7
|
@stderr = $stderr
|
8
8
|
$stderr = StringIO.new
|
9
|
+
@invalid_url = 'blah://example.com/invalid'
|
9
10
|
end
|
10
11
|
|
11
12
|
after do
|
@@ -51,7 +52,26 @@ describe Launchy do
|
|
51
52
|
end
|
52
53
|
|
53
54
|
it "raises an exception if no scheme is found for the given uri" do
|
54
|
-
lambda { Launchy.open(
|
55
|
+
lambda { Launchy.open( @invalid_url ) }.must_raise Launchy::ApplicationNotFoundError
|
56
|
+
end
|
57
|
+
|
58
|
+
it "raises an exception if we have an invalid scheme and a valid path" do
|
59
|
+
lambda { Launchy.open( "blah://example.com/" ) }.must_raise Launchy::ApplicationNotFoundError
|
60
|
+
end
|
61
|
+
|
62
|
+
it "calls the block if instead of raising an exception if there is an error" do
|
63
|
+
Launchy.open( @invalid_url ) { $stderr.puts "oops had an error opening #{@invalid_url}" }
|
64
|
+
$stderr.string.strip.must_equal "oops had an error opening #{@invalid_url}"
|
65
|
+
end
|
66
|
+
|
67
|
+
it "calls the block with the values passed to launchy and the error" do
|
68
|
+
options = { :dry_run => true }
|
69
|
+
Launchy.open( @invalid_url, :dry_run => true ) { |e| $stderr.puts "had an error opening #{@invalid_url} with options #{options}: #{e}" }
|
70
|
+
$stderr.string.strip.must_equal "had an error opening #{@invalid_url} with options #{options}: No application found to handle '#{@invalid_url}'"
|
71
|
+
end
|
72
|
+
|
73
|
+
it "raises the error in the called block" do
|
74
|
+
lambda { Launchy.open( @invalid_url ) { raise StandardError, "KABOOM!" } }.must_raise StandardError
|
55
75
|
end
|
56
76
|
|
57
77
|
[ 'www.example.com', 'www.example.com/foo/bar' ].each do |x|
|
data/tasks/default.rake
CHANGED
@@ -56,6 +56,9 @@ begin
|
|
56
56
|
t.libs = %w[ lib spec ]
|
57
57
|
t.pattern = "spec/**/*_spec.rb"
|
58
58
|
end
|
59
|
+
|
60
|
+
task :test_requirements
|
61
|
+
task :test => :test_requirements
|
59
62
|
task :default => :test
|
60
63
|
rescue LoadError
|
61
64
|
This.task_warning( 'test' )
|
@@ -71,9 +74,10 @@ begin
|
|
71
74
|
RDoc::Task.new do |t|
|
72
75
|
t.markup = 'tomdoc'
|
73
76
|
t.rdoc_dir = 'doc'
|
74
|
-
t.main = 'README.
|
77
|
+
t.main = 'README.md'
|
75
78
|
t.title = "#{This.name} #{This.version}"
|
76
|
-
t.rdoc_files.include( '*.rdoc', '
|
79
|
+
t.rdoc_files.include( FileList['*.{rdoc,md,txt}'], FileList['ext/**/*.c'],
|
80
|
+
FileList['lib/**/*.rb'] )
|
77
81
|
end
|
78
82
|
rescue LoadError => le
|
79
83
|
This.task_warning( 'rdoc' )
|
@@ -146,19 +150,70 @@ end
|
|
146
150
|
#------------------------------------------------------------------------------
|
147
151
|
# Fixme - look for fixmes and report them
|
148
152
|
#------------------------------------------------------------------------------
|
149
|
-
|
150
|
-
task :
|
151
|
-
|
152
|
-
|
153
|
+
namespace :fixme do
|
154
|
+
task :default => 'manifest:check' do
|
155
|
+
This.manifest.each do |file|
|
156
|
+
next if file == __FILE__
|
157
|
+
next unless file =~ %r/(txt|rb|md|rdoc|css|html|xml|css)\Z/
|
158
|
+
puts "FIXME: Rename #{file}" if file =~ /fixme/i
|
159
|
+
IO.readlines( file ).each_with_index do |line, idx|
|
160
|
+
prefix = "FIXME: #{file}:#{idx+1}".ljust(42)
|
161
|
+
puts "#{prefix} => #{line.strip}" if line =~ /fixme/i
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
def fixme_project_root
|
167
|
+
This.project_path( '../fixme' )
|
168
|
+
end
|
169
|
+
|
170
|
+
def fixme_project_path( subtree )
|
171
|
+
fixme_project_root.join( subtree )
|
172
|
+
end
|
173
|
+
|
174
|
+
def local_fixme_files
|
175
|
+
This.manifest.select { |p| p =~ %r|^tasks/| }
|
176
|
+
end
|
153
177
|
|
154
|
-
|
178
|
+
def outdated_fixme_files
|
179
|
+
local_fixme_files.reject do |local|
|
180
|
+
upstream = fixme_project_path( local )
|
181
|
+
Digest::SHA256.file( local ) == Digest::SHA256.file( upstream )
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
def fixme_up_to_date?
|
186
|
+
outdated_fixme_files.empty?
|
187
|
+
end
|
155
188
|
|
156
|
-
|
157
|
-
|
158
|
-
|
189
|
+
desc "See if the fixme tools are outdated"
|
190
|
+
task :outdated => :release_check do
|
191
|
+
if fixme_up_to_date? then
|
192
|
+
puts "Fixme files are up to date."
|
193
|
+
else
|
194
|
+
outdated_fixme_files.each do |f|
|
195
|
+
puts "#{f} is outdated"
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
desc "Update outdated fixme files"
|
201
|
+
task :update => :release_check do
|
202
|
+
if fixme_up_to_date? then
|
203
|
+
puts "Fixme files are already up to date."
|
204
|
+
else
|
205
|
+
puts "Updating fixme files:"
|
206
|
+
outdated_fixme_files.each do |local|
|
207
|
+
upstream = fixme_project_path( local )
|
208
|
+
puts " * #{local}"
|
209
|
+
FileUtils.cp( upstream, local )
|
210
|
+
end
|
211
|
+
puts "Use your git commands as appropriate."
|
159
212
|
end
|
160
213
|
end
|
161
214
|
end
|
215
|
+
desc "Look for fixmes and report them"
|
216
|
+
task :fixme => "fixme:default"
|
162
217
|
|
163
218
|
#------------------------------------------------------------------------------
|
164
219
|
# Gem Specification
|
@@ -172,7 +227,10 @@ task :gemspec do
|
|
172
227
|
end
|
173
228
|
|
174
229
|
# the gemspec is also a dev artifact and should not be kept around.
|
175
|
-
CLOBBER << This.gemspec_file
|
230
|
+
CLOBBER << This.gemspec_file.to_s
|
231
|
+
|
232
|
+
# .rbc files from ruby 2.0
|
233
|
+
CLOBBER << FileList["**/*.rbc"]
|
176
234
|
|
177
235
|
# The standard gem packaging task, everyone has it.
|
178
236
|
require 'rubygems/package_task'
|
data/tasks/this.rb
CHANGED
@@ -25,7 +25,7 @@ class ThisProject
|
|
25
25
|
#
|
26
26
|
# Yields self
|
27
27
|
def initialize(&block)
|
28
|
-
@exclude_from_manifest = %r
|
28
|
+
@exclude_from_manifest = %r/\.(git|DS_Store)|^(doc|coverage|pkg|tmp)|Gemfile*|\.(gemspec|swp|jar|bundle|so|rvmrc)$|~$/
|
29
29
|
@gemspecs = Hash.new
|
30
30
|
yield self if block_given?
|
31
31
|
end
|
@@ -54,7 +54,7 @@ class ThisProject
|
|
54
54
|
#
|
55
55
|
# Retuns the text of the section as an array of paragrphs.
|
56
56
|
def section_of( file, section_name )
|
57
|
-
re =
|
57
|
+
re = /^[=#]+ (.*)$/
|
58
58
|
sectional = project_path( file )
|
59
59
|
parts = sectional.read.split( re )[1..-1]
|
60
60
|
parts.map! { |p| p.strip }
|
@@ -77,8 +77,8 @@ class ThisProject
|
|
77
77
|
# path - the relative path of the file from the project root
|
78
78
|
#
|
79
79
|
# Returns the Pathname of the file
|
80
|
-
def project_path( relative_path )
|
81
|
-
project_root.join( relative_path )
|
80
|
+
def project_path( *relative_path )
|
81
|
+
project_root.join( *relative_path )
|
82
82
|
end
|
83
83
|
|
84
84
|
# Internal: The absolute path of this file
|
@@ -110,6 +110,13 @@ class ThisProject
|
|
110
110
|
manifest_file.readlines.map { |l| l.strip }
|
111
111
|
end
|
112
112
|
|
113
|
+
# Internal: Return the files that define the extensions
|
114
|
+
#
|
115
|
+
# Returns an Array
|
116
|
+
def extension_conf_files
|
117
|
+
manifest.grep( /extconf.rb\Z/ )
|
118
|
+
end
|
119
|
+
|
113
120
|
# Internal: Returns the gemspace associated with the current ruby platform
|
114
121
|
def platform_gemspec
|
115
122
|
gemspecs[platform]
|
@@ -130,8 +137,8 @@ class ThisProject
|
|
130
137
|
spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
|
131
138
|
spec.test_files = spec.files.grep(/^spec/)
|
132
139
|
|
133
|
-
spec.extra_rdoc_files += spec.files.grep(/(txt|rdoc)$/)
|
134
|
-
spec.rdoc_options = [ "--main" , 'README.
|
140
|
+
spec.extra_rdoc_files += spec.files.grep(/(txt|rdoc|md)$/)
|
141
|
+
spec.rdoc_options = [ "--main" , 'README.md',
|
135
142
|
"--markup", "tomdoc" ]
|
136
143
|
end
|
137
144
|
end
|
@@ -180,7 +187,7 @@ class ThisProject
|
|
180
187
|
|
181
188
|
# Internal: Return the DESCRIPTION section of the README.rdoc file
|
182
189
|
def description_section
|
183
|
-
section_of( 'README.
|
190
|
+
section_of( 'README.md', 'DESCRIPTION')
|
184
191
|
end
|
185
192
|
|
186
193
|
# Internal: Return the summary text from the README
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: launchy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
5
|
-
prerelease:
|
4
|
+
version: 2.3.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jeremy Hinegardner
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-04-16 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: addressable
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: minitest
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: rdoc
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -85,15 +76,16 @@ executables:
|
|
85
76
|
- launchy
|
86
77
|
extensions: []
|
87
78
|
extra_rdoc_files:
|
88
|
-
-
|
79
|
+
- CONTRIBUTING.md
|
80
|
+
- HISTORY.md
|
89
81
|
- Manifest.txt
|
90
|
-
- README.
|
82
|
+
- README.md
|
91
83
|
files:
|
92
84
|
- CONTRIBUTING.md
|
93
|
-
- HISTORY.
|
85
|
+
- HISTORY.md
|
94
86
|
- LICENSE
|
95
87
|
- Manifest.txt
|
96
|
-
- README.
|
88
|
+
- README.md
|
97
89
|
- Rakefile
|
98
90
|
- bin/launchy
|
99
91
|
- lib/launchy.rb
|
@@ -128,31 +120,30 @@ files:
|
|
128
120
|
- tasks/this.rb
|
129
121
|
homepage: http://github.com/copiousfreetime/launchy
|
130
122
|
licenses: []
|
123
|
+
metadata: {}
|
131
124
|
post_install_message:
|
132
125
|
rdoc_options:
|
133
126
|
- --main
|
134
|
-
- README.
|
127
|
+
- README.md
|
135
128
|
- --markup
|
136
129
|
- tomdoc
|
137
130
|
require_paths:
|
138
131
|
- lib
|
139
132
|
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
-
none: false
|
141
133
|
requirements:
|
142
134
|
- - ! '>='
|
143
135
|
- !ruby/object:Gem::Version
|
144
136
|
version: '0'
|
145
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
-
none: false
|
147
138
|
requirements:
|
148
139
|
- - ! '>='
|
149
140
|
- !ruby/object:Gem::Version
|
150
141
|
version: '0'
|
151
142
|
requirements: []
|
152
143
|
rubyforge_project:
|
153
|
-
rubygems_version:
|
144
|
+
rubygems_version: 2.0.3
|
154
145
|
signing_key:
|
155
|
-
specification_version:
|
146
|
+
specification_version: 4
|
156
147
|
summary: Launchy is helper class for launching cross-platform applications in a fire
|
157
148
|
and forget manner.
|
158
149
|
test_files:
|