ir_b 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -11,11 +11,15 @@ Install
11
11
  Usage
12
12
  ----
13
13
 
14
- ir b
14
+ require 'ir_b'
15
+ ...
16
+ ir b # or ir-b
15
17
 
16
- or
18
+ or with [pry](http://pry.github.com/):
17
19
 
18
- ir-b
20
+ require 'ir_b/pry'
21
+ ...
22
+ ir b
19
23
 
20
24
  Detail
21
25
  ----
data/Rakefile CHANGED
@@ -10,6 +10,8 @@ begin
10
10
  gem.email = "jugyo.org@gmail.com"
11
11
  gem.homepage = "http://github.com/jugyo/ir_b"
12
12
  gem.authors = ["jugyo"]
13
+ gem.add_dependency "pry"
14
+ gem.add_dependency "pry-doc"
13
15
  gem.add_development_dependency "shoulda", ">= 0"
14
16
  gem.add_development_dependency "rr", ">= 0"
15
17
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.3.0
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ require 'ir_b/pry'
2
+ a = 'a'
3
+ ir b
data/ir_b.gemspec ADDED
@@ -0,0 +1,67 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{ir_b}
8
+ s.version = "1.3.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["jugyo"]
12
+ s.date = %q{2011-08-23}
13
+ s.description = %q{You can do irb anywhere by calling 'ir b' (need a whitespace!).}
14
+ s.email = %q{jugyo.org@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ "LICENSE",
22
+ "README.md",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "examples/example1.rb",
26
+ "examples/example2.rb",
27
+ "examples/with_pry.rb",
28
+ "ir_b.gemspec",
29
+ "lib/ir_b.rb",
30
+ "lib/ir_b/pry.rb",
31
+ "test/helper.rb",
32
+ "test/test_ir_b.rb"
33
+ ]
34
+ s.homepage = %q{http://github.com/jugyo/ir_b}
35
+ s.require_paths = ["lib"]
36
+ s.rubygems_version = %q{1.6.2}
37
+ s.summary = %q{irb anywhere}
38
+ s.test_files = [
39
+ "examples/example1.rb",
40
+ "examples/example2.rb",
41
+ "examples/with_pry.rb",
42
+ "test/helper.rb",
43
+ "test/test_ir_b.rb"
44
+ ]
45
+
46
+ if s.respond_to? :specification_version then
47
+ s.specification_version = 3
48
+
49
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
+ s.add_runtime_dependency(%q<pry>, [">= 0"])
51
+ s.add_runtime_dependency(%q<pry-doc>, [">= 0"])
52
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
53
+ s.add_development_dependency(%q<rr>, [">= 0"])
54
+ else
55
+ s.add_dependency(%q<pry>, [">= 0"])
56
+ s.add_dependency(%q<pry-doc>, [">= 0"])
57
+ s.add_dependency(%q<shoulda>, [">= 0"])
58
+ s.add_dependency(%q<rr>, [">= 0"])
59
+ end
60
+ else
61
+ s.add_dependency(%q<pry>, [">= 0"])
62
+ s.add_dependency(%q<pry-doc>, [">= 0"])
63
+ s.add_dependency(%q<shoulda>, [">= 0"])
64
+ s.add_dependency(%q<rr>, [">= 0"])
65
+ end
66
+ end
67
+
data/lib/ir_b.rb CHANGED
@@ -26,23 +26,30 @@ end
26
26
 
27
27
  module IrB
28
28
  class << self
29
+ attr_accessor :pry
30
+
29
31
  def -(_binding)
30
- file = _binding.eval '__FILE__'
31
- ir_b_line = _binding.eval '__LINE__'
32
- puts "#{file}:#{ir_b_line}"
33
-
34
- File.open(file).each_with_index do |line, index|
35
- line_n = index + 1
36
- next unless line_n > (ir_b_line - 6)
37
- break if line_n > (ir_b_line + 5)
38
- if line_n == ir_b_line
39
- puts " =>#{line_n.to_s.rjust(3)}: #{line.chomp}"
40
- else
41
- puts "#{line_n.to_s.rjust(6)}: #{line.chomp}"
32
+ if pry
33
+ require 'pry'
34
+ _binding.pry
35
+ else
36
+ file = _binding.eval '__FILE__'
37
+ ir_b_line = _binding.eval '__LINE__'
38
+ puts "#{file}:#{ir_b_line}"
39
+
40
+ File.open(file).each_with_index do |line, index|
41
+ line_n = index + 1
42
+ next unless line_n > (ir_b_line - 6)
43
+ break if line_n > (ir_b_line + 5)
44
+ if line_n == ir_b_line
45
+ puts " =>#{line_n.to_s.rjust(3)}: #{line.chomp}"
46
+ else
47
+ puts "#{line_n.to_s.rjust(6)}: #{line.chomp}"
48
+ end
42
49
  end
43
- end
44
50
 
45
- IRB.start_session(_binding)
51
+ IRB.start_session(_binding)
52
+ end
46
53
  end
47
54
  end
48
55
  end
data/lib/ir_b/pry.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'ir_b'
2
+ IrB.pry = true
metadata CHANGED
@@ -1,100 +1,110 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ir_b
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 2
8
- - 0
9
- version: 1.2.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - jugyo
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2010-11-13 00:00:00 -06:00
12
+ date: 2011-08-23 00:00:00.000000000 +09:00
18
13
  default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: shoulda
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: pry
17
+ requirement: &2157721300 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
22
24
  prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
25
+ version_requirements: *2157721300
26
+ - !ruby/object:Gem::Dependency
27
+ name: pry-doc
28
+ requirement: &2157720820 !ruby/object:Gem::Requirement
24
29
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- version: "0"
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *2157720820
37
+ - !ruby/object:Gem::Dependency
38
+ name: shoulda
39
+ requirement: &2157720340 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
31
45
  type: :development
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: rr
35
46
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
47
+ version_requirements: *2157720340
48
+ - !ruby/object:Gem::Dependency
49
+ name: rr
50
+ requirement: &2157719640 !ruby/object:Gem::Requirement
37
51
  none: false
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
- version: "0"
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
44
56
  type: :development
45
- version_requirements: *id002
57
+ prerelease: false
58
+ version_requirements: *2157719640
46
59
  description: You can do irb anywhere by calling 'ir b' (need a whitespace!).
47
60
  email: jugyo.org@gmail.com
48
61
  executables: []
49
-
50
62
  extensions: []
51
-
52
- extra_rdoc_files:
63
+ extra_rdoc_files:
53
64
  - LICENSE
54
65
  - README.md
55
- files:
66
+ files:
56
67
  - .document
57
68
  - LICENSE
58
69
  - README.md
59
70
  - Rakefile
60
71
  - VERSION
61
- - example1.rb
62
- - example2.rb
72
+ - examples/example1.rb
73
+ - examples/example2.rb
74
+ - examples/with_pry.rb
75
+ - ir_b.gemspec
63
76
  - lib/ir_b.rb
77
+ - lib/ir_b/pry.rb
64
78
  - test/helper.rb
65
79
  - test/test_ir_b.rb
66
80
  has_rdoc: true
67
81
  homepage: http://github.com/jugyo/ir_b
68
82
  licenses: []
69
-
70
83
  post_install_message:
71
- rdoc_options:
72
- - --charset=UTF-8
73
- require_paths:
84
+ rdoc_options: []
85
+ require_paths:
74
86
  - lib
75
- required_ruby_version: !ruby/object:Gem::Requirement
87
+ required_ruby_version: !ruby/object:Gem::Requirement
76
88
  none: false
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- segments:
81
- - 0
82
- version: "0"
83
- required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
94
  none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- segments:
89
- - 0
90
- version: "0"
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
91
99
  requirements: []
92
-
93
100
  rubyforge_project:
94
- rubygems_version: 1.3.7
101
+ rubygems_version: 1.6.2
95
102
  signing_key:
96
103
  specification_version: 3
97
104
  summary: irb anywhere
98
- test_files:
105
+ test_files:
106
+ - examples/example1.rb
107
+ - examples/example2.rb
108
+ - examples/with_pry.rb
99
109
  - test/helper.rb
100
110
  - test/test_ir_b.rb