tapp 1.3.0 → 1.3.1

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/.rspec ADDED
@@ -0,0 +1 @@
1
+ -r turnip
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - ruby-head
5
+ - rbx-18mode
6
+ - rbx-19mode
7
+ script: bundle exec rspec
data/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # ChangeLog
2
+
3
+ ## 1.3.0
4
+
5
+ * Add `tapp` command-line tool. (ursm)
6
+
7
+ ## 1.2.0
8
+
9
+ * Add `Tapp.verbose` option. (moro)
10
+
11
+ ## 1.1.0
12
+
13
+ * `Object#taap` support awesome\_print (Thanks ryopeko!)
14
+
15
+ ## 1.0.0
16
+
17
+ initial release
data/README.rdoc CHANGED
@@ -1,4 +1,4 @@
1
- = tapp
1
+ = tapp {<img src="https://secure.travis-ci.org/esminc/tapp.png?branch=master" alt="Build Status" />}[http://travis-ci.org/esminc/tapp]
2
2
 
3
3
  == Usage
4
4
 
@@ -42,7 +42,7 @@ examples of use:
42
42
  * Send me a pull request. Bonus points for topic branches.
43
43
 
44
44
  == Contributors
45
- see https://github.com/esminc/tapp/pulls
45
+ see https://github.com/esminc/tapp/contributors
46
46
 
47
47
  == Copyright
48
48
 
data/lib/tapp/command.rb CHANGED
@@ -4,7 +4,9 @@ module Tapp
4
4
  class Command < Thor
5
5
  desc 'grep [<git-grep-options>]', 'Print lines using tapp'
6
6
  def grep(*)
7
- system 'git', 'grep', '--word-regexp', '-e', 'tapp', *ARGV.drop(1)
7
+ opts = ['--word-regexp', '-e', 'tapp', '-e', 'taputs', '-e', 'taap', *ARGV.drop(1)]
8
+ git_grep = ['git', 'grep', opts].flatten.join(' ')
9
+ puts `#{git_grep}`.gsub(/^Gemfile(\.lock)?:.+?\n/, '')
8
10
  end
9
11
  end
10
12
  end
data/lib/tapp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tapp
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
data/lib/tapp.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'tapp/version'
2
- require 'pp'
3
2
 
4
3
  module Tapp
5
4
  class << self
@@ -15,8 +14,18 @@ end
15
14
 
16
15
  class Object
17
16
  def tapp
18
- Tapp.report_called
19
- tap { pp block_given? ? yield(self) : self }
17
+ require 'pp'
18
+
19
+ Object.module_eval do
20
+ remove_method :tapp
21
+
22
+ def tapp
23
+ Tapp.report_called
24
+ tap { pp block_given? ? yield(self) : self }
25
+ end
26
+ end
27
+
28
+ tapp
20
29
  end
21
30
 
22
31
  def taputs
@@ -25,9 +34,18 @@ class Object
25
34
  end
26
35
 
27
36
  def taap
28
- Tapp.report_called
29
37
  require 'ap'
30
- tap { ap block_given? ? yield(self) : self }
38
+
39
+ Object.module_eval do
40
+ remove_method :taap
41
+
42
+ def taap
43
+ Tapp.report_called
44
+ tap { ap block_given? ? yield(self) : self }
45
+ end
46
+ end
47
+
48
+ taap
31
49
  rescue LoadError
32
50
  warn "Sorry, you need to install awesome_print: `gem install awesome_print`"
33
51
  end
@@ -0,0 +1,17 @@
1
+ Feature: Object#tapp
2
+
3
+ Scenario: Call tapp within methods chain
4
+ Given I have the following code:
5
+ """
6
+ require 'tapp'
7
+
8
+ (1..5).tapp.select(&:odd?).tapp.inject(&:+)
9
+ """
10
+
11
+ When Ruby it
12
+
13
+ Then I should see:
14
+ """
15
+ 1..5
16
+ [1, 3, 5]
17
+ """
@@ -0,0 +1,4 @@
1
+ RSpec.configure do |config|
2
+ Turnip::Config.step_dirs = 'spec/steps'
3
+ Turnip::StepLoader.load_steps
4
+ end
@@ -0,0 +1,18 @@
1
+ step "I have the following code:" do |code|
2
+ @code = code
3
+ end
4
+
5
+ step "Ruby it" do
6
+ stdout = StringIO.new
7
+ $stdout = stdout
8
+ begin
9
+ eval @code
10
+ ensure
11
+ $stdout = STDOUT
12
+ end
13
+ @output = stdout.string.chop
14
+ end
15
+
16
+ step "I should see:" do |output|
17
+ @output.should == output
18
+ end
data/tapp.gemspec CHANGED
@@ -17,4 +17,5 @@ Gem::Specification.new do |s|
17
17
  s.require_paths = ["lib"]
18
18
 
19
19
  s.add_runtime_dependency 'thor'
20
+ s.add_development_dependency 'turnip'
20
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-01 00:00:00.000000000 Z
12
+ date: 2012-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &15119680 !ruby/object:Gem::Requirement
16
+ requirement: &12842600 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,18 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *15119680
24
+ version_requirements: *12842600
25
+ - !ruby/object:Gem::Dependency
26
+ name: turnip
27
+ requirement: &12842140 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *12842140
25
36
  description: tap { pp self }
26
37
  email:
27
38
  - ursm@ursm.jp
@@ -31,7 +42,9 @@ extensions: []
31
42
  extra_rdoc_files: []
32
43
  files:
33
44
  - .gitignore
34
- - CHANGELOG.rdoc
45
+ - .rspec
46
+ - .travis.yml
47
+ - CHANGELOG.md
35
48
  - Gemfile
36
49
  - LICENSE
37
50
  - README.rdoc
@@ -40,6 +53,9 @@ files:
40
53
  - lib/tapp.rb
41
54
  - lib/tapp/command.rb
42
55
  - lib/tapp/version.rb
56
+ - spec/acceptance/tapp.feature
57
+ - spec/spec_helper.rb
58
+ - spec/steps/tapp_steps.rb
43
59
  - tapp.gemspec
44
60
  homepage: http://github.com/esminc/tapp
45
61
  licenses: []
@@ -61,8 +77,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
77
  version: '0'
62
78
  requirements: []
63
79
  rubyforge_project:
64
- rubygems_version: 1.8.11
80
+ rubygems_version: 1.8.15
65
81
  signing_key:
66
82
  specification_version: 3
67
83
  summary: tap { pp self }
68
- test_files: []
84
+ test_files:
85
+ - spec/acceptance/tapp.feature
86
+ - spec/spec_helper.rb
87
+ - spec/steps/tapp_steps.rb
data/CHANGELOG.rdoc DELETED
@@ -1,11 +0,0 @@
1
- = ChangeLog
2
-
3
- == 1.1.0
4
-
5
- * New Feature
6
-
7
- * Object#taap support awesome_print (Thanks ryopeko!)
8
-
9
- == 1.0.0
10
-
11
- initial release