hooker 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +6 -0
- data/Manifest.txt +1 -0
- data/README.rdoc +4 -7
- data/Rakefile +2 -27
- data/lib/hooker/base.rb +2 -2
- data/lib/hooker.rb +6 -2
- data/test/setup.rb +3 -4
- data/test/test_hooker.rb +9 -3
- data/test/test_load_dir/placeholder +2 -0
- metadata +89 -106
data/History.rdoc
CHANGED
@@ -1,2 +1,8 @@
|
|
1
|
+
=== 1.0.1 (2012-9-12)
|
2
|
+
* Ensure Errno::EISDIR when mistaken attempt to load a directory,
|
3
|
+
i.e. "./config"
|
4
|
+
* Fix shadow warning in tests with 1.9 mode (dev)
|
5
|
+
* Upgrade to tarpit ~> 2.0, bundler Gemfile, gemspec (build)
|
6
|
+
|
1
7
|
=== 1.0.0 (2011-2-6)
|
2
8
|
* Initial release.
|
data/Manifest.txt
CHANGED
data/README.rdoc
CHANGED
@@ -6,12 +6,9 @@
|
|
6
6
|
|
7
7
|
Hooker provides a simple registry of hooks or extension points,
|
8
8
|
enabling decoupled run time configuration in terse but straight ruby
|
9
|
-
syntax.
|
10
|
-
|
11
|
-
|
12
|
-
Functions}[http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html]
|
13
|
-
(Lisp) and other applications which support configuration
|
14
|
-
files in ruby.
|
9
|
+
syntax. Inspiration includes
|
10
|
+
{Emacs Hook Functions}[http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html]
|
11
|
+
and other ruby-based configuration files.
|
15
12
|
|
16
13
|
=== Features
|
17
14
|
|
@@ -66,7 +63,7 @@ Supports the config:
|
|
66
63
|
|
67
64
|
== License
|
68
65
|
|
69
|
-
Copyright (c) 2011 David Kellum
|
66
|
+
Copyright (c) 2011-2012 David Kellum
|
70
67
|
|
71
68
|
Licensed under the Apache License, Version 2.0 (the "License"); you
|
72
69
|
may not use this file except in compliance with the License. You
|
data/Rakefile
CHANGED
@@ -1,32 +1,7 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
|
3
|
-
$LOAD_PATH << './lib'
|
4
|
-
|
5
3
|
require 'rubygems'
|
6
|
-
|
4
|
+
require 'bundler/setup'
|
7
5
|
require 'rjack-tarpit'
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
t = RJack::TarPit.new( 'hooker', Hooker::VERSION )
|
12
|
-
|
13
|
-
t.specify do |h|
|
14
|
-
h.developer( 'David Kellum', 'dek-oss@gravitext.com' )
|
15
|
-
h.testlib = :minitest
|
16
|
-
h.extra_dev_deps += [ [ 'minitest', '>= 1.7.1', '< 2.1' ] ]
|
17
|
-
end
|
18
|
-
|
19
|
-
# Version/date consistency checks:
|
20
|
-
|
21
|
-
task :check_history_version do
|
22
|
-
t.test_line_match( 'History.rdoc', /^==/, / #{ t.version } / )
|
23
|
-
end
|
24
|
-
task :check_history_date do
|
25
|
-
t.test_line_match( 'History.rdoc', /^==/, /\([0-9\-]+\)$/ )
|
26
|
-
end
|
27
|
-
|
28
|
-
task :gem => [ :check_history_version ]
|
29
|
-
task :tag => [ :check_history_version, :check_history_date ]
|
30
|
-
task :push => [ :check_history_version, :check_history_date ]
|
31
|
-
|
32
|
-
t.define_tasks
|
7
|
+
RJack::TarPit.new( 'hooker' ).define_tasks
|
data/lib/hooker/base.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2011 David Kellum
|
2
|
+
# Copyright (c) 2011-2012 David Kellum
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you
|
5
5
|
# may not use this file except in compliance with the License. You may
|
@@ -16,5 +16,5 @@
|
|
16
16
|
|
17
17
|
module Hooker
|
18
18
|
# Hooker version
|
19
|
-
VERSION = '1.0.
|
19
|
+
VERSION = '1.0.1'
|
20
20
|
end
|
data/lib/hooker.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2011 David Kellum
|
2
|
+
# Copyright (c) 2011-2012 David Kellum
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you
|
5
5
|
# may not use this file except in compliance with the License. You may
|
@@ -79,7 +79,11 @@ module Hooker
|
|
79
79
|
# Load the specified file via Kernel.load, with a log message if
|
80
80
|
# set.
|
81
81
|
def load_file( file )
|
82
|
-
log "Loading file #{file}
|
82
|
+
log "Loading file #{file}"
|
83
|
+
|
84
|
+
# Workaround for some odd load behavior when not a regular file.
|
85
|
+
IO.read( file )
|
86
|
+
|
83
87
|
load( file, true ) #wrap in in anonymous module
|
84
88
|
end
|
85
89
|
|
data/test/setup.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2011 David Kellum
|
2
|
+
# Copyright (c) 2011-2012 David Kellum
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you
|
5
5
|
# may not use this file except in compliance with the License. You
|
@@ -16,9 +16,8 @@
|
|
16
16
|
|
17
17
|
#### General test setup: LOAD_PATH, logging, console output ####
|
18
18
|
|
19
|
-
ldir = File.join( File.dirname( __FILE__ ), "..", "lib" )
|
20
|
-
$LOAD_PATH.unshift( ldir ) unless $LOAD_PATH.include?( ldir )
|
21
|
-
|
22
19
|
require 'rubygems'
|
20
|
+
require 'bundler/setup'
|
21
|
+
|
23
22
|
require 'minitest/unit'
|
24
23
|
require 'minitest/autorun'
|
data/test/test_hooker.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env jruby
|
2
2
|
#.hashdot.profile += jruby-shortlived
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2011 David Kellum
|
4
|
+
# Copyright (c) 2011-2012 David Kellum
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you
|
7
7
|
# may not use this file except in compliance with the License. You
|
@@ -74,8 +74,8 @@ class TestContext < MiniTest::Unit::TestCase
|
|
74
74
|
|
75
75
|
def test_apply
|
76
76
|
Hooker.with do |h|
|
77
|
-
h.add( :test ) { |
|
78
|
-
h.add( :test ) { |
|
77
|
+
h.add( :test ) { |hsh| hsh[ :prop ] = "a" }
|
78
|
+
h.add( :test ) { |hsh| hsh[ :prop ] = "b" }
|
79
79
|
end
|
80
80
|
|
81
81
|
h = Hooker.apply( :test, { :prop => "orig" } )
|
@@ -141,4 +141,10 @@ class TestContext < MiniTest::Unit::TestCase
|
|
141
141
|
assert_equal( :returned, Hooker.inject( [ :church, :test ] ) )
|
142
142
|
end
|
143
143
|
|
144
|
+
def test_load_dir_error
|
145
|
+
assert_raises( Errno::EISDIR ) do
|
146
|
+
Hooker.load_file( File.join( TESTDIR, 'test_load_dir' ) )
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
144
150
|
end
|
metadata
CHANGED
@@ -1,116 +1,99 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: hooker
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 1
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
version: 1.0.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 1.0.1
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
12
|
-
|
13
|
-
autorequire:
|
7
|
+
authors:
|
8
|
+
- David Kellum
|
9
|
+
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
version_requirements: *id002
|
54
|
-
description: |-
|
55
|
-
Hooker provides a simple registry of hooks or extension points,
|
56
|
-
enabling decoupled run time configuration in terse but straight ruby
|
57
|
-
syntax.
|
58
|
-
|
59
|
-
Inspiration includes {Emacs Hook
|
60
|
-
Functions}[http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html]
|
61
|
-
(Lisp) and other applications which support configuration
|
62
|
-
files in ruby.
|
63
|
-
email:
|
64
|
-
- dek-oss@gravitext.com
|
12
|
+
date: 2012-09-13 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: minitest
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '2.3'
|
21
|
+
none: false
|
22
|
+
requirement: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.3'
|
27
|
+
none: false
|
28
|
+
prerelease: false
|
29
|
+
type: :development
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rjack-tarpit
|
32
|
+
version_requirements: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ~>
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '2.0'
|
37
|
+
none: false
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '2.0'
|
43
|
+
none: false
|
44
|
+
prerelease: false
|
45
|
+
type: :development
|
46
|
+
description: Hooker provides a simple registry of hooks or extension points, enabling decoupled run time configuration in terse but straight ruby syntax. Inspiration includes Emacs Hook Functions and other ruby-based configuration files.
|
47
|
+
email:
|
48
|
+
- dek-oss@gravitext.com
|
65
49
|
executables: []
|
66
|
-
|
67
50
|
extensions: []
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
- test/test_hooker.rb
|
84
|
-
has_rdoc: true
|
51
|
+
extra_rdoc_files:
|
52
|
+
- History.rdoc
|
53
|
+
- README.rdoc
|
54
|
+
files:
|
55
|
+
- History.rdoc
|
56
|
+
- Manifest.txt
|
57
|
+
- README.rdoc
|
58
|
+
- Rakefile
|
59
|
+
- lib/hooker/base.rb
|
60
|
+
- lib/hooker.rb
|
61
|
+
- test/alt_entry.rb
|
62
|
+
- test/config.rb
|
63
|
+
- test/setup.rb
|
64
|
+
- test/test_hooker.rb
|
65
|
+
- test/test_load_dir/placeholder
|
85
66
|
homepage: http://github.com/dekellum/hooker
|
86
67
|
licenses: []
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
68
|
+
post_install_message:
|
69
|
+
rdoc_options:
|
70
|
+
- --main
|
71
|
+
- README.rdoc
|
72
|
+
require_paths:
|
73
|
+
- lib
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
segments:
|
80
|
+
- 0
|
81
|
+
hash: 2
|
82
|
+
none: false
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
segments:
|
89
|
+
- 0
|
90
|
+
hash: 2
|
91
|
+
none: false
|
108
92
|
requirements: []
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
signing_key:
|
93
|
+
rubyforge_project:
|
94
|
+
rubygems_version: 1.8.24
|
95
|
+
signing_key:
|
113
96
|
specification_version: 3
|
114
|
-
summary: Hooker provides a simple registry of hooks or extension points, enabling decoupled run time configuration in terse but straight ruby syntax
|
115
|
-
test_files:
|
116
|
-
|
97
|
+
summary: Hooker provides a simple registry of hooks or extension points, enabling decoupled run time configuration in terse but straight ruby syntax.
|
98
|
+
test_files: []
|
99
|
+
...
|