lachie-tapp 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +5 -2
- data/VERSION +1 -1
- data/examples/tapp.eg.rb +7 -0
- data/lachie-tapp.gemspec +50 -0
- data/lib/tapp.rb +22 -6
- metadata +7 -5
data/README.rdoc
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
= tapp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
{ :your => 'object' }.tapp #(stdout)=> {:your=>"object"}
|
|
4
|
+
{ :my => 'hash' }.tapp(:mine) #(stdout)=> mine={:my=>"hash"}
|
|
5
|
+
|
|
6
|
+
If you have `awesome_print` installed, it'll be used instead of `pp`.
|
|
4
7
|
|
|
5
8
|
== Note on Patches/Pull Requests
|
|
6
9
|
|
|
@@ -14,4 +17,4 @@ Description goes here.
|
|
|
14
17
|
|
|
15
18
|
== Copyright
|
|
16
19
|
|
|
17
|
-
Copyright (c) 2010
|
|
20
|
+
Copyright (c) 2010 Lachie Cox. See LICENSE for details.
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.2.0
|
data/examples/tapp.eg.rb
ADDED
data/lachie-tapp.gemspec
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Generated by jeweler
|
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
|
4
|
+
# -*- encoding: utf-8 -*-
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |s|
|
|
7
|
+
s.name = %q{lachie-tapp}
|
|
8
|
+
s.version = "1.2.0"
|
|
9
|
+
|
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
|
+
s.authors = ["Lachie Cox"]
|
|
12
|
+
s.date = %q{2010-12-16}
|
|
13
|
+
s.description = %q{tap { pp self }}
|
|
14
|
+
s.email = %q{lachiec@gmail.com}
|
|
15
|
+
s.extra_rdoc_files = [
|
|
16
|
+
"LICENSE",
|
|
17
|
+
"README.rdoc"
|
|
18
|
+
]
|
|
19
|
+
s.files = [
|
|
20
|
+
".document",
|
|
21
|
+
".gitignore",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"README.rdoc",
|
|
24
|
+
"Rakefile",
|
|
25
|
+
"VERSION",
|
|
26
|
+
"examples/tapp.eg.rb",
|
|
27
|
+
"lachie-tapp.gemspec",
|
|
28
|
+
"lib/tapp.rb",
|
|
29
|
+
"tapp.gemspec"
|
|
30
|
+
]
|
|
31
|
+
s.homepage = %q{http://github.com/lachie/tapp}
|
|
32
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
|
33
|
+
s.require_paths = ["lib"]
|
|
34
|
+
s.rubygems_version = %q{1.3.6}
|
|
35
|
+
s.summary = %q{tap { pp self } (lachie's verison)}
|
|
36
|
+
s.test_files = [
|
|
37
|
+
"examples/tapp.eg.rb"
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
if s.respond_to? :specification_version then
|
|
41
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
42
|
+
s.specification_version = 3
|
|
43
|
+
|
|
44
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
|
45
|
+
else
|
|
46
|
+
end
|
|
47
|
+
else
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
data/lib/tapp.rb
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
begin
|
|
2
|
+
require 'awesome_print'
|
|
3
|
+
rescue LoadError
|
|
4
|
+
require 'pp'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
|
|
2
8
|
|
|
3
9
|
class Object
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
|
|
11
|
+
if defined?(::AwesomePrint)
|
|
12
|
+
def tapp(tag=nil)
|
|
13
|
+
tap {
|
|
14
|
+
print "#{tag}=" if tag
|
|
15
|
+
ap block_given? ? yield(self) : self
|
|
16
|
+
}
|
|
17
|
+
end
|
|
18
|
+
else
|
|
19
|
+
def tapp(tag=nil)
|
|
20
|
+
tap {
|
|
21
|
+
print "#{tag}=" if tag
|
|
22
|
+
pp block_given? ? yield(self) : self
|
|
23
|
+
}
|
|
24
|
+
end
|
|
9
25
|
end
|
|
10
26
|
|
|
11
27
|
def taputs(tag=nil)
|
metadata
CHANGED
|
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
|
4
4
|
prerelease: false
|
|
5
5
|
segments:
|
|
6
6
|
- 1
|
|
7
|
-
-
|
|
7
|
+
- 2
|
|
8
8
|
- 0
|
|
9
|
-
version: 1.
|
|
9
|
+
version: 1.2.0
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- Lachie Cox
|
|
@@ -14,7 +14,7 @@ autorequire:
|
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
16
|
|
|
17
|
-
date: 2010-
|
|
17
|
+
date: 2010-12-16 00:00:00 +11:00
|
|
18
18
|
default_executable:
|
|
19
19
|
dependencies: []
|
|
20
20
|
|
|
@@ -34,6 +34,8 @@ files:
|
|
|
34
34
|
- README.rdoc
|
|
35
35
|
- Rakefile
|
|
36
36
|
- VERSION
|
|
37
|
+
- examples/tapp.eg.rb
|
|
38
|
+
- lachie-tapp.gemspec
|
|
37
39
|
- lib/tapp.rb
|
|
38
40
|
- tapp.gemspec
|
|
39
41
|
has_rdoc: true
|
|
@@ -66,5 +68,5 @@ rubygems_version: 1.3.6
|
|
|
66
68
|
signing_key:
|
|
67
69
|
specification_version: 3
|
|
68
70
|
summary: tap { pp self } (lachie's verison)
|
|
69
|
-
test_files:
|
|
70
|
-
|
|
71
|
+
test_files:
|
|
72
|
+
- examples/tapp.eg.rb
|