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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5707fb76954bd035b09d19aa9fade09b2813d458
4
- data.tar.gz: 8485f06eb24491da720789d9b8319d3ae1400f72
3
+ metadata.gz: 6ac486f94aae284267633548caeb6bdf79c039fc
4
+ data.tar.gz: 20610934934d24769ae6d534a2927fbe03c6c937
5
5
  SHA512:
6
- metadata.gz: 1f27017da43d9556c7b24f02992d7cf04204bc1dc82f587d40a36b1a33f22995b8102c157532c11efcdccb4a6d910a961206e1b31885ddf534371f74de42e59e
7
- data.tar.gz: 65c5e1e493e8ece18b1015a2c9218bc9c9336dc034b82bc8266c895c233a7029cf4e5e1f66251802e4a557a250f4a4eef49d09f39fffeceee4119b265a14b9b6
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
- check_for_reloadability(code_object)
21
- reload_code_object(code_object)
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.empty? ? "self" : args.join(" ")
51
+ @obj_name ||= args.join(" ")
33
52
  end
34
53
 
35
54
  def check_for_reloadability(code_object)
@@ -1,3 +1,3 @@
1
1
  class Pry
2
- VERSION = "0.9.12.1"
2
+ VERSION = "0.9.12.2pre1"
3
3
  end
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.1
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-04-21 00:00:00.000000000 Z
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: '0'
343
+ version: 1.3.1
344
344
  requirements: []
345
345
  rubyforge_project:
346
346
  rubygems_version: 2.0.2