From ertai at lrde.epita.fr Sun Sep 4 10:03:47 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun Sep 4 09:57:31 2005 Subject: [TTK-Patches] [ruby_ex] 332: Add 3 extensions of Object. Message-ID: <20050904140347.B504B1C00089@mwinf0712.wanadoo.fr> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sun Sep 4 10:13:16 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun Sep 4 10:06:43 2005 Subject: [TTK-Patches] [ruby_ex] 333: Add 3 modules extensions. Message-ID: <20050904141316.816991C0027B@mwinf0808.wanadoo.fr> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sun Sep 4 10:55:47 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun Sep 4 10:49:05 2005 Subject: [TTK-Patches] [ruby_ex] 335: Update CoreEx packaging. Message-ID: <20050904145547.0EC041C001FB@mwinf0812.wanadoo.fr> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 4 14:03:07 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun Sep 4 13:56:33 2005 Subject: [TTK-Patches] [ruby_ex] 332: Add 3 extensions of Object. In-Reply-To: <20050904140347.B504B1C00089@mwinf0712.wanadoo.fr> References: <20050904140347.B504B1C00089@mwinf0712.wanadoo.fr> Message-ID: <840b875c0509041103d72155d@mail.gmail.com> On 9/4/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Add 3 extensions of Object. > > * core_ex/lib/core_ex/object/instance_eval_with_args.rb: New. > Make the instance_eval method of Object support arguments. > * core_ex/lib/core_ex/object/the_first_time.rb: New. > This method takes a block. It ensures that the code will be > run only once. You can use this method only once per file. > * core_ex/lib/core_ex/object/singleton_class.rb: New. Provides an > access to the singleton class of an object. Also provides > singleton_class_eval, undef_singleton_method, define_singleton_method. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 4 14:09:07 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun Sep 4 14:02:20 2005 Subject: [TTK-Patches] [ruby_ex] 333: Add 3 modules extensions. In-Reply-To: <20050904141316.816991C0027B@mwinf0808.wanadoo.fr> References: <20050904141316.816991C0027B@mwinf0808.wanadoo.fr> Message-ID: <840b875c05090411091a988abe@mail.gmail.com> On 9/4/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Add 3 modules extensions. > > * core_ex/lib/core_ex/attr_once.rb: Rename to ... > * core_ex/lib/core_ex/module/attr_once.rb: ... this and update. > * core_ex/lib/core_ex/module/mix_in_with_args.rb: New. Provides `mixin' > which is like `include' but can receive arguments. A module can aslo > be setup by two blocks `setup' and `teardown'. Which are run in the > class context, before and after the real inclusion. > * core_ex/lib/core_ex/module/import.rb: New. Allow to write > MyFavoriteModule.import to load or require a module managed by > Dependencies of activesupport. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 4 14:13:48 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun Sep 4 14:06:58 2005 Subject: [TTK-Patches] [ruby_ex] 334: Many chnages to the CoreEx architecture. In-Reply-To: <20050904143023.D048F1C0025D@mwinf0808.wanadoo.fr> References: <20050904143023.D048F1C0025D@mwinf0808.wanadoo.fr> Message-ID: <840b875c050904111347cd7697@mail.gmail.com> On 9/4/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Many chnages to the CoreEx architecture. > > * core_ex/lib/core_ex/try_dup.rb: New. > * core_ex/lib/core_ex/proc.rb: New. > * core_ex/lib/core_ex/yaml.rb: Redispatch some parts into some files. > * core_ex/lib/yaml_extension.rb: New. > > * core_ex/lib/core_ex/test/unit/ui/yaml/testrunner.rb: Rename to ... > * core_ex/lib/test/unit/u_i/yaml/test_runner.rb: ... this to follow > the same link between the camelcase name and the pathname. But now it doesn't follow the same path scheme of the TestRunner in the Ruby distribution. > * core_ex/lib/core_ex/temp_path.rb: Rename to ... > * core_ex/lib/temp_path.rb: ... this and update. > * core_ex/lib/core_ex/dtime.rb: Rename to ... > * core_ex/lib/d_time.rb: ... this and update. > * core_ex/lib/core_ex/dumpable_proc.rb: Rename to ... > * core_ex/lib/dumpable_proc.rb: ... this and update. > * core_ex/lib/core_ex/fileutils.rb: Rename to ... > * core_ex/lib/core_ex/file_utils.rb: ... this and update. > * core_ex/lib/core_ex/version.rb: Rename to ... > * core_ex/lib/version.rb: ... this and update. > * core_ex/lib/core_ex/pathlist.rb: Rename to ... > * core_ex/lib/path_list.rb: ... this and update. > > * core_ex/lib/core_ex/enumerable.rb: Minor changes. > * core_ex/lib/core_ex/rakefile_base.rf: Use stringify. > * core_ex/lib/core_ex/require.rb: Remove everything but a comment. > > * core_ex/lib/core_ex/pathname.rb, core_ex/lib/core_ex/time.rb, > * core_ex/lib/core_ex/exception.rb, core_ex/lib/core_ex/string.rb, > * core_ex/lib/core_ex/embedded_tests.rb, > * core_ex/lib/core_ex.rb: Update to the new project layout. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 4 14:14:27 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun Sep 4 14:07:37 2005 Subject: [TTK-Patches] [ruby_ex] 335: Update CoreEx packaging. In-Reply-To: <20050904145547.0EC041C001FB@mwinf0812.wanadoo.fr> References: <20050904145547.0EC041C001FB@mwinf0812.wanadoo.fr> Message-ID: <840b875c050904111459cf6ef1@mail.gmail.com> On 9/4/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Update CoreEx packaging. > > * core_ex/test/test-unit-setup.rb: Don't requires files which can be > loaded automatically. > * core_ex/SPEC.yml: Need activesupport. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Tue Sep 6 17:59:29 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue Sep 6 17:52:18 2005 Subject: [TTK-Patches] [ruby_ex] 336: Update the importing/requiring/loading system. Message-ID: <20050906215929.0C7511B436@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Tue Sep 6 18:38:51 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue Sep 6 18:31:21 2005 Subject: [TTK-Patches] [ruby_ex] 338: Update tests and packaging of CoreEx. Message-ID: <20050906223851.3A36D1AFC3@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Tue Sep 6 19:43:16 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue Sep 6 19:35:44 2005 Subject: [TTK-Patches] [ruby_ex] 340: Update tests. Message-ID: <20050906234316.CFCE11B86F@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Tue Sep 6 20:02:32 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue Sep 6 19:55:00 2005 Subject: [TTK-Patches] [ruby_ex] 341: Turn warnings on. Message-ID: <20050907000232.BB4991AFC3@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Tue Sep 6 21:30:15 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue Sep 6 21:22:49 2005 Subject: [TTK-Patches] 696: Switch to the rails generators. Message-ID: <20050907013015.A94E01B51F@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Tue Sep 6 21:41:44 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue Sep 6 21:34:13 2005 Subject: [TTK-Patches] 697: Update Strategies. Message-ID: <20050907014144.72A351B96F@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Tue Sep 6 22:12:33 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue Sep 6 22:05:01 2005 Subject: [TTK-Patches] 698: Update Filters, Dumpers, Loaders and Binary. Message-ID: <20050907021233.2D85D1AFC3@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Tue Sep 6 22:19:23 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue Sep 6 22:11:49 2005 Subject: [TTK-Patches] 699: Add the RMatch strategy. Message-ID: <20050907021923.472E01AFC3@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Tue Sep 6 22:23:56 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue Sep 6 22:16:24 2005 Subject: [TTK-Patches] 700: Update tests. Message-ID: <20050907022356.029AF1AFC3@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Wed Sep 7 01:31:28 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Wed Sep 7 01:24:46 2005 Subject: [TTK-Patches] [ruby_ex] 336: Update the importing/requiring/loading system. In-Reply-To: <20050906215929.0C7511B436@smtp.feydakins.org> References: <20050906215929.0C7511B436@smtp.feydakins.org> Message-ID: <840b875c05090622312ab2cc12@mail.gmail.com> On 9/6/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Update the importing/requiring/loading system. > > * core_ex/lib/core_ex/rakefile_base.rf, > * core_ex/lib/core_ex/module/import.rb: s/import/import!. > * core_ex/lib/core_ex/pathname.rb: Add import!, split_with_load_path, > and load_path!. > * core_ex/lib/core_ex/time.rb: Import DTime for the test suite. > * core_ex/lib/core_ex/yaml.rb: No inline by default, the option become > Inline instead of NoInline. > * core_ex/lib/core_ex/dependencies_ext/constant_load_path.rb: New. > * core_ex/lib/core_ex.rb: Update to make the require happy. > * core_ex/lib/path_list.rb: Add load_path!. Fix a bug in the > globbing to regexp. s/import/import! and s/import_items/import > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Wed Sep 7 01:33:05 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Wed Sep 7 01:26:11 2005 Subject: [TTK-Patches] [ruby_ex] 338: Update tests and packaging of CoreEx. In-Reply-To: <20050906223851.3A36D1AFC3@smtp.feydakins.org> References: <20050906223851.3A36D1AFC3@smtp.feydakins.org> Message-ID: <840b875c050906223324631c7b@mail.gmail.com> On 9/7/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Update tests and packaging of CoreEx. > > * core_ex/test/check-core_ex.yml, > * core_ex/test/unit-suite.yml, > * core_ex/test/sanity/multiple-requires.yml, > * core_ex/test/sanity/single-requires.yml, > * core_ex/test/check-pkg-core_ex.yml, > * core_ex/test/sanity-suite.yml: > Update to the !S::Strat style, use Iterate, and check lazy loading. > * core_ex/test/test-unit-setup.rb: Update. > * core_ex/lib/core_ex/rakefile_base.rf: No more use `ask' but HighLine. > * core_ex/SPEC.yml: No more auto_require, and update the > activesupport version to ~> 1.1.1. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Wed Sep 7 02:09:34 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Wed Sep 7 02:02:39 2005 Subject: [TTK-Patches] [ruby_ex] 340: Update tests. In-Reply-To: <20050906234316.CFCE11B86F@smtp.feydakins.org> References: <20050906234316.CFCE11B86F@smtp.feydakins.org> Message-ID: <840b875c05090623091f8df4d9@mail.gmail.com> On 9/7/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Update tests. > > * test/unit-suite.yml, > * test/sanity/multiple-requires.yml, > * test/sanity/single-requires.yml, > * test/test-unit-setup.rb, > * test/sanity-suite.yml: > Iterate instead of Glob, !S::Strat syntax, and lazy loading. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Wed Sep 7 02:10:20 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Wed Sep 7 02:03:24 2005 Subject: [TTK-Patches] [ruby_ex] 341: Turn warnings on. In-Reply-To: <20050907000232.BB4991AFC3@smtp.feydakins.org> References: <20050907000232.BB4991AFC3@smtp.feydakins.org> Message-ID: <840b875c0509062310721d0172@mail.gmail.com> On 9/7/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Turn warnings on. > > * lib/commands/pipe.rb, lib/commands/command.rb, lib/commands/seq.rb: > Initialize @input, @output, and @error. > * lib/hookable.rb: Handle undefined @stack. > * lib/generate_id.rb: Choose a defferent name for the second test. > * lib/file_type.rb: Layout. > * SPEC.yml: No more use auto_require, and update dependencies. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Wed Sep 7 02:28:29 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Wed Sep 7 02:21:34 2005 Subject: [TTK-Patches] 696: Switch to the rails generators. In-Reply-To: <20050907013015.A94E01B51F@smtp.feydakins.org> References: <20050907013015.A94E01B51F@smtp.feydakins.org> Message-ID: <840b875c05090623286ab64427@mail.gmail.com> On 9/7/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Switch to the rails generators. > > examples: > ruby script/generate strategy MyBrandNewStrategy > ruby script/destroy dumper MyOldUselessDumper > ruby script/generate -h # gives the list of available generators. > > * script: New. > * script/destroy: New. > * script/generate: New. > * template/new_filter.rb: Remove. > * template/new_loader.rb: Remove. > * template/new_dumper.rb: Remove. > * template/new_runit_test.rb: Remove. > * template/new_strategy.rb: Remove. > * misc/template.rb: Remove. > * lib/ttk/generators: New. > * lib/ttk/generators/dumper_generator.rb: New. > * lib/ttk/generators/generator.rb: New. > * lib/ttk/generators/strategy_generator.rb: New. > * lib/ttk/generators/filter_generator.rb: New. > * lib/ttk/generators/generator_generator.rb: New. > * lib/ttk/generators/loader_generator.rb: New. > * lib/ttk/generators/templates: New. > * lib/ttk/generators/templates/unit_test.rb: New. > * lib/ttk/generators/templates/strategy.yml: New. > * lib/ttk/generators/templates/strategy.rb: New. > * lib/ttk/generators/templates/filter.rb: New. > * lib/ttk/generators/templates/generator.rb: New. > * lib/ttk/generators/templates/loader.rb: New. > * lib/ttk/generators/templates/dumper.rb: New. > [...] > Index: lib/ttk/generators/generator.rb > --- lib/ttk/generators/generator.rb (revision 0) > +++ lib/ttk/generators/generator.rb (revision 0) > @@ -0,0 +1,90 @@ > +# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved. > +# Author:: Nicolas Pouillard . > +# License:: Gnu General Public License. > +# Revision:: $Id$ > + > +module TTK > + > + # = How to use these generators > + # > + # == Requirements: > + # > + # - Ruby on rails LOL. So now, in order to developpment a test framework, we require a web application framework ! So people who wants to install UTTK I must install RubyOnRails too ! Some time ago, I asked myself why I needed to install a music player when I wanted to install a C compiler. Now I know: code factorization has no cost, and unfortunately the music player uses the same error message formating function than my C compiler. But the music player is not the only one program who need this function so I was obliged to install the whole world. The funny thing is that I don't even have a sound card :-) Seriously, either Rails developers make a separated package or we implement our own Generator::NamedBase class. I think we can do it easly... [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Wed Sep 7 02:29:40 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Wed Sep 7 02:22:45 2005 Subject: [TTK-Patches] 697: Update Strategies. In-Reply-To: <20050907014144.72A351B96F@smtp.feydakins.org> References: <20050907014144.72A351B96F@smtp.feydakins.org> Message-ID: <840b875c050906232942d0b5ab@mail.gmail.com> On 9/7/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Update Strategies. > > * lib/ttk/strategies/Extract.rb, > * lib/ttk/strategies/Fetch.rb, > * lib/ttk/strategies/Assert.rb, > * lib/ttk/strategies/RUnit.rb, > * lib/ttk/strategies/Checkout.rb, > * lib/ttk/strategies/Authors.rb: Layout, and requires. > * lib/ttk/strategies/CmdBase.rb: Use a real chdir in the `son'. > * lib/ttk/strategies/Cmd.rb: Update type attributes. > * lib/ttk/strategies/Strategy.rb: Add a to_form draft, and fix the > cache mode. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Wed Sep 7 02:31:56 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Wed Sep 7 02:25:05 2005 Subject: [TTK-Patches] 698: Update Filters, Dumpers, Loaders and Binary. In-Reply-To: <20050907021233.2D85D1AFC3@smtp.feydakins.org> References: <20050907021233.2D85D1AFC3@smtp.feydakins.org> Message-ID: <840b875c05090623313167e2e6@mail.gmail.com> On 9/7/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://dev.uttk.org/repository/changesets/698 > > Index: ChangeLog > from Nicolas Pouillard > > Update Filters, Dumpers, Loaders and Binary. > > * lib/ttk/dumpers/BasicColor.rb, > * lib/ttk/loaders/Yaml.rb, > * lib/ttk/filters/ColorStatus.rb: > Remove some requires, use HighLine. > > * lib/ttk/dumpers/Xml.rb: Fix a bug with stranges streams. > * lib/ttk/dumpers/Yaml.rb: Use the Inline option. > * lib/ttk/filters/RPathFilter.rb: Allow to stop a matcher. > * lib/ttk/filters/Buffer.rb: Add assertions and secure the @stack. > * lib/ttk/logger_factory.rb: Use TTK.dir. > * lib/ttk/weights/Weight.rb: No more a DelegateClass but a little > float container. > * lib/ttk.rb, bin/ttk, bin/getopts/ttk.rb: Fix the cache mode. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Wed Sep 7 02:08:30 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Wed Sep 7 02:27:21 2005 Subject: [TTK-Patches] [ruby_ex] 339: Many many changes and new things for RubyEx. In-Reply-To: <20050906232825.E93ED1B86F@smtp.feydakins.org> References: <20050906232825.E93ED1B86F@smtp.feydakins.org> Message-ID: <840b875c05090623084aeacf6a@mail.gmail.com> On 9/7/05, Nicolas Pouillard wrote: > > Now take a big coffee :) > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Many many changes and new things for RubyEx. > > Remove many requires which are now useless, many are not yet > suppressed. > > Renaming to follow the camelize/underscore convention. > > * lib/rpath.rb: Rename to ... > * lib/r_path.rb: ... this. > And move new assertions to RPath::Assertions. > * lib/synflow.rb: Rename to ... > * lib/syn_flow.rb: ... this. > * lib/filetype.rb: Rename to ... > * lib/file_type.rb: ... this. > * lib/dlogger.rb: Rename to ... > * lib/d_logger.rb: ... this. > * lib/killall.rb: Rename to ... > * lib/kill_all.rb: ... this. > * lib/symtbl.rb: Rename to ... > * lib/sym_tbl.rb: ... this. > * lib/orderedhash.rb: Rename to ... > * lib/ordered_hash.rb: ... this. > * lib/symtbl_gsub.rb: Rename to ... > * lib/sym_tbl_gsub.rb: ... this. And modulize have_pretty_inspect. > > New section. > * lib/blank_slate.rb: New. For method_missing based classes. > * lib/method_call.rb: New. A method name, arguments, and a block. > * lib/mocks.rb: New. > * lib/mocks/mock.rb: New. Abstract mock. > * lib/mocks/object.rb: New. Save all method calls. > * lib/mocks/observer.rb: New. Respond to update. > * lib/mocks/assertions.rb: New. Helpers for unit tests which use these > classes. > * lib/mocks/method_logger.rb: New. Respond to log and treat arguments > as a method call. > * lib/verbose_object.rb: New implementation, objects returned by a > method call on a verbose object are verbosified. > * lib/auto_object.rb: New. It's like a verbose object but without real > object inside. > * lib/html_encode.rb: New. Support accent encoding for the iso latin1 > charset. > > * lib/shuffle.rb, > * lib/genpasswd.rb, > * lib/pp_hierarchy.rb, > * lib/choose.rb, > * lib/ioo.rb, > * lib/module/hierarchy.rb, > * lib/module/autoload_tree.rb, > * lib/module/instance_method_visibility.rb, > * lib/yaml/yregexpath.rb, > * lib/yaml/chop_header.rb, > * lib/yaml/transform.rb, > * lib/generate_id.rb, > * lib/logger_observer.rb: Make a module of a class. > > * lib/thread_mutex.rb: Add tests. > > * lib/attributed_class.rb: Improve default handling, and add a draft > of a to_form method. > * lib/config_file.rb: Suppress warnings during tests. > * lib/uri_ex.rb: Use it to have all uri extentions. > * lib/commands/datas/data.rb: Make it a YamlExtension. > * lib/random_generators/ruby.rb: Set the default random generator. > * lib/random_generators.rb: require random_generators/ruby. > * lib/random_generators/random_generator.rb: Update abstract usage. > > * lib/indexed_node.rb, > * lib/labeled_node.rb, > * lib/spring.rb, > * lib/algorithms/simulated_annealing.rb, > * lib/abstract_node.rb, > * lib/md5sum.rb, > * lib/object_monitor.rb, > * lib/observable.rb, > * lib/safe_eval.rb, > * lib/node.rb, > * lib/hash_eval.rb, > * lib/histogram.rb, > * lib/const_regexp.rb, > * lib/commands.rb, > * lib/daemon.rb, > * lib/abstract.rb, > * lib/diff.rb, > * lib/timeout_ex.rb, > * lib/hooker.rb, > * lib/object_monitor_activity.rb, > * lib/trace.rb, > * lib/cache.rb, > * lib/spring_set.rb, > * lib/observable_pool.rb, > * lib/io_marshal.rb, > * lib/uri/druby.rb, > * lib/uri/svn.rb, > * lib/hookable.rb, > * lib/regex_path.rb, > * lib/drb/drb_undumped_attributes.rb, > * lib/drb/drb_undumped_indexed_object.rb, > * lib/drb/drb_service.rb, > * lib/drb/insecure_protected_methods.rb, > * lib/drb/drb_observable.rb, > * lib/service_manager.rb: Just remove useless requires. > > * lib/sendmail.rb: Update to HighLine and some other things. "some other things" .... This is not very accurate. To write this or nothing is the same. The reviewer learn nothing more. > > * lib/ruby_ex.rb: Update to make it works these big changes. > > Remove section. > * lib/yaml/basenode_ext.rb, lib/ask.rb, lib/algorithms.rb, > * lib/checkout.rb: Remove. Useless and/or deprecated. > These changes should have been split into several patches... [...] > Index: lib/module/hierarchy.rb > --- lib/module/hierarchy.rb (revision 338) > +++ lib/module/hierarchy.rb (working copy) > @@ -5,11 +5,10 @@ > # $LastChangedBy: polrop $ > # $Id$ > > -require 'ruby_ex' > > # Extend the Module class with method to manipulate inheritance relation > # between constants of a module. > -class Module > +module Hierarchy > > # Return the list of all sub classes of base_class (including itself). > # If force_autoload is false, not yet loaded constants will be ignored. > @@ -136,8 +135,15 @@ > end > end > > +end # module Hierarchy > + > +class Module > + > + include Hierarchy > + > end # class Module Making Hierarchy a module instead of an extension of Module in order to include it right after in the class Module is fairly useless I think. [...] > > Index: lib/pp_hierarchy.rb > --- lib/pp_hierarchy.rb (revision 338) > +++ lib/pp_hierarchy.rb (working copy) > @@ -5,9 +5,8 @@ > # $LastChangedBy: polrop $ > # $Id: hierarchy.rb 145 2005-01-30 14:16:14Z polrop $ > > -require 'ruby_ex' > > -class Hash > +module PpHierarchy > > # Pretty print a hash symbolizing a class hierarchy. > def pp_hierarchy(prefix=//, abstract=false) > @@ -27,4 +26,10 @@ > end > end > > +end # module PpHierarchy > + > +class Hash > + > + include PpHierarchy > + > end # class Hash Same remarks as for Hierarchy. [...] > Index: lib/shuffle.rb > --- lib/shuffle.rb (revision 338) > +++ lib/shuffle.rb (working copy) > @@ -3,7 +3,7 @@ > # License:: GNU General Public License (GPL). > # Revision:: $Id$ > > -class Array > +module Shuffle > > def shuffle! ( generator=nil ) > n = size > @@ -25,6 +25,10 @@ > dup.swap!(i, j) > end > > +end # module Shuffle > + > +class Array > + include Shuffle > end # class Array > Once again. In which other class do you want to include this module? [...] > --- lib/mocks/object.rb (revision 0) > +++ lib/mocks/object.rb (revision 0) > @@ -0,0 +1,47 @@ > +# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved. > +# Author:: Nicolas Pouillard . > +# License:: Gnu General Public License. > +# Revision:: $Id$ > + > +require 'mocks' > +require 'blank_slate' > + > +module Mocks > + > + class Object < Mock It looks weird to me that Mocks::Object is not the base class of the Mock object hierarchy. > + concrete > + > + def self.blank_slate_ignore ( name ) > + super or name =~ /^(mock_|nil\?$)/ > + end > + > + include BlankSlate > + > + def method_missing ( meth, *args, &block ) > + mock_add MethodCall.new(meth, *args, &block) > + end > + I think it's not a good idea to implement method_missing for a mock object, since when I write a mock object for unit test, I want to know (to receive an exception) if I call a not implemented method. [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Wed Sep 7 02:36:01 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Wed Sep 7 02:35:50 2005 Subject: [TTK-Patches] 700: Update tests. In-Reply-To: <20050907022356.029AF1AFC3@smtp.feydakins.org> References: <20050907022356.029AF1AFC3@smtp.feydakins.org> Message-ID: <840b875c0509062336a6693bc@mail.gmail.com> On 9/7/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://dev.uttk.org/repository/changesets/700 > > Index: ChangeLog > from Nicolas Pouillard > > Update tests. > > * test/runit/logger/to_ttk_log_test.rb, > * test/runit/logger_test.rb, > * test/runit/filters/rpath_filter_test.rb, > * test/runit/filters/buffer_test.rb: Use the mocks objects from Mocks > in ruby_ex. > * test/runit/strategies/suite_test.rb, > * test/ttk-minimal/exit.yml: Quote true and false commands. > * test/examples/cache/cache_and_fatal.yml: Add {}. > * SPEC.yml: Update. > * vendor: New. Put here your links from ruby_ex, core_ex, active... > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Wed Sep 7 02:34:31 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Wed Sep 7 03:29:25 2005 Subject: [TTK-Patches] 699: Add the RMatch strategy. In-Reply-To: <20050907021923.472E01AFC3@smtp.feydakins.org> References: <20050907021923.472E01AFC3@smtp.feydakins.org> Message-ID: <840b875c0509062334158bc031@mail.gmail.com> On 9/7/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://dev.uttk.org/repository/changesets/699 > > Index: ChangeLog > from Nicolas Pouillard > > Add the RMatch strategy. > > * lib/ttk/strategies/RMatch.rb: New. Permits to put assertion on the > output of another strategy, with regex_path. > * test/ttk-minimal/rmatch.yml: New. > This the purpose of the Test strategy. But to use regex_path for that is a good idea. I suggest to merge RMatch in Test. [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Wed Sep 7 21:17:34 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Wed Sep 7 21:10:14 2005 Subject: [TTK-Patches] [ruby_ex] 342: Minor updates on CoreEx. Message-ID: <20050908011734.A65701B86F@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Wed Sep 7 21:33:56 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Wed Sep 7 21:26:22 2005 Subject: [TTK-Patches] [ruby_ex] 343: Minors updates on RubyEx. Message-ID: <20050908013356.AB39A1B86F@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Wed Sep 7 21:45:23 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Wed Sep 7 21:37:46 2005 Subject: [TTK-Patches] [ruby_ex] 344: More imports, less requires. Message-ID: <20050908014523.095AD1B86F@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Wed Sep 7 21:57:19 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Wed Sep 7 21:49:43 2005 Subject: [TTK-Patches] 701: Finish to adapt to CoreEx and RubyEx. Message-ID: <20050908015719.324E31B86F@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Wed Sep 7 22:04:05 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Wed Sep 7 21:56:32 2005 Subject: [TTK-Patches] 702: Clean up the Html backend. Message-ID: <20050908020405.221C51B0B6@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Wed Sep 7 22:10:46 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Wed Sep 7 22:03:18 2005 Subject: [TTK-Patches] 703: Restore missing JS files. Message-ID: <20050908021046.7C17A1B0B6@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Thu Sep 8 04:40:48 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Thu Sep 8 04:34:06 2005 Subject: [TTK-Patches] [ruby_ex] 342: Minor updates on CoreEx. In-Reply-To: <20050908011734.A65701B86F@smtp.feydakins.org> References: <20050908011734.A65701B86F@smtp.feydakins.org> Message-ID: <840b875c0509080140207196e3@mail.gmail.com> On 9/8/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Minor updates on CoreEx. > > * core_ex/lib/core_ex/rakefile_base.rf: Typo s/supress/suppress. > * core_ex/lib/core_ex/yaml.rb: Remove useless <<. > * core_ex/lib/core_ex/string.rb: Add `width' which take in account the > with of a tabulation.. > * core_ex/lib/core_ex.rb: Fix the rescue block. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Thu Sep 8 04:42:52 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Thu Sep 8 04:35:55 2005 Subject: [TTK-Patches] [ruby_ex] 343: Minors updates on RubyEx. In-Reply-To: <20050908013356.AB39A1B86F@smtp.feydakins.org> References: <20050908013356.AB39A1B86F@smtp.feydakins.org> Message-ID: <840b875c050908014276b17851@mail.gmail.com> On 9/8/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Minors updates on RubyEx. > > * lib/thread_mutex.rb: Remove the :raise method because the new was > not loaded. > * lib/commands/datas/temp.rb, lib/commands/datas/factory.rb: > Remove some requires. > * lib/commands/datas/data.rb: Remove bad rescue blocks. > * lib/commands/runners/runner.rb: Include Abstract manually. > * lib/drb_ex.rb, lib/commands.rb, lib/abstract.rb: Use import! instead > of require for AutoloadTree, InstanceMethodVisibility. > * lib/ruby_ex.rb: Rename import! to import_all. > * lib/hookable.rb: Use suppress instead of rescue nil. > * lib/mocks.rb: Remove requires. > * lib/syn_flow.rb: Layout. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Thu Sep 8 04:43:25 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Thu Sep 8 04:36:27 2005 Subject: [TTK-Patches] [ruby_ex] 344: More imports, less requires. In-Reply-To: <20050908014523.095AD1B86F@smtp.feydakins.org> References: <20050908014523.095AD1B86F@smtp.feydakins.org> Message-ID: <840b875c050908014367c8f011@mail.gmail.com> On 9/8/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > More imports, less requires. > > * lib/commands/datas/factory.rb, lib/drb_ex.rb, lib/mocks/mock.rb. > * lib/mocks.rb: Use import! instead of require. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Thu Sep 8 04:45:52 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Thu Sep 8 04:38:53 2005 Subject: [TTK-Patches] 701: Finish to adapt to CoreEx and RubyEx. In-Reply-To: <20050908015719.324E31B86F@smtp.feydakins.org> References: <20050908015719.324E31B86F@smtp.feydakins.org> Message-ID: <840b875c0509080145ade12c1@mail.gmail.com> On 9/8/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://dev.uttk.org/repository/changesets/701 > > Index: ChangeLog > from Nicolas Pouillard > > Finish to adapt to CoreEx and RubyEx. > > * bin/ttk: Make a specific case for OptionParser errors. > * bin/getopts/ttk.rb: Add imports, and comment the signature. > * lib/ttk.rb: More imports, more $LOAD_PATH. > * lib/ttk/filters/Saver.rb: Fix and make generic. > * lib/ttk/dumpers/Notif.rb: Use the generic version from Saver. > * lib/ttk/logger.rb: Layout. > * test/ttk-minimal/base.yml: Add tests that check the output. > * test/pkg-suite.yml: Add missing parenthesis. > * test/ttk-pkg/cmdline.yml: Adapt. > * test/test-unit-setup.rb: Import not require. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Thu Sep 8 04:54:07 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Thu Sep 8 04:47:10 2005 Subject: [TTK-Patches] 702: Clean up the Html backend. In-Reply-To: <20050908020405.221C51B0B6@smtp.feydakins.org> References: <20050908020405.221C51B0B6@smtp.feydakins.org> Message-ID: <840b875c0509080154278bd69c@mail.gmail.com> On 9/8/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://dev.uttk.org/repository/changesets/702 > > Index: ChangeLog > from Nicolas Pouillard > > Clean up the Html backend. > > * lib/ttk/dumpers/HtmlTtkJs.rb: Rename to ... > * lib/ttk/dumpers/Html.rb: ... and clean up. > * lib/js/ttk.js: Clean up and refactor. > * lib/ttk/strategies/Checkout.rb: Import UriEx. > * test/js/img/triangle.gif: Rename to ... > * lib/js/img/triangle.gif: ... this. > * test/js/img/opentriangle.gif: Rename to ... > * lib/js/img/opentriangle.gif: ... this. > * test/js/css/ttk.css: Rename to ... > * lib/js/css/ttk.css: ... this. > * lib/ttk/filters/Warrior.rb: Adapt. > * lib/ttk/strategies/Pool.rb, lib/ttk/strategies/CmdBase.rb, > * lib/ttk/strategies/Composite.rb: Layout. > [...] Reviewed -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Thu Sep 8 04:58:00 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Thu Sep 8 04:51:04 2005 Subject: [TTK-Patches] 703: Restore missing JS files. In-Reply-To: <20050908021046.7C17A1B0B6@smtp.feydakins.org> References: <20050908021046.7C17A1B0B6@smtp.feydakins.org> Message-ID: <840b875c05090801584279e636@mail.gmail.com> On 9/8/05, Nicolas Pouillard wrote: > > Everything pass all tests !!!! > Go there: http://api.uttk.org/logs > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://dev.uttk.org/repository/changesets/703 > > Index: ChangeLog > from Nicolas Pouillard > > Restore missing JS files. > > * lib/js/css/ttk.css: New. > * lib/js/img/triangle.gif: New. > * lib/js/img/opentriangle.gif: New. > * test/js: Remove. > * test/js/ttk.html: Remove. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Thu Sep 8 22:37:59 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Thu Sep 8 22:30:33 2005 Subject: [TTK-Patches] [ruby_ex] 345: Update the rakefile and make the rake check works. Message-ID: <20050909023759.92B4E1B0B6@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Thu Sep 8 22:44:10 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Thu Sep 8 22:36:36 2005 Subject: [TTK-Patches] [ruby_ex] 346: Add a little text manipulation class. Message-ID: <20050909024410.633E61B0B6@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Thu Sep 8 22:51:20 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Thu Sep 8 22:43:51 2005 Subject: [TTK-Patches] [ruby_ex] 347: Release in approach ... Message-ID: <20050909025120.32BAE1B0B6@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sat Sep 10 07:36:00 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sat Sep 10 07:29:06 2005 Subject: [TTK-Patches] [ruby_ex] 346: Add a little text manipulation class. In-Reply-To: <20050909024410.633E61B0B6@smtp.feydakins.org> References: <20050909024410.633E61B0B6@smtp.feydakins.org> Message-ID: <840b875c05091004365b9ae637@mail.gmail.com> On 9/9/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Add a little text manipulation class. > > * lib/text.rb: New. Support things like justification, spliting, > croping, and clipping. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sat Sep 10 07:31:26 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sat Sep 10 07:30:42 2005 Subject: [TTK-Patches] [ruby_ex] 345: Update the rakefile and make the rake check works. In-Reply-To: <20050909023759.92B4E1B0B6@smtp.feydakins.org> References: <20050909023759.92B4E1B0B6@smtp.feydakins.org> Message-ID: <840b875c05091004313a3e088c@mail.gmail.com> On 9/9/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Update the rakefile and make the rake check works. > > * core_ex/test/test-unit-setup.rb: Use run_embedded_test_sections. > * core_ex/lib/core_ex/rakefile_base.rf: Add ttk, vcs version checking. > Update :check and :distcheck. > * core_ex/lib/core_ex/module/mix_in_with_args.rb: Require 'ruby_ex'. > * core_ex/lib/core_ex/embedded_tests.rb: Add run_embedded_test_sections, > add @@embedded_test_blocks and rename @@files to @@embedded_test_files. > [...] Ok. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sat Sep 10 07:42:43 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sat Sep 10 09:15:37 2005 Subject: [TTK-Patches] [ruby_ex] 347: Release in approach ... In-Reply-To: <20050909025120.32BAE1B0B6@smtp.feydakins.org> References: <20050909025120.32BAE1B0B6@smtp.feydakins.org> Message-ID: <840b875c050910044249819aa2@mail.gmail.com> On 9/9/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Release in approach ... > > * test/stress-tests/threads_and_exceptions.yml: New. It's not a real > stress test for now. But it shows how ruby (at least on my box) can > be nondeterminisc with threads and exceptions (perhaps a bug). > * test/test-unit-setup.rb: Use run_embedded_test_sections. > * SPEC.yml: Update the dependency version. > * lib/sendmail.rb: Import instead of require. > * lib/yaml/chop_header.rb: Add an accessor to the loaded document. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Mon Sep 12 03:54:39 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon Sep 12 03:47:04 2005 Subject: [TTK-Patches] [ruby_ex] 348: Fix a bug in our camelize version. Message-ID: <20050912075439.32B961B893@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Mon Sep 12 04:00:18 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon Sep 12 03:52:32 2005 Subject: [TTK-Patches] [ruby_ex] 349: Add MetaFactory. Message-ID: <20050912080018.E11681B49C@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Mon Sep 12 04:05:35 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon Sep 12 03:57:46 2005 Subject: [TTK-Patches] [ruby_ex] 350: Some fixes and improvements of the Text class. Message-ID: <20050912080535.279FD1B49C@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Mon Sep 12 04:13:18 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon Sep 12 04:05:32 2005 Subject: [TTK-Patches] 704: Update dumpers. Message-ID: <20050912081318.5221A1B49C@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Mon Sep 12 04:48:24 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon Sep 12 04:40:36 2005 Subject: [TTK-Patches] 705: Update Logger and Logger::Path. Message-ID: <20050912084824.4281C1B49C@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Mon Sep 12 04:56:58 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon Sep 12 04:49:46 2005 Subject: [TTK-Patches] 706: Update Filters. Message-ID: <20050912085658.13CC11B49C@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 12 07:45:49 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon Sep 12 07:38:58 2005 Subject: [TTK-Patches] [ruby_ex] 348: Fix a bug in our camelize version. In-Reply-To: <20050912075439.32B961B893@smtp.feydakins.org> References: <20050912075439.32B961B893@smtp.feydakins.org> Message-ID: <840b875c050912044547ed0320@mail.gmail.com> On 9/12/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Fix a bug in our camelize version. > > * core_ex/lib/core_ex.rb: Remove _s before /s. > [...] Ok. Where's the test? -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sun Sep 4 10:30:23 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon Sep 12 13:00:30 2005 Subject: [TTK-Patches] [ruby_ex] 334: Many chnages to the CoreEx architecture. Message-ID: <20050904143023.D048F1C0025D@mwinf0808.wanadoo.fr> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Tue Sep 6 19:28:25 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon Sep 12 13:00:33 2005 Subject: [TTK-Patches] [ruby_ex] 339: Many many changes and new things for RubyEx. Message-ID: <20050906232825.E93ED1B86F@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Mon Sep 12 13:44:27 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon Sep 12 13:36:37 2005 Subject: [TTK-Patches] 707: No more use the. Message-ID: <20050912174427.3B8441B893@smtp.feydakins.org> Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 12 20:05:46 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon Sep 12 20:05:32 2005 Subject: [TTK-Patches] [ruby_ex] 348: Fix a bug in our camelize version. In-Reply-To: References: <20050912075439.32B961B893@smtp.feydakins.org> <840b875c050912044547ed0320@mail.gmail.com> Message-ID: <840b875c05091217057b1e0982@mail.gmail.com> On 9/12/05, Nicolas Pouillard wrote: > On 9/12/05, Nicolas Despr?s wrote: > > On 9/12/05, Nicolas Pouillard wrote: > > > > > > svn://svn.feydakins.org/ruby_ex/trunk > > > > > > Index: ChangeLog > > > from Nicolas Pouillard > > > > > > Fix a bug in our camelize version. > > > > > > * core_ex/lib/core_ex.rb: Remove _s before /s. > > > > > > > [...] > > > > Ok. Where's the test? > > > > In the activesupport unit test suite :) > > This part will be a patch proposal for activesupport and will be no > more maintained by us. > Ok sorry. So we have to report this bug. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 12 20:17:24 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon Sep 12 20:10:16 2005 Subject: [TTK-Patches] [ruby_ex] 350: Some fixes and improvements of the Text class. In-Reply-To: <20050912080535.279FD1B49C@smtp.feydakins.org> References: <20050912080535.279FD1B49C@smtp.feydakins.org> Message-ID: <840b875c0509121717374a880c@mail.gmail.com> On 9/12/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Some fixes and improvements of the Text class. > > * lib/text.rb: Rename crop_width to crop and crop_long to clip. > Fix some bug with the \n handling. Add identity, and mask, to_text and > String#to_text. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 12 20:24:35 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon Sep 12 20:17:28 2005 Subject: [TTK-Patches] 705: Update Logger and Logger::Path. In-Reply-To: <20050912084824.4281C1B49C@smtp.feydakins.org> References: <20050912084824.4281C1B49C@smtp.feydakins.org> Message-ID: <840b875c0509121724657b5e88@mail.gmail.com> On 9/12/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://dev.uttk.org/repository/changesets/705 > > Index: ChangeLog > from Nicolas Pouillard > > Update Logger and Logger::Path. > > * lib/ttk/logger/path.rb: Add Logger::Path::to_logger_path and > Array#to_logger_path. > * lib/ttk/logger.rb: Use a more specific exception that ArgumentError, > and use local variables to save $1, $2... ASAP. > * lib/ttk/strategies/ProbabilityThreshold.rb: Update the weight > displaying. > * test/test-unit-setup.rb: Use run_embedded_test_sections. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 12 20:30:26 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon Sep 12 20:29:36 2005 Subject: [TTK-Patches] [ruby_ex] 349: Add MetaFactory. In-Reply-To: <20050912080018.E11681B49C@smtp.feydakins.org> References: <20050912080018.E11681B49C@smtp.feydakins.org> Message-ID: <840b875c05091217302ab5ee6c@mail.gmail.com> On 9/12/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Add MetaFactory. > > * lib/meta_factory.rb: New. This class help to produce objects that, > share the same initializion step. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 12 20:10:51 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon Sep 12 20:31:03 2005 Subject: [TTK-Patches] 707: No more use the. In-Reply-To: References: <20050912174427.3B8441B893@smtp.feydakins.org> Message-ID: <840b875c050912171045c202a6@mail.gmail.com> On 9/12/05, Nicolas Pouillard wrote: > The subject was: No more use the #exception callback > > On 9/12/05, Nicolas Pouillard wrote: > > > > svn://svn.feydakins.org/ttk/trunk > > > > You can also view this changeset here: > > > > http://dev.uttk.org/repository/changesets/707 > > > > Index: ChangeLog > > from Nicolas Pouillard > > > > No more use the. > > > > * lib/ttk/status.rb: Remove StatusException. Make Status inherits from > > TTKException. Use class_inheritable_accessors to clean up the code. > > * lib/ttk/strategies/Block.rb: s/StatusException/Status/. > > * lib/ttk/strategies/Strategy.rb: Add a modified version of Timeout > > whcih handle SynFlows properly and adapt. > > * lib/ttk.rb: Little initialization swaping. > > * test/pool-tests/pool.yml: Remove useless `name:'. > > * test/pool-tests/base.yml: New. > > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 12 20:14:12 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon Sep 12 20:33:17 2005 Subject: [TTK-Patches] 706: Update Filters. In-Reply-To: <20050912085658.13CC11B49C@smtp.feydakins.org> References: <20050912085658.13CC11B49C@smtp.feydakins.org> Message-ID: <840b875c050912171468c22f6a@mail.gmail.com> On 9/12/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://dev.uttk.org/repository/changesets/706 > > Index: ChangeLog > from Nicolas Pouillard > > Update Filters. > > * lib/ttk/filters/KeepSkipBased.rb: New. An abstract class for > TextFilter and NodeCut. > * lib/ttk/filters/NodeCut.rb: Sublcass KeepSkipBased and add a `prune' > option. > * lib/ttk/filters/RPathFilter.rb: Layout. > * lib/ttk/filters/Filter.rb: Add a class attribute `default_options' > and now takes its observers one the first argument. > * lib/ttk/filters/Warrior.rb: Add a method to reuse this filter. > * lib/ttk/filters/Buffer.rb, > * test/runit/filters/buffer_test.rb, > * test/runit/filters/rpath_filter_test.rb: Update to the new > F::Filter#initialize. > * lib/ttk/filters/Id.rb: Do not spread useless nils. > * lib/ttk/filters/TextFilter.rb: New. A leaf filter based on the Text > class. > > * lib/ttk.rb: New yaml support for options of filters. > * bin/getopts/ttk.rb: Change the -l option, it use now Warrior with > the given basename (instead of `log'). > > * test/runit/filters/node_cut_test.rb: New. > * test/runit/filters/keep_skip_based_test.rb: New. > * test/runit/filters/text_filter_test.rb: New. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 12 20:18:57 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon Sep 12 20:38:53 2005 Subject: [TTK-Patches] 704: Update dumpers. In-Reply-To: <20050912081318.5221A1B49C@smtp.feydakins.org> References: <20050912081318.5221A1B49C@smtp.feydakins.org> Message-ID: <840b875c0509121718778cbc95@mail.gmail.com> On 9/12/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://dev.uttk.org/repository/changesets/704 > > Index: ChangeLog > from Nicolas Pouillard > > Update dumpers. > > * lib/ttk/dumpers/Xml.rb: Remove #xmlize* because REXML does the > escaping by it self, remove also the conversion of \n by
which > will be done by TextFilter and don't make sense in an Xml dumper. > * lib/ttk/dumpers/Yaml.rb: Fix 2 bugs. Put a |2 when the given text > begin with spaces, and no more squeeze group of new lines. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Wed Sep 14 04:35:32 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Wed Sep 14 04:31:46 2005 Subject: [TTK-Patches] [ruby_ex] 351: Some fixes before the release. Message-ID: Skipped content of type multipart/signed-------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches@lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Wed Sep 14 21:44:25 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Thu, 15 Sep 2005 03:44:25 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 352: Add an automated vendor directory support. Message-ID: <20050915014425.B42CF1B85C@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Add an automated vendor directory support. * core_ex/lib/core_ex/rakefile_base.rf: Add vendor, revendor, clobber_vendor, and tarballs. * core_ex/lib/core_ex.rb: Add core_ex_vendor_require, core_ex_gem_require, core_ex_require, core_ex_debug, and core_ex_register_vendor. * core_ex/SPEC.yml: Update dependencies. SPEC.yml | 2 - lib/core_ex.rb | 76 +++++++++++++++++++++++++++++++++++-------- lib/core_ex/rakefile_base.rf | 71 ++++++++++++++++++++++++++++++++-------- 3 files changed, 122 insertions(+), 27 deletions(-) Index: core_ex/lib/core_ex/rakefile_base.rf --- core_ex/lib/core_ex/rakefile_base.rf (revision 351) +++ core_ex/lib/core_ex/rakefile_base.rf (working copy) @@ -21,7 +21,8 @@ AUTHORS = Pathname.new('AUTHORS') SPEC_YML = Pathname.new('SPEC.yml') SPEC_DYN_YML = Pathname.new('SPEC.dyn.yml') -GEM_SPEC = Pathname.new("SPEC.gemspec") +GEM_SPEC = Pathname.new('SPEC.gemspec') +VENDOR = Pathname.new('vendor') RakefileBase = __FILE__ EDITOR = ENV['EDITOR'] || 'vi' @@ -43,13 +44,16 @@ def clean_task ( arg, &block ) if arg.is_a? Hash - name = :"clobber_#{arg.keys.first}" - task(name => arg.values.first, &block) + name, deps = arg.to_a.first else - name = :"clobber_#{arg}" - task(name, &block) + name, deps = arg, [] end - task :clobber => name + clobber_name = :"clobber_#{name}" + task clobber_name => deps do + Task[name].instance_eval { @already_invoked = false } + block[] unless block.nil? + end + task :clobber => clobber_name end @@ -73,8 +77,14 @@ +task :ruby_ex => [ :spec ] do + require_gem('ruby_ex', SPEC.ruby_ex_version || '~> 0.2.0') + require 'ruby_ex' +end + + # desc 'Setup the ttk command' -task :ttk => [ :spec ] do +task :ttk => [ :spec, :ruby_ex ] do require_gem('ttk', SPEC.ttk_version || '~> 0.3.0') require 'ttk' Commands.import! @@ -180,14 +190,22 @@ task :redoc => [ :clobber_doc, :doc ] +task :tarballs => [ :dyn_spec, :vendor ] do + Rake::PackageTask.new(SPEC.name, SPEC.dyn.version.to_s) do |p| + p.need_tar_gz = true + p.need_tar_bz2 = true + p.package_files = (SPEC.pkg_files + PathList['vendor/**/*']).map { |x| x.to_s } + end +end + desc 'Generate all packages' -task :package => [ :gem_spec, :gem ] +task :package => [ :tarballs, :gem_spec, :gem ] -clean_task :package => [ :gem_spec ] +clean_task :package => [ :spec, :clobber_vendor, :clobber_gem_spec ] desc 'Re-generate all packages' -task :repackage => [ :gem_spec ] +task :repackage => [ :clobber_package, :package ] @@ -238,7 +256,7 @@ if SPEC.dependencies SPEC.dependencies.each do |name, version| - s.add_dependency(name, version) + s.add_dependency(name, (version.is_a? Array)? version.first : version) end end @@ -266,8 +284,6 @@ gtask = Rake::GemPackageTask.new(spec) do |p| p.gem_spec = spec - p.need_tar_gz = true - p.need_tar_bz2 = true p.package_files = SPEC.pkg_files.map { |x| x.to_s } end gtask.instance_eval { $gem = 'pkg'.to_path + gem_file } @@ -547,3 +563,32 @@ x.rm_f end end + + + +task :vendor => [ :spec, :ruby_ex ] do + unless VENDOR.directory? + say "Creating the vendor directory..." + VENDOR.mkpath + require 'uri_ex' + if SPEC.dependencies + SPEC.dependencies.each do |name, version| + next unless version.is_a? Array + url = version.last + if url =~ /^\d+\/[^\/]+$/ + url = "http://rubyforge.org/frs/download.php/#{url}" + end + url = URI.parse(url) + dest = VENDOR + url.pathname.basename.ext.to_s.sub(/\.tar$/, '').to_path + STDERR.puts "#{url} => #{dest}" + FileType.guess(url.checkout).extract.path.mv(dest) + end + end + end +end + +clean_task :vendor do + VENDOR.rm_rf +end + +task :revendor => [:clobber_vendor, :vendor] \ No newline at end of file Index: core_ex/SPEC.yml --- core_ex/SPEC.yml (revision 351) +++ core_ex/SPEC.yml (working copy) @@ -37,6 +37,6 @@ - '[A-Z]*' dependencies: - activesupport: ~> 1.1.1 + activesupport: [~> 1.1.1, 5161/activesupport-1.1.1.tgz] ttk_version: ~> 0.3.0 Index: core_ex/lib/core_ex.rb --- core_ex/lib/core_ex.rb (revision 351) +++ core_ex/lib/core_ex.rb (working copy) @@ -9,19 +9,69 @@ require 'pathname' require 'set' -begin - require 'rubygems' - require_gem 'activesupport' -rescue LoadError -end + CORE_EX_DIR = Pathname.new(__FILE__).dirname.expand_path.cleanpath core_ex_long = (CORE_EX_DIR + 'core_ex.rb').to_s $LOADED_FEATURES << core_ex_long unless $LOADED_FEATURES.include? core_ex_long + CORE_EX_VENDORS = [] unless defined? CORE_EX_VENDORS + CORE_EX_VENDORS << CORE_EX_DIR.parent + 'vendor' + + def core_ex_debug ( &block ) + # STDERR.puts block[].inspect + end + + def core_ex_vendor_require ( dir_name, dir_version='*' ) + if CORE_EX_VENDORS.any? { |dir| dir.exist? } + dir = Pathname.glob("{#{CORE_EX_VENDORS.join(',')}}/#{dir_name}#{dir_version}/{lib,}").first + if dir and dir.directory? + if defined? CoreEx::Pathname and Pathname.include? CoreEx::Pathname + dir.load_path! + else + $LOAD_PATH << dir.to_s + end + core_ex_debug { [:vendor, dir_name, dir_version] } + else + raise LoadError, "no vendor dir #{dir}" + end + else + core_ex_debug { :novendor } + end + end + + def core_ex_register_vendor ( dir ) + CORE_EX_VENDORS << dir unless CORE_EX_VENDORS.include? dir + end + + begin + require 'rubygems' + def core_ex_gem_require ( gem_name, gem_version='> 0' ) + require_gem gem_name, gem_version + core_ex_debug { [:require_gem, gem_name, gem_version] } + end + rescue LoadError => ex + def core_ex_gem_require ( *a, &b ) + core_ex_debug { :nogem } + end + end + + def core_ex_require ( name, gem_name=name, dir_name=name, gem_version='> 0', dir_version='*' ) + begin + core_ex_vendor_require(dir_name, dir_version) + rescue LoadError => ex + begin + core_ex_gem_require(gem_name, gem_version) + rescue LoadError + end + end + require name + end + verbose = $VERBOSE $VERBOSE = false -require 'active_support' + core_ex_require 'active_support', 'activesupport', 'activesupport', '~> 1.1.1', '-1.1.1' + # <<< little active_support patch module Inflector def underscore(camel_cased_word) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050915/5230a18e/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Thu Sep 15 07:16:26 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Thu, 15 Sep 2005 13:16:26 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 353: CoreEx bump to 0.3. Message-ID: <20050915111626.9661C1B85C@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard CoreEx bump to 0.3. * core_ex/SPEC.dyn.yml: Bump to 0.3.0. * core_ex/lib/core_ex/module/mix_in_with_args.rb: Disable tests when ruby_ex is unavailable. * core_ex/NEWS: Add the 0.3 section. * vcs/ruby_ex.rb: Remove. * vcs/HOWTO: Remove. * vcs/vcs_ruby_ex.rb: New. Support of Vcs 0.3. ChangeLog | 48 ------------------------- core_ex/NEWS | 38 +++++++++++++++++++ core_ex/SPEC.dyn.yml | 10 ++--- core_ex/lib/core_ex/module/mix_in_with_args.rb | 4 ++ vcs/HOWTO | 24 ------------ vcs/ruby_ex.rb | 17 -------- vcs/vcs_ruby_ex.rb | 8 ++-- 7 files changed, 51 insertions(+), 98 deletions(-) Index: core_ex/lib/core_ex/module/mix_in_with_args.rb --- core_ex/lib/core_ex/module/mix_in_with_args.rb (revision 352) +++ core_ex/lib/core_ex/module/mix_in_with_args.rb (working copy) @@ -94,6 +94,7 @@ test_section __FILE__ do + begin require 'ruby_ex' require 'mocks' @@ -256,6 +257,9 @@ end # class TestMixInWithArgs + rescue LoadError + end + end end # module Module Index: core_ex/SPEC.dyn.yml --- core_ex/SPEC.dyn.yml (revision 352) +++ core_ex/SPEC.dyn.yml (working copy) @@ -1,10 +1,10 @@ --- !ruby/object:OpenStruct table: - :date: "Thu, 23 Jun 2005" + :version_id: '' + :url: svn://svn.feydakins.org/ruby_ex/trunk/core_ex :version: !ruby/object:Version build: 0 major: 0 - minor: 2 - revision: 307 - :url: svn://svn.feydakins.org/ruby_ex/trunk/core_ex - :version_id: '' + minor: 3 + revision: 353 + :date: "Thu, 15 Sep 2005" Index: vcs/HOWTO --- vcs/HOWTO (revision 352) +++ vcs/HOWTO (working copy) @@ -1,24 +0,0 @@ ---- - -Mini Vcs HOWTO: - - Checkout Vcs: - svn co https://svn.lrde.epita.fr/svn/lrdetools/trunk/vcs - - Update your PATH: - export PATH=$PATH:the_path_to_vcs/bin - - Check Vcs: - vcs --help - - Make aliases: - `vcs --mk-alias` - - Check the transparent mode: - svn status! - - Commit in ruby_ex: - svn ruby_ex_commit 'Your mail subject' - or: - svn rxci 'Your mail subject' - Index: vcs/vcs_ruby_ex.rb --- vcs/vcs_ruby_ex.rb (revision 313) +++ vcs/vcs_ruby_ex.rb (working copy) @@ -1,14 +1,14 @@ # # Vcs extension. +# http://rubyforge.org/projects/vcs # class Vcs - def ruby_ex_commit! ( s, *args ) + def ruby_ex_commit! ( *args ) - common_commit!(*args) do |rev| - mail!(:to => ['ttk-patches at lists.feydakins.org'], - :subject => "[ruby_ex] #{rev}: #{s}") + common_commit!('[ruby_ex] <%= rev %>: <%= title %>', *args) do |subject| + mail!(:to => ['ttk-patches at lists.feydakins.org'], :subject => subject) end end Index: vcs/ruby_ex.rb --- vcs/ruby_ex.rb (revision 352) +++ vcs/ruby_ex.rb (working copy) @@ -1,17 +0,0 @@ -# -# Vcs extension. -# - -class Vcs - - def ruby_ex_commit! ( s, *args ) - - common_commit!(*args) do |rev| - mail!(:to => ['ttk-patches at lists.feydakins.org'], - :subject => "[ruby_ex] #{rev}: #{s}") - end - - end - alias_command :rxci, :ruby_ex_commit - -end # class Vcs Index: core_ex/NEWS --- core_ex/NEWS (revision 352) +++ core_ex/NEWS (working copy) @@ -1,3 +1,41 @@ += New in 0.3, 2005-09-15: + + * Architecture: + - Need activesupport ~> 1.1.1. + - No more custom require/load/autoload. + - Many changes to be closer of the activesupport dependency system. + - No more use the auto_require feature of rubygems. + - Add an automated vendor directory support. + - No more use `ask' but HighLine in Rakefiles. + + * Module: + - mix_in_with_args.rb: Provides `mixin' which is like `include' but + can receive arguments. A module can aslo be setup by two blocks + `setup' and `teardown'. Which are run in the class context, + before and after the real inclusion. + - import.rb: Allow to write MyFavoriteModule.import! to load or require + a module managed by Dependencies of activesupport. + + * Object: + - instance_eval_with_args.rb: + Makes the instance_eval method of Object support arguments. + - the_first_time.rb: This method takes a block. It ensures that the + code will be run only once. You can use this method only once + per file. + - singleton_class.rb: Provides an access to the singleton class of + an object. Also provides singleton_class_eval, + undef_singleton_method, define_singleton_method. + + * Yaml: + - Better option handling in yaml extensions. + - Inlines little hashs and arrays (with the Inline option set to true). + + * PathList: + - Improves PathList#each, and support aliases in Yaml. + - Many other improvements. + + * TempPath: Add TempPath.fork_init that initialize a child of a fork. + = New in 0.2, 2005-06-24: * Yaml: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050915/05a25157/signature-0001.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Thu Sep 15 19:20:02 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Fri, 16 Sep 2005 01:20:02 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 355: Some other fixes. Message-ID: <20050915232002.5A80E1B967@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Some other fixes. * core_ex/lib/core_ex/object/instance_eval_with_args.rb, * core_ex/lib/core_ex/module/mix_in_with_args.rb: No more overload instance_eval but use instance_eval_with_args. * core_ex/lib/yaml_extension.rb: Use suppress. core_ex/module/mix_in_with_args.rb | 2 +- core_ex/object/instance_eval_with_args.rb | 30 ++++++++++++------------------ yaml_extension.rb | 2 +- 3 files changed, 14 insertions(+), 20 deletions(-) Index: core_ex/lib/core_ex/module/mix_in_with_args.rb --- core_ex/lib/core_ex/module/mix_in_with_args.rb (revision 354) +++ core_ex/lib/core_ex/module/mix_in_with_args.rb (working copy) @@ -26,7 +26,7 @@ if block = blocks[[kind, aModule]] if defined? CoreEx::Object::InstanceEvalWithArgs and ::Object.include? CoreEx::Object::InstanceEvalWithArgs - instance_eval(*args, &block) + instance_eval_with_args(*args, &block) else if args.empty? module_eval(&block) Index: core_ex/lib/core_ex/object/instance_eval_with_args.rb --- core_ex/lib/core_ex/object/instance_eval_with_args.rb (revision 354) +++ core_ex/lib/core_ex/object/instance_eval_with_args.rb (working copy) @@ -12,15 +12,9 @@ @@seed ||= 0 - setup do - alias_method :instance_eval_without_args, :instance_eval - end - - def instance_eval ( *args, &block ) - if block.nil?# or args.empty? - instance_eval_without_args(*args, &block) - else - method_name = :"instance_eval_temporary_method#{@@seed}" + def instance_eval_with_args ( *args, &block ) + raise ArgumentError, "no block given" if block.nil? + method_name = :"instance_eval_temporary_method#{object_id}.#{@@seed}" @@seed += 1 define_singleton_method(method_name, &block) begin @@ -30,7 +24,6 @@ end result end - end end # module InstanceEvalWithArgs @@ -38,6 +31,7 @@ end # module CoreEx + test_section __FILE__ do class TestInstanceEvalWithArgs < ::Test::Unit::TestCase @@ -50,7 +44,7 @@ def test_instance_eval assert_nothing_raised do - @res = "foo".instance_eval(42) do |x| + @res = "foo".instance_eval_with_args(42) do |x| x + 1 end end Index: core_ex/lib/yaml_extension.rb --- core_ex/lib/yaml_extension.rb (revision 354) +++ core_ex/lib/yaml_extension.rb (working copy) @@ -25,7 +25,7 @@ undef_method :to_yaml_type old_to_yaml = :"#{theYamlType}_to_yaml" alias_method old_to_yaml, :to_yaml - remove_method :to_yaml rescue NoMethodError + suppress(NoMethodError, NameError) { remove_method :to_yaml } define_method(:to_yaml_type) { "!#{theYamlType}" } -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050916/39a7a6c0/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Thu Sep 15 20:11:29 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Fri, 16 Sep 2005 02:11:29 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 356: CoreEx bump to 0.3.1. Message-ID: <20050916001129.5FAD71B513@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard * core_ex/SPEC.dyn.yml: CoreEx bump to 0.3.1. SPEC.dyn.yml | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: core_ex/SPEC.dyn.yml --- core_ex/SPEC.dyn.yml (revision 355) +++ core_ex/SPEC.dyn.yml (working copy) @@ -1,10 +1,10 @@ --- !ruby/object:OpenStruct table: - :version_id: '' :url: svn://svn.feydakins.org/ruby_ex/trunk/core_ex + :version_id: '' :version: !ruby/object:Version - build: 0 + build: 1 major: 0 minor: 3 - revision: 353 - :date: "Thu, 15 Sep 2005" + revision: 356 + :date: "Fri, 16 Sep 2005" -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050916/fa78b204/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Fri Sep 16 05:55:49 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Fri, 16 Sep 2005 11:55:49 +0200 (CEST) Subject: [TTK-Patches] '[ruby_ex] 358: Commands: Kill forked process at exit.' Message-ID: <20050916095549.472D61B916@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Commands: Kill forked process at exit. * lib/commands/datas/data.rb: Add D::Data#kill, D::Data.clean_all and call clean_all at exit. * lib/commands/datas/composite.rb: Add kill. * lib/commands/runners/fork.rb: Call fork_init in the son. datas/composite.rb | 3 +++ datas/data.rb | 18 +++++++++++++++++- runners/fork.rb | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) Index: lib/commands/runners/fork.rb --- lib/commands/runners/fork.rb (revision 357) +++ lib/commands/runners/fork.rb (working copy) @@ -30,6 +30,7 @@ def run_impl ( aCommand, data ) data.pid = Kernel.fork do begin + TempPath.fork_init hook_trigger :son, aCommand, data super rescue Exception => ex Index: lib/commands/datas/data.rb --- lib/commands/datas/data.rb (revision 357) +++ lib/commands/datas/data.rb (working copy) @@ -29,16 +29,22 @@ attr_accessor :status attr_reader :open_mode + @@datas ||= Set.new def initialize @open_mode = :w + @status, @pid = nil, nil + @@datas << self end def waitpid - return @status if defined? @status and not @status.nil? + return @status unless @status.nil? + return if @pid.nil? Process.waitpid(@pid) @status = $? + @@datas.delete(self) + self end @@ -124,6 +130,16 @@ msg.join("\n") end + def kill ( sig='KILL' ) + Process.kill sig, @pid if @status.nil? and not @pid.nil? + waitpid + end + + def self.clean_all + @@datas.dup.each { |data| data.kill } + end + + at_exit { clean_all } end # class Data Index: lib/commands/datas/composite.rb --- lib/commands/datas/composite.rb (revision 357) +++ lib/commands/datas/composite.rb (working copy) @@ -24,6 +24,9 @@ each { |x| x.waitpid } end + def kill ( *a, &b ) + each { |x| x.kill(*a, &b) } + end end # class Composite -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050916/d9412878/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Fri Sep 16 06:06:59 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Fri, 16 Sep 2005 12:06:59 +0200 (CEST) Subject: [TTK-Patches] '[ruby_ex] 359: Various fixes.' Message-ID: <20050916100659.B051C1B513@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Various fixes. * lib/thread_mutex.rb: Remove (useless). * lib/text.rb: Fix a bug with the last \n. * lib/sendmail.rb: Add (y/n) to the question. * lib/ruby_ex.rb: Update the require process. * SPEC.yml: Update dependencies. SPEC.yml | 3 +- lib/ruby_ex.rb | 12 +++++----- lib/sendmail.rb | 2 - lib/text.rb | 2 - lib/thread_mutex.rb | 57 ---------------------------------------------------- 5 files changed, 10 insertions(+), 66 deletions(-) Index: lib/sendmail.rb --- lib/sendmail.rb (revision 358) +++ lib/sendmail.rb (working copy) @@ -108,7 +108,7 @@ | to #{opts.to.join(', ')} | from #{opts.from_name} | #{(opts.signed.nil?)? 'not signed !' : 'signed by ' + opts.from} - |Are you sure?].head_cut! + |Are you sure? (y/n)].head_cut! raise 'Aborting' unless HighLine.new.agree question, true end Index: lib/thread_mutex.rb --- lib/thread_mutex.rb (revision 358) +++ lib/thread_mutex.rb (working copy) @@ -1,57 +0,0 @@ -# Copyright:: Copyright (c) 2004, 2005 Nicolas Pouillard. All rights reserved. -# Author:: Nicolas Pouillard . -# License:: Gnu General Public License. -# Revision:: $Id$ - - -module ThreadMutex - - setup do - alias_method :raise_without_exception_call, :raise - remove_method :raise - end - - def raise ( exc, *a, &b ) - exc = exc.exception if exc.respond_to? :exception - raise_without_exception_call(exc, *a, &b) - end - -end # module ThreadMutex - -class Thread - include ThreadMutex -end # class Thread - -test_section __FILE__ do - class TestThreadMutex < ::Test::Unit::TestCase - include Mocks::Assertions - - class TestThreadMutexError < Exception - end - - def setup - @mock_object = Mocks::Object.new - def @mock_object.exception ( *a, &b ) - super - TestThreadMutexError.new - end - end - - def teardown - end - - def test_inner_raise - Thread.new do - raise @mock_object - end - assert_mock [[:exception], []] # FIXME strange this [] isn't it ? - end - - def test_outer_raise - @t = Thread.new { sleep } - @t.raise @mock_object - assert_mock [[:exception], []] - end - - end # class TestThreadMutex -end \ No newline at end of file Index: SPEC.yml --- SPEC.yml (revision 358) +++ SPEC.yml (working copy) @@ -30,6 +30,7 @@ - '[A-Z]*' dependencies: - core_ex: ~> 0.3.0 + core_ex: [~> 0.3.1, 6077/core_ex-0.3.1.tar.gz] + highline: [~> 1.0.1, 5143/highline-1.0.1.tgz] ttk_version: ~> 0.3.0 Index: lib/ruby_ex.rb --- lib/ruby_ex.rb (revision 358) +++ lib/ruby_ex.rb (working copy) @@ -33,18 +33,18 @@ file.to_s =~ /drb/ end + unless defined? CoreEx - core_ex_lib_core_ex = dir.parent + 'core_ex' + 'lib' + 'core_ex' - begin - require core_ex_lib_core_ex - rescue LoadError + file = Pathname.glob("#{dir}/../{core_ex/lib/core_ex,vendor/core_ex*/core_ex}").first + if file.nil? require 'rubygems' require_gem 'core_ex' require 'core_ex' + else + require file end end - suppress(LoadError) { require 'rubygems' } - suppress(LoadError) { require 'highline' } + suppress(LoadError) { core_ex_require 'highline' } dir.load_path! (dir + 'module').load_path! Index: lib/text.rb --- lib/text.rb (revision 358) +++ lib/text.rb (working copy) @@ -52,7 +52,7 @@ def split! ( &block ) - last_new_line = (@text[-1] == ?\n)? @text[-1] : '' + last_new_line = (@text[-1] == ?\n)? "\n" : '' indent = @text[/\A([ \t]*)/, 1] words = @text.split(/\s+/) @text, block = '', method(:adder) if block.nil? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050916/654f1877/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Fri Sep 16 08:18:22 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Fri, 16 Sep 2005 14:18:22 +0200 (CEST) Subject: [TTK-Patches] '[ruby_ex] 360: Bump RubyEx to 0.2.' Message-ID: <20050916121822.0F59D1B4E0@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Bump RubyEx to 0.2. * SPEC.dyn.yml: Update to 0.2.0. * core_ex/README: Update to 0.3. * NEWS: Add the 0.2 section. * lib/commands/datas/data.rb: Add clean. NEWS | 76 ++++++++++++++++++++++++++++++++++++++++++--- SPEC.dyn.yml | 12 +++---- core_ex/README | 6 +++ lib/commands/datas/data.rb | 14 ++++++++ 4 files changed, 98 insertions(+), 10 deletions(-) Index: SPEC.dyn.yml --- SPEC.dyn.yml (revision 359) +++ SPEC.dyn.yml (working copy) @@ -1,10 +1,10 @@ --- !ruby/object:OpenStruct table: - :date: "Sun, 05 Jun 2005" - :version: !ruby/object:Version - build: 2 - major: 0 - minor: 1 - revision: 282 :version_id: '' :url: svn://svn.feydakins.org/ruby_ex/trunk + :version: !ruby/object:Version + build: 0 + major: 0 + minor: 2 + revision: 360 + :date: "Fri, 16 Sep 2005" Index: lib/commands/datas/data.rb --- lib/commands/datas/data.rb (revision 359) +++ lib/commands/datas/data.rb (working copy) @@ -135,6 +135,20 @@ waitpid end + def clean + kill + [@input, @output, @error].each do |stream| + if stream.is_a? File + stream.close + stream = stream.path.to_path + end + unless stream.is_a? Pathname + raise ArgumentError, "need a pathname not #{stream}" + end + stream.unlink if stream.exist? and stream.temp? + end + end + def self.clean_all @@datas.dup.each { |data| data.kill } end Index: core_ex/README --- core_ex/README (revision 359) +++ core_ex/README (working copy) @@ -1 +1,7 @@ +CoreEx is designed to provides a simple but quite useful extension of the +standard library of Ruby. So some classes and modules like Pathname, +Enumerable, Exception, FileUtils, String, YAML, Module, Class and Object are +extended. There is also some new features like DTime, TempPath, Version, +embedded_tests, FileList (almost from rake), a common Rakefile. + Coming Soon. Index: NEWS --- NEWS (revision 359) +++ NEWS (working copy) @@ -1,6 +1,74 @@ -= New in 0.2, ...: += New in 0.2, 2005-09-16: - SymTbl (Symbol Table): + * Many many changes and new things for RubyEx. + + * Remove many requires which are now useless, many are not yet + suppressed. + + * Renaming to follow the camelize/underscore convention. + + * Commands: + Provides a object oriented way to manage, combine and run your commands. + + Example: + require 'rubygems' ; require_gem 'ruby_ex' ; require 'ruby_ex' + Commands.import! + ls, wc, out = 'ls'.to_cmd, 'wc'.to_cmd, 'out'.to_path + + data = ls.system # other runners exist (exec, fork, sh...) + + p data.status + puts data.output.read + + (ls > STDOUT).system + + cmd = ls['*.rb'] | wc['-l'] > out + cmd.system + + puts out.read + + * RPath: Add RPath, a basic (but powerful) way to search your ruby data. + + * BlankSlate, Mocks, VerboseObject, and AutoObject: + + - BlankSlate: For method_missing based classes. + - Mocks::Mock: Abstract mock. + - Mocks::Object: Save all method calls. + - Mocks::Observer: Respond to update. + - Mocks::Assertions: Helpers for unit tests which use these classes. + - Mocks::MethodLogger: Respond to log and treat arguments as a method call. + - VerboseObject: Proxies that display received method calls and verbosify + objects recursivly. + - AutoObject: It's like a verbose object without a real object inside. + + * Text: + A little text manipulation class. + Transformation available are: + - justifying + - spliting + - croping + - clipping + + * FileType: + - Use the Commands module. + - Add extractable? and installable? methods. + - Add priorities for extensions. + - Clean the declaration syntax for extensions. + - Add many unit tests. + - Add gem filetype support (with the install method). + + * MetaFactory: A class that help to produce objects that + share the same initializion step. + + * Html encode: Support accent encoding for the iso latin1 charset. + + * URI: Support for Mysql and Pgsql. + + * HashEval: + Provides a block in which methods name are keys and arguments/blocks + are values. + + * SymTbl (Symbol Table): Add symtbl_gsub methods to provide a global substitution sheme over any objects. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050916/073bba28/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Fri Sep 16 09:11:29 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Fri, 16 Sep 2005 15:11:29 +0200 Subject: [TTK-Patches] [ruby_ex] 356: CoreEx bump to 0.3.1. In-Reply-To: <20050916001129.5FAD71B513@smtp.feydakins.org> References: <20050916001129.5FAD71B513@smtp.feydakins.org> Message-ID: <840b875c05091606112adffe2a@mail.gmail.com> On 9/16/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > * core_ex/SPEC.dyn.yml: CoreEx bump to 0.3.1. > [...] Ok. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Fri Sep 16 09:13:08 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Fri, 16 Sep 2005 15:13:08 +0200 Subject: [TTK-Patches] '[ruby_ex] 359: Various fixes.' In-Reply-To: <20050916100659.B051C1B513@smtp.feydakins.org> References: <20050916100659.B051C1B513@smtp.feydakins.org> Message-ID: <840b875c050916061366842a10@mail.gmail.com> On 9/16/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Various fixes. > > * lib/thread_mutex.rb: Remove (useless). > * lib/text.rb: Fix a bug with the last \n. > * lib/sendmail.rb: Add (y/n) to the question. > * lib/ruby_ex.rb: Update the require process. > * SPEC.yml: Update dependencies. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Fri Sep 16 09:23:51 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Fri, 16 Sep 2005 15:23:51 +0200 Subject: [TTK-Patches] '[ruby_ex] 360: Bump RubyEx to 0.2.' In-Reply-To: <20050916121822.0F59D1B4E0@smtp.feydakins.org> References: <20050916121822.0F59D1B4E0@smtp.feydakins.org> Message-ID: <840b875c050916062329994a1b@mail.gmail.com> On 9/16/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Bump RubyEx to 0.2. > > * SPEC.dyn.yml: Update to 0.2.0. > * core_ex/README: Update to 0.3. > * NEWS: Add the 0.2 section. > * lib/commands/datas/data.rb: Add clean. > [...] > Index: core_ex/README > --- core_ex/README (revision 359) > +++ core_ex/README (working copy) > @@ -1 +1,7 @@ > +CoreEx is designed to provides a simple but quite useful extension of the > +standard library of Ruby. So some classes and modules like Pathname, > +Enumerable, Exception, FileUtils, String, YAML, Module, Class and Object are > +extended. There is also some new features like DTime, TempPath, Version, > +embedded_tests, FileList (almost from rake), a common Rakefile. Thus, some classes... There are also new features... and a common Rakefile. > + > Coming Soon. > Index: NEWS > --- NEWS (revision 359) > +++ NEWS (working copy) > @@ -1,6 +1,74 @@ > -= New in 0.2, ...: > += New in 0.2, 2005-09-16: > > - SymTbl (Symbol Table): > + * Many many changes and new things for RubyEx. Useless because it's too fuzy. > + > + * Remove many requires which are now useless, many are not yet s/,/;/ > + suppressed. > + > + * Renaming to follow the camelize/underscore convention. Rename classes name and modules name to follow ... > + > + * Commands: > + Provides a object oriented way to manage, combine and run your commands. a -> an > + > + Example: > + require 'rubygems' ; require_gem 'ruby_ex' ; require 'ruby_ex' > + Commands.import! > + ls, wc, out = 'ls'.to_cmd, 'wc'.to_cmd, 'out'.to_path > + > + data = ls.system # other runners exist (exec, fork, sh...) > + > + p data.status > + puts data.output.read > + > + (ls > STDOUT).system > + > + cmd = ls['*.rb'] | wc['-l'] > out > + cmd.system > + > + puts out.read Move this documentation in the corresponding file and follow the RDoc format. > + > + * RPath: Add RPath, a basic (but powerful) way to search your ruby data. I think "simple" is a better qualifier than "basic (but powerfull)" > + > + * BlankSlate, Mocks, VerboseObject, and AutoObject: > + > + - BlankSlate: For method_missing based classes. > + - Mocks::Mock: Abstract mock. > + - Mocks::Object: Save all method calls. > + - Mocks::Observer: Respond to update. > + - Mocks::Assertions: Helpers for unit tests which use these classes. > + - Mocks::MethodLogger: Respond to log and treat arguments as a method call. > + - VerboseObject: Proxies that display received method calls and verbosify > + objects recursivly. > + - AutoObject: It's like a verbose object without a real object inside. > + > + * Text: > + A little text manipulation class. > + Transformation available are: > + - justifying > + - spliting > + - croping > + - clipping > + > + * FileType: > + - Use the Commands module. > + - Add extractable? and installable? methods. > + - Add priorities for extensions. > + - Clean the declaration syntax for extensions. > + - Add many unit tests. > + - Add gem filetype support (with the install method). > + > + * MetaFactory: A class that help to produce objects that ^^^^^^^^^^^ -> which > + share the same initializion step. > + > + * Html encode: Support accent encoding for the iso latin1 charset. > + > + * URI: Support for Mysql and Pgsql. MySQL and PgSQL > + > + * HashEval: > + Provides a block in which methods name are keys and arguments/blocks > + are values. > + > + * SymTbl (Symbol Table): > Add symtbl_gsub methods to provide a global substitution sheme over any > objects. > to provide -> which provide Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Fri Sep 16 09:12:36 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Fri, 16 Sep 2005 15:12:36 +0200 Subject: [TTK-Patches] '[ruby_ex] 358: Commands: Kill forked process at exit.' In-Reply-To: <20050916095549.472D61B916@smtp.feydakins.org> References: <20050916095549.472D61B916@smtp.feydakins.org> Message-ID: <840b875c050916061271b2ad3b@mail.gmail.com> On 9/16/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Commands: Kill forked process at exit. > > * lib/commands/datas/data.rb: Add D::Data#kill, D::Data.clean_all and > call clean_all at exit. > * lib/commands/datas/composite.rb: Add kill. > * lib/commands/runners/fork.rb: Call fork_init in the son. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Fri Sep 16 12:14:47 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Fri, 16 Sep 2005 18:14:47 +0200 Subject: [TTK-Patches] '[ruby_ex] 360: Bump RubyEx to 0.2.' In-Reply-To: References: <20050916121822.0F59D1B4E0@smtp.feydakins.org> <840b875c050916062329994a1b@mail.gmail.com> Message-ID: <840b875c050916091448c134a9@mail.gmail.com> On 9/16/05, Nicolas Pouillard wrote: > On 9/16/05, Nicolas Despr?s wrote: > > On 9/16/05, Nicolas Pouillard wrote: > > > > > > svn://svn.feydakins.org/ruby_ex/trunk > > > > > > Index: ChangeLog > > > from Nicolas Pouillard > > > > > > Bump RubyEx to 0.2. > > > > > > * SPEC.dyn.yml: Update to 0.2.0. > > > * core_ex/README: Update to 0.3. > > > * NEWS: Add the 0.2 section. > > > * lib/commands/datas/data.rb: Add clean. > > > [...] > > > > Move this documentation in the corresponding file and follow the RDoc format. > > > > I have duplicated it (I think thats important to entice people about Commands) > Ok, but I have never seen that in another project before. [...] Cheers, -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Mon Sep 19 09:56:35 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon, 19 Sep 2005 15:56:35 +0200 (CEST) Subject: [TTK-Patches] [RubyPreloaded] 4: Initial commit. Message-ID: <20050919135635.9066E1B324@smtp.feydakins.org> svn://svn.feydakins.org/ruby_preloaded/trunk Index: ChangeLog from Nicolas Pouillard Initial commit. * AUTHORS: New. * README: New. * NEWS: New. * lib/preloaded_client.rb: New. Client template. * lib/preloaded_server.rb: New. Server base class. * bin/ruby_preloaded: New. The server programm. * vcs/vcs_ruby_preloaded.rb: New. Vcs support (rpci to commit). * pty/extconf.rb, pty/pty.c: New. From ruby-1.8.3 and adapt. AUTHORS | 7 README | 47 ++ bin/ruby_preloaded | 26 + lib/preloaded_client.rb | 127 +++++++ lib/preloaded_server.rb | 127 +++++++ pty/extconf.rb | 15 pty/pty.c | 782 ++++++++++++++++++++++++++++++++++++++++++++++ vcs/vcs_ruby_preloaded.rb | 14 8 files changed, 1145 insertions(+) Index: README --- README (revision 0) +++ README (revision 0) @@ -0,0 +1,47 @@ +RubyPreloaded is a lightweight daemon used to preload somehow big ruby +applications without the initialization cost. + +You need to load the server just one time and when you want use an application +you can use this preloaded ruby instance. For this just ask for a an instance +running the client process. + +Example: + +$ time ttk --version + +TTK version 0.3.0-pre1 {Mon, 12 Sep 2005} [almost kid] + +Copyright (c) 2004, 2005 Nicolas Desprès, Nicolas Pouillard +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +ttk --version 1.96s user 0.50s system 74% cpu 3.292 total + +You that TTK is quite long to launch on my box !!! This due to its +initialization step. + +So now let's run the server on a terminal: + +$ ruby_preload +Generating the Ruby client... +/tmp/ruby_preloaded.1130/ruby + +The server does not return and wait for clients. +It's initialization step took almost the same time (3 seconds). + +Now run the client on another terminal: + +$ /tmp/ruby_preloaded.1130/ruby /the/path/to/the/ttk/installation/bin/ttk --version +TTK version 0.3.0-pre1 {Mon, 12 Sep 2005} [almost kid] + +Copyright (c) 2004, 2005 Nicolas Desprès, Nicolas Pouillard +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +/tmp/ruby_preloaded.1130/ruby ~/work/rep/ttk2/bin/ttk --version 0.03s user 0.03s system 4% cpu 1.005 total + + +For now thereis a gain of more than 2 seconds for each launch !!! +And it's just the begining... + +Have fun !!! + Index: bin/ruby_preloaded --- bin/ruby_preloaded (revision 0) +++ bin/ruby_preloaded (revision 0) @@ -0,0 +1,26 @@ +#!/usr/bin/env ruby +# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved. +# Author:: Nicolas Pouillard . +# License:: Gnu General Public License. +# Revision:: $Id$ + +require 'rubygems' +require_gem 'ttk', '0.3.0' +require 'ttk' +# require_gem 'vcs', '0.3.0' +# require 'vcs/vcs' + +dir = __FILE__.to_path.dirname.parent + +(dir/'lib').load_path! + +if PathList[dir/'pty'/'pty_ext.*'].empty? + system("cd #{dir}/pty && ruby extconf.rb && make") +end +if PathList[dir/'pty'/'pty_ext.*'].empty? + raise "The pty extension cannot be built" +end + +PreloadedServer.new.start do + load($0) +end \ No newline at end of file Index: pty/extconf.rb --- pty/extconf.rb (revision 0) +++ pty/extconf.rb (revision 0) @@ -0,0 +1,15 @@ +require 'mkmf' + +if /mswin32|mingw|bccwin32/ !~ RUBY_PLATFORM + have_header("sys/stropts.h") + have_func("setresuid") + have_header("libutil.h") + have_header("pty.h") + have_library("util", "openpty") + if have_func("openpty") or + have_func("_getpty") or + have_func("ptsname") or + have_func("ioctl") + create_makefile('pty_ext') + end +end Property changes on: pty/extconf.rb ___________________________________________________________________ Name: svn:keywords + Id Index: vcs/vcs_ruby_preloaded.rb --- vcs/vcs_ruby_preloaded.rb (revision 0) +++ vcs/vcs_ruby_preloaded.rb (revision 0) @@ -0,0 +1,14 @@ +class Vcs + + # COLLABOA = 'dev.uttk.org' + + def ruby_preloaded_commit! ( *args ) + + common_commit!('[RubyPreloaded] <%= rev %>: <%= title %>', *args) do |subject| + mail! :to => ['ttk-patches at lists.feydakins.org'], :subject => subject + end + + end + alias_command :rpci, :ruby_preloaded_commit + +end # class Vcs Property changes on: vcs/vcs_ruby_preloaded.rb ___________________________________________________________________ Name: svn:keywords + Id Index: lib/preloaded_server.rb --- lib/preloaded_server.rb (revision 0) +++ lib/preloaded_server.rb (revision 0) @@ -0,0 +1,127 @@ +# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved. +# Author:: Nicolas Pouillard . +# License:: Gnu General Public License. +# Revision:: $Id$ + +# core ex +require 'erb' +require 'io/nonblock' +PTY_EXT = __FILE__.to_path.dirname.parent/'pty'/'pty_ext' +require PTY_EXT + +begin + require 'rubygems' + require_gem 'termios' + TERMIOS = $:.grep(/\/termios[^\/]+\/lib$/).first + '/termios' +rescue LoadError + STDERR.puts "Termios is not available => termios disabled" + TERMIOS = nil +end + +class IO + def nwrite ( aString ) + aString = aString.to_s + write("#{aString.size}\n") + write(aString) + end + def nread + read(gets.chomp.to_i) + end +end + +class PreloadedServer + + BUFSIZE = 128 + + def initialize + @socket_path = TempPath.new('socket_server', '.sock') + @socket = UNIXServer.new(@socket_path) + @dir = __FILE__.to_path.dirname + @pids = [] + @client = TempPath.tmpdir/'ruby' + at_exit { stop } + end + + def instanciate_client_script ( path_dest, path_orig ) + path_dest.open('w') do |c| + c.puts ERB.new(path_orig.read).result(binding) + end + path_dest + end + + def gen_ruby_client_script + instanciate_client_script(@client, @dir/'preloaded_client.rb') + @client.chmod(0500) + end + + def gen_c_client_script + begin + source = instanciate_client_script(TempPath.new('ruby_preloaded', '.c'), + @dir/'preloaded_client.c') + system("gcc #{source} -o #@client -Wall") + @client.chmod(0500) + ensure + source.unlink if source + end + end + + def start ( &block ) + Signal.trap('CLD') do + @pids.dup.each do |pid| + @pids.delete pid if Process.wait(pid, Process::WNOHANG) + end + end + begin +# STDERR.puts "Generating the C client..." +# gen_c_client_script +# rescue Exception => ex +# STDERR.puts "Get an error generating the C client (#{ex})" + STDERR.puts "Generating the Ruby client...\n" + gen_ruby_client_script + end + puts @client + + loop do + client = @socket.accept + + @pids << Kernel.fork do + $0.replace @client.to_s + TempPath.fork_init + version = client.nread + + case version + when /^RUBY_PRELOADED_C_CLIENT_VERSION: [\d\.]+$/ + argc, argv = client.nread.to_i, [] + argc.times { argv << client.nread } + header = { :argv => argv, :argc => argc } + when /^RUBY_PRELOADED_RUBY_CLIENT_VERSION: [\d\.]+$/ + header = Marshal.load(client.nread) + else + raise "Bad client version: #{version.dump}" + end + + pty_slave_path = client.nread + + raise unless pty_slave_path.to_path.exist? + + PTY::Slave.new(pty_slave_path) + + if header.has_key? :argv + argv = header[:argv] + $0.replace argv.shift + ARGV.replace(argv) + end + ENV.replace header[:env] if header.has_key? :env + Dir.chdir header[:pwd] if header.has_key? :pwd + block[] + + end + end + end + + def stop + @pids.each { |pid| suppress(Errno::ECHILD) { Process.kill 'KILL', pid } } + Process.waitall + end + +end # class PreloadedServer Property changes on: lib/preloaded_server.rb ___________________________________________________________________ Name: svn:keywords + Id Index: pty/pty.c --- pty/pty.c (revision 0) +++ pty/pty.c (revision 0) @@ -0,0 +1,782 @@ +#include "config.h" +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_IOCTL_H +#include +#endif +#ifdef HAVE_LIBUTIL_H +#include +#endif +#ifdef HAVE_PTY_H +#include +#endif +#ifdef HAVE_SYS_WAIT_H +#include +#else +#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) +#endif +#include + +#include "ruby.h" +#include "rubyio.h" +#include "util.h" + +#include +#ifdef HAVE_SYS_STROPTS_H +#include +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +#define DEVICELEN 16 + +#if !defined(HAVE_OPENPTY) +#if defined(__hpux) +static +char *MasterDevice = "/dev/ptym/pty%s", + *SlaveDevice = "/dev/pty/tty%s", + *deviceNo[] = { + "p0","p1","p2","p3","p4","p5","p6","p7", + "p8","p9","pa","pb","pc","pd","pe","pf", + "q0","q1","q2","q3","q4","q5","q6","q7", + "q8","q9","qa","qb","qc","qd","qe","qf", + "r0","r1","r2","r3","r4","r5","r6","r7", + "r8","r9","ra","rb","rc","rd","re","rf", + "s0","s1","s2","s3","s4","s5","s6","s7", + "s8","s9","sa","sb","sc","sd","se","sf", + "t0","t1","t2","t3","t4","t5","t6","t7", + "t8","t9","ta","tb","tc","td","te","tf", + "u0","u1","u2","u3","u4","u5","u6","u7", + "u8","u9","ua","ub","uc","ud","ue","uf", + "v0","v1","v2","v3","v4","v5","v6","v7", + "v8","v9","va","vb","vc","vd","ve","vf", + "w0","w1","w2","w3","w4","w5","w6","w7", + "w8","w9","wa","wb","wc","wd","we","wf", + 0, + }; +#elif defined(_IBMESA) /* AIX/ESA */ +static +char *MasterDevice = "/dev/ptyp%s", + *SlaveDevice = "/dev/ttyp%s", + *deviceNo[] = { +"00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f", +"10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f", +"20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f", +"30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f", +"40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f", +"50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f", +"60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f", +"70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f", +"80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f", +"90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f", +"a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af", +"b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf", +"c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf", +"d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df", +"e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef", +"f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff", + }; +#elif !defined(HAVE_PTSNAME) +static +char *MasterDevice = "/dev/pty%s", + *SlaveDevice = "/dev/tty%s", + *deviceNo[] = { + "p0","p1","p2","p3","p4","p5","p6","p7", + "p8","p9","pa","pb","pc","pd","pe","pf", + "q0","q1","q2","q3","q4","q5","q6","q7", + "q8","q9","qa","qb","qc","qd","qe","qf", + "r0","r1","r2","r3","r4","r5","r6","r7", + "r8","r9","ra","rb","rc","rd","re","rf", + "s0","s1","s2","s3","s4","s5","s6","s7", + "s8","s9","sa","sb","sc","sd","se","sf", + 0, + }; +#endif +#endif /* !defined(HAVE_OPENPTY) */ + +static char SlaveName[DEVICELEN]; + +extern int errno; + +#ifndef HAVE_SETEUID +# ifdef HAVE_SETREUID +# define seteuid(e) setreuid(-1, (e)) +# else /* NOT HAVE_SETREUID */ +# ifdef HAVE_SETRESUID +# define seteuid(e) setresuid(-1, (e), -1) +# else /* NOT HAVE_SETRESUID */ + /* I can't set euid. (;_;) */ +# endif /* HAVE_SETRESUID */ +# endif /* HAVE_SETREUID */ +#endif /* NO_SETEUID */ + +static VALUE eChildExited; + +static VALUE +echild_status(self) + VALUE self; +{ + return rb_ivar_get(self, rb_intern("status")); +} + +struct pty_info { + int fd; + pid_t child_pid; + VALUE thread; +}; + +static void +raise_from_wait(state, info) + struct pty_info *info; + char *state; +{ + extern VALUE rb_last_status; + char buf[1024]; + VALUE exc; + + snprintf(buf, sizeof(buf), "pty - %s: %d", state, info->child_pid); + exc = rb_exc_new2(eChildExited, buf); + rb_iv_set(exc, "status", rb_last_status); + rb_funcall(info->thread, rb_intern("raise"), 1, exc); +} + +static VALUE +pty_syswait(info) + struct pty_info *info; +{ + int cpid, status; + + for (;;) { + cpid = rb_waitpid(info->child_pid, &status, WUNTRACED); + if (cpid == -1) return Qnil; + +#if defined(IF_STOPPED) + if (IF_STOPPED(status)) { /* suspend */ + raise_from_wait("stopped", info); + } +#elif defined(WIFSTOPPED) + if (WIFSTOPPED(status)) { /* suspend */ + raise_from_wait("stopped", info); + } +#else +---->> Either IF_STOPPED or WIFSTOPPED is needed <<---- +#endif /* WIFSTOPPED | IF_STOPPED */ + else if (kill(info->child_pid, 0) == 0) { + raise_from_wait("changed", info); + } + else { + raise_from_wait("exited", info); + return Qnil; + } + } +} + +static void getDevice _((int*, int*)); + +struct exec_info { + int argc; + VALUE *argv; +}; + +static VALUE +pty_exec(arg) + struct exec_info *arg; +{ + return rb_f_exec(arg->argc, arg->argv); +} + +static void +establishShell(argc, argv, info) + int argc; + VALUE *argv; + struct pty_info *info; +{ + static int i,master,slave,currentPid; + char *p,*getenv(); + struct passwd *pwent; + VALUE v; + struct exec_info arg; + int status; + + if (argc == 0) { + char *shellname; + + if ((p = getenv("SHELL")) != NULL) { + shellname = p; + } + else { + pwent = getpwuid(getuid()); + if (pwent && pwent->pw_shell) + shellname = pwent->pw_shell; + else + shellname = "/bin/sh"; + } + v = rb_str_new2(shellname); + argc = 1; + argv = &v; + } + getDevice(&master,&slave); + + info->thread = rb_thread_current(); + currentPid = getpid(); + if((i = fork()) < 0) { + close(master); + close(slave); + rb_sys_fail("fork failed"); + } + + if(i == 0) { /* child */ + currentPid = getpid(); + + /* + * Set free from process group and controlling terminal + */ +#ifdef HAVE_SETSID + (void) setsid(); +#else /* HAS_SETSID */ +# ifdef HAVE_SETPGRP +# ifdef SETGRP_VOID + if (setpgrp() == -1) + perror("setpgrp()"); +# else /* SETGRP_VOID */ + if (setpgrp(0, currentPid) == -1) + rb_sys_fail("setpgrp()"); + if ((i = open("/dev/tty", O_RDONLY)) < 0) + rb_sys_fail("/dev/tty"); + else { + if (ioctl(i, TIOCNOTTY, (char *)0)) + perror("ioctl(TIOCNOTTY)"); + close(i); + } +# endif /* SETGRP_VOID */ +# endif /* HAVE_SETPGRP */ +#endif /* HAS_SETSID */ + + /* + * obtain new controlling terminal + */ +#if defined(TIOCSCTTY) + close(master); + (void) ioctl(slave, TIOCSCTTY, (char *)0); + /* errors ignored for sun */ +#else + close(slave); + slave = open(SlaveName, O_RDWR); + if (slave < 0) { + perror("open: pty slave"); + _exit(1); + } + close(master); +#endif + dup2(slave,0); + dup2(slave,1); + dup2(slave,2); + close(slave); +#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRESUID) + seteuid(getuid()); +#endif + + arg.argc = argc; + arg.argv = argv; + rb_protect(pty_exec, (VALUE)&arg, &status); + sleep(1); + _exit(1); + } + + close(slave); + + info->child_pid = i; + info->fd = master; +} + +static void +setupPTY(info) + struct pty_info *info; +{ + static int i,master,slave,currentPid; + char *p,*getenv(); + struct passwd *pwent; + VALUE v; + struct exec_info arg; + int status; + + getDevice(&master,&slave); + + info->thread = rb_thread_current(); + currentPid = getpid(); + if((i = fork()) < 0) { + close(master); + close(slave); + rb_sys_fail("fork failed"); + } + + if(i == 0) { /* child */ + currentPid = getpid(); + + /* + * Set free from process group and controlling terminal + */ +#ifdef HAVE_SETSID + (void) setsid(); +#else /* HAS_SETSID */ +# ifdef HAVE_SETPGRP +# ifdef SETGRP_VOID + if (setpgrp() == -1) + perror("setpgrp()"); +# else /* SETGRP_VOID */ + if (setpgrp(0, currentPid) == -1) + rb_sys_fail("setpgrp()"); + if ((i = open("/dev/tty", O_RDONLY)) < 0) + rb_sys_fail("/dev/tty"); + else { + if (ioctl(i, TIOCNOTTY, (char *)0)) + perror("ioctl(TIOCNOTTY)"); + close(i); + } +# endif /* SETGRP_VOID */ +# endif /* HAVE_SETPGRP */ +#endif /* HAS_SETSID */ + + /* + * obtain new controlling terminal + */ +#if defined(TIOCSCTTY) + close(master); + (void) ioctl(slave, TIOCSCTTY, (char *)0); + /* errors ignored for sun */ +#else + close(slave); + slave = open(SlaveName, O_RDWR); + if (slave < 0) { + perror("open: pty slave"); + _exit(1); + } + close(master); +#endif + dup2(slave,0); + dup2(slave,1); + dup2(slave,2); + close(slave); +#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRESUID) + seteuid(getuid()); +#endif + + if (rb_block_given_p()) { + int status; + + rb_protect(rb_yield, Qundef, &status); + ruby_stop(status); + } + sleep(1); + _exit(1); + } + + close(slave); + + info->child_pid = i; + info->fd = master; +} + +static VALUE +pty_master_new(self) + VALUE self; +{ + int master; + int slave; + VALUE res; + OpenFile* wfptr; + OpenFile* rfptr; + VALUE rport = rb_obj_alloc(rb_cFile); + VALUE wport = rb_obj_alloc(rb_cFile); + + /* OpenFile* swfptr; */ + /* OpenFile* srfptr; */ + /* VALUE srport = rb_obj_alloc(rb_cFile); */ + /* VALUE swport = rb_obj_alloc(rb_cFile); */ + + MakeOpenFile(rport, rfptr); + MakeOpenFile(wport, wfptr); + /* MakeOpenFile(srport, srfptr); */ + /* MakeOpenFile(swport, swfptr); */ + + getDevice(&master, &slave); + + rfptr->mode = rb_io_mode_flags("r"); + rfptr->f = fdopen(master, "r"); + rfptr->path = strdup(SlaveName); + + wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC; + wfptr->f = fdopen(dup(master), "w"); + wfptr->path = strdup(SlaveName); + + /* srfptr->mode = rb_io_mode_flags("r"); */ + /* srfptr->f = fdopen(slave, "r"); */ + /* srfptr->path = strdup(SlaveName); */ + + /* swfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC; */ + /* swfptr->f = fdopen(dup(slave), "w"); */ + /* swfptr->path = strdup(SlaveName); */ + + rb_iv_set(self, "reader", rport); + rb_iv_set(self, "writer", wport); + rb_iv_set(self, "slave_name", rb_str_new2(strdup(SlaveName))); +} + +static VALUE +pty_master_reader(self) + VALUE self; +{ + return rb_iv_get(self, "reader"); +} + +static VALUE +pty_master_writer(self) + VALUE self; +{ + return rb_iv_get(self, "writer"); +} + +static VALUE +pty_master_slave_name(self) + VALUE self; +{ + return rb_iv_get(self, "slave_name"); +} + + +static VALUE +pty_slave_new(self, slave_name) + VALUE self; + VALUE slave_name; +{ + static int i,currentPid; + int slave; + char *p,*getenv(); + struct passwd *pwent; + VALUE v; + struct exec_info arg; + int status; + + /* info->thread = rb_thread_current(); */ + currentPid = getpid(); + /* if((i = fork()) < 0) { + close(master); + close(slave); + rb_sys_fail("fork failed"); + } */ + + /* if(i == 0) { |+ child +| */ + currentPid = getpid(); + + /* + * Set free from process group and controlling terminal + */ +#ifdef HAVE_SETSID + (void) setsid(); +#else /* HAS_SETSID */ +# ifdef HAVE_SETPGRP +# ifdef SETGRP_VOID + if (setpgrp() == -1) + perror("setpgrp()"); +# else /* SETGRP_VOID */ + if (setpgrp(0, currentPid) == -1) + rb_sys_fail("setpgrp()"); + if ((i = open("/dev/tty", O_RDONLY)) < 0) + rb_sys_fail("/dev/tty"); + else { + if (ioctl(i, TIOCNOTTY, (char *)0)) + perror("ioctl(TIOCNOTTY)"); + close(i); + } +# endif /* SETGRP_VOID */ +# endif /* HAVE_SETPGRP */ +#endif /* HAS_SETSID */ + + slave = open(StringValueCStr(slave_name), O_RDWR); + + /* + * obtain new controlling terminal + */ +#if defined(TIOCSCTTY) + /* close(master); */ + (void) ioctl(slave, TIOCSCTTY, (char *)0); + /* errors ignored for sun */ +#else + if (slave < 0) { + perror("open: pty slave"); + _exit(1); + } + /* close(master); */ +#endif + dup2(slave,0); + dup2(slave,1); + dup2(slave,2); + close(slave); +#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRESUID) + seteuid(getuid()); +#endif + + if (rb_block_given_p()) { + int status; + + rb_protect(rb_yield, Qundef, &status); + ruby_stop(status); + } + /* sleep(1); */ + /* _exit(1); */ + /* } */ + + /* close(slave); */ + rb_iv_set(self, "name", rb_str_new2(strdup(SlaveName))); + + /* info->child_pid = i; */ + /* info->fd = master; */ +} + +static VALUE +pty_finalize_syswait(info) + struct pty_info *info; +{ + rb_thread_kill(info->thread); + rb_funcall(info->thread, rb_intern("value"), 0); + rb_detach_process(info->child_pid); + return Qnil; +} + +#ifdef HAVE_OPENPTY +/* + * Use openpty(3) of 4.3BSD Reno and later, + * or the same interface function. + */ +static void +getDevice(master,slave) + int *master,*slave; +{ + if (openpty(master, slave, SlaveName, + (struct termios *)0, (struct winsize *)0) == -1) { + rb_raise(rb_eRuntimeError, "openpty() failed"); + } +} +#else /* HAVE_OPENPTY */ +#ifdef HAVE__GETPTY +static void +getDevice(master,slave) + int *master,*slave; +{ + char *name; + + if (!(name = _getpty(master, O_RDWR, 0622, 0))) { + rb_raise(rb_eRuntimeError, "_getpty() failed"); + } + + *slave = open(name, O_RDWR); + strcpy(SlaveName, name); +} +#else /* HAVE__GETPTY */ +static void +getDevice(master,slave) + int *master,*slave; +{ + int i,j; + +#ifdef HAVE_PTSNAME + char *pn; + void (*s)(); + + extern char *ptsname(int); + extern int unlockpt(int); + extern int grantpt(int); + + if((i = open("/dev/ptmx", O_RDWR, 0)) != -1) { + s = signal(SIGCHLD, SIG_DFL); + if(grantpt(i) != -1) { + signal(SIGCHLD, s); + if(unlockpt(i) != -1) { + if((pn = ptsname(i)) != NULL) { + if((j = open(pn, O_RDWR, 0)) != -1) { +#if defined I_PUSH && !defined linux + if(ioctl(j, I_PUSH, "ptem") != -1) { + if(ioctl(j, I_PUSH, "ldterm") != -1) { +#endif + *master = i; + *slave = j; + strcpy(SlaveName, pn); + return; +#if defined I_PUSH && !defined linux + } + } +#endif + } + } + } + } + close(i); + } + rb_raise(rb_eRuntimeError, "Cannot get Master/Slave device"); +#else + char **p; + char MasterName[DEVICELEN]; + + for (p = deviceNo; *p != NULL; p++) { + sprintf(MasterName,MasterDevice,*p); + if ((i = open(MasterName,O_RDWR,0)) >= 0) { + *master = i; + sprintf(SlaveName,SlaveDevice,*p); + if ((j = open(SlaveName,O_RDWR,0)) >= 0) { + *slave = j; + chown(SlaveName, getuid(), getgid()); + chmod(SlaveName, 0622); + return; + } + close(i); + } + } + rb_raise(rb_eRuntimeError, "Cannot get %s", SlaveName); +#endif +} +#endif /* HAVE__GETPTY */ +#endif /* HAVE_OPENPTY */ + +static void +freeDevice() +{ + chmod(SlaveName, 0666); + chown(SlaveName, 0, 0); +} + +/* ruby function: getpty */ +static VALUE +pty_getpty(argc, argv, self) + int argc; + VALUE *argv; + VALUE self; +{ + VALUE res; + struct pty_info info; + struct pty_info thinfo; + OpenFile *wfptr,*rfptr; + VALUE rport = rb_obj_alloc(rb_cFile); + VALUE wport = rb_obj_alloc(rb_cFile); + + MakeOpenFile(rport, rfptr); + MakeOpenFile(wport, wfptr); + + establishShell(argc, argv, &info); + + rfptr->mode = rb_io_mode_flags("r"); + rfptr->f = fdopen(info.fd, "r"); + rfptr->path = strdup(SlaveName); + + wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC; + wfptr->f = fdopen(dup(info.fd), "w"); + wfptr->path = strdup(SlaveName); + + res = rb_ary_new2(3); + rb_ary_store(res,0,(VALUE)rport); + rb_ary_store(res,1,(VALUE)wport); + rb_ary_store(res,2,INT2FIX(info.child_pid)); + + thinfo.thread = rb_thread_create(pty_syswait, (void*)&info); + thinfo.child_pid = info.child_pid; + rb_thread_schedule(); + + if (rb_block_given_p()) { + rb_ensure(rb_yield, res, pty_finalize_syswait, (VALUE)&thinfo); + return Qnil; + } + return res; +} + +/* ruby function: setup */ +static VALUE +pty_setup(self) + VALUE self; +{ + VALUE res; + struct pty_info info; + struct pty_info thinfo; + OpenFile *wfptr,*rfptr; + VALUE rport = rb_obj_alloc(rb_cFile); + VALUE wport = rb_obj_alloc(rb_cFile); + + MakeOpenFile(rport, rfptr); + MakeOpenFile(wport, wfptr); + + setupPTY(&info); + + rfptr->mode = rb_io_mode_flags("r"); + rfptr->f = fdopen(info.fd, "r"); + rfptr->path = strdup(SlaveName); + + wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC; + wfptr->f = fdopen(dup(info.fd), "w"); + wfptr->path = strdup(SlaveName); + + res = rb_ary_new2(3); + rb_ary_store(res,0,(VALUE)rport); + rb_ary_store(res,1,(VALUE)wport); + rb_ary_store(res,2,INT2FIX(info.child_pid)); + + thinfo.thread = rb_thread_create(pty_syswait, (void*)&info); + thinfo.child_pid = info.child_pid; + rb_thread_schedule(); + + return res; +} + +/* ruby function: protect_signal - obsolete */ +static VALUE +pty_protect(self) + VALUE self; +{ + rb_warn("PTY::protect_signal is no longer needed"); + rb_yield(Qnil); + return self; +} + +/* ruby function: reset_signal - obsolete */ +static VALUE +pty_reset_signal(self) + VALUE self; +{ + rb_warn("PTY::reset_signal is no longer needed"); + return self; +} + +static VALUE cPTY; +static VALUE cPTYMaster; +static VALUE cPTYSlave; + +void +Init_pty_ext() +{ + cPTY = rb_define_module("PTY"); + rb_define_module_function(cPTY,"setup",pty_setup,0); + + cPTYMaster = rb_define_class("PTY::Master", rb_cObject); + rb_define_const(cPTY, "Master", cPTYMaster); + rb_define_method(cPTYMaster,"initialize",pty_master_new,0); + rb_define_method(cPTYMaster,"reader",pty_master_reader,0); + rb_define_method(cPTYMaster,"writer",pty_master_writer,0); + rb_define_method(cPTYMaster,"slave_name",pty_master_slave_name,0); + + cPTYSlave = rb_define_class("PTY::Slave", rb_cObject); + rb_define_const(cPTY, "Slave", cPTYSlave); + rb_define_method(cPTYSlave,"initialize",pty_slave_new,1); + /* + rb_define_module_function(cPTY,"getpty",pty_getpty,-1); + rb_define_module_function(cPTY,"spawn",pty_getpty,-1); + rb_define_module_function(cPTY,"protect_signal",pty_protect,0); + rb_define_module_function(cPTY,"reset_signal",pty_reset_signal,0); + + eChildExited = rb_define_class_under(cPTY,"ChildExited",rb_eRuntimeError); + rb_define_method(eChildExited,"status",echild_status,0); + */ +} Index: lib/preloaded_client.rb --- lib/preloaded_client.rb (revision 0) +++ lib/preloaded_client.rb (revision 0) @@ -0,0 +1,127 @@ +#!/usr/bin/env ruby +# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved. +# Author:: Nicolas Pouillard . +# License:: Gnu General Public License. +# Revision:: $Id$ + +require 'socket' +require '<%= PTY_EXT %>' + +class PreloadedClient + + VERSION = 'RUBY_PRELOADED_RUBY_CLIENT_VERSION: 0.1' + BUFSIZE = 128 + + def initialize + @server = UNIXSocket.new('<%= @socket_path %>') + @server.nwrite VERSION + @pty_master = PTY::Master.new + fix_tty + header = { :argc => ARGV.size, + :argv => ARGV, + :env => ENV.to_hash, + :pwd => Dir.pwd } + @server.nwrite Marshal.dump(header) + @server.nwrite @pty_master.slave_name + end + + def start + reader, writer = @pty_master.reader, @pty_master.writer + class << STDIN ; self end.send(:define_method, :stream_output) { writer } + class << reader ; self end.send(:define_method, :stream_output) { STDOUT } + streams = [STDIN, reader] + loop do + result = IO.select(streams) + break if result.nil? + result.first.each do |input| + begin + input.stream_output.syswrite(input.sysread(BUFSIZE)) + rescue Errno::EAGAIN + rescue EOFError, Errno::ECHILD => ex + if input == STDIN + streams.delete input + else + exit + end + end + end + end + end + + def fix_tty + (STDIN.tty?)? STDIN.make_raw_tty : @pty_master.reader.make_raw_tty + end + +end # class PreloadedClient + + + +<% if TERMIOS %> + require '<%= TERMIOS %>' + + module Termios + class Termios + + def union ( *args ) + result = 0 + args.flatten.each do |val| + result |= ::Termios.const_get(val) if ::Termios.const_defined? val + end + result + end + + def with_these_constants ( *args, &block ) + args.flatten.each do |val| + block[::Termios.const_get(val)] if ::Termios.const_defined? val + end + end + + def make_raw + self.iflag |= IGNPAR + self.iflag &= ~ union(%w[ ISTRIP INLCR IGNCR ICRNL IXON IXANY IXOFF ]) + self.oflag &= ~OPOST + self.lflag &= ~ union(%w[ ISIG ICANON ECHO ECHOE ECHOK ECHONL IEXTEN ]) + self.cflag &= ~ union(%w[ CSIZE PARENB]) + self.cflag |= union(%w[ CS8 ]) + with_these_constants(%w[ VTIME VINTR VQUIT VERASE VKILL ]) { |val| cc[val] = 0 } + with_these_constants(%w[ VMIN VEOF VEOL ]) { |val| cc[val] = 1 } + end + + end # class Termios + + end # module Termios +<% end %> + + + +class IO + + def nwrite ( aString ) + aString = aString.to_s + write("#{aString.size}\n") + write(aString) + end + + def nread + read(gets.chomp.to_i) + end + + def make_raw_tty + <% if TERMIOS %> + if tty? + old_tty = Termios.tcgetattr(self) + new_tty = old_tty.dup + new_tty.make_raw + Termios.tcsetattr(self, Termios::TCSANOW, new_tty) + at_exit { Termios.tcsetattr(self, Termios::TCSANOW, old_tty) } + end + <% end %> + end + +end # class IO + + + +if $0 == __FILE__ + PreloadedClient.new.start +end Property changes on: lib/preloaded_client.rb ___________________________________________________________________ Name: svn:keywords + Id Index: NEWS Index: AUTHORS --- AUTHORS (revision 0) +++ AUTHORS (revision 0) @@ -0,0 +1,7 @@ +--- +RubyPreloaded was written by and with the assistance of: + + - Nicolas Pouillard : + - Initial Design + - Maintenance + - Current repository administration -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050919/d7895888/signature-0001.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 19 10:23:43 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 19 Sep 2005 16:23:43 +0200 Subject: [TTK-Patches] [RubyPreloaded] 4: Initial commit. In-Reply-To: <20050919135635.9066E1B324@smtp.feydakins.org> References: <20050919135635.9066E1B324@smtp.feydakins.org> Message-ID: <840b875c05091907233a7cfa0a@mail.gmail.com> On 9/19/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_preloaded/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Initial commit. > > * AUTHORS: New. > * README: New. > * NEWS: New. > * lib/preloaded_client.rb: New. Client template. > * lib/preloaded_server.rb: New. Server base class. > * bin/ruby_preloaded: New. The server programm. > * vcs/vcs_ruby_preloaded.rb: New. Vcs support (rpci to commit). > * pty/extconf.rb, pty/pty.c: New. From ruby-1.8.3 and adapt. > [...] > > Index: README > --- README (revision 0) > +++ README (revision 0) > @@ -0,0 +1,47 @@ > +RubyPreloaded is a lightweight daemon used to preload somehow big ruby > +applications without the initialization cost. > + > +You need to load the server just one time and when you want use an application you want *to* > +you can use this preloaded ruby instance. For this just ask for a an instance > +running the client process. > + > +Example: > + > +$ time ttk --version > + > +TTK version 0.3.0-pre1 {Mon, 12 Sep 2005} [almost kid] > + > +Copyright (c) 2004, 2005 Nicolas Despr?s, Nicolas Pouillard > +This is free software; see the source for copying conditions. There is NO > +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > + > +ttk --version 1.96s user 0.50s system 74% cpu 3.292 total > + > +You that TTK is quite long to launch on my box !!! This due to its You *know* > +initialization step. > + > +So now let's run the server on a terminal: > + > +$ ruby_preload > +Generating the Ruby client... > +/tmp/ruby_preloaded.1130/ruby > + > +The server does not return and wait for clients. > +It's initialization step took almost the same time (3 seconds). > + > +Now run the client on another terminal: > + > +$ /tmp/ruby_preloaded.1130/ruby /the/path/to/the/ttk/installation/bin/ttk --version > +TTK version 0.3.0-pre1 {Mon, 12 Sep 2005} [almost kid] > + > +Copyright (c) 2004, 2005 Nicolas Despr?s, Nicolas Pouillard > +This is free software; see the source for copying conditions. There is NO > +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > +/tmp/ruby_preloaded.1130/ruby ~/work/rep/ttk2/bin/ttk --version 0.03s user 0.03s system 4% cpu 1.005 total > + > + > +For now thereis a gain of more than 2 seconds for each launch !!! there is > +And it's just the begining... > + > +Have fun !!! > + [...] > \ No newline at end of file Take care of that. [...] That's interesting, but don't you think that making ttk more robust is a prior to add new features? -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Mon Sep 19 11:18:29 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon, 19 Sep 2005 17:18:29 +0200 Subject: [TTK-Patches] [RubyPreloaded] 5: Apply the review of README. Message-ID: svn://svn.feydakins.org/ruby_preloaded/trunk Index: ChangeLog from Nicolas Pouillard Apply the review of README. * README: Update. README | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: README --- README (revision 4) +++ README (working copy) @@ -1,9 +1,9 @@ RubyPreloaded is a lightweight daemon used to preload somehow big ruby applications without the initialization cost. -You need to load the server just one time and when you want use an application -you can use this preloaded ruby instance. For this just ask for a an instance -running the client process. +You need to load the server just one time and when you want to use an +application you can use this preloaded ruby instance. For this just ask +for a an instance running the client process. Example: @@ -17,7 +17,7 @@ ttk --version 1.96s user 0.50s system 74% cpu 3.292 total -You that TTK is quite long to launch on my box !!! This due to its +You see that TTK is quite long to launch on my box !!! This due to its initialization step. So now let's run the server on a terminal: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050919/9513172d/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 19 12:27:00 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 19 Sep 2005 18:27:00 +0200 Subject: [TTK-Patches] [RubyPreloaded] 4: Initial commit. In-Reply-To: References: <20050919135635.9066E1B324@smtp.feydakins.org> <840b875c05091907233a7cfa0a@mail.gmail.com> Message-ID: <840b875c05091909276a2aa63e@mail.gmail.com> On 9/19/05, Nicolas Pouillard wrote: > On 9/19/05, Nicolas Despr?s wrote: [...] > > That's interesting, but don't you think that making ttk more robust is > > a prior to add new features? > > > > 1/ Yes, but here it's another project. Ok. > 2/ The use of ruby_preloaded can be *very* useful in other projects: > vcs for example, or an irb with many libs preloaded... I like VCS but I don't want to run a daemon. > 3/ I would try to make a one file distribution of Uttk with Tar2RubyScript > and (perhaps) this. I don't understand the purpose of this remark in this thread... Cheers, -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 19 12:28:19 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 19 Sep 2005 18:28:19 +0200 Subject: [TTK-Patches] [RubyPreloaded] 5: Apply the review of README. In-Reply-To: References: Message-ID: <840b875c050919092866ce63c7@mail.gmail.com> On 9/19/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_preloaded/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Apply the review of README. > > * README: Update. Update of what? [...] Cheers, -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Mon Sep 19 16:33:39 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 19 Sep 2005 22:33:39 +0200 Subject: [TTK-Patches] [RubyPreloaded] 5: Apply the review of README. In-Reply-To: References: <840b875c050919092866ce63c7@mail.gmail.com> Message-ID: <840b875c0509191333f055a95@mail.gmail.com> On 9/19/05, Nicolas Pouillard wrote: > On 9/19/05, Nicolas Despr?s wrote: > > On 9/19/05, Nicolas Pouillard wrote: > > > > > > svn://svn.feydakins.org/ruby_preloaded/trunk > > > > > > Index: ChangeLog > > > from Nicolas Pouillard > > > > > > Apply the review of README. > > This is the tiltle, you can also read it !! I was waiting for some explanation in the ChangeLog as usual. > > > > > > > * README: Update. > > > > Update of what? > > > > Of the readme file :) I was speaking about which kind of update were done on the README file. Sorry, but I'm not familiar with the general explanation above the ChangeLog file. Maybe, I'm not the only one. [...] Cheers, -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 13:14:06 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sat, 24 Sep 2005 19:14:06 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 362: Some portablity fixes. Message-ID: <20050924171406.5C5411BD38@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Some portablity fixes. * core_ex/Rakefile: More robust initialization. * core_ex/lib/yaml_extension.rb: Better class conversion for the yaml type, and suppress some Exceptions. * core_ex/lib/core_ex/rakefile_base.rf: Use the !S:: Uttk style. * core_ex/lib/core_ex/yaml.rb: Suppress some Exceptions, take care of the emitter. * core_ex/lib/core_ex.rb: Require 'English', load core_ex path. * core_ex/lib/dumpable_proc.rb: Protect against code injection. * core_ex/NEWS, core_ex/README: Typo. NEWS | 4 ++-- README | 6 +++--- Rakefile | 5 +++-- lib/core_ex.rb | 4 ++++ lib/core_ex/rakefile_base.rf | 18 ++++++++---------- lib/core_ex/yaml.rb | 8 ++++---- lib/dumpable_proc.rb | 9 +++++++++ lib/yaml_extension.rb | 4 ++-- 8 files changed, 35 insertions(+), 23 deletions(-) Index: core_ex/lib/core_ex/yaml.rb --- core_ex/lib/core_ex/yaml.rb (revision 361) +++ core_ex/lib/core_ex/yaml.rb (working copy) @@ -63,7 +63,7 @@ alias_method :old_to_yaml, :to_yaml def to_yaml ( opts={} ) - em = opts[:Emitter] + em = (opts.is_a? YAML::Syck::Emitter)? opts : opts[:Emitter] if (opts[:Inline] or (em and em.options[:Inline])) and not is_complex_yaml? YAML::quick_emit(self.object_id, opts) do |out| out << '[' @@ -84,7 +84,7 @@ end - undef_method :is_complex_yaml? + suppress(NoMethodError, NameError) { undef_method :is_complex_yaml? } def is_complex_yaml? any? { |x| x.is_complex_yaml? } or inspect.size > 80 @@ -99,7 +99,7 @@ alias_method :old_to_yaml, :to_yaml def to_yaml ( opts={} ) - em = opts[:Emitter] + em = (opts.is_a? YAML::Syck::Emitter)? opts : opts[:Emitter] if (opts[:Inline] or (em and em.options[:Inline])) and not is_complex_yaml? YAML::quick_emit(self.object_id, opts) do |out| out << '{' @@ -122,7 +122,7 @@ end - undef_method :is_complex_yaml? + suppress(NoMethodError, NameError) { undef_method :is_complex_yaml? } def is_complex_yaml? any? { |x| x.is_complex_yaml? } or inspect.size > 80 Index: core_ex/lib/core_ex/rakefile_base.rf --- core_ex/lib/core_ex/rakefile_base.rf (revision 361) +++ core_ex/lib/core_ex/rakefile_base.rf (working copy) @@ -118,13 +118,11 @@ urls << "file://#{path.expand_path}" end ttk '-l', 'distcheck-log' do %Q[ - Check generated packages: - strategy: Iterate + Check generated packages: !S::Iterate over : #{urls.inspect} iter : url test : - 'Check the package: <>': - strategy: Import + 'Check the package: <>': !S::Import symbols : { url: <> } import : #{SPEC.root_test_suite} ] Index: core_ex/Rakefile --- core_ex/Rakefile (revision 361) +++ core_ex/Rakefile (working copy) @@ -3,5 +3,6 @@ # License:: Ruby License # Revision:: $Id$ -$: << 'lib' -load 'core_ex/rakefile_base.rf' +core_ex = File.join(File.dirname(__FILE__), 'lib', 'core_ex') +require core_ex +load "#{core_ex}/rakefile_base.rf" Index: core_ex/README --- core_ex/README (revision 361) +++ core_ex/README (working copy) @@ -1,7 +1,7 @@ CoreEx is designed to provides a simple but quite useful extension of the -standard library of Ruby. So some classes and modules like Pathname, +standard library of Ruby. Thus some classes and modules like Pathname, Enumerable, Exception, FileUtils, String, YAML, Module, Class and Object are -extended. There is also some new features like DTime, TempPath, Version, -embedded_tests, FileList (almost from rake), a common Rakefile. +extended. There are also some new features like DTime, TempPath, Version, +embedded_tests, FileList (almost from rake), and a common Rakefile. Coming Soon. Index: core_ex/NEWS --- core_ex/NEWS (revision 361) +++ core_ex/NEWS (working copy) @@ -53,8 +53,8 @@ = New in 0.1, 2005-05-31: CoreEx is designed to provides a simple but quite useful extension of the - standard library of Ruby. So some classes and modules like Pathname, Time, - Enumerable, Exception, FileUtils, String, and YAML are extended. There is + standard library of Ruby. Thus some classes and modules like Pathname, Time, + Enumerable, Exception, FileUtils, String, and YAML are extended. There are also some new features like attr_once, DTime, TempPath, Version, embedded_tests, filelist (almost from rake), a common Rakefile, and an extension of the require system. Index: core_ex/lib/dumpable_proc.rb --- core_ex/lib/dumpable_proc.rb (revision 361) +++ core_ex/lib/dumpable_proc.rb (working copy) @@ -7,6 +7,15 @@ class DumpableProc < Proc def self.new ( str ) + # FIXME imporve prevent from ruby injections + if str =~ /[{}]/ + str = str.gsub(/[^{}]/, '') + while str.gsub!(/\{\}/, '') + end + unless str.empty? + raise ArgumentError, "Bad block: bad `{' `}' equilibration" + end + end pr = super(&eval("proc { #{str} }")) pr.instance_eval { @str = str.freeze } pr Index: core_ex/lib/core_ex.rb --- core_ex/lib/core_ex.rb (revision 361) +++ core_ex/lib/core_ex.rb (working copy) @@ -5,6 +5,7 @@ unless defined? CORE_EX_LOADED and CORE_EX_LOADED CORE_EX_LOADED = true + require 'English' $LOADED_FEATURES << 'core_ex.rb' unless $LOADED_FEATURES.include? 'core_ex.rb' require 'pathname' @@ -237,6 +238,9 @@ include CoreEx::Time end # class Time + +CoreEx.dir.load_path! + CoreEx::Yaml.import! CoreEx::TryDup.import! Index: core_ex/lib/yaml_extension.rb --- core_ex/lib/yaml_extension.rb (revision 361) +++ core_ex/lib/yaml_extension.rb (working copy) @@ -11,7 +11,7 @@ theYamlType = aliases.shift case theYamlType when NilClass - theYamlType = self.name.downcase + theYamlType = self.name.demodulize.underscore when String when Symbol else @@ -22,7 +22,7 @@ yamlTypes << theYamlType yamlTypes.map! { |x| x.to_s.sub(/^!/, '') } - undef_method :to_yaml_type + suppress(NoMethodError, NameError) { undef_method :to_yaml_type } old_to_yaml = :"#{theYamlType}_to_yaml" alias_method old_to_yaml, :to_yaml suppress(NoMethodError, NameError) { remove_method :to_yaml } -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050924/bd7dde70/signature-0001.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 13:16:56 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sat, 24 Sep 2005 19:16:56 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 363: Fix a bug with checkout in URIs. Message-ID: <20050924171656.688941BD38@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Fix a bug with checkout in URIs. * lib/uri/ssh.rb, lib/uri/svn.rb: Also return the target. * lib/uri_ex.rb: Use to yaml extensions. uri/ssh.rb | 2 +- uri/svn.rb | 2 +- uri_ex.rb | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) Index: lib/uri/svn.rb --- lib/uri/svn.rb (revision 362) +++ lib/uri/svn.rb (working copy) @@ -32,7 +32,7 @@ tmp.mkpath target = to_s.sub(/^svn\./, '') tmp += pathname.basename - SVN['checkout', target, tmp].run(self.runner) + [tmp, SVN['checkout', target, tmp].run(self.runner)] end def save Index: lib/uri_ex.rb --- lib/uri_ex.rb (revision 362) +++ lib/uri_ex.rb (working copy) @@ -20,6 +20,7 @@ end class Generic + have YamlExtension, :uri, :url # # To make all uris command verbose you can change or modify the global @@ -38,12 +39,8 @@ self.path = path.to_s end - def to_yaml_type - '!uri' - end - - def to_yaml ( opts={} ) - "!uri #{to_s}" + def to_yaml_string + to_s end def checkout Index: lib/uri/ssh.rb --- lib/uri/ssh.rb (revision 362) +++ lib/uri/ssh.rb (working copy) @@ -51,7 +51,7 @@ def checkout out = TempPath.new('checkout', pathname.basename.to_s) - SCP[mk_opts, mk_arg, out].run(self.runner) + [out, SCP[mk_opts, mk_arg, out].run(self.runner)] end def save -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050924/bdf425d6/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 13:19:55 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sat, 24 Sep 2005 19:19:55 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 364: [Hookable/Hooker] Support for hook disabling. Message-ID: <20050924171955.A7BD91BD38@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard [Hookable/Hooker] Support for hook disabling. * lib/hookable.rb: Add Hookable#disable_hook and Hookable::disable_hook. hookable.rb | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletion(-) Index: lib/hookable.rb --- lib/hookable.rb (revision 363) +++ lib/hookable.rb (working copy) @@ -28,6 +28,8 @@ def hook_trigger ( name, *args ) + return if defined? @disabled_hooks and @disabled_hooks.include? name + return if defined? @@disabled_hooks and @@disabled_hooks.include? name self.class.hook_trigger(name, *args) return unless defined? @hookers @hookers.each do |hooker| @@ -38,6 +40,7 @@ def self.hook_trigger ( name, *args ) raise ArgumentError, "Unknown hook #{name}" unless hooks.include? name + return if defined? @@disabled_hooks and @@disabled_hooks.include? name hookers.each do |hooker| @@hook_trigger_internal[hooker, name, *args] end @@ -65,6 +68,18 @@ end + def disable_hook ( *hook_names ) + @disabled_hooks ||= [] + @disabled_hooks = @disabled_hooks + hook_names + end + + + def self.disable_hook ( *hook_names ) + @@disabled_hooks ||= [] + @@disabled_hooks = @@disabled_hooks + hook_names + end + + def self.hook_declare ( name, *groups ) hooks << name end -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050924/35d9519e/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 13:25:08 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sat, 24 Sep 2005 19:25:08 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 365: Fix the Pipe support in Commands. Message-ID: <20050924172508.63D261BD38@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Fix the Pipe support in Commands. * lib/commands/pipe.rb: Reimplement. * lib/commands/command.rb (sh_args): Generalize. * lib/commands/datas/composite.rb: More methods to make it invisble. * lib/commands/datas/data.rb: Some fixes. * lib/commands/runners/mock.rb: Rename to ... * lib/commands/runners/mockable.rb: ... this and make it a module. * lib/commands/runners/runner.rb: Add Runner#initialize_copy. * lib/commands.rb: Add a documention example. commands.rb | 18 +++++++++++ commands/command.rb | 8 ++--- commands/datas/composite.rb | 28 ++++++++++++++++- commands/datas/data.rb | 9 +++-- commands/pipe.rb | 67 ++++++++++++++++++++++++++++++++++--------- commands/runners/mock.rb | 67 ------------------------------------------- commands/runners/mockable.rb | 41 ++++++++++++-------------- commands/runners/runner.rb | 10 ++++++ 8 files changed, 136 insertions(+), 112 deletions(-) Index: lib/commands/pipe.rb --- lib/commands/pipe.rb (revision 364) +++ lib/commands/pipe.rb (working copy) @@ -5,32 +5,57 @@ require 'commands' +class IO + + def pipe? + false + end + + class << self + + alias_method :pipe_without_pipe?, :pipe + + def pipe + ios = pipe_without_pipe? + ios.each do |io| + io.send(:define_singleton_method, :pipe?) { true } + end + ios + end + + end # class << self + +end # class IO + module Commands class Pipe < Command def initialize ( *cmds ) - @cmds = cmds.map { |x| x.dup } - @input, @output, @error = nil, nil, nil + @cmds = cmds.flatten.map { |x| x.dup } end - def run ( *a ) - pids = [] + def run ( runner=@runner ) + datas = Datas::Composite.new + runner = runner.dup + runner.hook_trigger :display_command, self + runner.disable_hook :display_command + runner.disable_hook :waitpid ([nil] + @cmds).zip(@cmds + [nil]).each do |cmd1, cmd2| next if cmd1.nil? or cmd2.nil? rd, wr = IO.pipe + cmd1_runner = runner.dup + cmd1_runner.disable_hook :waitpid + cmd1_runner.subscribe_hook(:son) { rd.close } cmd1.output = wr cmd2.input = rd - pids << Kernel.fork do - rd.close - cmd1.exec - end + datas << cmd1.run(cmd1_runner) wr.close end - pids << Kernel.fork do - @cmds.last.exec - end - pids.each { |pid| Process.waitpid pid } + runner = runner.dup + datas << @cmds.last.run(runner) + datas.waitpid if runner.is_a? Runners::System + datas end def input= ( arg ) @@ -65,11 +90,27 @@ } end + def [] ( *args ) + new_cmds = @cmds.dup + new_cmds[-1] = new_cmds.last[*args] + Pipe.new(*new_cmds) + end + + # + # Conversion methods + # + def to_sh strs = @cmds.map { |cmd| "(#{cmd.to_sh})" } - "(#{strs.join(' | ')})#{sh_args}" + "#{strs.join(' | ')}" end + def to_s + to_sh + end + + + end # class Pipe end # module Commands Index: lib/commands/runners/mock.rb --- lib/commands/runners/mock.rb (revision 364) +++ lib/commands/runners/mock.rb (working copy) @@ -1,67 +0,0 @@ -# Author:: Nicolas Pouillard . -# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved. -# License:: GNU General Public License (GPL). -# Revision:: $Id$ - -require 'commands' - -module Commands - - module Runners - - class Mock < Runner - concrete - - attr_reader :log - - def initialize ( *a, &b ) - @log = [] - @contents = b - super - end - - def run_impl ( aCommand, data ) - end - - def run ( aCommand ) - d = super - d.output.open('w', &@contents) - d.status = 0 - d - end - - def display_command ( m ) - @log << m - end - - end # class Mock - - - - test_section __FILE__ do - - class MockTest < Test::Unit::TestCase - - def setup - assert_nothing_raised { @runner = Mock.new } - end - - def test_0_initialize - end - - def test_simple - assert_nothing_raised do - @cmd = 'foo bar baz'.to_cmd - @data = @runner.run(@cmd) - end - assert_kind_of(Commands::Datas::Data, @data) - assert_equal([@cmd], @runner.log) - end - - end # class SystemTest - - end - - end # module Runners - -end # module Commands Index: lib/commands.rb --- lib/commands.rb (revision 364) +++ lib/commands.rb (working copy) @@ -12,6 +12,24 @@ require 'commands/runners' +# Provides an object oriented way to manage, combine and run your commands. +# +# Example: +# require 'rubygems' ; require_gem 'ruby_ex' ; require 'ruby_ex' +# Commands.import! +# ls, wc, out = 'ls'.to_cmd, 'wc'.to_cmd, 'out'.to_path +# +# data = ls.system # other runners exist (exec, fork, sh...) +# +# p data.status +# puts data.output.read +# +# (ls > STDOUT).system +# +# cmd = ls['*.rb'] | wc['-l'] > out +# cmd.system +# +# puts out.read module Commands autoloaded_module(__FILE__, false) Index: lib/commands/command.rb --- lib/commands/command.rb (revision 364) +++ lib/commands/command.rb (working copy) @@ -240,9 +240,9 @@ def sh_args args = '' - args += " < #{@input.to_s.dump}" if @input - args += " > #{@output.to_s.dump}" if @output - args += " 2> #{@error.to_s.dump}" if @error + [ ['<', input], ['>', output], ['2>', error] ].each do |str, io| + args += " #{str} #{io.to_s.dump}" if io and not (io.respond_to? :pipe? and io.pipe?) + end args end @@ -496,7 +496,7 @@ assert_equal('"cp" > "ya"', (@cp > 'ya').to_sh) @cat << 'foo > bar' << '< baz' assert_equal( - '(("cat" "foo > bar" "< baz" < "yay") | ("cp" > "yoy"))', + '("cat" "foo > bar" "< baz" < "yay") | ("cp" > "yoy")', ((@cat | @cp) < 'yay' > 'yoy').to_sh) @wc.error = 'foo' assert_equal('"wc" 2> "foo"', @wc.to_sh) Index: lib/commands/runners/runner.rb --- lib/commands/runners/runner.rb (revision 364) +++ lib/commands/runners/runner.rb (working copy) @@ -46,6 +46,16 @@ end + def initialize_copy ( copy ) + super + if defined? @hookers + @hookers = @hookers.dup + else + @hookers = [] + end + end + + # # Methods. # Index: lib/commands/runners/mockable.rb --- lib/commands/runners/mockable.rb (revision 361) +++ lib/commands/runners/mockable.rb (working copy) @@ -9,41 +9,40 @@ module Runners - class Mock < Runner - concrete + module Mockable - attr_reader :log - - def initialize ( *a, &b ) + def make_mock ( &block ) @log = [] - @contents = b - super - end + @block = block - def run_impl ( aCommand, data ) - end + class << self + attr_reader :log + attr_accessor :block - def run ( aCommand ) - d = super - d.output.open('w', &@contents) - d.status = 0 - d + def exec ( aCommand, aData ) + @block[aCommand, aData] end def display_command ( m ) @log << m end + end # class << self - end # class Mock + self + end + end # module Mock + class Runner + include Mockable + end test_section __FILE__ do class MockTest < Test::Unit::TestCase def setup - assert_nothing_raised { @runner = Mock.new } + assert_nothing_raised { @runner = System.new.make_mock } end def test_0_initialize Index: lib/commands/datas/data.rb --- lib/commands/datas/data.rb (revision 364) +++ lib/commands/datas/data.rb (working copy) @@ -137,7 +137,8 @@ def clean kill - [@input, @output, @error].each do |stream| + [input, output, error].each do |stream| + next if stream.nil? or stream.is_a? IO if stream.is_a? File stream.close stream = stream.path.to_path @@ -150,7 +151,7 @@ end def self.clean_all - @@datas.dup.each { |data| data.kill } + @@datas.dup.each { |data| data.clean } end at_exit { clean_all } Index: lib/commands/datas/composite.rb --- lib/commands/datas/composite.rb (revision 364) +++ lib/commands/datas/composite.rb (working copy) @@ -11,13 +11,15 @@ class Composite < Data - def initialize ( *cmd ) + attr_accessor :contents + + def initialize ( *contents ) super() - @commands = cmd.flatten + @contents = contents.flatten end def each ( &block ) - @commands.each(&block) + @contents.each(&block) end def waitpid @@ -28,6 +30,26 @@ each { |x| x.kill(*a, &b) } end + def << ( data ) + @contents << data + end + + def status + @contents.last.status + end + + def output + @contents.last.output + end + + def error + @contents.last.error + end + + def input + @contents.first.input + end + end # class Composite end # module Datas -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050924/42b00df9/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 15:38:51 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sat, 24 Sep 2005 21:38:51 +0200 (CEST) Subject: [TTK-Patches] [core_ex] 366: Some packaging changes. Message-ID: <20050924193851.C18FD1BD38@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk/core_ex Index: ChangeLog from Nicolas Pouillard Some packaging changes. * ChangeLog: New. * vcs/vcs_core_ex.rb: New. Methods are cxci, core_ex_commit but just commit or ci works too (Vcs 0.4). * test/sanity/single-requires.yml: Use <> instead of ruby. ChangeLog | 1 + test/sanity/single-requires.yml | 2 +- vcs/vcs_core_ex.rb | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) Index: vcs/vcs_core_ex.rb --- vcs/vcs_core_ex.rb (revision 0) +++ vcs/vcs_core_ex.rb (working copy) @@ -5,13 +5,16 @@ class Vcs - def ruby_ex_commit! ( *args ) + protocol_version '0.1' - common_commit!('[ruby_ex] <%= rev %>: <%= title %>', *args) do |subject| + def core_ex_commit! ( *args ) + + common_commit!('[core_ex] <%= rev %>: <%= title %>', *args) do |subject| mail!(:to => ['ttk-patches at lists.feydakins.org'], :subject => subject) end end - alias_command :rxci, :ruby_ex_commit + alias_command :cxci, :core_ex_commit + default_commit :core_ex_commit end # class Vcs Index: test/sanity/single-requires.yml --- test/sanity/single-requires.yml (revision 365) +++ test/sanity/single-requires.yml (working copy) @@ -7,7 +7,7 @@ test: <>: !S::Suite attributes: !S::Cmd - command: ruby + command: <> exit: 0 error: "" output: !re 0 failures, 0 errors$ Index: ChangeLog --- ChangeLog (revision 0) +++ ChangeLog (revision 0) @@ -0,0 +1 @@ +See ../ChangeLog for previous entries. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050924/1ffc5e11/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 15:54:47 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sat, 24 Sep 2005 21:54:47 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 367: Symtbl gsub, FileType, OHash and Yaml... Message-ID: <20050924195447.AD2031BD38@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Symtbl gsub, FileType, OHash and Yaml... * lib/sym_tbl_gsub.rb: Keep pattern not yet expansed in a list, and re-inject them when the symtbl is defined. * lib/file_type.rb: Remove the FIXME concerning the pipe issue which is solved. Adapt tests to Runners::Mockable. * lib/ruby_ex.rb: Add a missing `lib/'. * lib/ordered_hash.rb: Now have a YamlExtension. * lib/yaml/chop_header.rb: Typo on variable name. file_type.rb | 50 +++++++++++++++++++++++++++--------------------- ordered_hash.rb | 27 ++++++++++++++++++++++++++ ruby_ex.rb | 2 - sym_tbl_gsub.rb | 54 ++++++++++++++++++++++++++++++++++++++-------------- yaml/chop_header.rb | 2 - 5 files changed, 98 insertions(+), 37 deletions(-) Index: lib/ordered_hash.rb --- lib/ordered_hash.rb (revision 366) +++ lib/ordered_hash.rb (working copy) @@ -193,6 +193,27 @@ hsh end + have YamlExtension, :ordered_hash, :ohash, :o_hash + + def self.yaml_load ( val ) + case val + when Hash + return OHash[val.to_a] + when OHash + return val + when Array + if val.all? { |x| x.is_a?(Hash) and x.size == 1 } + h = OHash.new + val.each do |x| + k, v = x + h[k] = v + end + return h + end + end + raise ArgumentError, "Cannot create a OHash with `#{val}'" + end + end # class OHash @@ -283,6 +304,12 @@ assert_not_equal OHash[1,2,3,4], OHash[3,4,1,2] end + def test_yaml_load ( aString, aClass, anObject=nil ) + end + + def test_yaml_dump ( anObject, ref, options={} ) + end + end # OrderedHashTest end Index: lib/yaml/chop_header.rb --- lib/yaml/chop_header.rb (revision 366) +++ lib/yaml/chop_header.rb (working copy) @@ -11,7 +11,7 @@ aStr = io.gets unless aStr =~ /^---/ io.rewind - raise Exception, "First line is not valid: `#{aLine}'" + raise Exception, "First line is not valid: `#{aStr}'" end io.each do |aLine| break if aLine =~ /^---/ Index: lib/file_type.rb --- lib/file_type.rb (revision 366) +++ lib/file_type.rb (working copy) @@ -1,7 +1,9 @@ -require 'abstract' -require 'commands' -require 'active_support/class_attribute_accessors' -require 'active_support/class_inheritable_attributes' +# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved. +# Author:: Nicolas Pouillard . +# License:: Gnu General Public License. +# Revision:: $Id$ + +Commands.import! module FileType @@ -133,8 +135,10 @@ @tmp = TempPath.new(base.path.basename, ext) cmd = mk_cmd(@tmp) data = cmd.run(self.class.runner) + data.waitpid if data.status.nil? if data.status != 0 @tmp.rmtree if @tmp.exist? + STDERR.puts data.error.read if data.error and data.error.exist? raise ExtractError, "Cannot extract a file: | path: #{to_s} | type: #{self.class} @@ -243,10 +247,7 @@ class TarBz2 < Generic filetype_extension(/\.(tar\.bz2|tbz2|tbz)$/) - # FIXME Use this pipe beacause -j is not portable - # extractable_dir (BZIP2 + %w[-c -d]) | (TAR + %w[xvf - -C]) - # problem: a pipe command doesn't properly implement `[]' - extractable_dir TAR + %w[xvjf %i -C] + extractable_dir((BZIP2 + %w[-c -d %i]) | (TAR + %w[xvf - -C])) end # class TarBz2 @@ -340,16 +341,19 @@ test_section __FILE__ do + Commands::Runners::Mockable.import! + class FileTypeTest < Test::Unit::TestCase def setup @tmp = TempPath.new (@tmp + 'foo').mkpath - @mr = Commands::Runners::Mock.new do |out| - out.write("#@tmp/foo/bar/baz\n#@tmp/foo\n#@tmp/foo/f/f/foo/baz\n") + @mr = Commands::Runners::System.new + @mr.make_mock do + puts "#@tmp/foo/bar/baz\n#@tmp/foo\n#@tmp/foo/f/f/foo/baz" end FileType::Generic.runner = @mr - @res_dir = __FILE__.to_path.dirname.parent + 'test/resources' + @fixtures = __FILE__.to_path.dirname.parent + 'test/resources' end def assert_guess ( type, *files ) @@ -366,7 +370,8 @@ assert(@inp.extractable?, "#@inp not extractable") assert_nothing_raised { @res = @inp.extract } assert_kind_of(FileType.const_get(type), @res) - assert_match(command, @mr.log.last.to_sh) + assert_match(command, @mr.log.first.to_sh) + assert_equal(1, @mr.log.size, "Mock log size != 1") end def assert_real_extract ( type, file ) @@ -424,27 +429,30 @@ end def test_extract_gz - assert_extract :Ruby, /^"gzip" "-d" "-c" "[^%]*" > "[^%]*"$/, 'foo.rb.gz' + assert_extract :Ruby, /^"gzip" "-d" "-c" "[^%]*" > "[^%]*"$/, @fixtures/'foo.rb.gz' end def test_extract_bz2 - assert_extract :Unknown, /^"bzip2" "-d" "-c" "[^%]*" > "[^%]*"$/, 'foo.bz2' + assert_extract :Unknown, /^"bzip2" "-d" "-c" "[^%]*" > "[^%]*"$/, @fixtures/'foo.bz2' end def test_extract_zip - assert_extract :Gz, /^"unzip" "-p" "[^%]*" > "[^%]*"$/, 'foo.gz.zip' + assert_extract :Gz, /^"unzip" "-p" "[^%]*" > "[^%]*"$/, @fixtures/'foo.gz.zip' end def test_extract_tar_bz2 assert_extract :Directory, - # /^"bzip2" -d -c "foo.tar.bz2" | "tar" "xvf" "-" "-C" "[^%]*" > "[^%]*"$/, - /^"tar" "xvjf" "foo.tar.bz2" "-C" "[^%]*" > "[^%]*"$/, 'foo.tar.bz2' + /^\("bzip2" "-c" "-d" "[^%]*foo.tar.bz2"\) \| \("tar" "xvf" "-" "-C" "[^%]*" > "[^%]*"\)$/, + @fixtures/'foo.tar.bz2' + end + def test_real_extract_tar_bz2 + assert_real_extract :Directory, @fixtures/'foo.tar.bz2' end def test_extract_tar_gz assert_extract :Directory, - /^"tar" "xvzf" "foo.tar.gz" "-C" ".*foo.*" > ".*log.*"$/, 'foo.tar.gz' - assert_real_extract :Directory, @res_dir + 'foo.tar.gz' + /^"tar" "xvzf" "[^%]*foo.tar.gz" "-C" ".*foo.*" > ".*log.*"$/, @fixtures/'foo.tar.gz' + assert_real_extract :Directory, @fixtures/'foo.tar.gz' end def test_extract_tar assert_extract :Directory, - /^"tar" "xvf" "foo.tar" "-C" "[^%]*" > "[^%]*"$/, 'foo.tar' + /^"tar" "xvf" "[^%]*foo.tar" "-C" "[^%]*" > "[^%]*"$/, @fixtures/'foo.tar' end def test_install_gem @@ -455,7 +463,7 @@ def test_longest_common_path assert_nothing_raised do - res = @res_dir + 'tar.gz.log' + res = @fixtures/'tar.gz.log' @longest = FileType::ExtractableDir.longest_common_path(res) end assert_equal(['core_ex-0.1.4'], @longest) Index: lib/sym_tbl_gsub.rb --- lib/sym_tbl_gsub.rb (revision 366) +++ lib/sym_tbl_gsub.rb (working copy) @@ -139,18 +139,30 @@ PathList.import! class PathList + attr_accessor :symtbl - alias add_matching_without_expand add_matching + alias_method :add_matching_without_expand, :add_matching def add_matching(pattern) - pattern = @expand[pattern] if defined? @expand and @expand + @pending_reject ||= [] + if defined? @symtbl and @symtbl + pattern = pattern.do_symtbl_gsub(@symtbl) + else + if pattern.to_s =~ /<<.*>>/ and not @pending_reject.include? pattern + @pending_reject << pattern + return + end + end add_matching_without_expand pattern end protected :add_matching def symtbl_gsub! ( symtbl ) - @expand = lambda { |pattern| pattern.do_symtbl_gsub(symtbl) } + @pending_add += @pending_reject if defined? @pending_reject + @pending_reject = [] + @pending = ! @pending_add.empty? + @symtbl = symtbl map! { |path| path.do_symtbl_gsub(symtbl) } - @expand = nil + @symtbl = nil self end @@ -173,7 +185,8 @@ 3 => 'foo', :i => '<>', :j => '<<3>>', - :pwd => __FILE__.to_path.dirname.to_s + :pwd => __FILE__.to_path.dirname.to_s, + :test => '<>/../test' ) end def assert_symtbl ( my, ref=nil ) @@ -215,10 +228,23 @@ pathlist = ['<>', '<>'.to_path] ls1 = '<>/../test'.to_path + 'resources/autoload_tree/*.rb' ls2 = '<>/../test'.to_path + 'resources/autoload_tree/*.rb' - pathlist << ls2 << ls1 + ls3 = '<>'.to_path + 'resources/foo.{tar*,bz*}' + pathlist << ls2 << ls1 << ls3 my = PathList[pathlist].symtbl_gsub(@s).map! { |x| x.basename } my.all? { |x| assert_kind_of(Pathname, x) } - ref = %w[ bar foo A.rb B.rb ] + ref = %w[ bar foo A.rb B.rb foo.bz2 foo.tar foo.tar.bz2 foo.tar.gz ] + assert_equal ref.to_set, my.map!{ |x| x.to_s }.to_set + end + def test_pathlist_keep_pending + pathlist = ['<>', '<>'.to_path] + pathlist << '<>/../test'.to_path + 'resources/autoload_tree/*.rb' + pathlist << '<>/../test'.to_path + 'resources/autoload_tree/*.rb' + pathlist << '<>'.to_path + 'resources/foo.{tar*,bz*}' + pathlist = PathList[pathlist] + assert_equal(['<>'.to_path, '<>'.to_path], pathlist) + my = pathlist.symtbl_gsub(@s).map! { |x| x.basename } + my.all? { |x| assert_kind_of(Pathname, x) } + ref = %w[ bar foo A.rb B.rb foo.bz2 foo.tar foo.tar.bz2 foo.tar.gz ] assert_equal ref.to_set, my.map!{ |x| x.to_s }.to_set end end # class SymTblGsubTest Index: lib/ruby_ex.rb --- lib/ruby_ex.rb (revision 366) +++ lib/ruby_ex.rb (working copy) @@ -35,7 +35,7 @@ unless defined? CoreEx - file = Pathname.glob("#{dir}/../{core_ex/lib/core_ex,vendor/core_ex*/core_ex}").first + file = Pathname.glob("#{dir}/../{core_ex/lib/core_ex,vendor/core_ex*/lib/core_ex}").first if file.nil? require 'rubygems' require_gem 'core_ex' -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050924/bbf75458/signature-0001.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 15:58:16 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sat, 24 Sep 2005 21:58:16 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 368: Update vcs support and add some fixtures. Message-ID: <20050924195816.154851BD38@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Update vcs support and add some fixtures. * test/check-ruby_ex.yml: Upgrade to Iterate and !S::. * vcs/vcs_ruby_ex.rb: Upgarde to Vcs 0.4 protocol 0.1. With just Vcs 0.4 just use `commit' or `ci'. * NEWS: Typo. Add some fixtures. * test/resources/foo.bz2: New. * test/resources/.DS_Store: New. * test/resources/foo.gz.zip: New. * test/resources/foo.rb.gz: New. * test/resources/foo.tar.bz2: New. * test/resources/foo.tar: New. NEWS | 20 +++++++++----------- test/check-ruby_ex.yml | 16 ++++++---------- vcs/vcs_ruby_ex.rb | 5 ++++- 3 files changed, 19 insertions(+), 22 deletions(-) Index: test/resources/foo.tar Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: test/resources/foo.tar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: test/resources/foo.bz2 Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: test/resources/foo.bz2 ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: test/resources/foo.gz.zip Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: test/resources/foo.gz.zip ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: test/resources/foo.rb.gz Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: test/resources/foo.rb.gz ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: test/check-ruby_ex.yml --- test/check-ruby_ex.yml (revision 367) +++ test/check-ruby_ex.yml (working copy) @@ -1,12 +1,8 @@ --- -RubyEx Main Test Suite: - - strategy: Glob - glob : <>/*-suite.yml - regexp : !re ([^/]*)\.yml$ - +RubyEx Main Test Suite: !S::Iterate + over: <>/(*-suite).yml + iter: [it_path, it_name] test: - <>: - strategy: Import - import : <> + <>: !S::Import + import: <> Index: test/resources/foo.tar.bz2 Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: test/resources/foo.tar.bz2 ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: test/resources/.DS_Store Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: test/resources/.DS_Store ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: vcs/vcs_ruby_ex.rb --- vcs/vcs_ruby_ex.rb (revision 367) +++ vcs/vcs_ruby_ex.rb (working copy) @@ -5,6 +5,8 @@ class Vcs + protocol_version '0.1' + def ruby_ex_commit! ( *args ) common_commit!('[ruby_ex] <%= rev %>: <%= title %>', *args) do |subject| @@ -13,5 +15,6 @@ end alias_command :rxci, :ruby_ex_commit + default_commit :ruby_ex_commit end # class Vcs Index: NEWS --- NEWS (revision 367) +++ NEWS (working copy) @@ -1,14 +1,12 @@ = New in 0.2, 2005-09-16: - * Many many changes and new things for RubyEx. - - * Remove many requires which are now useless, many are not yet + * Remove many requires which are now useless; many are not yet suppressed. - * Renaming to follow the camelize/underscore convention. + * Rename classes and modules to follow the camelize/underscore convention. * Commands: - Provides a object oriented way to manage, combine and run your commands. + Provides an object oriented way to manage, combine and run your commands. Example: require 'rubygems' ; require_gem 'ruby_ex' ; require 'ruby_ex' @@ -27,7 +25,7 @@ puts out.read - * RPath: Add RPath, a basic (but powerful) way to search your ruby data. + * RPath: Add RPath, a simple way to search your ruby data. * BlankSlate, Mocks, VerboseObject, and AutoObject: @@ -57,19 +55,19 @@ - Add many unit tests. - Add gem filetype support (with the install method). - * MetaFactory: A class that help to produce objects that + * MetaFactory: A class that help to produce objects which share the same initializion step. * Html encode: Support accent encoding for the iso latin1 charset. - * URI: Support for Mysql and Pgsql. + * URI: Support for MySQL and PgSQL. * HashEval: Provides a block in which methods name are keys and arguments/blocks are values. * SymTbl (Symbol Table): - Add symtbl_gsub methods to provide a global substitution sheme over any + Add symtbl_gsub methods which provide a global substitution sheme over any objects. = New in 0.1, 2005-05-31: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050924/c5b732cf/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 16:09:35 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sat, 24 Sep 2005 22:09:35 +0200 (CEST) Subject: [TTK-Patches] 708: Fix some blocker bugs in strategies. Message-ID: <20050924200935.D876B1B3EC@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/708 Index: ChangeLog from Nicolas Pouillard Fix some blocker bugs in strategies. * lib/ttk/strategies/CmdBase.rb: Initialize some variables. Add waitpid. Call waitpid in `run_impl' and in the `epilogue' (which is protected against timeouts). * lib/ttk/strategies/Checkout.rb: Adapt to the unified URI::Generic#checkout result. * lib/ttk/strategies/IOBased.rb: Do not show the input status which does not make sense. Do not skip too many streams during the display. * lib/ttk/strategies/Strategy.rb: Remove the completly useless require to 'thread_mutex'. Checkout.rb | 9 ++++++--- CmdBase.rb | 36 ++++++++++++++++++++++++------------ IOBased.rb | 4 ++-- Strategy.rb | 1 - 4 files changed, 32 insertions(+), 18 deletions(-) Index: lib/ttk/strategies/IOBased.rb --- lib/ttk/strategies/IOBased.rb (revision 707) +++ lib/ttk/strategies/IOBased.rb (working copy) @@ -80,7 +80,7 @@ def print_streams @streams.each do |stream| - next if invalid_stream?(stream) + next if stream.nil? @log << stream end end @@ -89,7 +89,7 @@ def invalid_stream? ( stream ) stream.nil? or stream.ref.nil? or - stream.my.nil? or stream.name == :input or + stream.my.nil? or stream.name == 'input' or (stream.my.is_a? Pathname and !stream.my.exist?) or (stream.ref.is_a? Pathname and !stream.ref.exist?) end Index: lib/ttk/strategies/CmdBase.rb --- lib/ttk/strategies/CmdBase.rb (revision 707) +++ lib/ttk/strategies/CmdBase.rb (working copy) @@ -17,7 +17,7 @@ def initialize ( *a, &b ) super - @my_exit = nil + @my_exit, @pid, @my_status = nil, nil, nil end @@ -28,7 +28,7 @@ def run_impl begin cmd = mk_command - cmd.gsub!(/\n/, ' ') + cmd.gsub!("\n", ' ') if @log.severity_level <= Logger::Severity::DEBUG @log[:running] = cmd @@ -50,9 +50,7 @@ end end father_hook - Process.waitpid(@pid) - @my_status = $? - @my_exit = @my_status.exitstatus + waitpid fail('exception raised during exec') if @my_exit == 127 end end @@ -70,10 +68,10 @@ def abort_hook - if defined? @pid + unless @pid.nil? begin Process.kill('-KILL', - at pid) - Process.waitpid(@pid) + waitpid rescue Errno::ESRCH @log.already_killed = @pid end @@ -84,6 +82,15 @@ protected :abort_hook + def waitpid + return if @pid.nil? or not @my_status.nil? + Process.waitpid(@pid) + @my_status = $? + @my_exit = @my_status.exitstatus + end + protected :waitpid + + def mk_command cmd = @command.to_s.dup cmd += ' %a' if cmd !~ /%a/ and @args @@ -99,12 +106,17 @@ protected :mk_command + def epilogue + waitpid + super + end + # # Attributes # - attr_reader :my_exit #FIXME: remove me + attr_reader :my_exit, :my_status, :pid attribute :command, 'the command to execute', :mandatory, [String, Pathname, Array] Index: lib/ttk/strategies/Strategy.rb --- lib/ttk/strategies/Strategy.rb (revision 707) +++ lib/ttk/strategies/Strategy.rb (working copy) @@ -6,7 +6,6 @@ require 'set' require 'timeout' -require 'thread_mutex' module TTK Index: lib/ttk/strategies/Checkout.rb --- lib/ttk/strategies/Checkout.rb (revision 707) +++ lib/ttk/strategies/Checkout.rb (working copy) @@ -19,9 +19,12 @@ def run_impl begin - file, out, err = @url.checkout + file, data = @url.checkout + if data.is_a? Commands::Datas::Data + out, err = data.output, data.error @log.my_stdout = out.read unless out.nil? or out.size.zero? @log.my_stderr = err.read unless err.nil? or err.size.zero? + end file = FileType.guess(file) if file.is_a? FileType::Directory @symtbl[:checkout_dir] = file.path -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050924/b2f46d34/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 16:46:05 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sat, 24 Sep 2005 22:46:05 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 369: Remove the inopportunely added .DS_Store. Message-ID: <20050924204605.97E3B1B3EC@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Remove the inopportunely added .DS_Store. * test/resources/.DS_Store: Remove. .DS_Store | 0 1 files changed Index: test/resources/.DS_Store Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050924/8d60d729/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 20:42:19 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 02:42:19 +0200 (CEST) Subject: [TTK-Patches] 709: Improve Proxies strategies and fix some bugs. Message-ID: <20050925004219.557F41AFBE@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/709 Index: ChangeLog from Nicolas Pouillard Improve Proxies strategies and fix some bugs. * lib/ttk/strategies/Test.rb: Reject :name, :status, :strategy like it was in Proxy but leave a FIXME. * lib/ttk/strategies/Iterate.rb: Add Hash#ttk_each. * lib/ttk/strategies/RMatch.rb: Deep re-implementation to avoid the Forker class which cause many problems. * lib/ttk/strategies/Proxy.rb: No more reject but supply a test name if the name is not set. * lib/ttk/strategies/RUnit.rb: Use <> and %a. * lib/ttk/strategies/Strategy.rb: The name attribute is no more mandatory (that is cleaner than the fake name `noname'). Iterate.rb | 9 +++++++ Proxy.rb | 5 +--- RMatch.rb | 70 +++++++++++++++++++++--------------------------------------- RUnit.rb | 4 +-- Strategy.rb | 20 +++++++++-------- Test.rb | 1 6 files changed, 50 insertions(+), 59 deletions(-) Index: lib/ttk/strategies/Iterate.rb --- lib/ttk/strategies/Iterate.rb (revision 708) +++ lib/ttk/strategies/Iterate.rb (working copy) @@ -121,3 +121,12 @@ end end # class Object + + +class Hash + + def ttk_each ( *a, &b ) + each(*a) { |k, v| b[k, v] } + end + +end # class Object Index: lib/ttk/strategies/Proxy.rb --- lib/ttk/strategies/Proxy.rb (revision 708) +++ lib/ttk/strategies/Proxy.rb (working copy) @@ -22,8 +22,7 @@ def run_composite test = @contents.first - test.reject :name, :strategy, :status - reject :reason + test.name ||= 'test' run_test(test, @log) end protected :run_composite Index: lib/ttk/strategies/RUnit.rb --- lib/ttk/strategies/RUnit.rb (revision 708) +++ lib/ttk/strategies/RUnit.rb (working copy) @@ -81,12 +81,12 @@ protected def prologue - @command = Config::CONFIG["RUBY_INSTALL_PATH"] + ' ' + @command = '<>' @command += '-w ' if @verbose @load_path.each { |x| @command += "-I#{x} " } @command += "%i " @command += "--runner yaml " - @command += "-- #@args " + @command += "-- %a" super end Index: lib/ttk/strategies/RMatch.rb --- lib/ttk/strategies/RMatch.rb (revision 708) +++ lib/ttk/strategies/RMatch.rb (working copy) @@ -17,62 +17,35 @@ def prologue super - must_match, must_not_match = @match, @dont_match - @errors_must_match = errors_must_match = must_match.dup - @errors_must_not_match = errors_must_not_match = [] - log = @log + @errors_must_match = @match.dup + @errors_must_not_match = [] + + prefix = @log.path.to_regex_path_string + @log.debug { @log.prefix = prefix ; nil } c = Class.new(Filters::RPathFilter) - c.class_eval do - include Concrete + c.include Concrete - must_match.each do |rpath| - match rpath do |filter, path| - log.debug { [rpath, path.to_s] } - errors_must_match.delete rpath - disable_matcher() + @match.each do |rpath| + c.match prefix + rpath do |filter, path| + @errors_must_match.delete rpath + c.disable_matcher() end end - must_not_match.each do |rpath| - match rpath do |filter, path| - log.debug { [rpath, path.to_s] } - errors_must_not_match << rpath - disable_matcher() + @dont_match.each do |rpath| + c.match prefix + rpath do |filter, path| + @errors_must_not_match << rpath + c.disable_matcher() end end - end # class c - - @filtered_log = Forker.new(@symtbl[:log_factory].create(c.new), @log) + @c_filter = c.new + @log.add_observer(@c_filter) create @test end protected :prologue - class Forker - def initialize ( *a ) - @children = a.reverse - end - # FIXME use BlankSlate - instance_methods.each do |meth| - next if meth =~ /^__.*__$/ - undef_method meth - end - def method_missing ( *a, &b ) - result = nil - @children.each do |child| - result = child.send(*a, &b) - end - result - end - end - - def run_composite - test = @contents.first - run_test(test, @filtered_log) - end - protected :run_composite - def assertion if @errors_must_match.empty? and @errors_must_not_match.empty? @@ -90,6 +63,13 @@ protected :assertion + def epilogue + @log.delete_observer @c_filter + super + end + protected :epilogue + + # # Attributes # Index: lib/ttk/strategies/Strategy.rb --- lib/ttk/strategies/Strategy.rb (revision 708) +++ lib/ttk/strategies/Strategy.rb (working copy) @@ -53,7 +53,7 @@ # # Create a new Strategy with the given optional document. - def initialize ( name='noname', &block ) + def initialize ( name=nil, &block ) @status = StartStatus.new @symbols = {} @symtbl = nil @@ -412,6 +412,7 @@ end @save = {} res = OHash.new + check_attributes each_attribute do |attr, val| next if val.nil? @@ -428,7 +429,7 @@ @symbols.each do |k, v| @symtbl[k] = v end - unless @reject.include? :name + unless self.name.nil? or @reject.include? :name if @symtbl[:pathname].nil? @symtbl[:pathname] = ('/' + self.name).to_sym else @@ -563,15 +564,16 @@ @name || @log.path.to_s || super end - def name=(other) - tmp = other.to_s - if tmp.empty? - raise(ArgumentError, "`#{tmp}' - not a valid strategy name") + def name= ( anObject ) + case anObject + when nil, '' + @name = nil else - @name = tmp + @name = anObject.to_s end end + def timeout=(other) if other >= 0 @timeout = other @@ -585,7 +587,7 @@ end def display_unexpected_exc ( exc ) - @log.error_pected_exception = exc + @log.error_unexpected_exception = exc end def display_unexpected_synflow_exc ( exc, arg ) @@ -644,7 +646,7 @@ end end - attribute :name, 'test name', :invisible, :mandatory, String + attribute :name, 'test name', :invisible, String attribute :strategy, 'the strategy class', Class, Strategy, :mandatory, :invisible attribute :wclass, 'a class to control weights', Class, Weights::Default Index: lib/ttk/strategies/Test.rb --- lib/ttk/strategies/Test.rb (revision 708) +++ lib/ttk/strategies/Test.rb (working copy) @@ -32,6 +32,7 @@ protected def run_impl_test(test, log) + test.reject :name, :status, :strategy # FIXME : Try to remove this if possible my_log = nil @outfile.open('w') do |io| my_log = Logger.new(Dumpers::Yaml.new(io)) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/d4e6620d/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 20:51:15 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 02:51:15 +0200 (CEST) Subject: [TTK-Patches] 710: Update the backend: remove the `close' notification. Message-ID: <20050925005115.45E6C1AFBE@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/710 Index: ChangeLog from Nicolas Pouillard Update the backend: remove the `close' notification. * lib/ttk/logger/path.rb: Add Logger::Path#{to_a,to_regex_path_string,to_regex_path}. * lib/ttk/loaders/Yaml.rb: Begin the 1.8.3 support. * lib/ttk/filters/Filter.rb: Emulate the `close' notification. * lib/ttk/dumpers/Dumper.rb: ... likewise and update the documentation. * bin/ttk: Remove the `close' notification. * lib/ttk/strategies/SubCmd.rb: Remove the `close' treatment. Make SubCmd quiet by default. bin/ttk | 6 ------ lib/ttk/dumpers/Dumper.rb | 21 +++++++++++++-------- lib/ttk/filters/Filter.rb | 8 +++++--- lib/ttk/loaders/Yaml.rb | 7 +++++++ lib/ttk/logger/path.rb | 17 ++++++++++++++++- lib/ttk/strategies/SubCmd.rb | 4 ++-- 6 files changed, 43 insertions(+), 20 deletions(-) Index: lib/ttk/dumpers/Dumper.rb --- lib/ttk/dumpers/Dumper.rb (revision 709) +++ lib/ttk/dumpers/Dumper.rb (working copy) @@ -18,22 +18,24 @@ # At any time `path' is "equivalent to" the shell command `pwd'. # # - new_node: - # - You receive a message like that: [ :new_node, path ]. - # - new_node is equivalent to `mkdir path && cd path' in shell. + # - You receive a message like that: [ :new_node, path, node ]. + # Where `path' is the current path. + # - The method new_node is called with path and node as arguments. + # - new_node is equivalent to `mkdir node && cd node' in shell. # # - new_leaf: - # - message: [ :new_leaf, path, node ] + # - call: new_leaf(path, node) # Where `path' is the current path. # - equivalent: `touch node' # # - up: - # - message: [ :up, path ] + # - call: up(path) # Where `path' is the current path. # - equivalent: `cd ..` # - This notification change the current path to the parent. # # - close: - # - message: [ :close ] + # - call: close() # - This notification close the dumper. class Dumper include Abstract @@ -71,13 +73,16 @@ def update ( msg, *args ) case msg - when :up then up(*args) + when :up + path = args.first + up(path) + close if path.to_a.empty? when :new_node then new_node(*args) when :new_leaf then new_leaf(*args) - when :close then close(*args) end end + def notif ( *args ) changed notify_observers(*args) Index: lib/ttk/strategies/SubCmd.rb --- lib/ttk/strategies/SubCmd.rb (revision 709) +++ lib/ttk/strategies/SubCmd.rb (working copy) @@ -14,6 +14,7 @@ def prologue @command = @symtbl[:ttk] @dir = @symtbl[:pwd] + @quiet_print = true super end protected :prologue @@ -27,7 +28,6 @@ YAML::each_document(out) do |notification| case notification when Array - next if notification.first == :close @log.send(*notification) when Status status = notification Index: bin/ttk --- bin/ttk (revision 709) +++ bin/ttk (working copy) @@ -102,8 +102,6 @@ end - log.close unless log.nil? - if (opts[:cache_mode] or opts[:cache_dir]) and not status.pass? raise 'HighLine is unavailable' unless defined? HighLine h = HighLine.new @@ -174,10 +172,6 @@ end exit(1) -ensure - - log.close unless log.nil? - end exit(0) Index: lib/ttk/loaders/Yaml.rb --- lib/ttk/loaders/Yaml.rb (revision 709) +++ lib/ttk/loaders/Yaml.rb (working copy) @@ -29,6 +29,11 @@ module YAML + module Syck + class Scalar + end + end + module BaseNode CLASS_KEY_LIST = [:strategy, :wclass, :symtbl_class] @@ -38,6 +43,8 @@ when Symbol when Integer when /^:(.*)/ then k = $1.to_sym + when Syck::Scalar + k = k.value.to_s.to_sym else k = k.to_s.to_sym end if CLASS_KEY_LIST.include?(k) and (val = v.value) =~ /^[A-Z]/ Index: lib/ttk/filters/Filter.rb --- lib/ttk/filters/Filter.rb (revision 709) +++ lib/ttk/filters/Filter.rb (working copy) @@ -28,10 +28,12 @@ def update ( msg, *args ) case msg - when :up then up(*args) + when :up + path = args.first + up(path) + close if path.to_a.empty? when :new_node then new_node(*args) when :new_leaf then new_leaf(*args) - when :close then close(*args) end end Index: lib/ttk/logger/path.rb --- lib/ttk/logger/path.rb (revision 709) +++ lib/ttk/logger/path.rb (working copy) @@ -10,8 +10,23 @@ class Path < Array + def to_a + map{ |x| (x.is_a? Array)? x.first : x } + end + + def to_s - '/' + map{ |x| (x.is_a? Array)? x.first : x }.join('/') + '/' + to_a.join('/') + end + + + def to_regex_path_string + '/' + to_a.map { |x| Regexp.quote x.to_s }.join('/') + end + + + def to_regex_path + RegexPath.new(to_regex_path_string) end -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/8c2dbcb3/signature-0001.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 20:58:05 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 02:58:05 +0200 (CEST) Subject: [TTK-Patches] 711: Add <> to the symtbl. Message-ID: <20050925005805.0460B1AFBE@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/711 Index: ChangeLog from Nicolas Pouillard !!! In your tests you now must use <> instead of just ruby !!! !!! This will permit to easily control and change the running ruby !!! Add <> to the symtbl. * lib/ttk.rb: Update to core_ex. * lib/ttk/streams.rb: No more dump regexp with `//'. * lib/ttk/status.rb: Add a strange workaround to avoid a Yaml bug. * lib/ttk/streams/Stream.rb: Enforce `Stream#to_ttk_log'. * bin/getopts/ttk.rb: Set exit 0 for --version. bin/getopts/ttk.rb | 2 +- lib/ttk.rb | 15 +++++++-------- lib/ttk/status.rb | 11 +++++++++++ lib/ttk/streams.rb | 5 +---- lib/ttk/streams/Stream.rb | 14 ++++++++++++-- 5 files changed, 32 insertions(+), 15 deletions(-) Index: lib/ttk.rb --- lib/ttk.rb (revision 710) +++ lib/ttk.rb (working copy) @@ -28,22 +28,21 @@ lib = Pathname.new(__FILE__).dirname vendor = lib.parent + 'vendor' unless defined? CoreEx - $LOAD_PATH << (vendor + 'active_support').to_s - vendor_core_ex_core_ex = vendor + 'core_ex' + 'core_ex' - if vendor_core_ex_core_ex.exist? - require vendor_core_ex_core_ex.to_s + CORE_EX_VENDORS = [vendor] + file = Pathname.glob("#{vendor}/core_ex*/core_ex").first + if file + require file.to_s else require 'rubygems' require_gem 'core_ex' require 'core_ex' end end - PathList[vendor/'*'].load_path! - RubyEx.import! lib.load_path! + RubyEx.import! mattr_accessor :dir self.dir = lib + 'ttk' - suppress(LoadError) { silence_warnings { require 'action_view' } } + suppress(LoadError) { silence_warnings { core_ex_require 'actionview', 'action_view' } } # Standard library requirements @@ -66,7 +65,6 @@ ConstRegexp.import! HashEval.import! RPath.import! - ThreadMutex.import! Commands.import! # Mother exception of every exception thrown by TTK. @@ -286,6 +284,7 @@ log=default_log(options, log_factory)) symtbl = SymTbl.new(options) symtbl[:ttk] = Pathname.new($0).expand_path + symtbl[:ruby] = Config::CONFIG['RUBY_INSTALL_PATH'] symtbl[:core_ex] = CoreEx.dir symtbl[:symtbl_class] = symtbl.class symtbl[:pwd] = Pathname.pwd.expand_path Index: bin/getopts/ttk.rb --- bin/getopts/ttk.rb (revision 710) +++ bin/getopts/ttk.rb (working copy) @@ -341,7 +341,7 @@ optparser.on_tail('--version', 'Show version') do puts ::TTK::VERSION_TEXT - exit 12 + exit 0 end end Index: lib/ttk/streams.rb --- lib/ttk/streams.rb (revision 710) +++ lib/ttk/streams.rb (working copy) @@ -22,7 +22,7 @@ to_s.compare_stream(stream) end def to_s_for_ttk_log - to_s + self end end @@ -39,9 +39,6 @@ def compare_stream ( stream ) stream.read =~ self end - def to_s_for_ttk_log - "/#{source.sub(/\//, '\\/')}/" - end end class String Index: lib/ttk/streams/Stream.rb --- lib/ttk/streams/Stream.rb (revision 710) +++ lib/ttk/streams/Stream.rb (working copy) @@ -43,8 +43,18 @@ end def to_ttk_log ( log ) - log["my_#@name"] = @my.to_s_for_ttk_log unless @name == 'input' - log["ref_#@name"] = @ref.to_s_for_ttk_log unless @ref.nil? + unless @name == 'input' + str = @my.to_s_for_ttk_log + unless str.nil? or (str.is_a? String and str.empty?) + log["my_#@name"] = str + end + end + unless @ref.nil? + str = @ref.to_s_for_ttk_log + unless str.nil? or (str.is_a? String and str.empty?) + log["ref_#@name"] = str + end + end end def clean Index: lib/ttk/status.rb --- lib/ttk/status.rb (revision 710) +++ lib/ttk/status.rb (working copy) @@ -155,6 +155,17 @@ def hook_name :failed_hook end + + # FIXME find the Yaml bug that force us to write it by hand + # problem: message is dumped twice. + have YamlExtension, 'TTK::Status::Fail' + def to_yaml_string + { 'message' => @message, 'weight' => @weight }.to_yaml.sub(/---.*$/, '') + end + def self.yaml_load ( val ) + new(val['weight'], val['message']) + end + end # class FailStatus end # module TTK -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/e2db26b1/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 21:02:39 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 03:02:39 +0200 (CEST) Subject: [TTK-Patches] 712: Update tests and packaging. Message-ID: <20050925010239.294F41BD38@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/712 Index: ChangeLog from Nicolas Pouillard Update tests and packaging. * test/ttk-pkg/cmdline.yml: Require an exit of 0. Check --authors. * test/ttk-minimal/sub.yml: Add a pass and a fail test. * test/ttk-minimal/runit.yml: Use RMatch to really control the output corectness. * test/ttk-minimal/env_cmd.yml, test/ttk-distcheck.yml, * test/ttk-minimal/signal_cmd.yml: Use <> instead of ruby. * SPEC.yml: Update dependencies. * vcs/ttk.rb: Update to Vcs 0.4. SPEC.yml | 5 +--- test/ttk-distcheck.yml | 2 - test/ttk-minimal/env_cmd.yml | 2 - test/ttk-minimal/runit.yml | 43 ++++++++++++++++++++-------------------- test/ttk-minimal/signal_cmd.yml | 2 - test/ttk-minimal/sub.yml | 5 ++++ test/ttk-pkg/cmdline.yml | 11 ++++++++++ vcs/ttk.rb | 18 +++++++++++----- 8 files changed, 55 insertions(+), 33 deletions(-) Index: test/ttk-minimal/sub.yml --- test/ttk-minimal/sub.yml (revision 711) +++ test/ttk-minimal/sub.yml (working copy) @@ -3,5 +3,10 @@ Test sub (sub.yml): !S::Suite attributes: !S::SubCmd {} contents: + - test sub pass: + input: --- !S::Pass {} + - test sub fail: + input: --- !S::Fail {} + weight: -1 - test sub with args: { args: <>/wc.yml } - test sub with input: { input: !path <>/wc.yml } Index: test/ttk-minimal/runit.yml --- test/ttk-minimal/runit.yml (revision 711) +++ test/ttk-minimal/runit.yml (working copy) @@ -1,8 +1,8 @@ --- - -RUnit strategy test suite: !S::Suite +RUnit strategy test suite: !S::RMatch symbols: unit_dir: <>/../ressources/runit + test: !S::Suite attributes: !S::RUnit input: !path <>/../test-unit-setup.rb contents: @@ -10,10 +10,8 @@ args: <>/good.rb - bad: args: <>/bad.rb - weight: -1 - error: args: <>/error.rb - weight: -1 - good directory: args: ressources/runit/good.rb dir: <>/.. @@ -21,4 +19,7 @@ - bad directory: args: ressources/runit/bad.rb dir: <>/.. - weight: -1 + match: + - ///good/status/PASS + - ///bad/status/FAIL + - ///error/status/ERROR Index: test/ttk-pkg/cmdline.yml --- test/ttk-pkg/cmdline.yml (revision 711) +++ test/ttk-pkg/cmdline.yml (working copy) @@ -4,6 +4,7 @@ attributes: !S::Cmd command : <> error : "" + exit : 0 contents: - version: args: --version @@ -14,6 +15,15 @@ This is free software; see the source for copying conditions\. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\. + - authors: + args: --authors + output: !re | + --- + TTK was written by and with the assistance of:(\n|.)* + - Vincent Cuissard.*:(\n|.)* + - Nicolas Desprès.*:(\n|.)* + - Nicolas Pouillard.*:(\n|.)* + - help: args: --help output: !re [^---\nUsage.*Team, m] @@ -31,6 +41,7 @@ error: | ERROR: invalid option: --this-option-does-not-exists (OptionParser) + exit: 1 - Strategy list: args: --strategy-list Index: SPEC.yml --- SPEC.yml (revision 711) +++ SPEC.yml (working copy) @@ -51,9 +51,8 @@ - '[A-Z]*' dependencies: - ruby_ex: ~> 0.1.2 - actionpack: ~> 1.9.1 - highline: ~> 0.6.0 + ruby_ex: [~> 0.2.0, 6087/ruby_ex-0.2.0.tar.gz] + actionpack: [~> 1.9.1, 5167/actionpack-1.9.1.tgz] # The version needed to test this ttk. # Not the version of this ttk. Index: test/ttk-distcheck.yml --- test/ttk-distcheck.yml (revision 711) +++ test/ttk-distcheck.yml (working copy) @@ -12,7 +12,7 @@ - Export the TTK binary: !S::Pass weight: 0 symbols: - ttk: ruby <>/bin/ttk + ttk: <> <>/bin/ttk - DistCheck the package: !S::SubCmd input: !path <>/test/ttk-check.yml Index: test/ttk-minimal/signal_cmd.yml --- test/ttk-minimal/signal_cmd.yml (revision 711) +++ test/ttk-minimal/signal_cmd.yml (working copy) @@ -1,7 +1,7 @@ Check SignalCmd Strategy: !S::Suite attributes: !S::SignalCmd command: | - ruby -e 'Process.kill("SEGV", $$)' + <> -e 'Process.kill("SEGV", $$)' contents: - Test as Cmd: Index: vcs/ttk.rb --- vcs/ttk.rb (revision 711) +++ vcs/ttk.rb (working copy) @@ -1,14 +1,20 @@ class Vcs - def ttk_commit! ( s, *args ) + # See http://rubyforge.org/projects/vcs + # and http://vcs.rubyforge.org - # really commit - common_commit!(*args) do |rev| - mail!(:to => ['ttk-patches at lists.feydakins.org'], - :subject => "#{rev}: #{s}") + COLLABOA = 'http://dev.uttk.org' + + protocol_version '0.1' + + def uttk_commit! ( *args ) + + common_commit!('<%= rev %>: <%= title %>', *args) do |subject| + mail! :to => ['ttk-patches at lists.feydakins.org'], :subject => subject end end - alias_command :ttkci, :ttk_commit + alias_command :uttkci, :uttk_commit + default_commit :uttk_commit end # class Vcs Index: test/ttk-minimal/env_cmd.yml --- test/ttk-minimal/env_cmd.yml (revision 711) +++ test/ttk-minimal/env_cmd.yml (working copy) @@ -2,7 +2,7 @@ Test the env feature in TestTCmd (env_cmd.yml): !S::Suite attributes: !S::Cmd - command: ruby -e "print ENV['FOO']" + command: <> -e "print ENV['FOO']" exit: 0 contents: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/ce7dfc44/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 21:18:06 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 03:18:06 +0200 (CEST) Subject: [TTK-Patches] 713: Remove the vendor dir. Message-ID: <20050925011806.21B3D1BD38@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/713 Index: ChangeLog from Nicolas Pouillard Remove the vendor dir. * vendor: Remove. The vendor dir is built when neeeded. 0 files changed -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/f57c27be/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 22:41:01 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 04:41:01 +0200 (CEST) Subject: [TTK-Patches] 714: More fixes... Message-ID: <20050925024101.B8E701AFBE@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/714 Index: ChangeLog from Nicolas Pouillard More fixes... * lib/ttk/filters/Buffer.rb: Reset at the begining of a new session to permit to use the result before it's destruction. * lib/ttk/strategies/RUnit.rb: RUnit is quiet by default. * lib/ttk.rb: Inverse arguments of core_ex_require. * test/runit/filters/node_cut_test.rb: Add the `close' notification in fixtures. lib/ttk.rb | 2 +- lib/ttk/filters/Buffer.rb | 8 +++++++- lib/ttk/strategies/RUnit.rb | 1 + test/runit/filters/node_cut_test.rb | 9 ++++++--- 4 files changed, 15 insertions(+), 5 deletions(-) Index: lib/ttk.rb --- lib/ttk.rb (revision 713) +++ lib/ttk.rb (working copy) @@ -42,7 +42,7 @@ RubyEx.import! mattr_accessor :dir self.dir = lib + 'ttk' - suppress(LoadError) { silence_warnings { core_ex_require 'actionview', 'action_view' } } + suppress(LoadError) { silence_warnings { core_ex_require 'action_view', 'actionpack' } } # Standard library requirements Index: lib/ttk/strategies/RUnit.rb --- lib/ttk/strategies/RUnit.rb (revision 713) +++ lib/ttk/strategies/RUnit.rb (working copy) @@ -87,6 +87,7 @@ @command += "%i " @command += "--runner yaml " @command += "-- %a" + @quiet_print = true super end Index: test/runit/filters/node_cut_test.rb --- test/runit/filters/node_cut_test.rb (revision 713) +++ test/runit/filters/node_cut_test.rb (working copy) @@ -42,7 +42,8 @@ [:new_node, [:root], :status], [:new_leaf, [:root, :status], "FAIL(50%)"], [:up, [:root]], - [:up, []]] + [:up, []], + [:close]] @@without_contents = [[:new_node, [], :root], @@ -59,7 +60,8 @@ [:new_node, [:root], :status], [:new_leaf, [:root, :status], "FAIL(50%)"], [:up, [:root]], - [:up, []]] + [:up, []], + [:close]] @@without_test1_prune = [[:new_node, [], :root], @@ -73,7 +75,8 @@ [:new_node, [:root], :status], [:new_leaf, [:root, :status], "FAIL(50%)"], [:up, [:root]], - [:up, []]] + [:up, []], + [:close]] # # Methods Index: lib/ttk/filters/Buffer.rb --- lib/ttk/filters/Buffer.rb (revision 713) +++ lib/ttk/filters/Buffer.rb (working copy) @@ -45,6 +45,7 @@ @buffer = {} @path = [@buffer] @last_node = nil + @reset_planned = false end alias :clear :reset @@ -83,10 +84,15 @@ def close super notif :new_leaf, [], @buffer - reset + @reset_planned = true end protected :close + def update ( *a, &b ) + reset if @reset_planned + super + end + def empty? @buffer.is_a? Hash and @buffer.empty? end -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/d909bc68/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sat Sep 24 22:59:38 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 04:59:38 +0200 (CEST) Subject: [TTK-Patches] 715: Fix Compact filter for Html backend. Message-ID: <20050925025938.355DC1AFBE@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/715 Index: ChangeLog from Nicolas Pouillard Fix Compact filter for Html backend. * lib/ttk/filters/Compact.rb: Do not compact SubCmds. Use `<=' instead of `<'. Compact.rb | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: lib/ttk/filters/Compact.rb --- lib/ttk/filters/Compact.rb (revision 714) +++ lib/ttk/filters/Compact.rb (working copy) @@ -27,7 +27,7 @@ raise ArgumentError, "bad type name #{type} : #{type.class}" end end - unless type < Strategies::Composite + unless type <= Strategies::Composite or type <= Strategies::SubCmd @record[path.to_s] = Buffer.new end end -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/05a2aadc/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sun Sep 25 00:10:14 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 06:10:14 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 370: Fix ruby_ex test suites. Message-ID: <20050925041014.CAE551AFBE@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Fix ruby_ex test suites. * test/check-pkg-ruby_ex.yml: Add a missing !pathlist. * test/check-ruby_ex.yml: Update to !S:: and add a weight 0. check-pkg-ruby_ex.yml | 10 ++++------ check-ruby_ex.yml | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) Index: test/check-ruby_ex.yml --- test/check-ruby_ex.yml (revision 369) +++ test/check-ruby_ex.yml (working copy) @@ -1,7 +1,7 @@ --- RubyEx Main Test Suite: !S::Iterate - over: <>/(*-suite).yml + over: !pathlist <>/(*-suite).yml iter: [it_path, it_name] test: <>: !S::Import Index: test/check-pkg-ruby_ex.yml --- test/check-pkg-ruby_ex.yml (revision 369) +++ test/check-pkg-ruby_ex.yml (working copy) @@ -1,15 +1,13 @@ --- # Run this suite with -S 'url: scheme://the/url/to/the/ttk/package' -RubyEx Package Test Suite: - strategy: Suite +RubyEx Package Test Suite: !S::Suite contents: - - Checkout: - strategy: Checkout + - Checkout: !S::Checkout url: <> fatal: true + weight: 0 - - Check the package: - strategy: Import + - Check the package: !S::Import import: <>/test/check-ruby_ex.yml -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/87408ad1/signature-0001.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sun Sep 25 00:11:03 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 06:11:03 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 371: Fix a test suite. Message-ID: <20050925041103.6790C1AFBE@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Fix a test suite. * core_ex/test/check-pkg-core_ex.yml: Add a weight 0. check-pkg-core_ex.yml | 1 + 1 files changed, 1 insertion(+) Index: core_ex/test/check-pkg-core_ex.yml --- core_ex/test/check-pkg-core_ex.yml (revision 370) +++ core_ex/test/check-pkg-core_ex.yml (working copy) @@ -7,6 +7,7 @@ - Checkout: !S::Checkout url: <> fatal: true + weight: 0 - Check the package: !S::Import import: <>/test/check-core_ex.yml -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/0670ea56/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sun Sep 25 06:36:23 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 12:36:23 +0200 (CEST) Subject: [TTK-Patches] [core_ex] 372: Use <> instead of ruby. Message-ID: <20050925103623.740DE1AFBE@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk/core_ex Index: ChangeLog from Nicolas Pouillard Use <> instead of ruby. * test/sanity/multiple-requires.yml: Update. multiple-requires.yml | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: test/sanity/multiple-requires.yml --- test/sanity/multiple-requires.yml (revision 371) +++ test/sanity/multiple-requires.yml (working copy) @@ -3,7 +3,7 @@ CoreEx Sanity Multiple Requires Test Suite: !S::Suite attributes: !S::Cmd - command: ruby + command: <> exit: 0 error: "" output: !re 0 failures, 0 errors$ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/195117ef/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sun Sep 25 06:37:28 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 12:37:28 +0200 (CEST) Subject: [TTK-Patches] [ruby_ex] 373: More <>. Message-ID: <20050925103728.C78301AFBE@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard More <>. * test/sanity/multiple-requires.yml, test/sanity/single-requires.yml: Update. multiple-requires.yml | 2 +- single-requires.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: test/sanity/single-requires.yml --- test/sanity/single-requires.yml (revision 372) +++ test/sanity/single-requires.yml (working copy) @@ -7,7 +7,7 @@ test: <>: !S::Suite attributes: !S::Cmd - command: ruby + command: <> exit: 0 error: "" output: !re 0 failures, 0 errors$ Index: test/sanity/multiple-requires.yml --- test/sanity/multiple-requires.yml (revision 372) +++ test/sanity/multiple-requires.yml (working copy) @@ -1,7 +1,7 @@ --- RubyEx Sanity Multiple Requires Test Suite: !S::Cmd - command: ruby + command: <> exit: 0 error: "" output: !re 0 failures, 0 errors$ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/f675f2ad/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 06:52:56 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 12:52:56 +0200 Subject: [TTK-Patches] [ruby_ex] 363: Fix a bug with checkout in URIs. In-Reply-To: <20050924171656.688941BD38@smtp.feydakins.org> References: <20050924171656.688941BD38@smtp.feydakins.org> Message-ID: <840b875c0509250352522dfd3b@mail.gmail.com> On 9/24/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Fix a bug with checkout in URIs. > > * lib/uri/ssh.rb, lib/uri/svn.rb: Also return the target. > * lib/uri_ex.rb: Use to yaml extensions. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 06:54:24 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 12:54:24 +0200 Subject: [TTK-Patches] [ruby_ex] 364: [Hookable/Hooker] Support for hook disabling. In-Reply-To: <20050924171955.A7BD91BD38@smtp.feydakins.org> References: <20050924171955.A7BD91BD38@smtp.feydakins.org> Message-ID: <840b875c0509250354690c4577@mail.gmail.com> On 9/24/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > [Hookable/Hooker] Support for hook disabling. > > * lib/hookable.rb: Add Hookable#disable_hook and Hookable::disable_hook. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 07:02:13 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 13:02:13 +0200 Subject: [TTK-Patches] [ruby_ex] 367: Symtbl gsub, FileType, OHash and Yaml... In-Reply-To: <20050924195447.AD2031BD38@smtp.feydakins.org> References: <20050924195447.AD2031BD38@smtp.feydakins.org> Message-ID: <840b875c0509250402730acecd@mail.gmail.com> On 9/24/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Symtbl gsub, FileType, OHash and Yaml... > > * lib/sym_tbl_gsub.rb: Keep pattern not yet expansed in a list, and > re-inject them when the symtbl is defined. > * lib/file_type.rb: Remove the FIXME concerning the pipe issue which > is solved. Adapt tests to Runners::Mockable. > * lib/ruby_ex.rb: Add a missing `lib/'. > * lib/ordered_hash.rb: Now have a YamlExtension. > * lib/yaml/chop_header.rb: Typo on variable name. > [...] Reviewed. Thx for the bug fix. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 07:00:03 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 13:00:03 +0200 Subject: [TTK-Patches] [core_ex] 366: Some packaging changes. In-Reply-To: <20050924193851.C18FD1BD38@smtp.feydakins.org> References: <20050924193851.C18FD1BD38@smtp.feydakins.org> Message-ID: <840b875c05092504007d4f41ff@mail.gmail.com> On 9/24/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk/core_ex > > Index: ChangeLog > from Nicolas Pouillard > > Some packaging changes. > > * ChangeLog: New. > * vcs/vcs_core_ex.rb: New. Methods are cxci, core_ex_commit but > just commit or ci works too (Vcs 0.4). > > * test/sanity/single-requires.yml: Use <> instead of ruby. > [...] > Index: ChangeLog > --- ChangeLog (revision 0) > +++ ChangeLog (revision 0) > @@ -0,0 +1 @@ > +See ../ChangeLog for previous entries. What is this? Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 08:09:30 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 14:09:30 +0200 Subject: [TTK-Patches] 714: More fixes... In-Reply-To: <20050925024101.B8E701AFBE@smtp.feydakins.org> References: <20050925024101.B8E701AFBE@smtp.feydakins.org> Message-ID: <840b875c05092505094eabae61@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/714 > > Index: ChangeLog > from Nicolas Pouillard > > More fixes... > > * lib/ttk/filters/Buffer.rb: Reset at the begining of a new session to > permit to use the result before it's destruction. > * lib/ttk/strategies/RUnit.rb: RUnit is quiet by default. > * lib/ttk.rb: Inverse arguments of core_ex_require. > * test/runit/filters/node_cut_test.rb: Add the `close' notification in > fixtures. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 08:11:10 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 14:11:10 +0200 Subject: [TTK-Patches] [ruby_ex] 373: More <>. In-Reply-To: <20050925103728.C78301AFBE@smtp.feydakins.org> References: <20050925103728.C78301AFBE@smtp.feydakins.org> Message-ID: <840b875c05092505112126e714@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > More <>. > > * test/sanity/multiple-requires.yml, test/sanity/single-requires.yml: > Update. > [...] Ok. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 07:15:02 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 13:15:02 +0200 Subject: [TTK-Patches] 708: Fix some blocker bugs in strategies. In-Reply-To: <20050924200935.D876B1B3EC@smtp.feydakins.org> References: <20050924200935.D876B1B3EC@smtp.feydakins.org> Message-ID: <840b875c05092504151a1f02aa@mail.gmail.com> On 9/24/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/708 > > Index: ChangeLog > from Nicolas Pouillard > > Fix some blocker bugs in strategies. > > * lib/ttk/strategies/CmdBase.rb: Initialize some variables. Add waitpid. > Call waitpid in `run_impl' and in the `epilogue' (which is protected > against timeouts). > * lib/ttk/strategies/Checkout.rb: > Adapt to the unified URI::Generic#checkout result. > * lib/ttk/strategies/IOBased.rb: Do not show the input status which does > not make sense. Do not skip too many streams during the display. > * lib/ttk/strategies/Strategy.rb: Remove the completly useless require > to 'thread_mutex'. Useless is suffisant I think :-) [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 07:48:51 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 13:48:51 +0200 Subject: [TTK-Patches] 713: Remove the vendor dir. In-Reply-To: <20050925011806.21B3D1BD38@smtp.feydakins.org> References: <20050925011806.21B3D1BD38@smtp.feydakins.org> Message-ID: <840b875c050925044842afd580@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/713 > > Index: ChangeLog > from Nicolas Pouillard > > Remove the vendor dir. > > * vendor: Remove. The vendor dir is built when neeeded. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sun Sep 25 10:26:30 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 16:26:30 +0200 (CEST) Subject: [TTK-Patches] 716: Inject the strategy into the stream type. Message-ID: <20050925142630.3CD71437B4@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/716 Index: ChangeLog from Nicolas Pouillard Inject the strategy into the stream type. * lib/ttk/logger/to_ttk_log.rb: Adapt Hash#to_ttk_log and OHash#to_ttk_log to pass the strategy as a type option. * test/runit/logger/to_ttk_log_test.rb: Adapt. * lib/ttk/filters/Compact.rb: Add some coments. * lib/ttk/filters/Buffer.rb: Handle the type option and re-inject it into the tree. lib/ttk/filters/Buffer.rb | 1 lib/ttk/filters/Compact.rb | 8 ++++-- lib/ttk/logger/to_ttk_log.rb | 14 ++++++++--- test/runit/logger/to_ttk_log_test.rb | 43 ++++++++++++++++------------------- 4 files changed, 38 insertions(+), 28 deletions(-) Index: test/runit/logger/to_ttk_log_test.rb --- test/runit/logger/to_ttk_log_test.rb (revision 715) +++ test/runit/logger/to_ttk_log_test.rb (working copy) @@ -83,28 +83,25 @@ } } @complex_notifs = - [[:new_node, [], :root], - [:new_node, [:root], :contents, {:ordered=>true}], - [:new_node, [:root, [:contents, {:ordered=>true}]], :test1], - [:new_node, [:root, [:contents, {:ordered=>true}], :test1], :cmd], - [:new_leaf, [:root, [:contents, {:ordered=>true}], :test1, :cmd], [:a]], - [:up, [:root, [:contents, {:ordered=>true}], :test1]], - [:new_node, [:root, [:contents, {:ordered=>true}], :test1], :exit], - [:new_leaf, [:root, [:contents, {:ordered=>true}], :test1, :exit], [:aa]], - [:up, [:root, [:contents, {:ordered=>true}], :test1]], - [:up, [:root, [:contents, {:ordered=>true}]]], - [:new_node, [:root, [:contents, {:ordered=>true}]], :test2], - [:new_node, [:root, [:contents, {:ordered=>true}], :test2], :cmd], - [:new_leaf, [:root, [:contents, {:ordered=>true}], :test2, :cmd], :b], - [:up, [:root, [:contents, {:ordered=>true}], :test2]], - [:new_node, [:root, [:contents, {:ordered=>true}], :test2], :exit], - [:new_leaf, [:root, [:contents, {:ordered=>true}], :test2, :exit], :bb], - [:up, [:root, [:contents, {:ordered=>true}], :test2]], - [:up, [:root, [:contents, {:ordered=>true}]]], - [:up, [:root]], - [:new_node, [:root], :strategy], - [:new_leaf, [:root, :strategy], :cmd], - [:up, [:root]], + [[:new_node, [], :root, {:type=>:cmd}], + [:new_node, [[:root, {:type=>:cmd}]], :contents, {:ordered=>true}], + [:new_node, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}]], :test1], + [:new_node, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test1], :cmd], + [:new_leaf, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test1, :cmd], [:a]], + [:up, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test1]], + [:new_node, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test1], :exit], + [:new_leaf, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test1, :exit], [:aa]], + [:up, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test1]], + [:up, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}]]], + [:new_node, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}]], :test2], + [:new_node, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test2], :cmd], + [:new_leaf, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test2, :cmd], :b], + [:up, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test2]], + [:new_node, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test2], :exit], + [:new_leaf, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test2, :exit], :bb], + [:up, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}], :test2]], + [:up, [[:root, {:type=>:cmd}], [:contents, {:ordered=>true}]]], + [:up, [[:root, {:type=>:cmd}]]], [:up, []]] end @@ -129,7 +126,7 @@ @l << @complex_tree_with_ohash args = mock_object.mock_args @complex_notifs.each do |notif| - assert args.include?(notif) + assert args.include?(notif), "args.include?(#{notif.inspect})" end test1 = [] args.each_with_index { |notif, i| test1 << i if notif.include? :test1 } Index: lib/ttk/logger/to_ttk_log.rb --- lib/ttk/logger/to_ttk_log.rb (revision 715) +++ lib/ttk/logger/to_ttk_log.rb (working copy) @@ -37,19 +37,27 @@ def to_ttk_log ( log ) each do |k, v| + next if k == :strategy log[k] = v end end + def to_ttk_log_with_key ( key, log, opts=nil ) + if has_key? :strategy + opts = (opts || {}).merge(:type => self[:strategy]) + end + log.new_node key, opts do + log << self + end + end + end # class ::Hash class ::OHash < ::Hash def to_ttk_log_with_key ( key, log ) - log.new_node key, :ordered => true do - log << self - end + super key, log, :ordered => true end end # class ::OHash Index: lib/ttk/filters/Buffer.rb --- lib/ttk/filters/Buffer.rb (revision 715) +++ lib/ttk/filters/Buffer.rb (working copy) @@ -53,6 +53,7 @@ def new_node ( path, node, options=nil ) super value = (options && options[:ordered]) ? OHash.new : {} + value[:strategy] = options[:type] if options and options.has_key? :type @path.last[node] = value @path << value @last_node = node Index: lib/ttk/filters/Compact.rb --- lib/ttk/filters/Compact.rb (revision 715) +++ lib/ttk/filters/Compact.rb (working copy) @@ -27,6 +27,8 @@ raise ArgumentError, "bad type name #{type} : #{type.class}" end end + # We record the flow if the type is NOT a subclass of Composite nor + # a subclass of SubCmd (SubCmd abd Composite included) unless type <= Strategies::Composite or type <= Strategies::SubCmd @record[path.to_s] = Buffer.new end @@ -38,8 +40,8 @@ def up ( path ) super path_s = path.to_s - if buf = @record[path_s] - notif :new_leaf, path, buf.buffer + if buf = @record[path_s] # If this path was recorded + notif :new_leaf, path, buf.buffer # We dump it as leaf @record.delete path_s end end @@ -49,8 +51,10 @@ def update ( msg, *a, &b ) super if msg != :up if @record.empty? + # We are recording nothing so we transmit the message as is. notif(msg, *a) else + # Each buffer receive the message @record.each do |path_s, buf| buf.update(msg, *a) end -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/c741b4fe/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:35:28 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:35:28 +0200 Subject: [TTK-Patches] 709: Improve Proxies strategies and fix some bugs. In-Reply-To: <840b875c05092504587bf6a8f8@mail.gmail.com> References: <20050925004219.557F41AFBE@smtp.feydakins.org> <840b875c05092504587bf6a8f8@mail.gmail.com> Message-ID: <840b875c050925073572614ee2@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/709 > > Index: ChangeLog > from Nicolas Pouillard > > Improve Proxies strategies and fix some bugs. > > * lib/ttk/strategies/Test.rb: Reject :name, :status, :strategy like it > was in Proxy but leave a FIXME. > * lib/ttk/strategies/Iterate.rb: Add Hash#ttk_each. > * lib/ttk/strategies/RMatch.rb: Deep re-implementation to avoid the > Forker class which cause many problems. > * lib/ttk/strategies/Proxy.rb: No more reject but supply a test name > if the name is not set. > * lib/ttk/strategies/RUnit.rb: Use <> and %a. > * lib/ttk/strategies/Strategy.rb: The name attribute is no more > mandatory (that is cleaner than the fake name `noname'). > [...] > Index: lib/ttk/strategies/Iterate.rb > --- lib/ttk/strategies/Iterate.rb (revision 708) > +++ lib/ttk/strategies/Iterate.rb (working copy) > @@ -121,3 +121,12 @@ > end > > end # class Object > + > + > +class Hash > + > + def ttk_each ( *a, &b ) > + each(*a) { |k, v| b[k, v] } > + end > + > +end # class Object Hash [...] Are you sure that the Iterate.rb file is the good place to extend Hash with this method? > Index: lib/ttk/strategies/Strategy.rb > --- lib/ttk/strategies/Strategy.rb (revision 708) > +++ lib/ttk/strategies/Strategy.rb (working copy) > @@ -53,7 +53,7 @@ > # > > # Create a new Strategy with the given optional document. > - def initialize ( name='noname', &block ) > + def initialize ( name=nil, &block ) nil looks probably better in uttk's input/output. > @status = StartStatus.new > @symbols = {} > @symtbl = nil > @@ -412,6 +412,7 @@ > end > @save = {} > res = OHash.new > + > check_attributes > each_attribute do |attr, val| > next if val.nil? > @@ -428,7 +429,7 @@ > @symbols.each do |k, v| > @symtbl[k] = v > end > - unless @reject.include? :name > + unless self.name.nil? or @reject.include? :name > if @symtbl[:pathname].nil? > @symtbl[:pathname] = ('/' + self.name).to_sym > else > @@ -563,15 +564,16 @@ > @name || @log.path.to_s || super > end > > - def name=(other) > - tmp = other.to_s > - if tmp.empty? > - raise(ArgumentError, "`#{tmp}' - not a valid strategy name") > + def name= ( anObject ) > + case anObject > + when nil, '' > + @name = nil > else > - @name = tmp > + @name = anObject.to_s > end > end > > + > def timeout=(other) > if other >= 0 > @timeout = other > @@ -585,7 +587,7 @@ > end > > def display_unexpected_exc ( exc ) > - @log.error_pected_exception = exc > + @log.error_unexpected_exception = exc > end > > def display_unexpected_synflow_exc ( exc, arg ) > @@ -644,7 +646,7 @@ > end > end > > - attribute :name, 'test name', :invisible, :mandatory, String > + attribute :name, 'test name', :invisible, String Great! Now people can make unnamed test ! [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:35:56 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:35:56 +0200 Subject: [TTK-Patches] 710: Update the backend: remove the `close' notification. In-Reply-To: <840b875c0509250502f3c0613@mail.gmail.com> References: <20050925005115.45E6C1AFBE@smtp.feydakins.org> <840b875c0509250502f3c0613@mail.gmail.com> Message-ID: <840b875c0509250735599cdc97@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/710 > > Index: ChangeLog > from Nicolas Pouillard > > Update the backend: remove the `close' notification. > > * lib/ttk/logger/path.rb: > Add Logger::Path#{to_a,to_regex_path_string,to_regex_path}. > * lib/ttk/loaders/Yaml.rb: Begin the 1.8.3 support. > * lib/ttk/filters/Filter.rb: Emulate the `close' notification. > * lib/ttk/dumpers/Dumper.rb: ... likewise and update the documentation. > * bin/ttk: Remove the `close' notification. > * lib/ttk/strategies/SubCmd.rb: Remove the `close' treatment. > Make SubCmd quiet by default. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:36:21 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:36:21 +0200 Subject: [TTK-Patches] 711: Add <> to the symtbl. In-Reply-To: <840b875c050925050578b40e96@mail.gmail.com> References: <20050925005805.0460B1AFBE@smtp.feydakins.org> <840b875c050925050578b40e96@mail.gmail.com> Message-ID: <840b875c05092507362805bb47@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/711 > > Index: ChangeLog > from Nicolas Pouillard > > !!! In your tests you now must use <> instead of just ruby !!! > !!! This will permit to easily control and change the running ruby !!! > Add <> to the symtbl. This message is more useful in the NEWS file. > > * lib/ttk.rb: Update to core_ex. > * lib/ttk/streams.rb: No more dump regexp with `//'. > * lib/ttk/status.rb: Add a strange workaround to avoid a Yaml bug. > * lib/ttk/streams/Stream.rb: Enforce `Stream#to_ttk_log'. > * bin/getopts/ttk.rb: Set exit 0 for --version. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:36:45 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:36:45 +0200 Subject: [TTK-Patches] 712: Update tests and packaging. In-Reply-To: <840b875c05092505087d7dde79@mail.gmail.com> References: <20050925010239.294F41BD38@smtp.feydakins.org> <840b875c05092505087d7dde79@mail.gmail.com> Message-ID: <840b875c05092507363bb839a0@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/712 > > Index: ChangeLog > from Nicolas Pouillard > > Update tests and packaging. > > * test/ttk-pkg/cmdline.yml: Require an exit of 0. Check --authors. > * test/ttk-minimal/sub.yml: Add a pass and a fail test. > * test/ttk-minimal/runit.yml: Use RMatch to really control the output > corectness. It was already "really" controled... > * test/ttk-minimal/env_cmd.yml, test/ttk-distcheck.yml, > * test/ttk-minimal/signal_cmd.yml: Use <> instead of ruby. > > * SPEC.yml: Update dependencies. > * vcs/ttk.rb: Update to Vcs 0.4. > [...] > Index: test/ttk-minimal/runit.yml > --- test/ttk-minimal/runit.yml (revision 711) > +++ test/ttk-minimal/runit.yml (working copy) > @@ -1,8 +1,8 @@ > --- > - > -RUnit strategy test suite: !S::Suite > +RUnit strategy test suite: !S::RMatch > symbols: > unit_dir: <>/../ressources/runit > + test: !S::Suite > attributes: !S::RUnit > input: !path <>/../test-unit-setup.rb > contents: > @@ -10,10 +10,8 @@ > args: <>/good.rb > - bad: > args: <>/bad.rb > - weight: -1 > - error: > args: <>/error.rb > - weight: -1 > - good directory: > args: ressources/runit/good.rb > dir: <>/.. > @@ -21,4 +19,7 @@ > - bad directory: > args: ressources/runit/bad.rb > dir: <>/.. > - weight: -1 > + match: > + - ///good/status/PASS > + - ///bad/status/FAIL > + - ///error/status/ERROR What does it changes except the call to another strategy? I think this is a useless patch. [...] > Index: vcs/ttk.rb > --- vcs/ttk.rb (revision 711) > +++ vcs/ttk.rb (working copy) > @@ -1,14 +1,20 @@ > class Vcs > > - def ttk_commit! ( s, *args ) > + # See http://rubyforge.org/projects/vcs > + # and http://vcs.rubyforge.org > > - # really commit > - common_commit!(*args) do |rev| > - mail!(:to => ['ttk-patches at lists.feydakins.org'], > - :subject => "#{rev}: #{s}") > + COLLABOA = 'http://dev.uttk.org' > + > + protocol_version '0.1' > + > + def uttk_commit! ( *args ) > + > + common_commit!('<%= rev %>: <%= title %>', *args) do |subject| > + mail! :to => ['ttk-patches at lists.feydakins.org'], :subject => subject > end > > end > - alias_command :ttkci, :ttk_commit > + alias_command :uttkci, :uttk_commit > + default_commit :uttk_commit Doesn't work with vcs 0.3.0 [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:37:07 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:37:07 +0200 Subject: [TTK-Patches] 714: More fixes... In-Reply-To: <840b875c05092505094eabae61@mail.gmail.com> References: <20050925024101.B8E701AFBE@smtp.feydakins.org> <840b875c05092505094eabae61@mail.gmail.com> Message-ID: <840b875c05092507375967e262@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/714 > > Index: ChangeLog > from Nicolas Pouillard > > More fixes... > > * lib/ttk/filters/Buffer.rb: Reset at the begining of a new session to > permit to use the result before it's destruction. > * lib/ttk/strategies/RUnit.rb: RUnit is quiet by default. > * lib/ttk.rb: Inverse arguments of core_ex_require. > * test/runit/filters/node_cut_test.rb: Add the `close' notification in > fixtures. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:37:24 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:37:24 +0200 Subject: [TTK-Patches] 715: Fix Compact filter for Html backend. In-Reply-To: <840b875c0509250509396a8f99@mail.gmail.com> References: <20050925025938.355DC1AFBE@smtp.feydakins.org> <840b875c0509250509396a8f99@mail.gmail.com> Message-ID: <840b875c050925073711f0eb01@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/715 > > Index: ChangeLog > from Nicolas Pouillard > > Fix Compact filter for Html backend. > > * lib/ttk/filters/Compact.rb: Do not compact SubCmds. > Use `<=' instead of `<'. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:37:43 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:37:43 +0200 Subject: [TTK-Patches] [ruby_ex] 370: Fix ruby_ex test suites. In-Reply-To: <840b875c05092505105296d73d@mail.gmail.com> References: <20050925041014.CAE551AFBE@smtp.feydakins.org> <840b875c05092505105296d73d@mail.gmail.com> Message-ID: <840b875c0509250737409c1c0c@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Fix ruby_ex test suites. > > * test/check-pkg-ruby_ex.yml: Add a missing !pathlist. > * test/check-ruby_ex.yml: Update to !S:: and add a weight 0. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:38:02 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:38:02 +0200 Subject: [TTK-Patches] [ruby_ex] 371: Fix a test suite. In-Reply-To: <840b875c05092505105c352c85@mail.gmail.com> References: <20050925041103.6790C1AFBE@smtp.feydakins.org> <840b875c05092505105c352c85@mail.gmail.com> Message-ID: <840b875c05092507384e52eaa0@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Fix a test suite. > > * core_ex/test/check-pkg-core_ex.yml: Add a weight 0. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:38:25 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:38:25 +0200 Subject: [TTK-Patches] [core_ex] 372: Use <> instead of ruby. In-Reply-To: <840b875c05092505107472cc3a@mail.gmail.com> References: <20050925103623.740DE1AFBE@smtp.feydakins.org> <840b875c05092505107472cc3a@mail.gmail.com> Message-ID: <840b875c05092507383ec9ea3f@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk/core_ex > > Index: ChangeLog > from Nicolas Pouillard > > Use <> instead of ruby. > > * test/sanity/multiple-requires.yml: Update. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:38:44 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:38:44 +0200 Subject: [TTK-Patches] [ruby_ex] 373: More <>. In-Reply-To: <840b875c05092505112126e714@mail.gmail.com> References: <20050925103728.C78301AFBE@smtp.feydakins.org> <840b875c05092505112126e714@mail.gmail.com> Message-ID: <840b875c05092507385d08b544@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > More <>. > > * test/sanity/multiple-requires.yml, test/sanity/single-requires.yml: > Update. > [...] Ok. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:40:13 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:40:13 +0200 Subject: [TTK-Patches] 716: Inject the strategy into the stream type. In-Reply-To: <20050925142630.3CD71437B4@smtp.feydakins.org> References: <20050925142630.3CD71437B4@smtp.feydakins.org> Message-ID: <840b875c0509250740165c8579@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/716 > > Index: ChangeLog > from Nicolas Pouillard > > Inject the strategy into the stream type. > > * lib/ttk/logger/to_ttk_log.rb: Adapt Hash#to_ttk_log and > OHash#to_ttk_log to pass the strategy as a type option. > * test/runit/logger/to_ttk_log_test.rb: Adapt. > * lib/ttk/filters/Compact.rb: Add some coments. > * lib/ttk/filters/Buffer.rb: Handle the type option and re-inject it > into the tree. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 06:58:27 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 12:58:27 +0200 Subject: [TTK-Patches] [ruby_ex] 365: Fix the Pipe support in Commands. In-Reply-To: <20050924172508.63D261BD38@smtp.feydakins.org> References: <20050924172508.63D261BD38@smtp.feydakins.org> Message-ID: <840b875c05092503586be26e7a@mail.gmail.com> On 9/24/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Fix the Pipe support in Commands. > > * lib/commands/pipe.rb: Reimplement. > * lib/commands/command.rb (sh_args): Generalize. > * lib/commands/datas/composite.rb: More methods to make it invisble. > * lib/commands/datas/data.rb: Some fixes. > * lib/commands/runners/mock.rb: Rename to ... > * lib/commands/runners/mockable.rb: ... this and make it a module. > * lib/commands/runners/runner.rb: Add Runner#initialize_copy. > * lib/commands.rb: Add a documention example. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 11:05:48 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 17:05:48 +0200 Subject: [TTK-Patches] 712: Update tests and packaging. In-Reply-To: References: <20050925010239.294F41BD38@smtp.feydakins.org> <840b875c05092505087d7dde79@mail.gmail.com> <840b875c05092507363bb839a0@mail.gmail.com> Message-ID: <840b875c05092508057198e929@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > On 9/25/05, Nicolas Despr?s wrote: > > On 9/25/05, Nicolas Pouillard wrote: > > > > > > svn://svn.feydakins.org/ttk/trunk > > > > > > You can also view this changeset here: > > > > > > http://http://dev.uttk.org/repository/changesets/712 > > > > > > Index: ChangeLog > > > from Nicolas Pouillard > > > > > > Update tests and packaging. > > > > > > * test/ttk-pkg/cmdline.yml: Require an exit of 0. Check --authors. > > > * test/ttk-minimal/sub.yml: Add a pass and a fail test. > > > * test/ttk-minimal/runit.yml: Use RMatch to really control the output > > > corectness. > > > > It was already "really" controled... > > > > Nop > Sorry, it's not against you but like many other test in uttk no > difference is done > between FAIL, ERROR and ABORT. When you put a test with a weight of -1 > like here: > Ok, that's right. I didn't thought about that. We definitely need the Test strategy. [...] > > > Index: vcs/ttk.rb > > > --- vcs/ttk.rb (revision 711) > > > +++ vcs/ttk.rb (working copy) > > > @@ -1,14 +1,20 @@ > > > class Vcs > > > > > > - def ttk_commit! ( s, *args ) > > > + # See http://rubyforge.org/projects/vcs > > > + # and http://vcs.rubyforge.org > > > > > > - # really commit > > > - common_commit!(*args) do |rev| > > > - mail!(:to => ['ttk-patches at lists.feydakins.org'], > > > - :subject => "#{rev}: #{s}") > > > + COLLABOA = 'http://dev.uttk.org' > > > + > > > + protocol_version '0.1' > > > + > > > + def uttk_commit! ( *args ) > > > + > > > + common_commit!('<%= rev %>: <%= title %>', *args) do |subject| > > > + mail! :to => ['ttk-patches at lists.feydakins.org'], :subject => subject > > > end > > > > > > end > > > - alias_command :ttkci, :ttk_commit > > > + alias_command :uttkci, :uttk_commit > > > + default_commit :uttk_commit > > > > Doesn't work with vcs 0.3.0 > > > > Yes, I know, 2 solutions: > > * build vcs 0.4: rake gem in the repository and gem install pkg/vcs* > > * use vcs 0.3: svn up -r711 vcs > > Vcs 0.4 will be released very soon I hope, but it's already useable for now. I shouldn't have to do that. I don't want to be a vcs maintainer and I only want to use the updated gem version. I see only one solution: sort your patches and release vcs *before* patching ttk. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sun Sep 25 11:42:40 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 17:42:40 +0200 (CEST) Subject: [TTK-Patches] 717: F::TextFilter, F::KeepSkipBased some fixes. Message-ID: <20050925154240.C68A5437E3@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/717 Index: ChangeLog from Nicolas Pouillard F::TextFilter, F::KeepSkipBased some fixes. * lib/ttk/filters/TextFilter.rb: Fix the use of quotes in the doc. * lib/ttk/filters/KeepSkipBased.rb: Factorize and remove dead code. KeepSkipBased.rb | 10 +--------- TextFilter.rb | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) Index: lib/ttk/filters/TextFilter.rb --- lib/ttk/filters/TextFilter.rb (revision 716) +++ lib/ttk/filters/TextFilter.rb (working copy) @@ -25,7 +25,7 @@ # width: Maximal width of a line # # Examples: - # Yaml syntax: "TextFilter: [!keep '^(in|out)put$', !action justify, Yaml]" + # Yaml syntax: 'TextFilter: [!keep "^(in|out)put$", !action justify, Yaml]' # def initialize ( observers, options, &b ) super Index: lib/ttk/filters/KeepSkipBased.rb --- lib/ttk/filters/KeepSkipBased.rb (revision 716) +++ lib/ttk/filters/KeepSkipBased.rb (working copy) @@ -17,8 +17,7 @@ def initialize ( observers, options, &b ) super - @keep, @skip, @action = @options[:keep], @options[:skip], @options[:action] - @filter_this_one = false + @keep, @skip, @action = @options.values_at :keep, :skip, :action end @@ -32,13 +31,6 @@ ! keep? node end - - # Override me in subclasses - def node_filter ( anObject ) - anObject - end - protected :node_filter - end # class KeepSkipBased end # module Filters -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/aad4a91c/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Sun Sep 25 12:06:43 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Sun, 25 Sep 2005 18:06:43 +0200 (CEST) Subject: [TTK-Patches] 718: Update NEWS. Message-ID: <20050925160643.218A343BEE@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/718 Index: ChangeLog from Nicolas Pouillard Update NEWS. * NEWS: Add the use of <>. * lib/ttk/strategies/Iterate.rb: Typo. NEWS | 6 ++++++ lib/ttk/strategies/Iterate.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) Index: lib/ttk/strategies/Iterate.rb --- lib/ttk/strategies/Iterate.rb (revision 717) +++ lib/ttk/strategies/Iterate.rb (working copy) @@ -129,4 +129,4 @@ each(*a) { |k, v| b[k, v] } end -end # class Object +end # class Hash Index: NEWS --- NEWS (revision 717) +++ NEWS (working copy) @@ -23,6 +23,12 @@ The command can now support a special argument %i, which is replaced by the name of the input file. + * Miscellaneous: + + * Ruby is now in the symtbl: + In your tests you now must use <> instead of just ruby. + This will permit to easily control and change the running ruby. + = New in 0.2, 2005-05-06: This release is mainly a BugFix release but it provides also some improvments: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050925/5c01f066/signature.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 12:27:03 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 18:27:03 +0200 Subject: [TTK-Patches] 718: Update NEWS. In-Reply-To: <20050925160643.218A343BEE@smtp.feydakins.org> References: <20050925160643.218A343BEE@smtp.feydakins.org> Message-ID: <840b875c05092509272e19f3ab@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/718 > > Index: ChangeLog > from Nicolas Pouillard > > Update NEWS. > > * NEWS: Add the use of <>. > * lib/ttk/strategies/Iterate.rb: Typo. > [...] Good. Thx. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 12:37:58 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 18:37:58 +0200 Subject: [TTK-Patches] 717: F::TextFilter, F::KeepSkipBased some fixes. In-Reply-To: <20050925154240.C68A5437E3@smtp.feydakins.org> References: <20050925154240.C68A5437E3@smtp.feydakins.org> Message-ID: <840b875c05092509377996b394@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/717 > > Index: ChangeLog > from Nicolas Pouillard > > F::TextFilter, F::KeepSkipBased some fixes. > > * lib/ttk/filters/TextFilter.rb: Fix the use of quotes in the doc. > * lib/ttk/filters/KeepSkipBased.rb: Factorize and remove dead code. > [...] Ok. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 12:24:06 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 18:24:06 +0200 Subject: [TTK-Patches] 709: Improve Proxies strategies and fix some bugs. In-Reply-To: References: <20050925004219.557F41AFBE@smtp.feydakins.org> <840b875c05092504587bf6a8f8@mail.gmail.com> <840b875c050925073572614ee2@mail.gmail.com> Message-ID: <840b875c05092509243afa0ece@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > On 9/25/05, Nicolas Despr?s wrote: > > On 9/25/05, Nicolas Pouillard wrote: > > > > > > svn://svn.feydakins.org/ttk/trunk > > > > > > You can also view this changeset here: > > > > > > http://http://dev.uttk.org/repository/changesets/709 > > > > > > Index: ChangeLog > > > from Nicolas Pouillard > > > > > > Improve Proxies strategies and fix some bugs. > > > > > > * lib/ttk/strategies/Test.rb: Reject :name, :status, :strategy like it > > > was in Proxy but leave a FIXME. > > > * lib/ttk/strategies/Iterate.rb: Add Hash#ttk_each. > > > * lib/ttk/strategies/RMatch.rb: Deep re-implementation to avoid the > > > Forker class which cause many problems. > > > * lib/ttk/strategies/Proxy.rb: No more reject but supply a test name > > > if the name is not set. > > > * lib/ttk/strategies/RUnit.rb: Use <> and %a. > > > * lib/ttk/strategies/Strategy.rb: The name attribute is no more > > > mandatory (that is cleaner than the fake name `noname'). > > > > > [...] > > > > Are you sure that the Iterate.rb file is the good place to extend Hash > > with this method? > > ttk_each is a method introduced by S::Iterate in order to define the > default Uttk behavior for > iteration over any structure. So I think that this methods belongs to Iterate. > > If one day more than one strategy use this method or if we define > ttk_each for many classes we > will find a more central place to put them. > Ok. > > > Index: lib/ttk/strategies/Strategy.rb > > > --- lib/ttk/strategies/Strategy.rb (revision 708) > > > +++ lib/ttk/strategies/Strategy.rb (working copy) > > > @@ -53,7 +53,7 @@ > > > # > > > > > > # Create a new Strategy with the given optional document. > > > - def initialize ( name='noname', &block ) > > > + def initialize ( name=nil, &block ) > > > > nil looks probably better in uttk's input/output. > > > > Nop nils do not appear in uttk's input/output. > So, it might look weird in the output, if someone write this: S::Pass.new in a ruby input file. > [...] > > > Great! Now people can make unnamed test ! > > > > In some case it's cumbersome to give names to test especially for Proxies. > (see http://dev.uttk.org/tickets/show/16) > > example: > > foo: !S::RMatch > test: > a name: !S::Pass > ... > > vs > > foo: !S::RMatch > test: !S::Pass > ... > > in the case of a proxy the name is not very useful because there is > only one key under test. > > So aim of this patch is not to allow unnamed tests every where but > make a clearer distinction > with nil and not nil instead of "a name" and "noname" like before. > Ok, but the error message looks strange for $ cat test/toto.yml --- suite: !S::Suite contents: - "": !S::Pass {} $ ./bin/ttk -F Yaml test/toto.yml --- root: !S::Suite status: ERROR reason: interning empty string (ArgumentError) $ We have to improve error reporting/handling that's very important. Cheers, -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 07:49:21 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 13:49:21 +0200 Subject: [TTK-Patches] [ruby_ex] 369: Remove the inopportunely added .DS_Store. In-Reply-To: <20050924204605.97E3B1B3EC@smtp.feydakins.org> References: <20050924204605.97E3B1B3EC@smtp.feydakins.org> Message-ID: <840b875c05092504493d2e7d6a@mail.gmail.com> On 9/24/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Remove the inopportunely added .DS_Store. > [...] Ok. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 10:34:54 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 16:34:54 +0200 Subject: [TTK-Patches] [ruby_ex] 368: Update vcs support and add some fixtures. In-Reply-To: <840b875c05092504521a16cca1@mail.gmail.com> References: <20050924195816.154851BD38@smtp.feydakins.org> <840b875c05092504521a16cca1@mail.gmail.com> Message-ID: <840b875c0509250734742635d8@mail.gmail.com> On 9/24/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Update vcs support and add some fixtures. > > * test/check-ruby_ex.yml: Upgrade to Iterate and !S::. > * vcs/vcs_ruby_ex.rb: Upgarde to Vcs 0.4 protocol 0.1. > With just Vcs 0.4 just use `commit' or `ci'. > * NEWS: Typo. > [...] Ok, but Vcs 0.4 is not available on rubyforge. I think you are the only one who use it. So now, I cannot commit anymore in ttk's repository even in order to fix the bug in the vcs extension :-(. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 16:12:02 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Sun, 25 Sep 2005 22:12:02 +0200 Subject: [TTK-Patches] 709: Improve Proxies strategies and fix some bugs. In-Reply-To: References: <20050925004219.557F41AFBE@smtp.feydakins.org> <840b875c05092504587bf6a8f8@mail.gmail.com> <840b875c050925073572614ee2@mail.gmail.com> <840b875c05092509243afa0ece@mail.gmail.com> Message-ID: <840b875c05092513127b307ebd@mail.gmail.com> On 9/25/05, Nicolas Pouillard wrote: > On 9/25/05, Nicolas Despr?s wrote: > > On 9/25/05, Nicolas Pouillard wrote: > > > On 9/25/05, Nicolas Despr?s wrote: > > > > On 9/25/05, Nicolas Pouillard wrote: > > > > > > > > > > svn://svn.feydakins.org/ttk/trunk > > > > > > > > > > You can also view this changeset here: > > > > > > > > > > http://http://dev.uttk.org/repository/changesets/709 > > > > > > > > > > Index: ChangeLog > > > > > from Nicolas Pouillard > > > > > > > > > > Improve Proxies strategies and fix some bugs. > > > > > > > > > > * lib/ttk/strategies/Test.rb: Reject :name, :status, :strategy like it > > > > > was in Proxy but leave a FIXME. > > > > > * lib/ttk/strategies/Iterate.rb: Add Hash#ttk_each. > > > > > * lib/ttk/strategies/RMatch.rb: Deep re-implementation to avoid the > > > > > Forker class which cause many problems. > > > > > * lib/ttk/strategies/Proxy.rb: No more reject but supply a test name > > > > > if the name is not set. > > > > > * lib/ttk/strategies/RUnit.rb: Use <> and %a. > > > > > * lib/ttk/strategies/Strategy.rb: The name attribute is no more > > > > > mandatory (that is cleaner than the fake name `noname'). > > > > > > > > > > > > [...] > > > > So, it might look weird in the output, if someone write this: > > > > S::Pass.new > > > > in a ruby input file. > > > > It must output like --- !S::Pass {} in a Yaml input: > > $ ttk pass.yml -F Yaml > --- > root: !S::Suite > contents: > - status: PASS > status: PASS > [...] > > Here you have supply a name but an empty one. > > $ cat empty.yml > --- !S::Suite > contents: > - !S::Pass {} > > $ ttk emty.yml -F Yaml > --- > root: !S::Suite > contents: > - contents: > - status: PASS > - status: PASS > status: PASS > > No problem. > I think it should have an error message in those cases, because the name is nil. [...] -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 20:22:57 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 02:22:57 +0200 Subject: [TTK-Patches] [ruby_ex] 368: Update vcs support and add some fixtures. In-Reply-To: References: <20050924195816.154851BD38@smtp.feydakins.org> <840b875c05092504521a16cca1@mail.gmail.com> <840b875c0509250734742635d8@mail.gmail.com> Message-ID: <840b875c0509251722582ecc21@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > On 9/25/05, Nicolas Despr?s wrote: > > On 9/24/05, Nicolas Pouillard wrote: > > > > > > svn://svn.feydakins.org/ruby_ex/trunk > > > > > > Index: ChangeLog > > > from Nicolas Pouillard > > > > > > Update vcs support and add some fixtures. > > > > > > * test/check-ruby_ex.yml: Upgrade to Iterate and !S::. > > > * vcs/vcs_ruby_ex.rb: Upgarde to Vcs 0.4 protocol 0.1. > > > With just Vcs 0.4 just use `commit' or `ci'. > > > * NEWS: Typo. > > > > > > > [...] > > > > Ok, but Vcs 0.4 is not available on rubyforge. I think you are the > > only one who use it. So now, I cannot commit anymore in ttk's > > repository even in order to fix the bug in the vcs extension :-(. > > > > 1/ What bug in the vcs extension ? > Sorry I should have been more explicit. protocol_version '0.1' is not defined. ./vcs/ttk.rb:9: undefined method `protocol_version' for Vcs:Class (NoMethodError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:in `require_without_unification' from /usr/lib/ruby/gems/1.8/gems/core_ex-0.3.1/lib/core_ex.rb:217:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/dependencies.rb:200:in `require' from /usr/lib/ruby/gems/1.8/gems/vcs-0.3.0/bin/vcs:45 from /usr/lib/ruby/gems/1.8/gems/vcs-0.3.0/bin/vcs:42:in `glob' from /usr/lib/ruby/1.8/pathname.rb:764:in `glob' from /usr/lib/ruby/1.8/pathname.rb:764:in `glob' from /usr/lib/ruby/gems/1.8/gems/vcs-0.3.0/bin/vcs:42 from /usr/bin/vcs:18:in `load' from /usr/bin/vcs:18 and default_commit :uttk_commit is not defined too: ./vcs/ttk.rb:21: undefined method `default_commit' for Vcs:Class (NoMethodError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:18:in `require_without_unification' from /usr/lib/ruby/gems/1.8/gems/core_ex-0.3.1/lib/core_ex.rb:217:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/dependencies.rb:200:in `require' from /usr/lib/ruby/gems/1.8/gems/vcs-0.3.0/bin/vcs:45 from /usr/lib/ruby/gems/1.8/gems/vcs-0.3.0/bin/vcs:42:in `glob' from /usr/lib/ruby/1.8/pathname.rb:764:in `glob' from /usr/lib/ruby/1.8/pathname.rb:764:in `glob' from /usr/lib/ruby/gems/1.8/gems/vcs-0.3.0/bin/vcs:42 from /usr/bin/vcs:18:in `load' from /usr/bin/vcs:18 I'm using: $ vcs --version Vcs version: 0.3.0 which is the current rubygem version of vcs (I've done a "sudo gem update" before). > 2/ you can commit: > just type "svn up -r710 vcs" before your commit Sorry, but I can't do that any more since svn is wrapped by vcs and vcs is buggy. [...] Once again: try to patch uttk extension of vcs before updating vcs on rubygem in order to avoid this kind of problem. I think it is not a big deal to do that in the right order. I think vcs deserves a better test suite and I really think that uttk must be able to provide such a test suite strategy: we just need to write it and to mock the right dependent component. Cheers, -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 20:29:35 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 02:29:35 +0200 Subject: [TTK-Patches] [ruby_ex] 368: Update vcs support and add some fixtures. In-Reply-To: <840b875c0509251722582ecc21@mail.gmail.com> References: <20050924195816.154851BD38@smtp.feydakins.org> <840b875c05092504521a16cca1@mail.gmail.com> <840b875c0509250734742635d8@mail.gmail.com> <840b875c0509251722582ecc21@mail.gmail.com> Message-ID: <840b875c050925172968d05903@mail.gmail.com> On 9/26/05, Nicolas Despr?s wrote: > On 9/26/05, Nicolas Pouillard wrote: > > On 9/25/05, Nicolas Despr?s wrote: > > > On 9/24/05, Nicolas Pouillard wrote: > > > > > > > > svn://svn.feydakins.org/ruby_ex/trunk > > > > > > > > Index: ChangeLog > > > > from Nicolas Pouillard > > > > > > > > Update vcs support and add some fixtures. > > > > > > > > * test/check-ruby_ex.yml: Upgrade to Iterate and !S::. > > > > * vcs/vcs_ruby_ex.rb: Upgarde to Vcs 0.4 protocol 0.1. > > > > With just Vcs 0.4 just use `commit' or `ci'. > > > > * NEWS: Typo. > > > > > > > [...] Could you please remove the lines below in the ttk/trunk/vcs/ttk.rb file until Vcs 0.4 is release ? protocol_version '0.1' default_commit :uttk_commit Thank you. -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From nicolas.despres at gmail.com Sun Sep 25 22:13:43 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 04:13:43 +0200 Subject: [TTK-Patches] [ruby_ex] 368: Update vcs support and add some fixtures. In-Reply-To: References: <20050924195816.154851BD38@smtp.feydakins.org> <840b875c05092504521a16cca1@mail.gmail.com> <840b875c0509250734742635d8@mail.gmail.com> <840b875c0509251722582ecc21@mail.gmail.com> Message-ID: <840b875c05092519135378f5b7@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > On 9/26/05, Nicolas Despr?s wrote: > > On 9/26/05, Nicolas Pouillard wrote: > > > On 9/25/05, Nicolas Despr?s wrote: > > > > On 9/24/05, Nicolas Pouillard wrote: > > > > > > > > > > svn://svn.feydakins.org/ruby_ex/trunk > > > > > > > > > > Index: ChangeLog > > > > > from Nicolas Pouillard > > > > > > > > > > Update vcs support and add some fixtures. > > > > > > > > > > * test/check-ruby_ex.yml: Upgrade to Iterate and !S::. > > > > > * vcs/vcs_ruby_ex.rb: Upgarde to Vcs 0.4 protocol 0.1. > > > > > With just Vcs 0.4 just use `commit' or `ci'. > > > > > * NEWS: Typo. > > > > > > > > > [...] > > > > Once again: try to patch uttk extension of vcs before updating vcs on > > rubygem in order to avoid this kind of problem. > > Yes It's my bad. I know that. It was for testing this version of vcs. > I need to make some patches before release it. > > > I think it is not a > > big deal to do that in the right order. > > Yes but it's not a big deal to type \svn up -r710 too. For me it is not, but I'm thinking about the other whiche are not close to you and this ML. > > > I think vcs deserves a better > > test suite > > Perhaps you want to write it ... Yes, I will ! > > > and I really think that uttk must be able to provide such a > > test suite strategy: we just need to write it and to mock the right > > dependent component. > > Yes but it's many work that I can't spend right now. I really wish that uttk can test vcs ! That's one of the major uttk's test. Specially to prove that uttk is able to mock system interactions easily ! Maybe vcs deserve a -zen option as Akim advises me. But this advise is relevant while vcs is using binary interface instead of API interface. I had a look at RSCM, and I have unfortunately understood that is only handling binary interface of SCM software. Maybe, I'm wrong but I trust more API interface than binary interface. Anyway, I wish once RSCM will handle API instead of binary and so VCS could use RSCM. > > Vcs is not buggy it's just not yet released. I understand, and it is exactly the point I reproache to you to haven't been able to patch ttk's vcs extension after vcs is updated on rubygem. I know that vcs is working well on your *peronal version*. But it's not a big deal since we're, by now, a few to develop uttk. I hope nobody in our lab have such disappointement ; but I think they don't. Really, it's not a big deal, but please don't do that later, when their will have more than you and me as uttk developers and so vcs users. Cheers, -- Nicolas Despr?s _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Mon Sep 26 00:28:11 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon, 26 Sep 2005 06:28:11 +0200 (CEST) Subject: [TTK-Patches] 719: Add a ttk -> uttk renaming script. Message-ID: <20050926042811.A730744A55@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/719 Index: ChangeLog from Nicolas Pouillard <%= title %>. * misc/renaming: It takes files or directories as arguments. Traverse them with find. Move directories and files with "svn move". Replace the contents of the files in place. renaming | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 57 insertions(+) svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/719 Index: ChangeLog from Nicolas Pouillard <%= title %>. * misc/renaming: It takes files or directories as arguments. Traverse them with find. Move directories and files with "svn move". Replace the contents of the files in place. Index: misc/renaming --- misc/renaming (revision 0) +++ misc/renaming (revision 0) @@ -0,0 +1,57 @@ +#!/usr/bin/env ruby + +require 'pathname' + +class String + def uttk_rename! + r = gsub!(/([^Uu])ttk/, '\1uttk') || r + r = gsub!(/^ttk/, 'uttk') || r + r = gsub!(/([^uU])ttk/, '\1Uttk') || r + r = gsub!(/^T[Tt][Kk]/, 'Uttk') || r + r = gsub!(/([^Uu])T[tT][kK]/, '\1Uttk') || r + r = gsub!(/TestTKewl/, 'Unified Test Tool Kit') || r + r = gsub!(/TestToolKit/, 'Unified Test Tool Kit') || r + r = gsub!(/([^Uu ][^Nn ][^Ii ][^Ff ][^Ii ][^Ee ][^Dd ]\s*)(\s*?[tT][Ee][Ss][Tt]\s*[Tt][Oo][Oo][Ll]\s*[Kk][Ii][Tt])/, '\1 Unified\2') || r + (r)? self : nil + end +end + +class Pathname + def uttk_rename! + path = self + if new = basename.to_s.uttk_rename! + p = dirname + new + if system("svn move #{self} #{p} --force") + path = p + end + r = self + end + unless path.directory? + r = path.read.uttk_rename! + if r + path.open('w') { |f| f.syswrite(r) } + end + end + (r)? self : nil + end +end + +ARGV.each do |arg| + Pathname.new(arg).find do |path| + next if path.to_s == /^\.\.?$/ + Find.prune if path.to_s =~ /\.svn/ + next unless path.directory? + if path.uttk_rename! + STDERR.puts "- #{path}" + end + end + Pathname.new(arg).find do |path| + next if path.to_s == /renaming/ + next if path.to_s == /^\.\.?$/ + Find.prune if path.to_s =~ /\.svn/ + next if path.directory? + if path.uttk_rename! + STDERR.puts "- #{path}" + end + end +end Property changes on: misc/renaming ___________________________________________________________________ Name: svn:executable + * -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050926/c0e5c75f/signature-0001.bin -------------- next part -------------- _______________________________________________ TTK-Patches mailing list TTK-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/ttk-patches From ertai at lrde.epita.fr Mon Sep 26 01:57:29 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon, 26 Sep 2005 07:57:29 +0200 (CEST) Subject: [Uttk-Patches] 721: TTK -> Uttk renaming: stage 2. Message-ID: <20050926055729.4A3F544C48@smtp.feydakins.org> svn://svn.feydakins.org/uttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/721 Index: ChangeLog from Nicolas Pouillard TTK -> Uttk renaming: stage 2. * test/uttk-dist/uttk-dist, * test/uttk-dist/ttk-dist, * test/uttk-pkg/ttk-pkg, * test/uttk-pkg/uttk-pkg, * test/uttk-ruby/ttk-ruby, * test/uttk-ruby/uttk-ruby, * test/uttk-minimal/ttk-minimal, * test/uttk-minimal/uttk-minimal, * lib/uttk/logger/to_ttk_log.rb, * lib/uttk/logger/to_uttk_log.rb, * lib/uttk/uttk, * lib/uttk/ttk: Apply misc/reanming. 0 files changed -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050926/d4913e20/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Mon Sep 26 05:52:41 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon, 26 Sep 2005 11:52:41 +0200 (CEST) Subject: [Uttk-Patches] 722: Renaming stage 3. Message-ID: <20050926095241.126367A6ED@smtp.feydakins.org> svn://svn.feydakins.org/uttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/722 Index: ChangeLog from Nicolas Pouillard Renaming stage 3. * test/unit, * test/pkg, * test/ruby, * test/ruby/wc.rb, * test/minimal, * test/minimal/pkg.yml, * test/minimal/glob.yml, * test/minimal/iterate.yml, * test/minimal/runit.yml, * test/minimal/author.yml, * test/minimal/cat.yml, * test/minimal/wc.yml, * test/uttk-dist, * test/uttk-dist/dist-dispatch.yml, * test/uttk-dist/local-fetch.yml, * test/uttk-dist/tester.yml, * test/uttk-dist/dist-nested-pass.yml, * test/uttk-dist/dist-pass.yml, * test/uttk-dist/cat, * test/uttk-dist/cat/file.in, * test/uttk-dist/cat/file.out, * test/uttk-dist/uttk-dist, * test/uttk-dist/dist-cat.yml, * test/uttk-dist/dist-abort.yml, * test/uttk-dist/dist-suite.yml, * test/uttk-dist/dist-error.yml, * test/uttk-dist/dist-ribute.yml, * test/uttk-dist/dist-delegate.yml, * test/uttk-dist/dist-fail.yml, * test/dist-suite.yml, * test/ressources, * test/ressources/mini-lib, * test/ressources/mini-lib/strlen.c, * test/ressources/mini-lib/Makefile, * test/ressources/runit, * test/ressources/runit/bad.rb, * test/ressources/runit/good.rb, * test/ressources/runit/error.rb, * test/ressources/text, * test/ressources/text/1.txt, * test/ressources/ball, * test/ressources/ball/jack-exit, * test/ressources/ball/jack-exit/exit.c, * test/ressources/ball/jack-exit/Makefile, * test/ressources/ball/bar_p-mini-lib, * test/ressources/ball/bar_p-mini-lib/Makefile, * test/ressources/ball/bar_p-mini-lib/my_strlen.c, * test/ressources/ball/joe_i-mini-lib, * test/ressources/ball/joe_i-mini-lib/configure, * test/ressources/ball/joe_i-mini-lib/Makefile, * test/ressources/ball/joe_i-mini-lib/my_strlen.c, * test/ressources/ball/foo_s-mini-lib.tar.bz2, * test/ressources/ball/hello.tar.bz2, * test/ressources/ball/qux_j-mini-lib, * test/ressources/ball/qux_j-mini-lib/Makefile, * test/ressources/ball/qux_j-mini-lib/my_strlen.c, * test/ressources/ball/joe-exit, * test/ressources/ball/joe-exit/exit.c, * test/ressources/ball/joe-exit/Makefile, * test/ressources/ball/20040804-exam_a1-zapngo-tessar_m.tar.gz, * test/ressources/ball/john-exit.tar.bz2, * test/ressources/ball/jack-exit.tar.bz2, * test/ressources/ball/bar_p-mini-lib.tar.bz2, * test/ressources/ball/foo_s-mini-lib, * test/ressources/ball/foo_s-mini-lib/configure, * test/ressources/ball/foo_s-mini-lib/Makefile, * test/ressources/ball/foo_s-mini-lib/my_strlen.c, * test/ressources/ball/hello, * test/ressources/ball/hello/hello.c, * test/ressources/ball/hello/Makefile, * test/ressources/ball/joe_i-mini-lib.tar.bz2, * test/ressources/ball/john-exit, * test/ressources/ball/john-exit/exit.c, * test/ressources/ball/john-exit/Makefile, * test/ressources/ball/joe-exit.tar.bz2, * test/ressources/ball/qux_j-mini-lib.tar.bz2, * test/ressources/ball/hello.tar.gz, * test/ressources/ball/Makefile, * test/ressources/package, * test/ressources/package/pkg_foo, * test/ressources/package/pkg_foo/configure, * test/ressources/package/pkg_foo/foo.sh, * test/ressources/package/pkg_foo/Makefile, * test/ressources/package/pkg_foo/bootstrap, * test/ressources/package/pkg_foo.tar.gz, * test/pool-suite.yml, * test/runit, * test/runit/dumpers, * test/runit/dumpers/xml_test.rb, * test/runit/dumpers/yaml_test.rb, * test/runit/logger, * test/runit/logger/verbosity_test.rb, * test/runit/logger/section_node_test.rb, * test/runit/logger/severity_test.rb, * test/runit/logger/to_uttk_log_test.rb, * test/runit/logger_test.rb, * test/runit/fetchers, * test/runit/fetchers/fetchers_test.rb, * test/runit/filters, * test/runit/filters/node_cut_test.rb, * test/runit/filters/rpath_filter_test.rb, * test/runit/filters/keep_skip_based_test.rb, * test/runit/filters/buffer_test.rb, * test/runit/filters/text_filter_test.rb, * test/runit/loaders, * test/runit/strategies, * test/runit/strategies/suite_test.rb, * test/dist, * test/uttk-pkg, * test/uttk-pkg/uttk-pkg, * test/uttk-pkg/cmdline.yml, * test/uttk-ruby, * test/uttk-ruby/uttk-ruby, * test/uttk-ruby/wc.rb, * test/uttk-ruby/base.rb, * test/unit-suite.yml, * test/pkg-suite.yml, * test/pool-tests, * test/pool-tests/pool.yml, * test/pool-tests/base.yml, * test/fixtures, * test/fixtures/text/1.txt, * test/pool, * test/uttk-minimal, * test/uttk-minimal/test.yml, * test/uttk-minimal/pkg.yml, * test/uttk-minimal/glob.yml, * test/uttk-minimal/killall.yml, * test/uttk-minimal/timeout.yml, * test/uttk-minimal/fatal.yml, * test/uttk-minimal/sub.yml, * test/uttk-minimal/block.yml, * test/uttk-minimal/probability_threshold.yml, * test/uttk-minimal/iterate.yml, * test/uttk-minimal/signal_cmd.yml, * test/uttk-minimal/runit.yml, * test/uttk-minimal/author.yml, * test/uttk-minimal/cat.yml, * test/uttk-minimal/diff.yml, * test/uttk-minimal/exit.yml, * test/uttk-minimal/wc.yml, * test/uttk-minimal/import.yml, * test/uttk-minimal/base.yml, * test/uttk-minimal/env_cmd.yml, * test/uttk-minimal/uttk-minimal, * test/uttk-minimal/rmatch.yml, * test/minimal-suite.yml, * test/examples/students/stud.yml, * test/examples/students/mini-lib.yml, * test/examples/students/glob_stud.yml, * test/examples/students/pool_stud.yml, * test/examples/students/ball.yml: Rename ressources to fixtures, runit to unit, test/uttk-* to test/*. dist-suite.yml | 4 ++-- examples/students/ball.yml | 2 +- examples/students/glob_stud.yml | 2 +- examples/students/mini-lib.yml | 4 ++-- examples/students/pool_stud.yml | 2 +- examples/students/stud.yml | 6 +++--- fixtures/text/1.txt | 2 +- minimal-suite.yml | 2 +- minimal/author.yml | 2 +- minimal/cat.yml | 2 +- minimal/glob.yml | 2 +- minimal/iterate.yml | 2 +- minimal/pkg.yml | 2 +- minimal/runit.yml | 6 +++--- minimal/wc.yml | 2 +- pkg-suite.yml | 2 +- pool-suite.yml | 2 +- ruby/wc.rb | 2 +- unit-suite.yml | 2 +- 19 files changed, 25 insertions(+), 25 deletions(-) Index: test/examples/students/stud.yml --- test/examples/students/stud.yml (revision 721) +++ test/examples/students/stud.yml (working copy) @@ -15,7 +15,7 @@ - test with 3: { args: 3, exit: 3 } contents: - - joe: { url: file://<>/../../ressources/ball/joe-exit.tar.bz2, weight: 3 } - - john: { url: file://<>/../../ressources/ball/john-exit.tar.bz2, weight: 2 } - - jack: { url: file://<>/../../ressources/ball/jack-exit.tar.bz2, weight: 1 } + - joe: { url: file://<>/../../fixtures/ball/joe-exit.tar.bz2, weight: 3 } + - john: { url: file://<>/../../fixtures/ball/john-exit.tar.bz2, weight: 2 } + - jack: { url: file://<>/../../fixtures/ball/jack-exit.tar.bz2, weight: 1 } Index: test/minimal/wc.yml --- test/minimal/wc.yml (revision 721) +++ test/minimal/wc.yml (working copy) @@ -22,5 +22,5 @@ input: "foo" - from file test: - input: !path '<>/../ressources/text/1.txt' + input: !path '<>/../fixtures/text/1.txt' output: !re \s*244\n$ Index: test/minimal/cat.yml --- test/minimal/cat.yml (revision 721) +++ test/minimal/cat.yml (working copy) @@ -12,5 +12,5 @@ command: cat weight: -1 input: !path <>/cat.yml - output: !path <>/../ressources/text/1.txt + output: !path <>/../fixtures/text/1.txt Index: test/minimal/author.yml --- test/minimal/author.yml (revision 721) +++ test/minimal/author.yml (working copy) @@ -4,7 +4,7 @@ Prepare tarball and test (author.yml): !S::Suite contents: - Checkout the tarball: !S::Checkout - url: file://<>/../ressources/ball/20040804-exam_a1-zapngo-tessar_m.tar.gz + url: file://<>/../fixtures/ball/20040804-exam_a1-zapngo-tessar_m.tar.gz fatal: true - Test the AUTHORS file: !S::Authors author: tessar_m Index: test/examples/students/ball.yml --- test/examples/students/ball.yml (revision 721) +++ test/examples/students/ball.yml (working copy) @@ -1,7 +1,7 @@ --- Test a TarBall (ball.yml): !S::Package - url: file://<>/../../ressources/ball/hello.tar.gz + url: file://<>/../../fixtures/ball/hello.tar.gz skip_steps: [ check, distcheck, install ] test: Test the HelloWorld: !S::Cmd Index: test/minimal/runit.yml --- test/minimal/runit.yml (revision 721) +++ test/minimal/runit.yml (working copy) @@ -1,7 +1,7 @@ --- RUnit strategy test suite: !S::RMatch symbols: - unit_dir: <>/../ressources/runit + unit_dir: <>/../fixtures/runit test: !S::Suite attributes: !S::RUnit input: !path <>/../test-unit-setup.rb @@ -13,11 +13,11 @@ - error: args: <>/error.rb - good directory: - args: ressources/runit/good.rb + args: fixtures/runit/good.rb dir: <>/.. verbose: true - bad directory: - args: ressources/runit/bad.rb + args: fixtures/runit/bad.rb dir: <>/.. match: - ///good/status/PASS Index: test/pkg-suite.yml --- test/pkg-suite.yml (revision 721) +++ test/pkg-suite.yml (working copy) @@ -1,7 +1,7 @@ --- Test suite for Uttk packages: !S::Iterate - over: !pathlist <>/uttk-pkg/(*).yml + over: !pathlist <>/pkg/(*).yml iter: [it_file, it_name] test: Test <>: !S::Import Index: test/unit-suite.yml --- test/unit-suite.yml (revision 721) +++ test/unit-suite.yml (working copy) @@ -1,7 +1,7 @@ --- "Uttk's unit test suite": !S::Iterate - over: !pathlist <>/runit/**/(*_test.rb) + over: !pathlist <>/unit/**/(*_test.rb) iter: [it_file, it_name] test: Unit test <>: !S::RUnit Index: test/dist-suite.yml --- test/dist-suite.yml (revision 721) +++ test/dist-suite.yml (working copy) @@ -21,7 +21,7 @@ - slave2: { args: -l uttkd_slave2.log -n 'slave2' -t 'druby://localhost:62000' -m 'druby://localhost:62004' Slave & } - contents: !S::Iterate - over: !pathlist <>/uttk-dist/dist-({pass,fail,error,nested-pass,suite,delegate,ribute,cat,abort}).yml + over: !pathlist <>/dist/dist-({pass,fail,error,nested-pass,suite,delegate,ribute,cat,abort}).yml iter: [it_file, it_name] test: Test <>: !S::SubCmd @@ -32,7 +32,7 @@ -t 'druby://localhost:52000' -t 'druby://localhost:62000' <> - dir: <>/uttk-dist + dir: <>/dist - clean: !S::KillAll weight: -1 Index: test/minimal/pkg.yml --- test/minimal/pkg.yml (revision 721) +++ test/minimal/pkg.yml (working copy) @@ -4,7 +4,7 @@ attributes: !S::Package {} contents: - Test the foo package: - url: file://<>/../ressources/package/pkg_foo.tar.gz + url: file://<>/../fixtures/package/pkg_foo.tar.gz test: Test yo: !S::Cmd dir: '<>' Index: test/fixtures/text/1.txt --- test/fixtures/text/1.txt (revision 721) +++ test/fixtures/text/1.txt (working copy) @@ -1,4 +1,4 @@ /*-------------------------------------------------------. - | Unified Unified UnifiedTest Tool Kit | + | Unified Test Tool Kit | | "parce que les tests on s'en bat pas les couilles !" | `-------------------------------------------------------*/ Index: test/pool-suite.yml --- test/pool-suite.yml (revision 721) +++ test/pool-suite.yml (working copy) @@ -1,7 +1,7 @@ --- Pool Test Suite for Uttk: !S::Iterate - over: !pathlist <>/pool-tests/(*).yml + over: !pathlist <>/pool/(*).yml iter: [it_file, it_name] test: Test <>: !S::Import Index: test/examples/students/pool_stud.yml --- test/examples/students/pool_stud.yml (revision 721) +++ test/examples/students/pool_stud.yml (working copy) @@ -11,7 +11,7 @@ # This test doesn't work for the moment symbols: - dir: <>/../../ressources/ball + dir: <>/../../fixtures/ball attributes: !S::Package skip_steps: [ check, distcheck, install ] test: Index: test/minimal/glob.yml --- test/minimal/glob.yml (revision 721) +++ test/minimal/glob.yml (working copy) @@ -1,7 +1,7 @@ --- Test a list of tarballs (glob.yml): !S::Glob - glob: '<>/../ressources/ball/*.tar.bz2' + glob: '<>/../fixtures/ball/*.tar.bz2' regexp: !re ([^/]*)\.tar\.bz2$ test: 'Useless test suite for <>': !S::Suite Index: test/ruby/wc.rb --- test/ruby/wc.rb (revision 721) +++ test/ruby/wc.rb (working copy) @@ -30,7 +30,7 @@ end name 'from file test' do - input Pathname.new('<>/../ressources/text/1.txt') + input Pathname.new('<>/../fixtures/text/1.txt') output(/\s*244\n$/) end Index: test/minimal-suite.yml --- test/minimal-suite.yml (revision 721) +++ test/minimal-suite.yml (working copy) @@ -3,7 +3,7 @@ --- Uttk minimal test suite: !S::Iterate - over: !pathlist <>/uttk-minimal/(*).yml + over: !pathlist <>/minimal/(*).yml iter: [it_file, it_name] test: Test <>: !S::Import Index: test/minimal/iterate.yml --- test/minimal/iterate.yml (revision 721) +++ test/minimal/iterate.yml (working copy) @@ -84,7 +84,7 @@ - Iterate over ranges: over: !range "'p'..'r'" - Iterate over a pathname list: - over: !filelist <>/../ressources/ball/*-mini-lib.tar.* + over: !filelist <>/../fixtures/ball/*-mini-lib.tar.* - Iterate over a hash: over: foo: bar Index: test/examples/students/mini-lib.yml --- test/examples/students/mini-lib.yml (revision 721) +++ test/examples/students/mini-lib.yml (working copy) @@ -4,14 +4,14 @@ threshold: 0.43 test: Test the mini lib: !S::Iterate - over: !pathlist <>/../../ressources/ball/(*)-mini-lib.tar.bz2 + over: !pathlist <>/../../fixtures/ball/(*)-mini-lib.tar.bz2 iter: [it_file, it_name] test: Testing the mini-lib of <>: !S::Suite attributes: timeout: 4 symbols: - driver: <>/../../ressources/mini-lib + driver: <>/../../fixtures/mini-lib contents: - Extracting: !S::Checkout Index: test/examples/students/glob_stud.yml --- test/examples/students/glob_stud.yml (revision 721) +++ test/examples/students/glob_stud.yml (working copy) @@ -1,7 +1,7 @@ --- Test students tarball with a globbing (glob_stud.yml): !S::Glob - glob: <>/../../ressources/ball/*-exit.tar.bz2 + glob: <>/../../fixtures/ball/*-exit.tar.bz2 regexp: !re "/([a-z]*)-[a-z]*\.tar\.bz2" test: TBall of <>: !S::Package -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050926/e02be426/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Mon Sep 26 07:11:20 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon, 26 Sep 2005 13:11:20 +0200 (CEST) Subject: [Uttk-Patches] 723: Adapt weight.yml and reveal 3 bugs. Message-ID: <20050926111120.865177A7BF@smtp.feydakins.org> svn://svn.feydakins.org/uttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/723 Index: ChangeLog from Nicolas Pouillard Adapt weight.yml and reveal 3 bugs. * test/minimal/weight.yml: New from test/all/weight.yml. This test was not in the main test suite because it was hard to check it's validty. Now with R?Match this can be done correctly. And reveal 3 bugs in uttk :( weight.yml | 184 ++++++++++++++++++++++++++++++++++++------------------------- 1 files changed, 109 insertions(+), 75 deletions(-) Index: test/minimal/weight.yml --- test/minimal/weight.yml (revision 722) +++ test/minimal/weight.yml (working copy) @@ -1,113 +1,147 @@ --- -Test the weight system: - strategy: Suite - attributes: - strategy: Suite - contents: - - All or nothing (0%): - wclass: WMin - contents: - - Suppose to PASS 1: - strategy: Pass - - Suppose to PASS 2: - strategy: Pass - - Suppose to FAIL 3: - strategy: Fail - - - All or nothing (100%): - wclass: WMin - contents: - - Suppose to PASS 4: - strategy: Pass - - Suppose to FAIL 5: - strategy: Fail +Test the weight system: !S::Suite + contents: + - All or nothing (0%): !S::RMatch + test: !S::Suite + wclass: W::WMin + contents: + - Suppose to PASS 1: !S::Pass {} + - Suppose to PASS 2: !S::Pass {} + - Suppose to FAIL 3: !S::Fail {} + match: + - ///1/status/PASS$ + - ///2/status/PASS$ + - ///3/status/FAIL$ + - //status/FAIL$ + + - All or nothing (100%): !S::RMatch + test: !S::Suite + wclass: W::WMin + contents: + - Suppose to PASS 4: !S::Pass {} + - Suppose to FAIL 5: !S::Fail weight: -1 - - Suppose to PASS 6: - strategy: Pass + - Suppose to PASS 6: !S::Pass {} + match: + - ///4/status/PASS$ + - ///5/status/FAIL$ + - ///6/status/PASS$ + - //status/PASS$ - - Percentage (70%): + - Percentage (70%): !S::RMatch + test: !S::Suite contents: - - Suppose to PASS 7: - strategy: Pass - - Suppose to PASS 8: - strategy: Pass + - Suppose to PASS 7: !S::Pass {} + - Suppose to PASS 8: !S::Pass weight: 2 - - Sub suite (25%): - strategy: Suite + - Sub suite (25%): !S::Suite contents: - - Suppose to PASS 9: - strategy: Pass - - Suppose to FAIL 10: - strategy: Fail + - Suppose to PASS 9: !S::Pass {} + - Suppose to FAIL 10: !S::Fail weight: 2 - - Suppose to FAIL 11: - strategy: Fail - - Suppose to FAIL 12: - strategy: Fail - - Suppose to PASS 13: - strategy: Pass - - - Fatal pass (100%): - attributes: - strategy: Pass + - Suppose to FAIL 11: !S::Fail {} + - Suppose to FAIL 12: !S::Fail {} + - Suppose to PASS 13: !S::Pass {} + match: + - ///7/status/PASS$ + - ///8/status/PASS$ + - ///Sub//9/status/PASS$ + - ///Sub//10/status/FAIL$ + - ///Sub//11/status/FAIL$ + - ///Sub/status/FAIL\(25%\)$ + - //status/FAIL\(70%\)$ + + - Fatal pass (100%): !S::RMatch + test: !S::Suite + attributes: !S::Pass {} contents: - Suppose to PASS 14: fatal: true - Suppose to PASS 15: {} + match: + - ///14/status/PASS$ + - ///15/status/PASS$ + - //status/PASS$ - - Fatal fail (50%): + - Fatal fail (50%): !S::RMatch + test: !S::Suite contents: - - Suppose to FAIL 16: - strategy: Fail + - Suppose to FAIL 16: !S::Fail fatal: true - - Suppose to be not tested 17: - strategy: Pass + - Suppose to be not tested 17: !S::Pass {} + match: + - ///16/status/FAIL$ + - //status/FAIL\(50%\)$ + dont_match: + - ///17 - - Fatal pass but other fail (50%): + - Fatal pass but other fail (50%): !S::RMatch + test: !S::Suite contents: - - Suppose to PASS 18: - strategy: Pass + - Suppose to PASS 18: !S::Pass fatal: true - - Suppose to FAIL 19: - strategy: Fail - - - Fatal pass but no weight (100%): - attributes: - strategy: Pass + - Suppose to FAIL 19: !S::Fail {} + match: + - ///18/status/PASS$ + - ///19/status/FAIL$ + - //status/FAIL\(50%\)$ + + - Fatal pass but no weight (100%): !S::RMatch + test: !S::Suite + attributes: !S::Pass {} contents: - Suppose to PASS 20: weight: 0 fatal: true - Suppose to PASS 21: {} - Suppose to PASS 22: {} - - - Fatal fail but no weight (100%): - attributes: - strategy: Pass + match: + - ///20/status/PASS$ + - ///21/status/PASS$ + - ///22/status/PASS$ + - //status/PASS$ + + - Fatal fail but no weight (100%): !S::RMatch + test: !S::Suite + attributes: !S::Pass {} contents: - - Suppose to FAIL 23: + - Suppose to FAIL 23: !S::Fail weight: 0 - strategy: Fail fatal: true - Suppose to be not tested 24: {} - Suppose to be not tested 25: {} - - - Negative (66%): - attributes: - strategy: Pass + match: + - ///23/status/FAIL$ + - //status/PASS$ + dont_match: + - ///24 + - ///25 + + - Negative (66%): !S::RMatch + test: !S::Suite + attributes: !S::Pass {} contents: - Suppose to PASS 26: {} - Suppose to PASS 27: weight: -1 - Suppose to PASS 28: {} - - - Negative (100%): - attributes: - strategy: Pass + match: + - ///26/status/PASS$ + - ///27/status/PASS$ + - ///28/status/PASS$ + - //status/FAIL\(66%\)$ + + - Negative (100%): !S::RMatch + test: !S::Suite + attributes: !S::Pass {} contents: - Suppose to PASS 29: {} - - Suppose to PASS 30: + - Suppose to PASS 30: !S::Fail weight: -1 - strategy: Fail - Suppose to PASS 31: {} + match: + - ///29/status/PASS$ + - ///30/status/FAIL$ + - ///31/status/PASS$ + - //status/PASS$ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050926/f7def0c4/signature-0001.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Mon Sep 26 07:28:05 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon, 26 Sep 2005 13:28:05 +0200 (CEST) Subject: [Uttk-Patches] 724: Remove deprecated strategies/tests/features. Message-ID: <20050926112805.9FDF97A7BF@smtp.feydakins.org> svn://svn.feydakins.org/uttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/724 Index: ChangeLog from Nicolas Pouillard Remove deprecated strategies/tests/features. * lib/uttk/strategies/Strategy.rb: Remove the deprecated Failure exception. * lib/uttk/strategies/RemoteCmd.rb, * lib/uttk/strategies/Glob.rb, * lib/uttk/strategies/Ball.rb, * lib/uttk/strategies/Extract.rb: Remove these deprecated strategies. * test/dist/uttk-dist, * test/all, * test/all/suite_timeout.yml, * test/all/remote_dispatcher.yml, * test/all/TestTAssert, * test/all/TestTAssert/first.yml, * test/all/TestTAssert/segfault.yml, * test/all/dist-suite-nested-in-pool.yml, * test/all/no_suite.yml, * test/all/xunit, * test/all/weight.yml, * test/all/dist-suite-indirect-nested.yml, * test/all/pipeline-timeout.yml, * test/all/dist-suite-nested-3.yml, * test/all/dist-suite-nested.yml, * test/all/remote_cmd.yml: Remove. * test/all/xunit/junit: Rename to ... * test/fixtures/java/unit: ... this. * test/fixtures/runit: Rename to ... * test/fixtures/unit: ... this. Strategy.rb | 14 -------------- 1 files changed, 14 deletions(-) Index: lib/uttk/strategies/Strategy.rb --- lib/uttk/strategies/Strategy.rb (revision 723) +++ lib/uttk/strategies/Strategy.rb (working copy) @@ -31,16 +31,6 @@ end end - - # - # Exceptions - # - - # Warn: do not raise this exception it's almost deprecated. - class Failure < UttkException - end - - # # Accessors # @@ -187,10 +177,6 @@ end raise ex - # Convert the Failure exception with `fail' (Warn: almost deprecated). - rescue Failure => ex - fail(ex) - # Catch all others exceptions and wrapped them in an error. rescue Exception => ex raise_error(ex) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050926/aa572618/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Mon Sep 26 08:00:58 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon, 26 Sep 2005 14:00:58 +0200 (CEST) Subject: [Uttk-Patches] 725: Fix some renaming errors, and add a layout rule in NORM. Message-ID: <20050926120058.218D07A9B0@smtp.feydakins.org> svn://svn.feydakins.org/uttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/725 Index: ChangeLog from Nicolas Pouillard Fix some renaming errors, and add a layout rule in NORM. * misc/renaming: Comment the complex rule which does not work. * README: Fix typos due to erros in the renaming script. * NORM: Likewise. Add the "no tabulation" rule. NORM | 50 ++++++++++++++++++++++++++++++++------------------ README | 19 ++++++++++--------- misc/renaming | 2 +- 3 files changed, 43 insertions(+), 28 deletions(-) Index: README --- README (revision 724) +++ README (working copy) @@ -1,17 +1,18 @@ -= Uttk - UnifiedUnified Unified UnifiedTest Tool Kit Unified += Uttk - Unified Test Tool Kit -Unified Unified UnifiedTest Tool Kit, aka Uttk, is designed to ease the test stage of the development -of your projects. +Unified Test Tool Kit, aka Uttk, is designed to ease the test stage of the +development of your projects. Testing is as important as design and implementation of a project. But it's -very cumbersome to write tests and tester scripts. That's why a project such as -Uttk can help you. It is written in Ruby, which is a script language one hundred -percents dynamic and object oriented. It's inherited from Smalltalk, Python and -Perl. UnifiedUnified Unified UnifiedTest Tool Kit allows two ways of test writing: a configuration file way -(using YAML: an XML plain text format) and a class extension way where you can -extend an already made class to specialize it for your own project case. +very cumbersome to write tests and tester scripts. That's why a project such +as Uttk can help you. It is written in Ruby, which is a script language one +hundred percents dynamic and object oriented. It's inherited from Smalltalk, +Python and Perl. Unified Test Tool Kit allows two ways of test writing: a +configuration file way (using YAML: an XML plain text format) and a class +extension way where you can extend an already made class to specialize it for +your own project case. Uttk's philosophy follows the principle that you can always extend already made test strategy to specialize it for your own case. Initially, Uttk comes with a Index: NORM --- NORM (revision 724) +++ NORM (working copy) @@ -1,31 +1,28 @@ -*- outline -*- - /*---------------------------. - | Coding style of Unified Unified UnifiedTest Tool Kit | - `---------------------------*/ - - /*--------------------------------------. - | ! Coding style is not about layout ! | - `--------------------------------------*/ + /*---------------------------------------. + | Coding style of Unified Test Tool Kit | + `---------------------------------------*/ /*------------------------------------------------------------------. | This document consists of a set of rules which must be respect by | - | every maintainers of Unified Unified UnifiedTest Tool Kit. | + | every maintainers of Unified Unified Test Tool Kit. | `------------------------------------------------------------------*/ * Introduction - This text deals with the norm applied to all official Unified Unified UnifiedTest Tool Kit source files -included in the distribution. Everyone who write a peace of code into Unified Unified UnifiedTest Tool Kit -must follow the rules below. + This text deals with the norm applied to all official Unified Test Tool Kit +source files included in the distribution. Everyone who write a peace of code +into Unified Test Tool Kit must follow the rules below. Every rules mentioned below are not about the layout of uttk's source file. In this document some part of the ruby's standard library may be forbidden and some features of Ruby too. We do so for stability/security and efficiency reasons. If you want to add a rule to this file you have to justify it with at least one strong and objective argument. Any subjective rules will not be allowed in -this document. The summary of every rules must be scared to allow fast reading. +this document. The summary of every rules must be scared to allow fast +reading. * Coding style rules @@ -46,12 +43,12 @@ | You have to write your log messages using the block. | `------------------------------------------------------*/ - Ruby's logger provides two ways to write your log messages. You can pass your -log string to the logger either as a function argument or as a block which -return a string. The second version is prefered since the block, thought the -string, will not be evaluated by Ruby if the log level severity is higher than -the level of your message. This way, time is saved for every debug messages -when your severity level is fatal, for instance. + Ruby's logger provides two ways to write your log messages. You can pass +your log string to the logger either as a function argument or as a block +which return a string. The second version is prefered since the block, thought +the string, will not be evaluated by Ruby if the log level severity is higher +than the level of your message. This way, time is saved for every debug +messages when your severity level is fatal, for instance. ** Using blocks @@ -83,3 +80,20 @@ def each_value | def each_value ( &block ) @a.each { |k, v| yield v } | @a.each_value(&block) end | end + + +* Layout rules + +** Try to respect the orginal style + +** No Tabulations + + Don't use tabulations. They pollute the code since editors and/or users are +not agree on the width of a tabulation. Tell your editor to replace them by +spaces. Expect in the ChangeLog which is handled automatically by Vcs. + +*** Vim + Just type (or add it to your .vimrc): `:set expandtab' + +*** Emacs + FIXME: FILL ME Index: misc/renaming --- misc/renaming (revision 724) +++ misc/renaming (working copy) @@ -11,7 +11,7 @@ r = gsub!(/([^Uu])T[tT][kK]/, '\1Uttk') || r r = gsub!(/TestTKewl/, 'Unified Test Tool Kit') || r r = gsub!(/TestToolKit/, 'Unified Test Tool Kit') || r - r = gsub!(/([^Uu ][^Nn ][^Ii ][^Ff ][^Ii ][^Ee ][^Dd ]\s*)(\s*?[tT][Ee][Ss][Tt]\s*[Tt][Oo][Oo][Ll]\s*[Kk][Ii][Tt])/, '\1 Unified\2') || r + # r = gsub!(/([^Uu ][^Nn ][^Ii ][^Ff ][^Ii ][^Ee ][^Dd ]\s*)(\s*?[tT][Ee][Ss][Tt]\s*[Tt][Oo][Oo][Ll]\s*[Kk][Ii][Tt])/, '\1 Unified\2') || r (r)? self : nil end end -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050926/3a72532a/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Mon Sep 26 08:12:39 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon, 26 Sep 2005 14:12:39 +0200 (CEST) Subject: [Uttk-Patches] 726: Replace tabulations by 8 spaces. Message-ID: <20050926121239.9384F7A7BF@smtp.feydakins.org> svn://svn.feydakins.org/uttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/726 Index: ChangeLog from Nicolas Pouillard Replace tabulations by 8 spaces. * test/fixtures/mini-lib/strlen.c, * test/fixtures/java/unit/MultiRight/Foo/Foo.java, * test/fixtures/java/unit/MultiRight/Foo/FooTest.java, * test/fixtures/java/unit/MultiRight/bar/Bar.java, * test/fixtures/java/unit/MultiRight/bar/BarTest.java, * test/fixtures/java/unit/MultiRight/MultiRight.java, * test/fixtures/java/unit/MultiRight/MultiRightTest.java, * test/fixtures/java/unit/SimpleException/SimpleExceptionTest.java, * test/fixtures/text/1.txt, * test/fixtures/ball/jack-exit/exit.c, * test/fixtures/ball/bar_p-mini-lib/my_strlen.c, * test/fixtures/ball/joe_i-mini-lib/my_strlen.c, * test/fixtures/ball/qux_j-mini-lib/my_strlen.c, * test/fixtures/ball/joe-exit/exit.c, * test/fixtures/ball/foo_s-mini-lib/my_strlen.c, * test/fixtures/ball/hello/hello.c, * test/fixtures/ball/john-exit/exit.c, * misc/expandtab.rb, * lib/uttk/dumpers/Yaml.rb, * lib/uttk/dumpers/Dumper.rb, * lib/uttk/loaders/Yaml.rb, * lib/uttk/strategies/Bootstrap.rb, * lib/uttk/strategies/Compile.rb, * lib/uttk/strategies/Package.rb, * lib/uttk/strategies/Composite.rb, * lib/uttk/strategies/Configure.rb, * lib/uttk/strategies/Block.rb, * lib/uttk/strategies/Collection.rb, * lib/uttk/strategies/Strategy.rb, * lib/uttk/strategies/Cmd.rb, * lib/uttk/strategies/IOBased.rb, * lib/uttk/strategies/Pool.rb: Update exit.c | 0 1 files changed Index: lib/uttk/strategies/IOBased.rb Index: test/fixtures/java/unit/MultiRight/bar/Bar.java Index: lib/uttk/strategies/Pool.rb Index: test/fixtures/ball/john-exit/exit.c Index: test/fixtures/java/unit/MultiRight/MultiRightTest.java Index: lib/uttk/strategies/Block.rb Index: lib/uttk/strategies/Bootstrap.rb Index: lib/uttk/dumpers/Yaml.rb Index: test/fixtures/ball/hello/hello.c Index: test/fixtures/ball/bar_p-mini-lib/my_strlen.c Index: test/fixtures/ball/joe_i-mini-lib/my_strlen.c Index: test/fixtures/java/unit/MultiRight/bar/BarTest.java Index: lib/uttk/loaders/Yaml.rb Index: test/fixtures/text/1.txt Index: test/fixtures/java/unit/SimpleException/SimpleExceptionTest.java Index: test/fixtures/java/unit/MultiRight/Foo/Foo.java Index: lib/uttk/strategies/Strategy.rb Index: lib/uttk/strategies/Composite.rb Index: lib/uttk/strategies/Compile.rb Index: misc/expandtab.rb Index: test/fixtures/ball/joe-exit/exit.c Index: test/fixtures/ball/qux_j-mini-lib/my_strlen.c Index: lib/uttk/strategies/Configure.rb Index: test/fixtures/mini-lib/strlen.c Index: lib/uttk/strategies/Package.rb Index: test/fixtures/ball/foo_s-mini-lib/my_strlen.c Index: test/fixtures/java/unit/MultiRight/MultiRight.java Index: test/fixtures/java/unit/MultiRight/Foo/FooTest.java Index: lib/uttk/strategies/Cmd.rb Index: lib/uttk/strategies/Collection.rb Index: lib/uttk/dumpers/Dumper.rb Index: test/fixtures/ball/jack-exit/exit.c -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050926/100f4c51/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Mon Sep 26 08:42:24 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Mon, 26 Sep 2005 14:42:24 +0200 (CEST) Subject: [Uttk-Patches] 727: uttk-line-count: more extensions. Message-ID: <20050926124224.7F0277BBB4@smtp.feydakins.org> svn://svn.feydakins.org/uttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/727 Index: ChangeLog from Nicolas Pouillard uttk-line-count: more extensions. * misc/uttk-line-count.rb: Treat also Yaml, JavaScript and CSS files. uttk-line-count.rb | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: misc/uttk-line-count.rb --- misc/uttk-line-count.rb (revision 726) +++ misc/uttk-line-count.rb (working copy) @@ -64,7 +64,7 @@ files = [] if ARGV.empty? - Pathname.glob('{bin,lib,test}/**/*.rb').each { |x| files << x } + Pathname.glob('{bin,lib,test}/**/*.{rb,yml,js,css}').each { |x| files << x } else files += ARGV.map { |x| Pathname.new(x) } end @@ -110,6 +110,9 @@ count += comment_count unless skip_comment count += empty_count unless skip_empty_line + if f.to_s =~ /\.yml$/ + code_count, test_count = 0, code_count + end lst = [ count, code_count, comment_count, empty_count, test_count ] merge_arrays!(total, lst) { |x, y| x + y } -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050926/938ca5bd/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Mon Sep 26 10:28:40 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 16:28:40 +0200 Subject: [Uttk-Patches] [TTK-Patches] [ruby_ex] 362: Some portablity fixes. In-Reply-To: <840b875c0509250352c147ffb@mail.gmail.com> References: <20050924171406.5C5411BD38@smtp.feydakins.org> <840b875c0509250352c147ffb@mail.gmail.com> Message-ID: <840b875c0509260728f2cb782@mail.gmail.com> On 9/24/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Some portablity fixes. > > * core_ex/Rakefile: More robust initialization. > * core_ex/lib/yaml_extension.rb: Better class conversion for the yaml > type, and suppress some Exceptions. > * core_ex/lib/core_ex/rakefile_base.rf: Use the !S:: Uttk style. > * core_ex/lib/core_ex/yaml.rb: Suppress some Exceptions, take care of > the emitter. > * core_ex/lib/core_ex.rb: Require 'English', load core_ex path. > * core_ex/lib/dumpable_proc.rb: Protect against code injection. > * core_ex/NEWS, core_ex/README: Typo. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Mon Sep 26 10:29:47 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 16:29:47 +0200 Subject: [Uttk-Patches] [TTK-Patches] 709: Improve Proxies strategies and fix some bugs. In-Reply-To: <840b875c050925170921ef24e3@mail.gmail.com> References: <20050925004219.557F41AFBE@smtp.feydakins.org> <840b875c05092504587bf6a8f8@mail.gmail.com> <840b875c050925073572614ee2@mail.gmail.com> <840b875c05092509243afa0ece@mail.gmail.com> <840b875c05092513127b307ebd@mail.gmail.com> <840b875c050925170921ef24e3@mail.gmail.com> Message-ID: <840b875c05092607292f3b7200@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > On 9/25/05, Nicolas Despr?s wrote: > > On 9/25/05, Nicolas Pouillard wrote: > > > On 9/25/05, Nicolas Despr?s wrote: > > > > On 9/25/05, Nicolas Pouillard wrote: > > > > > On 9/25/05, Nicolas Despr?s wrote: > > > > > > On 9/25/05, Nicolas Pouillard wrote: > > > > > > > > > > > > > > svn://svn.feydakins.org/ttk/trunk > > > > > > > > > > > > > > You can also view this changeset here: > > > > > > > > > > > > > > http://http://dev.uttk.org/repository/changesets/709 > > > > > > > > > > > > > > Index: ChangeLog > > > > > > > from Nicolas Pouillard > > > > > > > > > > > > > > Improve Proxies strategies and fix some bugs. > > > > > > > > > > > > > > * lib/ttk/strategies/Test.rb: Reject :name, :status, :strategy like it > > > > > > > was in Proxy but leave a FIXME. > > > > > > > * lib/ttk/strategies/Iterate.rb: Add Hash#ttk_each. > > > > > > > * lib/ttk/strategies/RMatch.rb: Deep re-implementation to avoid the > > > > > > > Forker class which cause many problems. > > > > > > > * lib/ttk/strategies/Proxy.rb: No more reject but supply a test name > > > > > > > if the name is not set. > > > > > > > * lib/ttk/strategies/RUnit.rb: Use <> and %a. > > > > > > > * lib/ttk/strategies/Strategy.rb: The name attribute is no more > > > > > > > mandatory (that is cleaner than the fake name `noname'). > > > > > > > > > [...] > > > > > I think it should have an error message in those cases, because the name is nil. > > > > Yes because this don't have a name. > For some tests it's better to let it optional. > For me it is very important to name tests. Without a name it is harder to locate an error in a test. I understand that the strategy Proxy need to make the name attribute non-mandatory but it is the only exception by now. So let's handled it properly in Proxy for now. I insist: a test must be named. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Mon Sep 26 11:07:38 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 17:07:38 +0200 Subject: [Uttk-Patches] 727: uttk-line-count: more extensions. In-Reply-To: <20050926124224.7F0277BBB4@smtp.feydakins.org> References: <20050926124224.7F0277BBB4@smtp.feydakins.org> Message-ID: <840b875c050926080720c4f12c@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/uttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/727 > > Index: ChangeLog > from Nicolas Pouillard > > uttk-line-count: more extensions. > > * misc/uttk-line-count.rb: Treat also Yaml, JavaScript and CSS files. > [...] Ok. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Mon Sep 26 11:10:40 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 17:10:40 +0200 Subject: [Uttk-Patches] 726: Replace tabulations by 8 spaces. In-Reply-To: <20050926121239.9384F7A7BF@smtp.feydakins.org> References: <20050926121239.9384F7A7BF@smtp.feydakins.org> Message-ID: <840b875c05092608107737207c@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/uttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/726 > > Index: ChangeLog > from Nicolas Pouillard > > Replace tabulations by 8 spaces. > Why? [...] -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Mon Sep 26 11:24:19 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 17:24:19 +0200 Subject: [Uttk-Patches] 725: Fix some renaming errors, and add a layout rule in NORM. In-Reply-To: <20050926120058.218D07A9B0@smtp.feydakins.org> References: <20050926120058.218D07A9B0@smtp.feydakins.org> Message-ID: <840b875c050926082434050e11@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/uttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/725 > > Index: ChangeLog > from Nicolas Pouillard > > Fix some renaming errors, and add a layout rule in NORM. > > * misc/renaming: Comment the complex rule which does not work. > * README: Fix typos due to erros in the renaming script. > * NORM: Likewise. Add the "no tabulation" rule. > [...] > +configuration file way (using YAML: an XML plain text format) and a class Maybe one day, it will handle XML as input language. > +extension way where you can extend an already made class to specialize it for > +your own project case. > > Uttk's philosophy follows the principle that you can always extend already made > test strategy to specialize it for your own case. Initially, Uttk comes with a > Index: NORM > --- NORM (revision 724) > +++ NORM (working copy) > @@ -1,31 +1,28 @@ > -*- outline -*- > > - /*---------------------------. > - | Coding style of Unified Unified UnifiedTest Tool Kit | > - `---------------------------*/ > - > - /*--------------------------------------. > - | ! Coding style is not about layout ! | > - `--------------------------------------*/ Why did you remove this banner? It is important IMHO. [...] > + This text deals with the norm applied to all official Unified Test Tool Kit > +source files included in the distribution. Everyone who write a peace of code > +into Unified Test Tool Kit must follow the rules below. UTTK to avoid to repeat it all the time. > Every rules mentioned below are not about the layout of uttk's source file. > In this document some part of the ruby's standard library may be forbidden and > some features of Ruby too. We do so for stability/security and efficiency > reasons. > If you want to add a rule to this file you have to justify it with at least > one strong and objective argument. Any subjective rules will not be allowed in > -this document. The summary of every rules must be scared to allow fast reading. > +this document. The summary of every rules must be scared to allow fast > +reading. scared -> squared [...] > +** No Tabulations > + > + Don't use tabulations. They pollute the code since editors and/or users are > +not agree on the width of a tabulation. Tell your editor to replace them by > +spaces. Expect in the ChangeLog which is handled automatically by Vcs. > + The coding style is not about layout. Move these guidelines to another file please. We can also add the one which explain how to remove trailling whitespace :-) [...] -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Mon Sep 26 11:25:18 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 17:25:18 +0200 Subject: [Uttk-Patches] 724: Remove deprecated strategies/tests/features. In-Reply-To: <20050926112805.9FDF97A7BF@smtp.feydakins.org> References: <20050926112805.9FDF97A7BF@smtp.feydakins.org> Message-ID: <840b875c0509260825549accc2@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/uttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/724 > > Index: ChangeLog > from Nicolas Pouillard > > Remove deprecated strategies/tests/features. > > * lib/uttk/strategies/Strategy.rb: Remove the deprecated Failure exception. > * lib/uttk/strategies/RemoteCmd.rb, > * lib/uttk/strategies/Glob.rb, > * lib/uttk/strategies/Ball.rb, > * lib/uttk/strategies/Extract.rb: Remove these deprecated strategies. > > * test/dist/uttk-dist, > * test/all, > * test/all/suite_timeout.yml, > * test/all/remote_dispatcher.yml, > * test/all/TestTAssert, > * test/all/TestTAssert/first.yml, > * test/all/TestTAssert/segfault.yml, > * test/all/dist-suite-nested-in-pool.yml, > * test/all/no_suite.yml, > * test/all/xunit, > * test/all/weight.yml, > * test/all/dist-suite-indirect-nested.yml, > * test/all/pipeline-timeout.yml, > * test/all/dist-suite-nested-3.yml, > * test/all/dist-suite-nested.yml, > * test/all/remote_cmd.yml: Remove. > > * test/all/xunit/junit: Rename to ... > * test/fixtures/java/unit: ... this. > * test/fixtures/runit: Rename to ... > * test/fixtures/unit: ... this. > Ok. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Mon Sep 26 11:27:33 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 17:27:33 +0200 Subject: [Uttk-Patches] 722: Renaming stage 3. In-Reply-To: <20050926095241.126367A6ED@smtp.feydakins.org> References: <20050926095241.126367A6ED@smtp.feydakins.org> Message-ID: <840b875c05092608272c00086d@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/uttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/722 > > Index: ChangeLog > from Nicolas Pouillard > > Renaming stage 3. > > * test/unit, > * test/pkg, > * test/ruby, > * test/ruby/wc.rb, > * test/minimal, > * test/minimal/pkg.yml, > * test/minimal/glob.yml, > * test/minimal/iterate.yml, > * test/minimal/runit.yml, > * test/minimal/author.yml, > * test/minimal/cat.yml, > * test/minimal/wc.yml, > * test/uttk-dist, > * test/uttk-dist/dist-dispatch.yml, > * test/uttk-dist/local-fetch.yml, > * test/uttk-dist/tester.yml, > * test/uttk-dist/dist-nested-pass.yml, > * test/uttk-dist/dist-pass.yml, > * test/uttk-dist/cat, > * test/uttk-dist/cat/file.in, > * test/uttk-dist/cat/file.out, > * test/uttk-dist/uttk-dist, > * test/uttk-dist/dist-cat.yml, > * test/uttk-dist/dist-abort.yml, > * test/uttk-dist/dist-suite.yml, > * test/uttk-dist/dist-error.yml, > * test/uttk-dist/dist-ribute.yml, > * test/uttk-dist/dist-delegate.yml, > * test/uttk-dist/dist-fail.yml, > * test/dist-suite.yml, > * test/ressources, > * test/ressources/mini-lib, > * test/ressources/mini-lib/strlen.c, > * test/ressources/mini-lib/Makefile, > * test/ressources/runit, > * test/ressources/runit/bad.rb, > * test/ressources/runit/good.rb, > * test/ressources/runit/error.rb, > * test/ressources/text, > * test/ressources/text/1.txt, > * test/ressources/ball, > * test/ressources/ball/jack-exit, > * test/ressources/ball/jack-exit/exit.c, > * test/ressources/ball/jack-exit/Makefile, > * test/ressources/ball/bar_p-mini-lib, > * test/ressources/ball/bar_p-mini-lib/Makefile, > * test/ressources/ball/bar_p-mini-lib/my_strlen.c, > * test/ressources/ball/joe_i-mini-lib, > * test/ressources/ball/joe_i-mini-lib/configure, > * test/ressources/ball/joe_i-mini-lib/Makefile, > * test/ressources/ball/joe_i-mini-lib/my_strlen.c, > * test/ressources/ball/foo_s-mini-lib.tar.bz2, > * test/ressources/ball/hello.tar.bz2, > * test/ressources/ball/qux_j-mini-lib, > * test/ressources/ball/qux_j-mini-lib/Makefile, > * test/ressources/ball/qux_j-mini-lib/my_strlen.c, > * test/ressources/ball/joe-exit, > * test/ressources/ball/joe-exit/exit.c, > * test/ressources/ball/joe-exit/Makefile, > * test/ressources/ball/20040804-exam_a1-zapngo-tessar_m.tar.gz, > * test/ressources/ball/john-exit.tar.bz2, > * test/ressources/ball/jack-exit.tar.bz2, > * test/ressources/ball/bar_p-mini-lib.tar.bz2, > * test/ressources/ball/foo_s-mini-lib, > * test/ressources/ball/foo_s-mini-lib/configure, > * test/ressources/ball/foo_s-mini-lib/Makefile, > * test/ressources/ball/foo_s-mini-lib/my_strlen.c, > * test/ressources/ball/hello, > * test/ressources/ball/hello/hello.c, > * test/ressources/ball/hello/Makefile, > * test/ressources/ball/joe_i-mini-lib.tar.bz2, > * test/ressources/ball/john-exit, > * test/ressources/ball/john-exit/exit.c, > * test/ressources/ball/john-exit/Makefile, > * test/ressources/ball/joe-exit.tar.bz2, > * test/ressources/ball/qux_j-mini-lib.tar.bz2, > * test/ressources/ball/hello.tar.gz, > * test/ressources/ball/Makefile, > * test/ressources/package, > * test/ressources/package/pkg_foo, > * test/ressources/package/pkg_foo/configure, > * test/ressources/package/pkg_foo/foo.sh, > * test/ressources/package/pkg_foo/Makefile, > * test/ressources/package/pkg_foo/bootstrap, > * test/ressources/package/pkg_foo.tar.gz, > * test/pool-suite.yml, > * test/runit, > * test/runit/dumpers, > * test/runit/dumpers/xml_test.rb, > * test/runit/dumpers/yaml_test.rb, > * test/runit/logger, > * test/runit/logger/verbosity_test.rb, > * test/runit/logger/section_node_test.rb, > * test/runit/logger/severity_test.rb, > * test/runit/logger/to_uttk_log_test.rb, > * test/runit/logger_test.rb, > * test/runit/fetchers, > * test/runit/fetchers/fetchers_test.rb, > * test/runit/filters, > * test/runit/filters/node_cut_test.rb, > * test/runit/filters/rpath_filter_test.rb, > * test/runit/filters/keep_skip_based_test.rb, > * test/runit/filters/buffer_test.rb, > * test/runit/filters/text_filter_test.rb, > * test/runit/loaders, > * test/runit/strategies, > * test/runit/strategies/suite_test.rb, > * test/dist, > * test/uttk-pkg, > * test/uttk-pkg/uttk-pkg, > * test/uttk-pkg/cmdline.yml, > * test/uttk-ruby, > * test/uttk-ruby/uttk-ruby, > * test/uttk-ruby/wc.rb, > * test/uttk-ruby/base.rb, > * test/unit-suite.yml, > * test/pkg-suite.yml, > * test/pool-tests, > * test/pool-tests/pool.yml, > * test/pool-tests/base.yml, > * test/fixtures, > * test/fixtures/text/1.txt, > * test/pool, > * test/uttk-minimal, > * test/uttk-minimal/test.yml, > * test/uttk-minimal/pkg.yml, > * test/uttk-minimal/glob.yml, > * test/uttk-minimal/killall.yml, > * test/uttk-minimal/timeout.yml, > * test/uttk-minimal/fatal.yml, > * test/uttk-minimal/sub.yml, > * test/uttk-minimal/block.yml, > * test/uttk-minimal/probability_threshold.yml, > * test/uttk-minimal/iterate.yml, > * test/uttk-minimal/signal_cmd.yml, > * test/uttk-minimal/runit.yml, > * test/uttk-minimal/author.yml, > * test/uttk-minimal/cat.yml, > * test/uttk-minimal/diff.yml, > * test/uttk-minimal/exit.yml, > * test/uttk-minimal/wc.yml, > * test/uttk-minimal/import.yml, > * test/uttk-minimal/base.yml, > * test/uttk-minimal/env_cmd.yml, > * test/uttk-minimal/uttk-minimal, > * test/uttk-minimal/rmatch.yml, > * test/minimal-suite.yml, > * test/examples/students/stud.yml, > * test/examples/students/mini-lib.yml, > * test/examples/students/glob_stud.yml, > * test/examples/students/pool_stud.yml, > * test/examples/students/ball.yml: Rename ressources to fixtures, > runit to unit, test/uttk-* to test/*. > Ok. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Mon Sep 26 11:27:52 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 17:27:52 +0200 Subject: [Uttk-Patches] 721: TTK -> Uttk renaming: stage 2. In-Reply-To: <20050926055729.4A3F544C48@smtp.feydakins.org> References: <20050926055729.4A3F544C48@smtp.feydakins.org> Message-ID: <840b875c05092608277d037101@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/uttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/721 > > Index: ChangeLog > from Nicolas Pouillard > > TTK -> Uttk renaming: stage 2. > > * test/uttk-dist/uttk-dist, > * test/uttk-dist/ttk-dist, > * test/uttk-pkg/ttk-pkg, > * test/uttk-pkg/uttk-pkg, > * test/uttk-ruby/ttk-ruby, > * test/uttk-ruby/uttk-ruby, > * test/uttk-minimal/ttk-minimal, > * test/uttk-minimal/uttk-minimal, > * lib/uttk/logger/to_ttk_log.rb, > * lib/uttk/logger/to_uttk_log.rb, > * lib/uttk/uttk, > * lib/uttk/ttk: Apply misc/reanming. > Ok. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Mon Sep 26 11:26:53 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 17:26:53 +0200 Subject: [Uttk-Patches] [TTK-Patches] 719: Add a ttk -> uttk renaming script. In-Reply-To: <840b875c050926080914c1148c@mail.gmail.com> References: <20050926042811.A730744A55@smtp.feydakins.org> <840b875c050926080914c1148c@mail.gmail.com> Message-ID: <840b875c05092608265bb4f26d@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/719 > > Index: ChangeLog > from Nicolas Pouillard > > <%= title %>. > > * misc/renaming: It takes files or directories as arguments. > Traverse them with find. > Move directories and files with "svn move". > Replace the contents of the files in place. > [...] Reviewed. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Mon Sep 26 11:26:14 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 17:26:14 +0200 Subject: [Uttk-Patches] 723: Adapt weight.yml and reveal 3 bugs. In-Reply-To: <20050926111120.865177A7BF@smtp.feydakins.org> References: <20050926111120.865177A7BF@smtp.feydakins.org> Message-ID: <840b875c05092608261e0f9690@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/uttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/723 > > Index: ChangeLog > from Nicolas Pouillard > > Adapt weight.yml and reveal 3 bugs. > > * test/minimal/weight.yml: New from test/all/weight.yml. This test was not in > the main test suite because it was hard to check it's validty. Now with > R?Match this can be done correctly. And reveal 3 bugs in uttk :( > Ok, good. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Mon Sep 26 14:34:50 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Mon, 26 Sep 2005 20:34:50 +0200 Subject: [Uttk-Patches] [TTK-Patches] 720: TTK -> Uttk renaming stage 1. In-Reply-To: <840b875c05092608281159670a@mail.gmail.com> References: <20050926045954.D3146438F8@smtp.feydakins.org> <840b875c05092608281159670a@mail.gmail.com> Message-ID: <840b875c050926113457dcab85@mail.gmail.com> On 9/26/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/uttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/720 > > Index: ChangeLog > from Nicolas Pouillard > > TTK -> Uttk renaming stage 1. > Ok. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Tue Sep 27 07:02:29 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue, 27 Sep 2005 13:02:29 +0200 (CEST) Subject: [Uttk-Patches] 728: Little renaming, and remove vcs/HOWTO. Message-ID: <20050927110229.54D687A7AF@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/728 Index: ChangeLog from Nicolas Pouillard Little renaming, and remove vcs/HOWTO. * lib/uttk/generators/generator.rb: Replace uttk-minimal by just minimal. * lib/uttk/strategies/RUnit.rb: Likewise in the documentation. * vcs/HOWTO: Remove. Deprecated information. generators/generator.rb | 2 +- strategies/RUnit.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: lib/uttk/strategies/RUnit.rb --- lib/uttk/strategies/RUnit.rb (revision 727) +++ lib/uttk/strategies/RUnit.rb (working copy) @@ -69,7 +69,7 @@ # verbose: true # # This file is extracted from the Uttk's minimal test suite - # (test/uttk-minimal/unit_test.yml). The strategy upon it is based (Glob) + # (test/minimal/unit_test.yml). The strategy upon it is based (Glob) # looks for every file ending by `_test.rb' in a particular directory # relative to the place the Uttk YAML input file is located (<>). All # these files are loaded as RUnit strategy with a verbose mode on, the Uttk Index: lib/uttk/generators/generator.rb --- lib/uttk/generators/generator.rb (revision 727) +++ lib/uttk/generators/generator.rb (working copy) @@ -40,7 +40,7 @@ end def minimal - 'uttk-minimal' + 'minimal' end attr_reader :root, :fullname, :email, :year -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050927/fa37e43c/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Tue Sep 27 07:06:27 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Tue, 27 Sep 2005 13:06:27 +0200 Subject: [Uttk-Patches] 728: Little renaming, and remove vcs/HOWTO. In-Reply-To: <20050927110229.54D687A7AF@smtp.feydakins.org> References: <20050927110229.54D687A7AF@smtp.feydakins.org> Message-ID: <840b875c05092704066cca9a30@mail.gmail.com> On 9/27/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/728 > > Index: ChangeLog > from Nicolas Pouillard > > Little renaming, and remove vcs/HOWTO. > > * lib/uttk/generators/generator.rb: Replace uttk-minimal by just minimal. > * lib/uttk/strategies/RUnit.rb: Likewise in the documentation. > * vcs/HOWTO: Remove. Deprecated information. > [...] Ok. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Tue Sep 27 10:17:07 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue, 27 Sep 2005 16:17:07 +0200 (CEST) Subject: [Uttk-Patches] 729: No trailling whitespaces, no block_given, no block.call. Message-ID: <20050927141707.09BA97C25D@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/729 Index: ChangeLog from Nicolas Pouillard No trailling whitespaces, no block_given, no block.call. * NORM: Add 2 two sub rules for blocks, and the trailling whitespaces rule for layout. NORM | 52 +++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 43 insertions(+), 9 deletions(-) Index: NORM --- NORM (revision 728) +++ NORM (working copy) @@ -52,9 +52,12 @@ ** Using blocks - /*--------------------------------------------------. - | Do not use yield, and try to minimize block.call. | - `---------------------------------------------------*/ + /*----------------------------------------------. + | Do not use yield, block_given?, iterator? | + | block.call (but []) and try minimize block[]. | + `-----------------------------------------------*/ + +*** Do not use yield Ruby provides sevral ways to use blocks, and we retain the most efficient. @@ -67,12 +70,6 @@ @a.each { |k, v| yield k, v } | @a.each(&block) end | end | - def each2 ( &block ) | - @a.each do |k, v| | - block.call(k, v) | - end | - end | - | def each_key | def each_key ( &block ) @a.each { |k, v| yield k } | @a.each_key(&block) end | end @@ -80,7 +77,40 @@ def each_value | def each_value ( &block ) @a.each { |k, v| yield v } | @a.each_value(&block) end | end + end | end + + +*** Try to minimize block.call or block[] + + # Bad | # Good + | + def each2 ( &block ) | def each2 ( &block ) + @a.each do |k, v| | @a.each(&block) + block.call(k, v) | end + end | + end + +*** No block_given? nor iterator? + + Since we do not use yield, block_given? and iterator? are useless. + Example: + + def foo ( &block ) + if block # instead of block_given? or iterator? + ... + end + end + def foo ( &block ) + if block.nil? # instead of not block_given? or not iterator? + ... + end + end + +*** No block.call but block[] + + The methods [] and call are aliases. But the [] one is closer to a real + function call. * Layout rules @@ -97,3 +127,7 @@ *** Emacs FIXME: FILL ME + +** No trailling whitespaces + + Do not let trailling whitespaces in your files !!! -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050927/de420560/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Tue Sep 27 10:23:27 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue, 27 Sep 2005 16:23:27 +0200 (CEST) Subject: [Uttk-Patches] 730: No more block_given?. Message-ID: <20050927142327.360C47C25F@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/730 Index: ChangeLog from Nicolas Pouillard No more block_given?. * lib/uttk/dumpers/BasicColor.rb, * lib/uttk/dumpers/Basic.rb, * lib/uttk/logger.rb, * lib/uttk/loaders/Loader.rb, * lib/uttk/strategies/Composite.rb, * lib/uttk/strategies/Block.rb, * lib/uttk/strategies/Collection.rb, * lib/uttk/strategies/Composite/contents_eval.rb, * lib/uttk/strategies/Strategy.rb: Apply the block rule. dumpers/Basic.rb | 2 +- dumpers/BasicColor.rb | 2 +- loaders/Loader.rb | 6 +++--- logger.rb | 6 +++--- strategies/Block.rb | 4 ++-- strategies/Collection.rb | 2 +- strategies/Composite.rb | 2 +- strategies/Composite/contents_eval.rb | 2 +- strategies/Strategy.rb | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) Index: lib/uttk/strategies/Block.rb --- lib/uttk/strategies/Block.rb (revision 729) +++ lib/uttk/strategies/Block.rb (working copy) @@ -13,7 +13,7 @@ def self.create ( *a, &block ) - raise ArgumentError, 'need a block' unless block_given? + raise ArgumentError, 'need a block' if block.nil? strategy = new(*a) strategy.test = block strategy @@ -21,7 +21,7 @@ def test=(block1=nil, &block2) - if block_given? + if block @test = block2 elsif not block1.nil? @test = block1 Index: lib/uttk/loaders/Loader.rb --- lib/uttk/loaders/Loader.rb (revision 729) +++ lib/uttk/loaders/Loader.rb (working copy) @@ -125,7 +125,7 @@ end new do |t| t.symtbl ||= symtbl - block[t] if block_given? + block[t] if block end end @@ -153,7 +153,7 @@ Uttk::Loaders.get_class(strategy).new do |t| t.symtbl ||= symtbl - block[t] if block_given? + block[t] if block t.assign(self) end @@ -173,7 +173,7 @@ t.attributes = symtbl[:attributes] t.symbols = symtbl[:symbols] t.contents = self - block[t] if block_given? + block[t] if block end end Index: lib/uttk/strategies/Strategy.rb --- lib/uttk/strategies/Strategy.rb (revision 729) +++ lib/uttk/strategies/Strategy.rb (working copy) @@ -51,7 +51,7 @@ @save = nil @reject = Set.new self.name = name - if block_given? + if block if block.arity == -1 instance_eval(&block) else @@ -542,7 +542,7 @@ def testify ( symtbl, &block ) @symtbl ||= symtbl - block[self] if block_given? + block[self] if block self end Index: lib/uttk/strategies/Composite.rb --- lib/uttk/strategies/Composite.rb (revision 729) +++ lib/uttk/strategies/Composite.rb (working copy) @@ -29,7 +29,7 @@ res = anObject.testify(new_symtbl.merge!(testify_options)) do |aTest| initialize_test(aTest) raise "nil symtbl" if aTest.symtbl.nil? - block[aTest] if block_given? + block[aTest] if block end @contents << res res Index: lib/uttk/dumpers/BasicColor.rb --- lib/uttk/dumpers/BasicColor.rb (revision 729) +++ lib/uttk/dumpers/BasicColor.rb (working copy) @@ -25,7 +25,7 @@ "<%=color '#{path}', :green %> " + "<%=color '#{node.inspect}', :magenta %> " + "<%=color '#{options.inspect}', :yellow %> " + - "<%=color 'block_given: #{block_given?}', :cyan %>" + "<%=color 'block_given: #{not block.nil?}', :cyan %>" end end # class BasicColor Index: lib/uttk/strategies/Composite/contents_eval.rb --- lib/uttk/strategies/Composite/contents_eval.rb (revision 729) +++ lib/uttk/strategies/Composite/contents_eval.rb (working copy) @@ -14,7 +14,7 @@ def initialize(contents=[], &block) @contents = contents - if block_given? + if block if block.arity == -1 instance_eval(&block) else Index: lib/uttk/logger.rb --- lib/uttk/logger.rb (revision 729) +++ lib/uttk/logger.rb (working copy) @@ -137,11 +137,11 @@ notif :new_node, copy, node, options end rescue Exception => ex - up if block_given? + up if block raise ex end - if block_given? + if block begin block[] ensure @@ -174,7 +174,7 @@ str = key.to_s if str =~ /^(.*)=$/ self[$1.to_sym] = a[0] - elsif block_given? + elsif block begin args = make_log_arguments(str) args += a Index: lib/uttk/strategies/Collection.rb --- lib/uttk/strategies/Collection.rb (revision 729) +++ lib/uttk/strategies/Collection.rb (working copy) @@ -31,7 +31,7 @@ if @attributes.has_key? :contents t.assign_one(:contents, @attributes[:contents], true) end - block[t] if block_given? + block[t] if block @attributes.each do |k,v| t.reject k if t.respond_to? k and t.send(k) == v end Index: lib/uttk/dumpers/Basic.rb --- lib/uttk/dumpers/Basic.rb (revision 729) +++ lib/uttk/dumpers/Basic.rb (working copy) @@ -13,7 +13,7 @@ def update ( *a, &b ) super - @io.puts "NOTIFICATION: #{a.inspect} block_given: #{block_given?}" + @io.puts "NOTIFICATION: #{a.inspect} block_given: #{not block.nil?}" end end # class Basic -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050927/6e649b10/signature-0001.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Tue Sep 27 10:49:56 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Tue, 27 Sep 2005 16:49:56 +0200 (CEST) Subject: [Uttk-Patches] 731: Remove trailing whitespaces. Message-ID: <20050927144956.2254A7C288@smtp.feydakins.org> svn://svn.feydakins.org/ttk/trunk You can also view this changeset here: http://http://dev.uttk.org/repository/changesets/731 Index: ChangeLog from Nicolas Pouillard Remove trailing whitespaces. * lib/uttk/filters/RPathFilter.rb, * lib/uttk/filters/Buffer.rb, * lib/uttk/filters/TextFilter.rb, * lib/uttk/generators/generator.rb, * lib/uttk/generators/templates/strategy.yml, * lib/uttk/weights/Weight.rb, * lib/uttk/strategies/Make.rb, * lib/uttk/strategies/Bootstrap.rb, * lib/uttk/strategies/SqlQuery.rb, * lib/uttk/strategies/Compile.rb, * lib/uttk/strategies/Package.rb, * lib/uttk/strategies/Iterate.rb, * lib/uttk/strategies/Stub.rb, * lib/uttk/strategies/Configure.rb, * lib/uttk/strategies/KillAll.rb, * lib/uttk/strategies/Assert.rb, * lib/uttk/strategies/SignalCmd.rb, * lib/uttk/strategies/PackageCollection.rb, * lib/uttk/strategies/Sleep.rb, * lib/js/uttk.js, * lib/js/css/uttk.css, * test/unit/logger_test.rb, * test/pkg/cmdline.yml, * test/minimal/weight.yml, * test/minimal/rmatch.yml, * test/examples/students-suite.yml, * test/examples/students/stud.yml: Update. strategy.yml | 0 1 files changed Index: lib/uttk/strategies/Sleep.rb Index: test/examples/students/stud.yml Index: test/minimal/rmatch.yml Index: lib/uttk/strategies/SqlQuery.rb Index: lib/uttk/strategies/Bootstrap.rb Index: lib/uttk/filters/TextFilter.rb Index: lib/js/uttk.js Index: lib/uttk/strategies/KillAll.rb Index: lib/uttk/strategies/Stub.rb Index: test/examples/students-suite.yml Index: test/minimal/weight.yml Index: test/pkg/cmdline.yml Index: test/unit/logger_test.rb Index: lib/uttk/generators/generator.rb Index: lib/uttk/strategies/Make.rb Index: lib/uttk/weights/Weight.rb Index: lib/uttk/filters/Buffer.rb Index: lib/uttk/strategies/Compile.rb Index: lib/uttk/strategies/SignalCmd.rb Index: lib/uttk/strategies/Configure.rb Index: lib/uttk/strategies/PackageCollection.rb Index: lib/uttk/strategies/Assert.rb Index: lib/uttk/strategies/Package.rb Index: lib/uttk/filters/RPathFilter.rb Index: lib/js/css/uttk.css Index: lib/uttk/strategies/Iterate.rb Index: lib/uttk/generators/templates/strategy.yml -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050927/5808b2b2/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Tue Sep 27 12:45:26 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Tue, 27 Sep 2005 18:45:26 +0200 Subject: [Uttk-Patches] 730: No more block_given?. In-Reply-To: <20050927142327.360C47C25F@smtp.feydakins.org> References: <20050927142327.360C47C25F@smtp.feydakins.org> Message-ID: <840b875c0509270945273c2546@mail.gmail.com> On 9/27/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/730 > > Index: ChangeLog > from Nicolas Pouillard > > No more block_given?. > > * lib/uttk/dumpers/BasicColor.rb, > * lib/uttk/dumpers/Basic.rb, > * lib/uttk/logger.rb, > * lib/uttk/loaders/Loader.rb, > * lib/uttk/strategies/Composite.rb, > * lib/uttk/strategies/Block.rb, > * lib/uttk/strategies/Collection.rb, > * lib/uttk/strategies/Composite/contents_eval.rb, > * lib/uttk/strategies/Strategy.rb: Apply the block rule. > [...] Ok, thanks. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Tue Sep 27 12:46:20 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Tue, 27 Sep 2005 18:46:20 +0200 Subject: [Uttk-Patches] 729: No trailling whitespaces, no block_given, no block.call. In-Reply-To: <20050927141707.09BA97C25D@smtp.feydakins.org> References: <20050927141707.09BA97C25D@smtp.feydakins.org> Message-ID: <840b875c05092709465189ddb0@mail.gmail.com> On 9/27/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/729 > > Index: ChangeLog > from Nicolas Pouillard > > No trailling whitespaces, no block_given, no block.call. > > * NORM: Add 2 two sub rules for blocks, and the trailling whitespaces rule for > layout. > [...] Ok, thanks. I will add a rule to prohibit files not ended by a newline. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Tue Sep 27 12:46:38 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Tue, 27 Sep 2005 18:46:38 +0200 Subject: [Uttk-Patches] 731: Remove trailing whitespaces. In-Reply-To: <20050927144956.2254A7C288@smtp.feydakins.org> References: <20050927144956.2254A7C288@smtp.feydakins.org> Message-ID: <840b875c05092709463e15e1@mail.gmail.com> On 9/27/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ttk/trunk > > You can also view this changeset here: > > http://http://dev.uttk.org/repository/changesets/731 > > Index: ChangeLog > from Nicolas Pouillard > > Remove trailing whitespaces. > > * lib/uttk/filters/RPathFilter.rb, > * lib/uttk/filters/Buffer.rb, > * lib/uttk/filters/TextFilter.rb, > * lib/uttk/generators/generator.rb, > * lib/uttk/generators/templates/strategy.yml, > * lib/uttk/weights/Weight.rb, > * lib/uttk/strategies/Make.rb, > * lib/uttk/strategies/Bootstrap.rb, > * lib/uttk/strategies/SqlQuery.rb, > * lib/uttk/strategies/Compile.rb, > * lib/uttk/strategies/Package.rb, > * lib/uttk/strategies/Iterate.rb, > * lib/uttk/strategies/Stub.rb, > * lib/uttk/strategies/Configure.rb, > * lib/uttk/strategies/KillAll.rb, > * lib/uttk/strategies/Assert.rb, > * lib/uttk/strategies/SignalCmd.rb, > * lib/uttk/strategies/PackageCollection.rb, > * lib/uttk/strategies/Sleep.rb, > * lib/js/uttk.js, > * lib/js/css/uttk.css, > * test/unit/logger_test.rb, > * test/pkg/cmdline.yml, > * test/minimal/weight.yml, > * test/minimal/rmatch.yml, > * test/examples/students-suite.yml, > * test/examples/students/stud.yml: Update. > [...] Ok. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Thu Sep 29 17:16:03 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Thu, 29 Sep 2005 23:16:03 +0200 (CEST) Subject: [Uttk-Patches] [ruby_ex] 375: Add an header option to Sendmail. Message-ID: <20050929211603.628347A7A7@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Add an header option to Sendmail. * lib/sendmail.rb: With this option you can easily add your fields to the header. sendmail.rb | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: lib/sendmail.rb --- lib/sendmail.rb (revision 374) +++ lib/sendmail.rb (working copy) @@ -23,6 +23,7 @@ :from => email, :to => [], :server => ENV['SMTPSERVER'] || 'localhost:25', + :header => {}, :body => STDIN ) string_args, hash_args = args.partition { |x| x.is_a?(String) } @@ -59,6 +60,9 @@ opts.on('--comment STRING', 'Choose a comment for GPG') do |aComment| options.comment = aComment end + opts.on('--header STRING', 'Add some header fields (Yaml syntax)') do |s| + options.header = YAML.load(s) + end opts.on('-m', '--[no-]mime', 'Choose the mime protocole') do |mime| options.mime = mime end @@ -107,7 +111,7 @@ |Send a mail, with this subject: #{opts.subject} | to #{opts.to.join(', ')} | from #{opts.from_name} - | #{(opts.signed.nil?)? 'not signed !' : 'signed by ' + opts.from} + | #{(opts.signed)? 'signed by ' + opts.from : 'not signed !'} |Are you sure? (y/n)].head_cut! raise 'Aborting' unless HighLine.new.agree question, true end @@ -118,6 +122,9 @@ f.print %Q[From: #{opts.from_name} |Subject: #{opts.subject} |To: #{opts.to.join(', ')}\n].head_cut! + opts.header.each do |k, v| + f.puts "#{k}: #{v}" + end if opts.signed TempPath.new do |mail_body| mail_body.open('w') do |out| -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050929/63e86a85/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Thu Sep 29 17:15:28 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Thu, 29 Sep 2005 23:15:28 +0200 (CEST) Subject: [Uttk-Patches] [ruby_ex] 374: Two fixes in Commands. Message-ID: <20050929211528.AC3327C60A@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Two fixes in Commands. * lib/commands/runners/fork.rb: Clean TempPath before exec. * lib/commands/runners/runner.rb: Flush outputs, after reopen. fork.rb | 6 +++++- runner.rb | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) Index: lib/commands/runners/fork.rb --- lib/commands/runners/fork.rb (revision 373) +++ lib/commands/runners/fork.rb (working copy) @@ -30,7 +30,7 @@ def run_impl ( aCommand, data ) data.pid = Kernel.fork do begin - TempPath.fork_init + TempPath.fork_init true hook_trigger :son, aCommand, data super rescue Exception => ex @@ -74,6 +74,10 @@ self end + def before_exec ( command, data ) + TempPath.clean + end + end # class Fork Index: lib/commands/runners/runner.rb --- lib/commands/runners/runner.rb (revision 373) +++ lib/commands/runners/runner.rb (working copy) @@ -85,6 +85,8 @@ STDIN.reopen(data.input.to_io_for_commands) unless data.input.nil? STDOUT.reopen(data.output.to_io_for_commands) unless data.output.nil? STDERR.reopen(data.error.to_io_for_commands) unless data.error.nil? + STDOUT.flush + STDERR.flush hook_trigger :before_chdir, data Dir.chdir(aCommand.dir) unless aCommand.dir.nil? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050929/fddbcd19/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Thu Sep 29 17:46:37 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Thu, 29 Sep 2005 23:46:37 +0200 (CEST) Subject: [Uttk-Patches] [ruby_ex] 376: Rename resources to fixtures. Message-ID: <20050929214637.AB0427C615@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Rename resources to fixtures. * test/functional: New. * test/resources: Rename to ... * test/fixtures: ... this. * test/fixtures/my_diff.patch: New. * lib/sym_tbl_gsub.rb, * lib/md5sum.rb, * lib/file_type.rb, * lib/cache.rb, * lib/module/autoload_tree.rb: Update. lib/cache.rb | 2 lib/file_type.rb | 2 lib/md5sum.rb | 2 lib/module/autoload_tree.rb | 2 lib/sym_tbl_gsub.rb | 12 +-- test/fixtures/my_diff.patch | 164 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 174 insertions(+), 10 deletions(-) Index: test/fixtures/my_diff.patch --- test/fixtures/my_diff.patch (revision 0) +++ test/fixtures/my_diff.patch (revision 0) @@ -0,0 +1,164 @@ +Index: core_ex/lib/core_ex.rb +=================================================================== +--- core_ex/lib/core_ex.rb (revision 361) ++++ core_ex/lib/core_ex.rb (working copy) +@@ -3,6 +3,17 @@ + # License:: Gnu General Public License. + # Revision:: $Id$ + ++min_release = "1.8.2 (2004-12-25)" ++ruby_release = "#{RUBY_VERSION} (#{RUBY_RELEASE_DATE})" ++if ruby_release < min_release ++ abort <<-end_message ++ ++ CoreEx requires Ruby version #{min_release} or later. ++ You're running #{ruby_release}; please upgrade to continue. ++ ++ end_message ++end ++ + unless defined? CORE_EX_LOADED and CORE_EX_LOADED + CORE_EX_LOADED = true + $LOADED_FEATURES << 'core_ex.rb' unless $LOADED_FEATURES.include? 'core_ex.rb' +Index: core_ex/NEWS +=================================================================== +--- core_ex/NEWS (revision 361) ++++ core_ex/NEWS (working copy) +@@ -53,8 +53,8 @@ + = New in 0.1, 2005-05-31: + + CoreEx is designed to provides a simple but quite useful extension of the +- standard library of Ruby. So some classes and modules like Pathname, Time, +- Enumerable, Exception, FileUtils, String, and YAML are extended. There is ++ standard library of Ruby. Thus some classes and modules like Pathname, Time, ++ Enumerable, Exception, FileUtils, String, and YAML are extended. There are + also some new features like attr_once, DTime, TempPath, Version, + embedded_tests, filelist (almost from rake), a common Rakefile, and an + extension of the require system. +Index: core_ex/README +=================================================================== +--- core_ex/README (revision 361) ++++ core_ex/README (working copy) +@@ -1,7 +1,7 @@ + CoreEx is designed to provides a simple but quite useful extension of the +-standard library of Ruby. So some classes and modules like Pathname, ++standard library of Ruby. Thus some classes and modules like Pathname, + Enumerable, Exception, FileUtils, String, YAML, Module, Class and Object are +-extended. There is also some new features like DTime, TempPath, Version, +-embedded_tests, FileList (almost from rake), a common Rakefile. ++extended. There are also some new features like DTime, TempPath, Version, ++embedded_tests, FileList (almost from rake), and a common Rakefile. + + Coming Soon. +Index: lib/commands.rb +=================================================================== +--- lib/commands.rb (revision 361) ++++ lib/commands.rb (working copy) +@@ -12,6 +12,24 @@ + require 'commands/runners' + + ++# Provides an object oriented way to manage, combine and run your commands. ++# ++# Example: ++# require 'rubygems' ; require_gem 'ruby_ex' ; require 'ruby_ex' ++# Commands.import! ++# ls, wc, out = 'ls'.to_cmd, 'wc'.to_cmd, 'out'.to_path ++# ++# data = ls.system # other runners exist (exec, fork, sh...) ++# ++# p data.status ++# puts data.output.read ++# ++# (ls > STDOUT).system ++# ++# cmd = ls['*.rb'] | wc['-l'] > out ++# cmd.system ++# ++# puts out.read + module Commands + + autoloaded_module(__FILE__, false) +Index: lib/ruby_ex.rb +=================================================================== +--- lib/ruby_ex.rb (revision 361) ++++ lib/ruby_ex.rb (working copy) +@@ -35,7 +35,7 @@ + + + unless defined? CoreEx +- file = Pathname.glob("#{dir}/../{core_ex/lib/core_ex,vendor/core_ex*/core_ex}").first ++ file = Pathname.glob("#{dir}/../{core_ex/lib/core_ex,vendor/core_ex*/lib/core_ex}").first + if file.nil? + require 'rubygems' + require_gem 'core_ex' +Index: NEWS +=================================================================== +--- NEWS (revision 361) ++++ NEWS (working copy) +@@ -1,14 +1,12 @@ + = New in 0.2, 2005-09-16: + +- * Many many changes and new things for RubyEx. +- +- * Remove many requires which are now useless, many are not yet ++ * Remove many requires which are now useless; many are not yet + suppressed. + +- * Renaming to follow the camelize/underscore convention. ++ * Rename classes and modules to follow the camelize/underscore convention. + + * Commands: +- Provides a object oriented way to manage, combine and run your commands. ++ Provides an object oriented way to manage, combine and run your commands. + + Example: + require 'rubygems' ; require_gem 'ruby_ex' ; require 'ruby_ex' +@@ -21,13 +19,13 @@ + puts data.output.read + + (ls > STDOUT).system +- ++ + cmd = ls['*.rb'] | wc['-l'] > out + cmd.system + + puts out.read + +- * RPath: Add RPath, a basic (but powerful) way to search your ruby data. ++ * RPath: Add RPath, a simple way to search your ruby data. + + * BlankSlate, Mocks, VerboseObject, and AutoObject: + +@@ -40,7 +38,7 @@ + - VerboseObject: Proxies that display received method calls and verbosify + objects recursivly. + - AutoObject: It's like a verbose object without a real object inside. +- ++ + * Text: + A little text manipulation class. + Transformation available are: +@@ -57,19 +55,19 @@ + - Add many unit tests. + - Add gem filetype support (with the install method). + +- * MetaFactory: A class that help to produce objects that ++ * MetaFactory: A class that help to produce objects which + share the same initializion step. + + * Html encode: Support accent encoding for the iso latin1 charset. + +- * URI: Support for Mysql and Pgsql. ++ * URI: Support for MySQL and PgSQL. + + * HashEval: + Provides a block in which methods name are keys and arguments/blocks + are values. + + * SymTbl (Symbol Table): +- Add symtbl_gsub methods to provide a global substitution sheme over any ++ Add symtbl_gsub methods which provide a global substitution sheme over any + objects. + + = New in 0.1, 2005-05-31: Index: lib/file_type.rb --- lib/file_type.rb (revision 375) +++ lib/file_type.rb (working copy) @@ -353,7 +353,7 @@ puts "#@tmp/foo/bar/baz\n#@tmp/foo\n#@tmp/foo/f/f/foo/baz" end FileType::Generic.runner = @mr - @fixtures = __FILE__.to_path.dirname.parent + 'test/resources' + @fixtures = __FILE__.to_path.dirname.parent + 'test/fixtures' end def assert_guess ( type, *files ) Index: lib/sym_tbl_gsub.rb --- lib/sym_tbl_gsub.rb (revision 375) +++ lib/sym_tbl_gsub.rb (working copy) @@ -226,9 +226,9 @@ end def test_pathlist pathlist = ['<>', '<>'.to_path] - ls1 = '<>/../test'.to_path + 'resources/autoload_tree/*.rb' - ls2 = '<>/../test'.to_path + 'resources/autoload_tree/*.rb' - ls3 = '<>'.to_path + 'resources/foo.{tar*,bz*}' + ls1 = '<>/../test'.to_path + 'fixtures/autoload_tree/*.rb' + ls2 = '<>/../test'.to_path + 'fixtures/autoload_tree/*.rb' + ls3 = '<>'.to_path + 'fixtures/foo.{tar*,bz*}' pathlist << ls2 << ls1 << ls3 my = PathList[pathlist].symtbl_gsub(@s).map! { |x| x.basename } my.all? { |x| assert_kind_of(Pathname, x) } @@ -237,9 +237,9 @@ end def test_pathlist_keep_pending pathlist = ['<>', '<>'.to_path] - pathlist << '<>/../test'.to_path + 'resources/autoload_tree/*.rb' - pathlist << '<>/../test'.to_path + 'resources/autoload_tree/*.rb' - pathlist << '<>'.to_path + 'resources/foo.{tar*,bz*}' + pathlist << '<>/../test'.to_path + 'fixtures/autoload_tree/*.rb' + pathlist << '<>/../test'.to_path + 'fixtures/autoload_tree/*.rb' + pathlist << '<>'.to_path + 'fixtures/foo.{tar*,bz*}' pathlist = PathList[pathlist] assert_equal(['<>'.to_path, '<>'.to_path], pathlist) my = pathlist.symtbl_gsub(@s).map! { |x| x.basename } Index: lib/module/autoload_tree.rb --- lib/module/autoload_tree.rb (revision 375) +++ lib/module/autoload_tree.rb (working copy) @@ -42,7 +42,7 @@ class AutoloadTreeTest < Test::Unit::TestCase - REPO_DIR = __FILE__.to_path.dirname.parent.parent + 'test/resources/autoload_tree' + REPO_DIR = __FILE__.to_path.dirname.parent.parent + 'test/fixtures/autoload_tree' module AutoloadTree; end Index: lib/cache.rb --- lib/cache.rb (revision 375) +++ lib/cache.rb (working copy) @@ -215,7 +215,7 @@ assert(! cache.present?('foo')) # FIXME man printf + Tempfile + File::md5sum - # resources/foo.txt + TempPath + Path#md5sum + # fixtures/foo.txt + TempPath + Path#md5sum tmp_file = Tempfile.new('cache') system("man printf > #{tmp_file.path} 2> /dev/null") md5 = File.md5sum(tmp_file.path) Index: lib/md5sum.rb --- lib/md5sum.rb (revision 375) +++ lib/md5sum.rb (working copy) @@ -50,7 +50,7 @@ class MD5SumTest < Test::Unit::TestCase def setup - @source = __FILE__.to_path.dirname.parent + 'test/resources/foo.txt' + @source = __FILE__.to_path.dirname.parent + 'test/fixtures/foo.txt' @ref = '9508b4f53cff19cf42c5a0f0fc127602' end -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050929/8fe5bff2/signature-0001.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Thu Sep 29 17:49:22 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Thu, 29 Sep 2005 23:49:22 +0200 (CEST) Subject: [Uttk-Patches] [ruby_ex] 377: Rename TTK to Uttk. Message-ID: <20050929214922.A42F47C60A@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Rename TTK to Uttk. * test/check-pkg-ruby_ex.yml, vcs/vcs_ruby_ex.rb: Update. test/check-pkg-ruby_ex.yml | 2 +- vcs/vcs_ruby_ex.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: test/check-pkg-ruby_ex.yml --- test/check-pkg-ruby_ex.yml (revision 376) +++ test/check-pkg-ruby_ex.yml (working copy) @@ -1,6 +1,6 @@ --- -# Run this suite with -S 'url: scheme://the/url/to/the/ttk/package' +# Run this suite with -S 'url: scheme://the/url/to/the/ruby_ex/package' RubyEx Package Test Suite: !S::Suite contents: Index: vcs/vcs_ruby_ex.rb --- vcs/vcs_ruby_ex.rb (revision 376) +++ vcs/vcs_ruby_ex.rb (working copy) @@ -10,7 +10,7 @@ def ruby_ex_commit! ( *args ) common_commit!('[ruby_ex] <%= rev %>: <%= title %>', *args) do |subject| - mail!(:to => ['ttk-patches at lists.feydakins.org'], :subject => subject) + mail!(:to => ['uttk-patches at lists.feydakins.org'], :subject => subject) end end -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050929/96b68093/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Thu Sep 29 17:56:11 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Thu, 29 Sep 2005 23:56:11 +0200 (CEST) Subject: [Uttk-Patches] [core_ex] 378: Rename TTK to Uttk. Message-ID: <20050929215611.BFFA87C649@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk/core_ex Index: ChangeLog from Nicolas Pouillard Rename TTK to Uttk. * lib/core_ex.rb: Raise a LoadError if rubygems cannot be really loaded. * test/check-pkg-core_ex.yml, * lib/core_ex/rakefile_base.rf, * vcs/vcs_core_ex.rb: Renaming. lib/core_ex.rb | 1 + lib/core_ex/rakefile_base.rf | 20 ++++++++++---------- test/check-pkg-core_ex.yml | 2 +- vcs/vcs_core_ex.rb | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) Index: vcs/vcs_core_ex.rb --- vcs/vcs_core_ex.rb (revision 377) +++ vcs/vcs_core_ex.rb (working copy) @@ -10,7 +10,7 @@ def core_ex_commit! ( *args ) common_commit!('[core_ex] <%= rev %>: <%= title %>', *args) do |subject| - mail!(:to => ['ttk-patches at lists.feydakins.org'], :subject => subject) + mail!(:to => ['uttk-patches at lists.feydakins.org'], :subject => subject) end end Index: test/check-pkg-core_ex.yml --- test/check-pkg-core_ex.yml (revision 377) +++ test/check-pkg-core_ex.yml (working copy) @@ -1,6 +1,6 @@ --- -# Run this suite with -S 'url: scheme://the/url/to/the/ttk/package' +# Run this suite with -S 'url: scheme://the/url/to/the/core_ex/package' CoreEx Package Test Suite: !S::Suite contents: Index: lib/core_ex/rakefile_base.rf --- lib/core_ex/rakefile_base.rf (revision 377) +++ lib/core_ex/rakefile_base.rf (working copy) @@ -83,12 +83,12 @@ end -# desc 'Setup the ttk command' -task :ttk => [ :spec, :ruby_ex ] do - require_gem('ttk', SPEC.ttk_version || '~> 0.3.0') - require 'ttk' +# desc 'Setup the uttk command' +task :uttk => [ :spec, :ruby_ex ] do + require_gem('uttk', SPEC.uttk_version || '~> 0.3.0') + require 'uttk' Commands.import! - def ttk ( *a, &b ) + def uttk ( *a, &b ) cmd = TTK.bin[*a] cmd.input = b[] if b cmd.output = STDOUT @@ -100,8 +100,8 @@ desc 'Launch all test suites' -task :check => [ :ttk, :spec, :dyn_spec ] do - ttk '-l', 'check-log', '-S', 'url: file://<>', '-C', +task :check => [ :uttk, :spec, :dyn_spec ] do + uttk '-l', 'check-log', '-S', 'url: file://<>', '-C', SPEC.root_test_suite end clean_task :check do @@ -111,13 +111,13 @@ desc 'Check generated packages' -task :distcheck => [ :ttk, :package ] do +task :distcheck => [ :uttk, :package ] do urls = [] Pathname.glob('pkg/*') do |path| next unless path.file? urls << "file://#{path.expand_path}" end - ttk '-l', 'distcheck-log' do %Q[ + uttk '-l', 'distcheck-log' do %Q[ Check generated packages: !S::Iterate over: #{urls.inspect} iter: url @@ -349,7 +349,7 @@ # desc 'Common tasks for a release' task :common_release => [ - :ttk, + :uttk, :vcs, :release_confirm, Index: lib/core_ex.rb --- lib/core_ex.rb (revision 377) +++ lib/core_ex.rb (working copy) @@ -47,6 +47,7 @@ begin require 'rubygems' + raise LoadError, 'RubyGems not loaded' unless defined? RubyGems def core_ex_gem_require ( gem_name, gem_version='> 0' ) require_gem gem_name, gem_version core_ex_debug { [:require_gem, gem_name, gem_version] } -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050929/87cb58b0/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Thu Sep 29 18:04:03 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Fri, 30 Sep 2005 00:04:03 +0200 (CEST) Subject: [Uttk-Patches] [ruby_ex] 379: Add RegexList a class to handle sorting with regular expressions. Message-ID: <20050929220403.414677C60A@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Add RegexList a class to handle sorting with regular expressions. * lib/regex_list.rb: New. Provides RegexList and a PathList extension for ease the PathList sorting. regex_list.rb | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 192 insertions(+) Index: lib/regex_list.rb --- lib/regex_list.rb (revision 0) +++ lib/regex_list.rb (revision 0) @@ -0,0 +1,192 @@ +# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved. +# Author:: Nicolas Pouillard . +# License:: Gnu General Public License. +# Revision:: $Id$ + +class RegexList + + def initialize ( *args ) + @regexps = args.flatten + @regexps.map! { |re| (re.is_a? Regexp)? re : Regexp.new(re) } + @regexps.reverse! + @scores = {} + end + + if ENV['REGEXP_LIST_DEBUG'] + + @@h = HighLine.new + + def score ( aString ) + if @scores.has_key? aString + result = @scores[aString] + action = '<%= color "Hit ", :green %>' + else + result = score_without_cache(aString) + action = '<%= color "Miss", :red %>' + @scores[aString] = result + end + @@h.say "#{action}: #{aString} -> #{result.inspect}" + result + end + + else + + # Perform a cache over +score_without_cache+ + def score ( aString ) + return @scores[aString] if @scores.has_key? aString + return @scores[aString] = score_without_cache(aString) + end + + end + + # Score represent a weighted sum of the match result with each regexp. + # + # 0: Not matched at all + # 1: Just the last regexp matches (the Nth regexp) + # 2: Just the (N - 1)th matches + # 3: The Nth and the (N - 1)th + # 2^(N - 1): Just the first one matches + # + # Formula: + # U(i <- 0 .. N - 1) is a vector with 1 when it matches and 0 otherwise + # Score = U(N - 1) * 2^(N - 1) + U(N - 2) * 2^(N - 2) + ... + U(0) * 2^0 + def score_without_cache ( aString ) + result = 0 + @regexps.each_with_index do |re, i| + result += 2 ** i if aString =~ re + end + return result + end + + def [] ( score ) + @regexps[score] + end + + + module Assertions + attr_accessor :regex_list + def assert_regex_list_score ( input, ref, cache=true ) + if cache + assert_equal ref, @regex_list.score(input) + else + assert_equal ref, @regex_list.score_without_cache(input) + end + end + end # module Assertions + + + # PathList Extension which gives sorting/filtering features to PathList + module PathListExtension + + def sort_with_regex_list! ( regex_list ) + sort! { |x, y| regex_list.score(y.to_s) <=> regex_list.score(x.to_s) } + end + + def grep_with_regex_list! ( regex_list ) + reject! { |x| regex_list.score(x.to_s).zero? } + sort_with_regex_list! regex_list + end + + def grep_with_negative_regex_list! ( regex_list ) + sort_with_regex_list! regex_list + reverse! + end + + def exclude_with_regex_list! ( regex_list ) + reject! { |x| not regex_list.score(x.to_s).zero? } + self + end + + def self.dup_based_method ( meth ) + define_method(meth) { |regex_list| dup.send(meth.to_s + '!', regex_list) } + end + + dup_based_method :sort_with_regex_list + dup_based_method :grep_with_regex_list + dup_based_method :grep_with_negative_regex_list + dup_based_method :exclude_with_regex_list + + module Assertions + attr_reader :path_list + + RegexList::PathListExtension.instance_methods.each do |meth| + define_method('assert_' + meth.to_s) do |ref, input| + input = RegexList.new(input) unless input.is_a? RegexList + ref = PathList.new(ref) unless ref.is_a? PathList + assert_nothing_raised { @result = @path_list.send(meth, input) } + assert_kind_of(PathList, @result) + assert_equal(ref.stringify, @result.stringify) + end + end + + end # module Assertions + + end # module PathListExtension + +end # class RegexList + +PathList.import! +class PathList + include RegexList::PathListExtension +end + + +test_section __FILE__ do + + class TestRegexList < ::Test::Unit::TestCase + include RegexList::Assertions + + def setup + assert_nothing_raised do + @regex_list = RegexList.new %w[ a/abc b/foo fg kb c/a a/bar f ] + end + end + + def teardown + end + + def test_0_initialize + end + + def test_score_without_cache + assert_regex_list_score 'a', 0 + assert_regex_list_score 'a/abc', 64 + assert_regex_list_score 'kb', 8 + assert_regex_list_score 'f', 1 + assert_regex_list_score 'a/abc/fg', 81 + assert_regex_list_score 'kb/foo', 41 + assert_regex_list_score 'a/abc b/foo fg kb c/a a/bar f', 127 + assert_regex_list_score 'a/abca/abca/abca/abc', 64 + end + + end # class TestRegexList + + + class TestPathListRegexListExtension < ::Test::Unit::TestCase + include RegexList::PathListExtension::Assertions + + def setup + @path_list = PathList.new %w[ a a/b a/c a/bc b/foo fg kb c/a a/bar f ] + end + + def test_sort_with_regex_list + assert_sort_with_regex_list(%w[ f b/foo fg a/bc a/c a/b kb c/a a/bar a ], %w[ f ]) + end + + def test_grep_with_regex_list + assert_grep_with_regex_list(%w[ b/foo fg f ], %w[ f ]) + assert_grep_with_regex_list(%w[ a/b a/bc b/foo kb a/bar ], %w[ b ]) + assert_grep_with_regex_list(%w[ b/foo a/b a/bc a/bar kb fg f ], %w[ b f ]) + end + + def test_grep_with_negative_regex_list + assert_grep_with_negative_regex_list(%w[f a/bar a/b kb a b/foo fg a/bc c/a a/c ], %w[ c ]) + end + + def test_exclude_with_regex_list + assert_exclude_with_regex_list(%w[ a a/b a/c a/bc kb c/a a/bar ], %w[ f ]) + end + + end # class TestPathListRegexListExtension + +end Property changes on: lib/regex_list.rb ___________________________________________________________________ Name: svn:keywords + Id -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050930/1bd56117/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From ertai at lrde.epita.fr Thu Sep 29 18:09:34 2005 From: ertai at lrde.epita.fr (Nicolas Pouillard) Date: Fri, 30 Sep 2005 00:09:34 +0200 (CEST) Subject: [Uttk-Patches] [ruby_ex] 380: Add DiffTool a module for the Diff manipulation. Message-ID: <20050929220934.2D40F7C658@smtp.feydakins.org> svn://svn.feydakins.org/ruby_ex/trunk Index: ChangeLog from Nicolas Pouillard Add DiffTool a module for the Diff manipulation. * lib/diff_tools.rb: New. Provides DiffTools::Diff for set of chunks, DiffTools::Chunk for diffs between just two files, and DiffTools::App a basic command line application. Methods provided are: grep, negative, and exclude. diff_tools.rb | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 141 insertions(+) Index: lib/diff_tools.rb --- lib/diff_tools.rb (revision 0) +++ lib/diff_tools.rb (revision 0) @@ -0,0 +1,141 @@ +# Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved. +# Author:: Nicolas Pouillard . +# License:: Gnu General Public License. +# Revision:: $Id$ + +RegexList.import! + +module DiffTools + + class Diff + + def initialize ( anObject=nil ) + @chunks = {} + @path_list = PathList.new + case anObject + when String + anObject.split(/^Index: /m).each do |chunk| + self << 'Index: ' + chunk unless chunk.empty? + end + when Diff + merge! anObject + when Array + anObject.flatten.each { |chunk| self << chunk } + when NilClass + else + raise TypeError, "Unexpected type #{anObject.class}" + end + end + + def << ( chunk ) + chunk = Chunk.new(chunk) unless chunk.is_a? Chunk + if @path_list.include? chunk.path + raise ArgumentError, "Already have the path `#{chunk.path}'" + end + @chunks[chunk.path] = chunk + @path_list << chunk.path + end + + def [] ( *args ) + grep(*args) + end + + def create ( path_list ) + result = Diff.new + path_list.each do |path| + result << @chunks[path] + end + result + end + protected :create + + def grep ( *args ) + create @path_list.grep_with_regex_list(RegexList.new(args)) + end + + def negative ( *args ) + create @path_list.grep_with_negative_regex_list(RegexList.new(args)) + end + + def exclude ( *args ) + create @path_list.exclude_with_regex_list(RegexList.new(args)) + end + + def to_s + @chunks.values.join + end + + end # class Diff + + + + class Chunk + + attr_reader :path, :contents + + def initialize ( anObject ) + case anObject + when String + @path = anObject[/\AIndex: (.+)$/, 1] + raise ArgumentError, "The path cannot be empty (#{anObject})" if @path.nil? or @path.empty? + @contents = anObject + else + raise TypeError, "Unexpected type #{anObject.class}" + end + end + + def to_s + @contents + end + + def inspect + "#<#{self.class}: Index: #@path>" + end + + end # class Chunk + + + + class App + def initialize ( stdin, stdout, stderr, argv ) + gre, neg, exc = [], [], [] + argv.each do |arg| + case arg + when /^(.*)!$/ then exc << $1 + when /^(.*)-$/ then neg << $1 + else gre << arg + end + end + stdout.puts Diff.new(stdin.read).exclude(exc).negative(neg).grep(gre) + end + end # class App + +end # module DiffTools + + +DiffTools::App.new(STDIN, STDOUT, STDERR, ARGV) if $0 == __FILE__ + + +test_section __FILE__ do + + class TestDiffTools < ::Test::Unit::TestCase + + def setup + @fixtures = 'test'.to_path/'fixtures' + @my_diff = @fixtures/'my_diff.patch' + @output_diff = TempPath.new('output_diff.patch') + # @output_diff = '/tmp/output_diff.patch'.to_path + end + + def teardown + end + + def test_example + diff = DiffTools::Diff.new(@my_diff.read) + sorted = diff[/NEWS/, /^[^.]*$/, /core_ex/, /ruby_ex/, //] + @output_diff.open('w') { |f| f.puts sorted.to_s } + end + + end # class TestDiffTools + +end Property changes on: lib/diff_tools.rb ___________________________________________________________________ Name: svn:keywords + Id -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/ttk-patches/attachments/20050930/75306c1b/signature.bin -------------- next part -------------- _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Thu Sep 29 17:59:04 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Thu, 29 Sep 2005 23:59:04 +0200 Subject: [Uttk-Patches] [ruby_ex] 377: Rename TTK to Uttk. In-Reply-To: <20050929214922.A42F47C60A@smtp.feydakins.org> References: <20050929214922.A42F47C60A@smtp.feydakins.org> Message-ID: <840b875c05092914594a13cdf2@mail.gmail.com> On 9/29/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk > > Index: ChangeLog > from Nicolas Pouillard > > Rename TTK to Uttk. > > * test/check-pkg-ruby_ex.yml, vcs/vcs_ruby_ex.rb: Update. > [...] Ok. thx. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches From nicolas.despres at gmail.com Thu Sep 29 17:59:52 2005 From: nicolas.despres at gmail.com (=?ISO-8859-1?Q?Nicolas_Despr=E8s?=) Date: Thu, 29 Sep 2005 23:59:52 +0200 Subject: [Uttk-Patches] [core_ex] 378: Rename TTK to Uttk. In-Reply-To: <20050929215611.BFFA87C649@smtp.feydakins.org> References: <20050929215611.BFFA87C649@smtp.feydakins.org> Message-ID: <840b875c0509291459795ed69@mail.gmail.com> On 9/29/05, Nicolas Pouillard wrote: > > svn://svn.feydakins.org/ruby_ex/trunk/core_ex > > Index: ChangeLog > from Nicolas Pouillard > > Rename TTK to Uttk. > > * lib/core_ex.rb: Raise a LoadError if rubygems cannot be really loaded. > > * test/check-pkg-core_ex.yml, > * lib/core_ex/rakefile_base.rf, > * vcs/vcs_core_ex.rb: Renaming. > [...] Ok. -- Nicolas Despr?s _______________________________________________ Uttk-Patches mailing list Uttk-Patches at lists.feydakins.org http://mailman.feydakins.org/mailman/listinfo/uttk-patches