lachie-tapp 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,9 @@
1
1
  = tapp
2
2
 
3
- Description goes here.
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 Keita Urashima. See LICENSE for details.
20
+ Copyright (c) 2010 Lachie Cox. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require File.expand_path("../../lib/tapp",__FILE__)
3
+
4
+ "hi there".tapp
5
+ {
6
+ :foomax => %w{special}
7
+ }.tapp(:hash)
@@ -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
+
@@ -1,11 +1,27 @@
1
- require 'pp'
1
+ begin
2
+ require 'awesome_print'
3
+ rescue LoadError
4
+ require 'pp'
5
+ end
6
+
7
+
2
8
 
3
9
  class Object
4
- def tapp(tag=nil)
5
- tap {
6
- print "#{tag}=" if tag
7
- pp block_given? ? yield(self) : self
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
- - 1
7
+ - 2
8
8
  - 0
9
- version: 1.1.0
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-10-22 00:00:00 +11:00
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