pry-remote-em 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -65,16 +65,18 @@ module PryRemoteEm
65
65
  def initialize(opts = {:tls => false})
66
66
  @after_auth = []
67
67
  @opts = opts
68
- if (a = opts[:auth])
69
- if a.respond_to?(:call)
70
- return fail("auth handler procs must take two arguments not (#{a.method(:call).arity})") unless a.method(:call).arity == 2
71
- @auth = a
72
- else
73
- return error("auth handler objects must respond to :call, or :[]") unless a.respond_to?(:[])
74
- @auth = lambda {|u,p| a[u] && a[u] == p }
75
- end
76
- @auth_tries = 5
68
+ return unless (a = opts[:auth])
69
+ if a.is_a?(Proc)
70
+ return fail("auth handler Procs must take two arguments not (#{a.arity})") unless a.arity == 2
71
+ @auth = a
72
+ elsif a.respond_to?(:call)
73
+ return fail("auth handler must take two arguments not (#{a.method(:call).arity})") unless a.method(:call).arity == 2
74
+ @auth = a
75
+ else
76
+ return error("auth handler objects must respond to :call, or :[]") unless a.respond_to?(:[])
77
+ @auth = lambda {|u,p| a[u] && a[u] == p }
77
78
  end
79
+ @auth_tries = 5
78
80
  end
79
81
 
80
82
  def post_init
@@ -168,7 +170,7 @@ module PryRemoteEm
168
170
  end
169
171
 
170
172
  def print(val)
171
- send_data({:d => val})
173
+ @auth_required ? @after_auth.push({:d => val}) : send_data({:d => val})
172
174
  end
173
175
  alias :write :print
174
176
 
@@ -1,3 +1,3 @@
1
1
  module PryRemoteEm
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
metadata CHANGED
@@ -1,71 +1,68 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pry-remote-em
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.3
4
5
  prerelease:
5
- version: 0.4.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Caleb Crane
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-02-04 00:00:00 +09:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2012-02-04 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: eventmachine
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70346942721200 !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
25
22
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: pry
29
23
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70346942721200
25
+ - !ruby/object:Gem::Dependency
26
+ name: pry
27
+ requirement: &70346942720300 !ruby/object:Gem::Requirement
31
28
  none: false
32
- requirements:
29
+ requirements:
33
30
  - - ~>
34
- - !ruby/object:Gem::Version
31
+ - !ruby/object:Gem::Version
35
32
  version: 0.9.6
36
33
  type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: rb-readline
40
34
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70346942720300
36
+ - !ruby/object:Gem::Dependency
37
+ name: rb-readline
38
+ requirement: &70346942719100 !ruby/object:Gem::Requirement
42
39
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
47
44
  type: :runtime
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: highline
51
45
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70346942719100
47
+ - !ruby/object:Gem::Dependency
48
+ name: highline
49
+ requirement: &70346942716820 !ruby/object:Gem::Requirement
53
50
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
58
55
  type: :runtime
59
- version_requirements: *id004
60
- description: Connect to Pry remotely using EventMachine with tab-completion, paging, user authentication and SSL support.
56
+ prerelease: false
57
+ version_requirements: *70346942716820
58
+ description: Connect to Pry remotely using EventMachine with tab-completion, paging,
59
+ user authentication and SSL support.
61
60
  email: pry-remote-em@simulacre.org
62
- executables:
61
+ executables:
63
62
  - pry-remote-em
64
63
  extensions: []
65
-
66
64
  extra_rdoc_files: []
67
-
68
- files:
65
+ files:
69
66
  - lib/pry-remote-em/client.rb
70
67
  - lib/pry-remote-em/json-proto.rb
71
68
  - lib/pry-remote-em/server.rb
@@ -73,33 +70,29 @@ files:
73
70
  - lib/pry-remote-em.rb
74
71
  - bin/pry-remote-em
75
72
  - README.md
76
- has_rdoc: true
77
73
  homepage: http://github.com/simulacre/pry-remote-em
78
74
  licenses: []
79
-
80
75
  post_install_message:
81
76
  rdoc_options: []
82
-
83
- require_paths:
77
+ require_paths:
84
78
  - lib
85
- required_ruby_version: !ruby/object:Gem::Requirement
79
+ required_ruby_version: !ruby/object:Gem::Requirement
86
80
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: "0"
91
- required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
86
  none: false
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: "0"
87
+ requirements:
88
+ - - ! '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
97
91
  requirements: []
98
-
99
92
  rubyforge_project:
100
- rubygems_version: 1.6.2
93
+ rubygems_version: 1.8.10
101
94
  signing_key:
102
95
  specification_version: 3
103
96
  summary: Connect to Pry remotely using EventMachine
104
97
  test_files: []
105
-
98
+ has_rdoc: