tappie 0.9 → 1.0.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/.bundle/config +2 -0
- data/LICENSE +1 -1
- data/README.markdown +9 -1
- data/Rakefile +2 -2
- data/lib/tappie.rb +24 -0
- data/tappie.gemspec +56 -0
- metadata +8 -5
data/.bundle/config
ADDED
data/LICENSE
CHANGED
data/README.markdown
CHANGED
@@ -8,6 +8,14 @@ It allows you to remove the syntax noise from that extra variable:
|
|
8
8
|
# 18
|
9
9
|
# Guilherme Silveira
|
10
10
|
|
11
|
+
## Scope ##
|
12
|
+
|
13
|
+
Because the invocation scope is the object itself, accessing instance variables result in internal access to the object, not the object scope where the method tap was invoked: this
|
14
|
+
can be what you desire or not. If you want to access the old scope, use tap as it was used before:
|
15
|
+
|
16
|
+
@old_scope = 10
|
17
|
+
puts "Guilherme Silveira".tap { |s| puts s.size; puts @old_scope }
|
18
|
+
|
11
19
|
## Benefits ##
|
12
20
|
|
13
21
|
Less noise if you are not using @variables of the current scope.
|
@@ -21,7 +29,7 @@ It allows you to remove the syntax noise from that extra variable:
|
|
21
29
|
|
22
30
|
Either copy tappie.rb code to your project or gem install it:
|
23
31
|
|
24
|
-
gem install
|
32
|
+
gem install tappie
|
25
33
|
|
26
34
|
Have fun!
|
27
35
|
|
data/Rakefile
CHANGED
@@ -5,8 +5,8 @@ begin
|
|
5
5
|
require 'jeweler'
|
6
6
|
Jeweler::Tasks.new do |gem|
|
7
7
|
gem.name = "tappie"
|
8
|
-
gem.version = "0.
|
9
|
-
gem.summary = %Q{
|
8
|
+
gem.version = "1.0.0"
|
9
|
+
gem.summary = %Q{Supports another clojure for tapping: acessing the object itself.}
|
10
10
|
gem.description = %Q{Allows tapping without the extra syntax noise of the parameter. Fully compatible with ruby 1.8 and 1.9.}
|
11
11
|
gem.email = "guilherme.silveira@caelum.com.br"
|
12
12
|
gem.homepage = "http://github.com/caelum/tappie"
|
data/lib/tappie.rb
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
+
#
|
2
|
+
# Feel free to copy the following code and use it instead of gem installing it.
|
3
|
+
# Do not forget the MIT license attached.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2010 guilherme silveira - caelum.com.br
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
8
|
+
# a copy of this software and associated documentation files (the
|
9
|
+
# "Software"), to deal in the Software without restriction, including
|
10
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
12
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
13
|
+
# the following conditions:
|
14
|
+
#
|
15
|
+
# The above copyright notice and this permission notice shall be
|
16
|
+
# included in all copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
23
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
24
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
25
|
module Tappie
|
2
26
|
|
3
27
|
# taps and returns the object itself.
|
data/tappie.gemspec
ADDED
@@ -0,0 +1,56 @@
|
|
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{tappie}
|
8
|
+
s.version = "1.0.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Guilherme Silveira"]
|
12
|
+
s.date = %q{2010-10-30}
|
13
|
+
s.description = %q{Allows tapping without the extra syntax noise of the parameter. Fully compatible with ruby 1.8 and 1.9.}
|
14
|
+
s.email = %q{guilherme.silveira@caelum.com.br}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.markdown"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".bundle/config",
|
21
|
+
".document",
|
22
|
+
".gitignore",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
25
|
+
"LICENSE",
|
26
|
+
"README.markdown",
|
27
|
+
"Rakefile",
|
28
|
+
"lib/tappie.rb",
|
29
|
+
"tappie.gemspec",
|
30
|
+
"test/helper.rb",
|
31
|
+
"test/test_tappie.rb"
|
32
|
+
]
|
33
|
+
s.homepage = %q{http://github.com/caelum/tappie}
|
34
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
35
|
+
s.require_paths = ["lib"]
|
36
|
+
s.rubygems_version = %q{1.3.7}
|
37
|
+
s.summary = %q{Supports another clojure for tapping: acessing the object itself.}
|
38
|
+
s.test_files = [
|
39
|
+
"test/helper.rb",
|
40
|
+
"test/test_tappie.rb"
|
41
|
+
]
|
42
|
+
|
43
|
+
if s.respond_to? :specification_version then
|
44
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
45
|
+
s.specification_version = 3
|
46
|
+
|
47
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
48
|
+
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
49
|
+
else
|
50
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
51
|
+
end
|
52
|
+
else
|
53
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tappie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
version:
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Guilherme Silveira
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-30 00:00:00 -02:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
@@ -41,6 +42,7 @@ extra_rdoc_files:
|
|
41
42
|
- LICENSE
|
42
43
|
- README.markdown
|
43
44
|
files:
|
45
|
+
- .bundle/config
|
44
46
|
- .document
|
45
47
|
- .gitignore
|
46
48
|
- Gemfile
|
@@ -49,6 +51,7 @@ files:
|
|
49
51
|
- README.markdown
|
50
52
|
- Rakefile
|
51
53
|
- lib/tappie.rb
|
54
|
+
- tappie.gemspec
|
52
55
|
- test/helper.rb
|
53
56
|
- test/test_tappie.rb
|
54
57
|
has_rdoc: true
|
@@ -84,7 +87,7 @@ rubyforge_project:
|
|
84
87
|
rubygems_version: 1.3.7
|
85
88
|
signing_key:
|
86
89
|
specification_version: 3
|
87
|
-
summary:
|
90
|
+
summary: "Supports another clojure for tapping: acessing the object itself."
|
88
91
|
test_files:
|
89
92
|
- test/helper.rb
|
90
93
|
- test/test_tappie.rb
|