pry 0.9.12.1 → 0.9.12.2pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pry/commands/reload_code.rb +23 -4
- data/lib/pry/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ac486f94aae284267633548caeb6bdf79c039fc
|
4
|
+
data.tar.gz: 20610934934d24769ae6d534a2927fbe03c6c937
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1e22426948a622adf6bb9897ab2f89942af7cbe20b4b3c0d6842814df05c07e6bbd5e59d707054be4bed93e926ff9d898b05bb20eccf32689a84a9fe7a3a0c8
|
7
|
+
data.tar.gz: 0114c22a06213a091d42a82c27f374af8c2ca37110ff6069bad9b4616a3704b9574f24c7172714df8a22e89a46f80a54927541e0666e3a0d247a2909f5c3c10b
|
@@ -15,21 +15,40 @@ class Pry
|
|
15
15
|
BANNER
|
16
16
|
|
17
17
|
def process
|
18
|
-
code_object = Pry::CodeObject.lookup(obj_name, _pry_)
|
19
18
|
|
20
|
-
|
21
|
-
|
19
|
+
if obj_name.empty?
|
20
|
+
# if no parameters were provided then try to reload the
|
21
|
+
# current file (i.e target.eval("__FILE__"))
|
22
|
+
reload_current_file
|
23
|
+
else
|
24
|
+
code_object = Pry::CodeObject.lookup(obj_name, _pry_)
|
25
|
+
reload_code_object(code_object)
|
26
|
+
end
|
22
27
|
end
|
23
28
|
|
24
29
|
private
|
25
30
|
|
31
|
+
def current_file
|
32
|
+
File.expand_path target.eval("__FILE__")
|
33
|
+
end
|
34
|
+
|
35
|
+
def reload_current_file
|
36
|
+
if !File.exists?(current_file)
|
37
|
+
raise CommandError, "Current file: #{current_file} cannot be found on disk!"
|
38
|
+
end
|
39
|
+
|
40
|
+
load current_file
|
41
|
+
output.puts "The current file: #{current_file} was reloaded!"
|
42
|
+
end
|
43
|
+
|
26
44
|
def reload_code_object(code_object)
|
45
|
+
check_for_reloadability(code_object)
|
27
46
|
load code_object.source_file
|
28
47
|
output.puts "#{obj_name} was reloaded!"
|
29
48
|
end
|
30
49
|
|
31
50
|
def obj_name
|
32
|
-
@obj_name ||= args.
|
51
|
+
@obj_name ||= args.join(" ")
|
33
52
|
end
|
34
53
|
|
35
54
|
def check_for_reloadability(code_object)
|
data/lib/pry/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.12.
|
4
|
+
version: 0.9.12.2pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mair (banisterfiend)
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: coderay
|
@@ -338,9 +338,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
338
338
|
version: '0'
|
339
339
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
340
340
|
requirements:
|
341
|
-
- - '
|
341
|
+
- - '>'
|
342
342
|
- !ruby/object:Gem::Version
|
343
|
-
version:
|
343
|
+
version: 1.3.1
|
344
344
|
requirements: []
|
345
345
|
rubyforge_project:
|
346
346
|
rubygems_version: 2.0.2
|