wrap 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Rakefile +26 -40
- data/lib/wrap.rb +5 -1
- data/wrap.gemspec +5 -7
- metadata +9 -22
- data/b.rb +0 -58
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OTY2NzEyMGYxNWU0M2Y5MGE5OGYzM2M0ZjAwNTA4OWFhOGIzMmQ1MQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NWJjMTA1MWEwYjM5NDg2ZTI1NDQ1Mzk5NDk0Yzc4ZjE5ZWYwZmM2Yw==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YWZiOTUxNWMyMjgzOGRjNTEyZGIyYWY3NWM1Njg2ZjdjZTczM2MxYWZhNjg0
|
10
|
+
OGI3MTEwMmE2ZTQ4YTBjOTM3NTA3NWU0ZTk5ZTE3ZmY2ODhhYjA3ZjJmNjVj
|
11
|
+
ZGQxZGYzYWI3ODc4OTc1OWUxZTJkMDAxNmY5YjI5NjQ2NmZhYzA=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NzY4ZWQ2ZWY1MDEyNmRjYjNhZDVmN2E0ZGVmOTEzYzMwMTQwNTNmMzc4YmMz
|
14
|
+
YzQwNGFmZGQ3ZjlkYjAxNDQwNTc5ZDJmMGNjYzZiYzI0MjNkYWNhNDhiMGEy
|
15
|
+
MjQwNGVkZTY4ZmM1MTY1ZGUyNWM4NzY0YTM0MThkM2JiZTRmNTA=
|
data/Rakefile
CHANGED
@@ -3,6 +3,9 @@ This.author = "Ara T. Howard"
|
|
3
3
|
This.email = "ara.t.howard@gmail.com"
|
4
4
|
This.homepage = "https://github.com/ahoward/#{ This.lib }"
|
5
5
|
|
6
|
+
task :license do
|
7
|
+
open('LICENSE', 'w'){|fd| fd.puts "same as ruby's"}
|
8
|
+
end
|
6
9
|
|
7
10
|
task :default do
|
8
11
|
puts((Rake::Task.tasks.map{|task| task.name.gsub(/::/,':')} - ['default']).sort)
|
@@ -29,7 +32,7 @@ def run_tests!(which = nil)
|
|
29
32
|
|
30
33
|
test_rbs.each_with_index do |test_rb, index|
|
31
34
|
testno = index + 1
|
32
|
-
command = "#{ This.ruby } -I ./lib -I ./test/lib #{ test_rb }"
|
35
|
+
command = "#{ This.ruby } -w -I ./lib -I ./test/lib #{ test_rb }"
|
33
36
|
|
34
37
|
puts
|
35
38
|
say(div, :color => :cyan, :bold => true)
|
@@ -60,7 +63,7 @@ end
|
|
60
63
|
task :gemspec do
|
61
64
|
ignore_extensions = ['git', 'svn', 'tmp', /sw./, 'bak', 'gem']
|
62
65
|
ignore_directories = ['pkg']
|
63
|
-
ignore_files = ['test/log'
|
66
|
+
ignore_files = ['test/log']
|
64
67
|
|
65
68
|
shiteless =
|
66
69
|
lambda do |list|
|
@@ -87,9 +90,10 @@ task :gemspec do
|
|
87
90
|
files = shiteless[Dir::glob("**/**")]
|
88
91
|
executables = shiteless[Dir::glob("bin/*")].map{|exe| File.basename(exe)}
|
89
92
|
#has_rdoc = true #File.exist?('doc')
|
90
|
-
test_files =
|
93
|
+
test_files = "test/#{ lib }.rb" if File.file?("test/#{ lib }.rb")
|
91
94
|
summary = object.respond_to?(:summary) ? object.summary : "summary: #{ lib } kicks the ass"
|
92
95
|
description = object.respond_to?(:description) ? object.description : "description: #{ lib } kicks the ass"
|
96
|
+
license = object.respond_to?(:license) ? object.license : "same as ruby's"
|
93
97
|
|
94
98
|
if This.extensions.nil?
|
95
99
|
This.extensions = []
|
@@ -100,51 +104,39 @@ task :gemspec do
|
|
100
104
|
end
|
101
105
|
extensions = [extensions].flatten.compact
|
102
106
|
|
103
|
-
# TODO
|
104
|
-
if This.dependencies.nil?
|
105
|
-
dependencies = []
|
106
|
-
else
|
107
|
-
case This.dependencies
|
108
|
-
when Hash
|
109
|
-
dependencies = This.dependencies.values
|
110
|
-
when Array
|
111
|
-
dependencies = This.dependencies
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
107
|
template =
|
116
108
|
if test(?e, 'gemspec.erb')
|
117
109
|
Template{ IO.read('gemspec.erb') }
|
118
110
|
else
|
119
111
|
Template {
|
120
112
|
<<-__
|
121
|
-
##
|
113
|
+
## #{ lib }.gemspec
|
122
114
|
#
|
123
115
|
|
124
116
|
Gem::Specification::new do |spec|
|
125
|
-
spec.name =
|
126
|
-
spec.version =
|
117
|
+
spec.name = #{ lib.inspect }
|
118
|
+
spec.version = #{ version.inspect }
|
127
119
|
spec.platform = Gem::Platform::RUBY
|
128
|
-
spec.summary =
|
129
|
-
spec.description =
|
120
|
+
spec.summary = #{ lib.inspect }
|
121
|
+
spec.description = #{ description.inspect }
|
122
|
+
spec.license = #{ license.inspect }
|
130
123
|
|
131
|
-
spec.files =\n
|
132
|
-
spec.executables =
|
124
|
+
spec.files =\n#{ files.sort.pretty_inspect }
|
125
|
+
spec.executables = #{ executables.inspect }
|
133
126
|
|
134
127
|
spec.require_path = "lib"
|
135
128
|
|
136
|
-
spec.test_files =
|
129
|
+
spec.test_files = #{ test_files.inspect }
|
137
130
|
|
138
|
-
|
139
|
-
|
140
|
-
<% end %>
|
131
|
+
### spec.add_dependency 'lib', '>= version'
|
132
|
+
#### spec.add_dependency 'map'
|
141
133
|
|
142
|
-
spec.extensions.push(
|
134
|
+
spec.extensions.push(*#{ extensions.inspect })
|
143
135
|
|
144
|
-
spec.rubyforge_project =
|
145
|
-
spec.author =
|
146
|
-
spec.email =
|
147
|
-
spec.homepage =
|
136
|
+
spec.rubyforge_project = #{ This.rubyforge_project.inspect }
|
137
|
+
spec.author = #{ This.author.inspect }
|
138
|
+
spec.email = #{ This.email.inspect }
|
139
|
+
spec.homepage = #{ This.homepage.inspect }
|
148
140
|
end
|
149
141
|
__
|
150
142
|
}
|
@@ -188,8 +180,8 @@ task :readme do
|
|
188
180
|
end
|
189
181
|
|
190
182
|
template =
|
191
|
-
if test(?e, '
|
192
|
-
Template{ IO.read('
|
183
|
+
if test(?e, 'README.erb')
|
184
|
+
Template{ IO.read('README.erb') }
|
193
185
|
else
|
194
186
|
Template {
|
195
187
|
<<-__
|
@@ -280,12 +272,6 @@ BEGIN {
|
|
280
272
|
end
|
281
273
|
This.version = version
|
282
274
|
|
283
|
-
# see if dependencies are export by the module
|
284
|
-
#
|
285
|
-
if This.object.respond_to?(:dependencies)
|
286
|
-
This.dependencies = This.object.dependencies
|
287
|
-
end
|
288
|
-
|
289
275
|
# we need to know the name of the lib an it's version
|
290
276
|
#
|
291
277
|
abort('no lib') unless This.lib
|
@@ -293,7 +279,7 @@ BEGIN {
|
|
293
279
|
|
294
280
|
# discover full path to this ruby executable
|
295
281
|
#
|
296
|
-
c =
|
282
|
+
c = Config::CONFIG
|
297
283
|
bindir = c["bindir"] || c['BINDIR']
|
298
284
|
ruby_install_name = c['ruby_install_name'] || c['RUBY_INSTALL_NAME'] || 'ruby'
|
299
285
|
ruby_ext = c['EXEEXT'] || ''
|
data/lib/wrap.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
##
|
6
6
|
#
|
7
7
|
class << Wrap
|
8
|
-
Wrap::Version = '1.5.
|
8
|
+
Wrap::Version = '1.5.1' unless defined?(Wrap::Version)
|
9
9
|
|
10
10
|
def version
|
11
11
|
Wrap::Version
|
@@ -16,6 +16,10 @@
|
|
16
16
|
'map' => [ 'map' , ' >= 4.7.1' ]
|
17
17
|
}
|
18
18
|
end
|
19
|
+
|
20
|
+
def description
|
21
|
+
'non-sucking :before and :after filters for any ruby class'
|
22
|
+
end
|
19
23
|
end
|
20
24
|
|
21
25
|
##
|
data/wrap.gemspec
CHANGED
@@ -3,17 +3,16 @@
|
|
3
3
|
|
4
4
|
Gem::Specification::new do |spec|
|
5
5
|
spec.name = "wrap"
|
6
|
-
spec.version = "1.5.
|
6
|
+
spec.version = "1.5.1"
|
7
7
|
spec.platform = Gem::Platform::RUBY
|
8
8
|
spec.summary = "wrap"
|
9
|
-
spec.description = "
|
9
|
+
spec.description = "non-sucking :before and :after filters for any ruby class"
|
10
|
+
spec.license = "same as ruby's"
|
10
11
|
|
11
12
|
spec.files =
|
12
13
|
["README",
|
13
14
|
"Rakefile",
|
14
|
-
"b.rb",
|
15
15
|
"lib",
|
16
|
-
"lib/wrap",
|
17
16
|
"lib/wrap.rb",
|
18
17
|
"test",
|
19
18
|
"test/testing.rb",
|
@@ -26,9 +25,8 @@ Gem::Specification::new do |spec|
|
|
26
25
|
|
27
26
|
spec.test_files = nil
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
### spec.add_dependency 'lib', '>= version'
|
29
|
+
#### spec.add_dependency 'map'
|
32
30
|
|
33
31
|
spec.extensions.push(*[])
|
34
32
|
|
metadata
CHANGED
@@ -1,28 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
5
|
-
prerelease:
|
4
|
+
version: 1.5.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ara T. Howard
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
-
|
15
|
-
name: map
|
16
|
-
requirement: &70281867850260 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 4.7.1
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: *70281867850260
|
25
|
-
description: ! 'description: wrap kicks the ass'
|
11
|
+
date: 2014-02-15 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: non-sucking :before and :after filters for any ruby class
|
26
14
|
email: ara.t.howard@gmail.com
|
27
15
|
executables: []
|
28
16
|
extensions: []
|
@@ -30,33 +18,32 @@ extra_rdoc_files: []
|
|
30
18
|
files:
|
31
19
|
- README
|
32
20
|
- Rakefile
|
33
|
-
- b.rb
|
34
21
|
- lib/wrap.rb
|
35
22
|
- test/testing.rb
|
36
23
|
- test/wrap_test.rb
|
37
24
|
- wrap.gemspec
|
38
25
|
homepage: https://github.com/ahoward/wrap
|
39
|
-
licenses:
|
26
|
+
licenses:
|
27
|
+
- same as ruby's
|
28
|
+
metadata: {}
|
40
29
|
post_install_message:
|
41
30
|
rdoc_options: []
|
42
31
|
require_paths:
|
43
32
|
- lib
|
44
33
|
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
-
none: false
|
46
34
|
requirements:
|
47
35
|
- - ! '>='
|
48
36
|
- !ruby/object:Gem::Version
|
49
37
|
version: '0'
|
50
38
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
-
none: false
|
52
39
|
requirements:
|
53
40
|
- - ! '>='
|
54
41
|
- !ruby/object:Gem::Version
|
55
42
|
version: '0'
|
56
43
|
requirements: []
|
57
44
|
rubyforge_project: codeforpeople
|
58
|
-
rubygems_version:
|
45
|
+
rubygems_version: 2.0.3
|
59
46
|
signing_key:
|
60
|
-
specification_version:
|
47
|
+
specification_version: 4
|
61
48
|
summary: wrap
|
62
49
|
test_files: []
|
data/b.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'wrap'
|
2
|
-
|
3
|
-
|
4
|
-
class C
|
5
|
-
include Wrap
|
6
|
-
|
7
|
-
class << self
|
8
|
-
def method_missing(method, *args, &block)
|
9
|
-
case method.to_s
|
10
|
-
when %r/\A(before|after)_(.*)\Z/
|
11
|
-
lifecycle, method = $1, $2
|
12
|
-
send(lifecycle, method, *args, &block)
|
13
|
-
else
|
14
|
-
super
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
before_initialize do
|
20
|
-
p :before_initialize
|
21
|
-
end
|
22
|
-
|
23
|
-
after_initialize do
|
24
|
-
p :after_initialize
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
C.new
|
29
|
-
|
30
|
-
__END__
|
31
|
-
class C
|
32
|
-
include Wrap
|
33
|
-
|
34
|
-
class << self
|
35
|
-
def method_missing(method, *args, &block)
|
36
|
-
p :method => method, :args => args
|
37
|
-
puts
|
38
|
-
case method.to_s
|
39
|
-
when %r/\A(before|after)_(.*)\Z/
|
40
|
-
lifecycle, method = $1, $2
|
41
|
-
wrap(method)
|
42
|
-
send(lifecycle, method, *args, &block)
|
43
|
-
else
|
44
|
-
super
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
before_initialize do
|
50
|
-
p :before_initialize
|
51
|
-
end
|
52
|
-
|
53
|
-
after_initialize do
|
54
|
-
p :after_initialize
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
C.new
|