pry 0.9.0pre3-java → 0.9.4pre2-java

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.
Files changed (47) hide show
  1. data/.gitignore +1 -0
  2. data/CHANGELOG +84 -6
  3. data/CONTRIBUTORS +13 -0
  4. data/README.markdown +23 -183
  5. data/Rakefile +22 -19
  6. data/TODO +36 -6
  7. data/bin/pry +12 -1
  8. data/lib/pry.rb +60 -12
  9. data/lib/pry/command_context.rb +21 -0
  10. data/lib/pry/command_processor.rb +62 -16
  11. data/lib/pry/command_set.rb +25 -11
  12. data/lib/pry/commands.rb +0 -3
  13. data/lib/pry/completion.rb +6 -6
  14. data/lib/pry/config.rb +25 -5
  15. data/lib/pry/default_commands/basic.rb +27 -6
  16. data/lib/pry/default_commands/context.rb +84 -35
  17. data/lib/pry/default_commands/documentation.rb +69 -31
  18. data/lib/pry/default_commands/easter_eggs.rb +5 -0
  19. data/lib/pry/default_commands/input.rb +193 -56
  20. data/lib/pry/default_commands/introspection.rb +98 -50
  21. data/lib/pry/default_commands/ls.rb +51 -21
  22. data/lib/pry/default_commands/shell.rb +57 -13
  23. data/lib/pry/extended_commands/experimental.rb +0 -32
  24. data/lib/pry/extended_commands/user_command_api.rb +33 -2
  25. data/lib/pry/helpers/base_helpers.rb +30 -10
  26. data/lib/pry/helpers/command_helpers.rb +75 -16
  27. data/lib/pry/helpers/text.rb +12 -11
  28. data/lib/pry/history.rb +61 -0
  29. data/lib/pry/plugins.rb +23 -12
  30. data/lib/pry/pry_class.rb +51 -50
  31. data/lib/pry/pry_instance.rb +129 -119
  32. data/lib/pry/version.rb +1 -1
  33. data/pry.gemspec +46 -0
  34. data/test/helper.rb +37 -3
  35. data/test/test_command_processor.rb +62 -19
  36. data/test/test_command_set.rb +40 -2
  37. data/test/test_completion.rb +27 -0
  38. data/test/test_default_commands/test_context.rb +185 -1
  39. data/test/test_default_commands/test_documentation.rb +10 -0
  40. data/test/test_default_commands/test_input.rb +207 -11
  41. data/test/test_default_commands/test_introspection.rb +20 -1
  42. data/test/test_default_commands/test_shell.rb +18 -0
  43. data/test/test_pry.rb +261 -45
  44. data/test/test_pry_history.rb +82 -0
  45. data/test/test_pry_output.rb +44 -0
  46. data/test/test_special_locals.rb +35 -0
  47. metadata +185 -159
data/.gitignore CHANGED
@@ -7,3 +7,4 @@ doc/
7
7
  pkg/
8
8
  coverage/
9
9
  .yardoc/
10
+ /tags
data/CHANGELOG CHANGED
@@ -1,3 +1,81 @@
1
+ */8/2011 version 0.9.4
2
+ * tempfile should end in .rb (for edit -t)
3
+ * ls output should not be in array format
4
+ * fix history saving (should not save all of Readline::HISTORY, but only what changed)
5
+ * prevent blank lines going to Readline::HISTORY (thanks cirwin!)
6
+ * ensure that cat --ex emulates the `whereami` format - includes line numbers and formatted the same, etc
7
+ * fixed bug #200 ( https://github.com/pry/pry/issues/200 )- string interpolation bug (thanks to ryanf)
8
+ * show-doc and stat now display method visibility (update WIKI)
9
+ * got rid of warnings caused by stricter ruby 1.9.3 rules
10
+ * remove interpolation of command names and fix interpolation error messag (update WIKI) (thanks ryanf!)
11
+ * 'nested sessions' now use binding stacks (so each instance manages its own collection of bindings without spawning other instances)
12
+ * changed `exit` command so that it now called Kernel#exit (after saving history)
13
+ * 'quit' now behaves like 'exit-all' (and aliased to exit-all) - it breaks out of the repl loop and sets empties the binding_stack
14
+ * 'cd ..' just pops a binding off the binding_stack with special behaviour when only one binding in stack - it breaks out of the repl loop
15
+ * added switch-to command (like jump-to but doesnt unwind the stack)
16
+ * show-method and show-doc now accept multiple method names
17
+ * control_d hook added (Pry.config.control_d_handler)
18
+ * behaviour of ^d is now to break out of current expr if in multi-line expr, or break out of current context if nested, or break out of pry repl loop if at top-level
19
+ * can no longer interpolate command name itself e.g #{x}-#{y} where x = "show" and y = "doc"
20
+ * ^C no longer captured
21
+ * got rid of Pry.active_instance, Pry.last_exception and friends.
22
+ * also special locals now shared among bindings in a pry instance (i.e _ex_ (and friends) re-injected into new binding entered with 'cd')
23
+ * renamed inp and out to _in_ and _out_ (to avoid collisions with actual locals in debugging scope)
24
+ * added third parameter to prompts, the pry instance itself (_pry) see https://github.com/pry/pry/issues/233 for why it's important
25
+ * cd behaviour when no args performs the same as `cd /`
26
+ * commands with keep_retval can now return nil (to suppress output now return 'void' instead)
27
+ * Pry::CommandProcessor::Result introduced
28
+ * Pry.view_clip() modified to be more robust and properly display Class#name
29
+ * edit command when invoked with no args now works like edit -t
30
+ * when edit is invoked (with no args or with -t) inside a multi-line expression input buffer, it dumps that buffer into a temp file and takes you to it
31
+ * got rid of Pry#null_input? since all that was needed was eval_string.empty?
32
+ * cd command now supports complex syntax: cd ../@y/y/../z
33
+ * JRuby is no longer a 2nd class citizen, almost full JRuby support, passing 100% tests
34
+
35
+ */7/2011 version 0.9.3
36
+ * cat --ex (cats 5 lines above and below line in file where exception was raised)
37
+ * edit --ex (edits line in file where exception was raised)
38
+ * edit -t (opens a temporary file and evals it in current context when closed)
39
+ * `pry -r` requires now happen after plugin loading (so as not to interfere with
40
+ * new Pry.config.disable_auto_reload option, for turning off auto reloading by edit-method and related (thanks ryanf)
41
+ * add better error messages for `cd` command
42
+ * fixed exotic object regression - BasicObject.new etc now return "=> unknown"
43
+ * added reload-method command (reloads the associated file of a method)
44
+ * converted: import => import-set, version => pry-version, install => install-command
45
+ * Pry.config.command_prefix support (thanks ryanf!)
46
+ * fixed indentation for simple-prompt
47
+ * hist command now excludes last line of input (the command invocation itself)
48
+ * hist now has `history` alias
49
+ * missing plugins no longer raise exception, just print a warning to $stderr
50
+ * fixed jedit editor support
51
+
52
+ 21/6/2011 version 0.9.2
53
+ * fixed string interpolation bug (caused valid ruby code not to execute, sorry!)
54
+ * fixed `ls` command, so it can properly display members of Object and classes, and BasicObject, etc
55
+ * added a few git related commands to experimental command set, blame and diff
56
+
57
+ 17/6/2011 version 0.9.0
58
+ * plugin system
59
+ * regex commands
60
+ * show-method works on methods defined in REPL
61
+ * new command system/API
62
+ * rubinius core support
63
+ * more backports to ruby 1.8
64
+ * inp/out special locals
65
+ * _ex_ backtrace navigation object (_ex_.line, _ex_.file)
66
+ * readline history saving/loading
67
+ * prompt stack
68
+ * more hooks
69
+ * amend-line
70
+ * play
71
+ * show-input
72
+ * edit
73
+ * much more comprehensive test suite
74
+ * support for new and old rubygems API
75
+ * changed -s behaviour of ls (now excludes Object methods)
76
+ * removed eval-file, lls, lcd, and a few other commands
77
+
78
+
1
79
  26/3/2011 version 0.7.6.1
2
80
  * added slightly better support for YARD
3
81
  * now @param and @return tags are colored green and markdown `code` is syntax highlighted using coderay
@@ -24,11 +102,11 @@
24
102
  * --color mode for pry commandline
25
103
  * clean up requires (put them all in one place)
26
104
  * simple-prompt command and toggle-color commandd.
27
-
105
+
28
106
  28/2/2011 version 0.6.3
29
107
  * Using MethodSource 0.3.4 so 1.8 show-method support provided
30
108
  * `Set` class added to list of classes that are inspected
31
-
109
+
32
110
  26/2/2011 version 0.6.1
33
111
  * !@ command alias for exit_all
34
112
  * `cd /` for breaking out to pry top level (jump-to 0)
@@ -40,11 +118,11 @@
40
118
  22/2/2011 version 0.5.8
41
119
  * Added -c (context) option to show-doc, show-methods and eval-file
42
120
  * Fixed up ordering issue of -c and -r parameters to command line pry
43
-
121
+
44
122
  21/2/2011 version 0.5.7
45
123
  * Added pry executable, auto-loads .pryrc in user's home directory, if it
46
124
  exists.
47
-
125
+
48
126
  19/2/2011 version 0.5.5
49
127
  * Added Pry.run_command
50
128
  * More useful error messages
@@ -65,7 +143,7 @@
65
143
  * Get rid of ls_method and ls_imethods (subsumed by more powerful ls)
66
144
  * Get rid of show_idoc and show_imethod
67
145
  * Add special eval-file command that evals target file in current context
68
-
146
+
69
147
  27/1/2011 version 0.4.5
70
148
  * fixed show_method (though fragile as it references __binding_impl__
71
149
  directly, making a name change to that method difficult
@@ -99,4 +177,4 @@
99
177
  * now rescuing SyntaxError as well as Racc::Parser error in valid_expression?
100
178
  8/12/2010 version 0.1.0
101
179
  * release!
102
-
180
+
data/CONTRIBUTORS ADDED
@@ -0,0 +1,13 @@
1
+ 564 John Mair
2
+ 76 Rob Gleeson
3
+ 50 Lee Jarvis
4
+ 46 Mon ouïe
5
+ 18 David Palm
6
+ 13 epitron
7
+ 8 Conrad Irwin
8
+ 6 Ryan Fitzgerald
9
+ 2 Darrick Wiebe
10
+ 2 Xavier Shay
11
+ 2 Eric Christopherson
12
+ 1 Josh Cheek
13
+ 1 Tim Pope
data/README.markdown CHANGED
@@ -1,9 +1,17 @@
1
- ![Alt text](http://dl.dropbox.com/u/15761219/pry_horizontal_red.png)
1
+ ![Alt text](http://dl.dropbox.com/u/26521875/pry_logo_350.png)
2
2
 
3
3
  (C) John Mair (banisterfiend) 2011
4
4
 
5
5
  _Get to the code_
6
6
 
7
+ **Note that JRuby is not yet supported in this release, but will be
8
+ soon.**
9
+
10
+ **Please** [DONATE](http://www.pledgie.com/campaigns/15899) to the Pry project - Pry was a **huge** amount of work and every donation received is encouraging and supports Pry's continued development!
11
+
12
+ [Skip to the website (recommended)](http://pry.github.com) <br />
13
+ [Skip to the wiki](https://github.com/pry/pry/wiki)
14
+
7
15
  Pry is a powerful alternative to the standard IRB shell for Ruby. It is
8
16
  written from scratch to provide a number of advanced features, some of
9
17
  these include:
@@ -28,7 +36,7 @@ currently not nearly as powerful as tools like [SLIME](http://en.wikipedia.org/w
28
36
  general direction Pry is heading.
29
37
 
30
38
  Pry is also fairly flexible and allows significant user
31
- [customization](http://rdoc.info/github/banister/pry/master/file/wiki/Customizing-pry.md). It
39
+ [customization](https://github.com/pry/pry/wiki/Customization-and-configuration)
32
40
  is trivial to set it to read from any object that has a `readline` method and write to any object that has a
33
41
  `puts` method - many other aspects of Pry are also configurable making
34
42
  it a good choice for implementing custom shells.
@@ -43,8 +51,9 @@ methods. The additional docs are accessed through the `show-doc` and
43
51
  `show-method` commands.
44
52
 
45
53
  * Install the [gem](https://rubygems.org/gems/pry): `gem install pry`
46
- * Read the [documentation](http://rdoc.info/github/banister/pry/master/file/README.markdown)
47
- * See the [source code](http://github.com/banister/pry)
54
+ * Browse the comprehensive [documentation at the official Pry wiki](https://github.com/pry/pry/wiki)
55
+ * Read the [YARD API documentation](http://rdoc.info/github/pry/pry/master/file/README.markdown)
56
+ * See the [source code](http://github.com/pry/pry)
48
57
 
49
58
  Pry also has `rubygems-test` support; to participate, first install
50
59
  Pry, then:
@@ -62,7 +71,7 @@ whitespace in between. Commands support a flexible syntax and allow
62
71
  Pry command will show a list of all private instance methods (in
63
72
  scope) that begin with 'pa'
64
73
 
65
- pry(YARD::Parser::SourceParser):5> ls -Mp --grep pa
74
+ pry(YARD::Parser::SourceParser):5> ls -Mp --grep ^pa
66
75
  [:parser_class, :parser_type=, :parser_type_for_filename]
67
76
 
68
77
  ### Navigating around state
@@ -193,8 +202,6 @@ current directory and count the number of lines in that file with
193
202
 
194
203
  ### Code Browsing
195
204
 
196
- #### show-method
197
-
198
205
  You can browse method source code with the `show-method` command. Nearly all Ruby methods (and some C methods, with the pry-doc
199
206
  gem) can have their source viewed. Code that is longer than a page is
200
207
  sent through a pager (such as less), and all code is properly syntax
@@ -224,7 +231,7 @@ instance methods beginning with 're' and display the source code for the `rep` m
224
231
  148: end
225
232
 
226
233
  Note that we can also view C methods (from Ruby Core) using the
227
- `pry-doc` gem; we also show off the alternate syntax for
234
+ `pry-doc` plugin; we also show off the alternate syntax for
228
235
  `show-method`:
229
236
 
230
237
  pry(main)> show-method Array#select
@@ -248,47 +255,6 @@ Note that we can also view C methods (from Ruby Core) using the
248
255
  return result;
249
256
  }
250
257
 
251
- #### Special locals
252
-
253
- Some commands such as `show-method`, `show-doc`, `show-command`, `stat`
254
- and `cat` update the `_file_` and `_dir_` local variables after they
255
- run. These locals contain the full path to the file involved in the
256
- last command as well as the directory containing that file.
257
-
258
- You can then use these special locals in conjunction with shell
259
- commands to do such things as change directory into the directory
260
- containing the file, open the file in an editor, display the file using `cat`, and so on.
261
-
262
- In the following example we wil use Pry to fix a bug in a method:
263
-
264
- pry(main)> greet "john"
265
- hello johnhow are you?=> nil
266
- pry(main)> show-method greet
267
-
268
- From: /Users/john/ruby/play/bug.rb @ line 2:
269
- Number of lines: 4
270
-
271
- def greet(name)
272
- print "hello #{name}"
273
- print "how are you?"
274
- end
275
- pry(main)> .emacsclient #{_file_}
276
- pry(main)> load _file_
277
- pry(main)> greet "john"
278
- hello john
279
- how are you?
280
- => nil
281
- pry(main)> show-method greet
282
-
283
- From: /Users/john/ruby/play/bug.rb @ line 2:
284
- Number of lines: 4
285
-
286
- def greet(name)
287
- puts "hello #{name}"
288
- puts "how are you?"
289
- end
290
-
291
-
292
258
  ### Documentation Browsing
293
259
 
294
260
  One use-case for Pry is to explore a program at run-time by `cd`-ing
@@ -343,63 +309,6 @@ We can also use `ri` in the normal way:
343
309
 
344
310
  a -- b -- c --
345
311
 
346
-
347
- ### History
348
-
349
- Readline history can be viewed and replayed using the `hist`
350
- command. When `hist` is invoked with no arguments it simply displays
351
- the history (passing the output through a pager if necessary))
352
- when the `--replay` option is used a line or a range of lines of
353
- history can be replayed.
354
-
355
- In the example below we will enter a few lines in a Pry session and
356
- then view history; we will then replay one of those lines:
357
-
358
- pry(main)> hist
359
- 0: hist -h
360
- 1: ls
361
- 2: ls
362
- 3: show-method puts
363
- 4: x = rand
364
- 5: hist
365
- pry(main)> hist --replay 3
366
-
367
- From: io.c in Ruby Core (C Method):
368
- Number of lines: 8
369
-
370
- static VALUE
371
- rb_f_puts(int argc, VALUE *argv, VALUE recv)
372
- {
373
- if (recv == rb_stdout) {
374
- return rb_io_puts(argc, argv, recv);
375
- }
376
- return rb_funcall2(rb_stdout, rb_intern("puts"), argc, argv);
377
- }
378
-
379
- In the next example we will replay a range of lines in history. Note
380
- that we replay to a point where a class definition is still open and so
381
- we can continue to add instance methods to the class:
382
-
383
- pry(main)> hist
384
- 0: class Hello
385
- 1: def hello_world
386
- 2: puts "hello world!"
387
- 3: end
388
- 4: end
389
- 5: hist
390
- pry(main)> hist --replay 0..3
391
- pry(main)* def goodbye_world
392
- pry(main)* puts "goodbye world!"
393
- pry(main)* end
394
- pry(main)* end
395
- => nil
396
- pry(main)> Hello.new.goodbye_world;
397
- goodbye world!
398
- pry(main)>
399
-
400
- Also note that in the above the line `Hello.new.goodbye_world;` ends
401
- with a semi-colon which causes expression evaluation output to be suppressed.
402
-
403
312
  ### Gist integration
404
313
 
405
314
  If the `gist` gem is installed then method source or documentation can be gisted to github with the
@@ -447,54 +356,12 @@ avaiable.
447
356
 
448
357
  MyArtChannel has kindly provided a hack to replace the `rails console` command in Rails 3: [https://gist.github.com/941174](https://gist.github.com/941174) This is not recommended for code bases with multiple developers, as they may not all want to use Pry.
449
358
 
450
- ### Other Features and limitations
451
-
452
- #### Other Features:
453
-
454
- * Pry can be invoked both at the command-line and used as a more
455
- powerful alternative to IRB or it can be invoked at runtime and used
456
- as a developer consoler / debugger.
457
- * Additional documentation and source code for Ruby Core methods are supported when the `pry-doc` gem is installed.
458
- * Pry sessions can nest arbitrarily deeply -- to go back one level of nesting type 'exit' or 'quit' or 'back'
459
- * Pry comes with syntax highlighting on by default just use the `toggle-color` command to turn it on and off.
460
- * Use `_` to recover last result.
461
- * Use `_pry_` to reference the Pry instance managing the current session.
462
- * Use `_ex_` to recover the last exception.
463
- * Use `_file_` and `_dir_` to refer to the associated file or
464
- directory containing the definition for a method.
465
- * A trailing `;` on an entered expression suppresses the display of
466
- the evaluation output.
467
- * Typing `!` on a line by itself will clear the input buffer - useful for
468
- getting you out of a situation where the parsing process
469
- goes wrong and you get stuck in an endless read loop.
470
- * Pry supports tab completion.
471
- * Pry has multi-line support built in.
472
- * Use `^d` (control-d) to quickly break out of a session.
473
- * Pry has special commands not found in many other Ruby REPLs: `show-method`, `show-doc`
474
- `jump-to`, `ls`, `cd`, `cat`
475
- * Pry gives good control over nested sessions (important when exploring complicated runtime state)
476
- * Pry is not based on the IRB codebase.
477
- * Pry allows significant customizability.
478
- * Pry uses the [method_source](https://github.com/banister/method_source) gem; so
479
- this functionality is available to a Pry session.
480
- * Pry uses [RubyParser](https://github.com/seattlerb/ruby_parser) to
481
- validate expressions in 1.8, and [Ripper](http://rdoc.info/docs/ruby-core/1.9.2/Ripper) for 1.9.
482
- * Pry implements all the methods in the REPL chain separately: `Pry#r`
483
- for reading; `Pry#re` for eval; `Pry#rep` for printing; and `Pry#repl`
484
- for the loop (`Pry.start` simply wraps `Pry.new.repl`). You can
485
- invoke any of these methods directly depending on exactly what aspect of the functionality you need.
486
-
487
- #### Limitations:
488
-
489
- * Some Pry commands (e.g `show-command`) do not work in Ruby 1.8
490
- MRI. But many other commands do work in Ruby 1.8 MRI, e.g
491
- `show-method`, due to a functional 1.8 source_location implementation.
359
+ ### Limitations:
360
+
492
361
  * JRuby not officially supported due to currently too many quirks and
493
- strange behaviour. Nonetheless most functionality should still work
494
- OK in JRuby. Full JRuby support coming in a future version.
495
- * `method_source` functionality does not work in JRuby with Ruby 1.8
362
+ strange behaviour. This will be fixed soon.
496
363
  * Tab completion is currently a bit broken/limited this will have a
497
- major overhaul in a future version.
364
+ major overhaul in a future version.
498
365
 
499
366
  ### Syntax Highlighting
500
367
 
@@ -503,40 +370,15 @@ off in a session by using the `toggle-color` command. Alternatively,
503
370
  you can turn it off permanently by putting the line `Pry.color =
504
371
  false` in your `~/.pryrc` file.
505
372
 
506
- ### Example Programs
507
-
508
- Pry comes bundled with a few example programs to illustrate some
509
- features, see the `examples/` directory.
510
-
511
- * `example_basic.rb` - Demonstrate basic Pry functionality
512
- * `example_input.rb` - Demonstrates how to set the `input` object.
513
- * `example_output.rb` - Demonstrates how to set the `output` object.
514
- * `example_hooks.rb` - Demonstrates how to set the `hooks` hash.
515
- * `example_print.rb` - Demonstrates how to set the `print` object.
516
- * `example_prompt.rb` - Demonstrates how to set the `prompt`.
517
- * `example_input2.rb` - An advanced `input` example.
518
- * `example_commands.rb` - Implementing a mathematical command set.
519
- * `example_commands_override.rb` - An advanced `commands` example.
520
- * `example_image_edit.rb` - A simple image editor using a Pry REPL (requires `Gosu` and `TexPlay` gems).
521
-
522
- ### Customizing Pry
523
-
524
- Pry allows a large degree of customization.
525
-
526
- [Read how to customize Pry here.](http://rdoc.info/github/banister/pry/master/file/wiki/Customizing-pry.md)
527
-
528
373
  ### Future Directions
529
374
 
530
375
  Many new features are planned such as:
531
376
 
377
+ * Increase modularity (rely more on plugin system)
532
378
  * Much improved tab completion (using [Bond](http://github.com/cldwalker/bond))
533
379
  * Improved JRuby support
534
- * Support for viewing source-code of binary gems and C stdlib
535
- * git integration
536
380
  * Much improved documentation system, better support for YARD
537
- * A proper plugin system
538
- * Get rid of `.` prefix for shell commands in `shell-mode`
539
- * Better support for code and method reloading
381
+ * Better support for code and method reloading and saving code
540
382
  * Extended and more sophisticated command system, allowing piping
541
383
  between commands and running commands in background
542
384
 
@@ -549,8 +391,6 @@ Problems or questions contact me at [github](http://github.com/banister)
549
391
  The Pry team consists of:
550
392
 
551
393
  * [banisterfiend](http://github.com/banister)
552
- * [epitron](http://github.com/epitron)
553
- * [injekt](http://github.com/injekt)
394
+ * [Rob Gleeson](https://github.com/robgleeson)
554
395
  * [Mon_Ouie](http://github.com/mon-ouie)
555
-
556
-
396
+ * [injekt](http://github.com/injekt)
data/Rakefile CHANGED
@@ -10,24 +10,25 @@ CLEAN.include("**/*#*", "**/*#*.*", "**/*_flymake*.*", "**/*_flymake",
10
10
 
11
11
  def apply_spec_defaults(s)
12
12
  s.name = "pry"
13
- s.summary = "an IRB alternative and runtime developer console"
13
+ s.summary = "An IRB alternative and runtime developer console"
14
14
  s.version = Pry::VERSION
15
15
  s.date = Time.now.strftime '%Y-%m-%d'
16
16
  s.author = "John Mair (banisterfiend)"
17
17
  s.email = 'jrmair@gmail.com'
18
18
  s.description = s.summary
19
- s.homepage = "http://banisterfiend.wordpress.com"
19
+ s.homepage = "http://pry.github.com"
20
20
  s.executables = ["pry"]
21
21
  s.files = `git ls-files`.split("\n")
22
22
  s.test_files = `git ls-files -- test/*`.split("\n")
23
23
  s.add_dependency("ruby_parser",">=2.0.5")
24
24
  s.add_dependency("coderay",">=0.9.8")
25
- s.add_dependency("slop","~>1.6.0")
26
- s.add_dependency("method_source",">=0.4.0")
25
+ s.add_dependency("slop","~>2.1.0")
26
+ s.add_dependency("method_source",">=0.6.5")
27
27
  s.add_development_dependency("bacon",">=1.1.0")
28
28
  s.add_development_dependency("open4", "~>1.0.1")
29
29
  end
30
30
 
31
+ desc "Run tests"
31
32
  task :test do
32
33
  sh "bacon -Itest -rubygems -a"
33
34
  end
@@ -52,15 +53,29 @@ namespace :ruby do
52
53
  pkg.need_zip = false
53
54
  pkg.need_tar = false
54
55
  end
55
-
56
+
56
57
  desc "Generate gemspec file"
57
58
  task :gemspec do
58
- File.open("#{spec.name}-#{spec.version}.gemspec", "w") do |f|
59
+ File.open("#{spec.name}.gemspec", "w") do |f|
59
60
  f << spec.to_ruby
60
61
  end
61
62
  end
62
63
  end
63
64
 
65
+ namespace :jruby do
66
+ spec = Gem::Specification.new do |s|
67
+ apply_spec_defaults(s)
68
+ s.add_dependency("spoon", ">=0.0.1")
69
+ s.platform = "java"
70
+ end
71
+
72
+ Rake::GemPackageTask.new(spec) do |pkg|
73
+ pkg.need_zip = false
74
+ pkg.need_tar = false
75
+ end
76
+ end
77
+
78
+
64
79
  [:mingw32, :mswin32].each do |v|
65
80
  namespace v do
66
81
  spec = Gem::Specification.new do |s|
@@ -76,20 +91,8 @@ end
76
91
  end
77
92
  end
78
93
 
79
- namespace :jruby do
80
- spec = Gem::Specification.new do |s|
81
- apply_spec_defaults(s)
82
- s.platform = "java"
83
- end
84
-
85
- Rake::GemPackageTask.new(spec) do |pkg|
86
- pkg.need_zip = false
87
- pkg.need_tar = false
88
- end
89
- end
90
-
91
94
  desc "build all platform gems at once"
92
- task :gems => [:clean, :rmgems, "ruby:gem", "jruby:gem", "mswin32:gem", "mingw32:gem"]
95
+ task :gems => [:clean, :rmgems, "ruby:gem", "mswin32:gem", "mingw32:gem", "jruby:gem"]
93
96
 
94
97
  desc "remove all platform gems"
95
98
  task :rmgems => ["ruby:clobber_package"]