[#389624] Good GUI for buisness focused application — Jaxxa <jaxxa90@...>
What would be a good Graphical User interface for use with a buisness
[#389628] how to make interface explicit with Hash stores? — Reginald Tan <redge.tan@...>
I have a class that uses hash as its internal store. What's a good way
[#389643] Ruby and Telnet — "Leo M." <leo.mmcm@...>
Hello!
[#389648] Sort order dilemma — Wayne Brissette <waynefb@...>
I've got a array that I need sorted in a certain way and I'm struggling to figure out how to make it happen the way I want.
[#389671] Importing Ruby-Lang into Xcode — "Dustin E." <dustyeike@...>
How do i Import an Existing Non-Xcode Project Into Xcode, specifically
On Wed, Nov 2, 2011 at 7:14 PM, Dustin E. <dustyeike@gmail.com> wrote:
In Xcode4, none that i see. There's import files to an existing project
[#389699] Setting systems date and time - Windows — Saul Glass <quati10@...>
Hi Guys,
[#389721] 'require' problem — Kaye Ng <sbstn26@...>
Hi guys!
you need
If you're not on 1.9.2 and don't have require_relative, I believe this
> Sam Rose wrote in post #1030126:
Hi guys! Yes, I'm using 1.9.2 .
[#389732] arcadia editor 0.11.0 released — Antonio Galeone <antonio.galeone@...>
Hi,
[#389733] What happens in dual sorts with nil values? — Wayne Brissette <waynefb@...>
I've put together an array that has a map. I did this so I could do some multi-level sorting of data. For example, if I had a map with:
[#389739] Ruby Challenge — teresa nuagen <unguyen90@...>
Here is a ruby challenge for all you computer science lovers out there,
Totally unrelated to any husker computer science programs right? Like
Jonan S. wrote in post #1030330:
> You mean like the professor for the course? Because that would be me .
On Wed, Nov 9, 2011 at 4:52 AM, aseret nuagen <unguyen90@aim.com> wrote:
Come on. Let's not be so harsh. If truth is being told, then this girl has
On Wed, Nov 9, 2011 at 22:08, Ryan Davis <ryand-ruby@zenspider.com> wrote:
[#389755] Are there two kinds of 'require' ? — Kaye Ng <sbstn26@...>
I'm reading a tutorial and it has an example like this"
[#389760] ANSI v1.4.0 released — transfire@...
ANSI 1.4.0 has been released.
Alternatively you can use isna which has simpler approach.
[#389770] need spome help please :) — "marcin k." <doreklamster@...>
Hello :)
[#389772] ruby instance inside Textmate bundle — Matthew Johnson <musical.matthew@...>
This is probably a pretty unusual request, but I'd like to create a
http://beginrescueend.com/rvm/install/
C. Zona wrote in post #1030343:
[#389792] Tricky DSL, how to do it? — Intransition <transfire@...>
I'd want to write a DSL such that a surface method_missing catches
You are missing a `super` on the method_missing. first you should ask if is
> Any ideas?
[#389803] Good debugging mechanism — Uma Mahesh <umamahesh_nyros@...>
Hi,
[#389804] best IDE — Uma Mahesh <umamahesh_nyros@...>
Hi,
I think it is better to use a very easy editor, like bluefish, and
[#389816] scite - F5 command not working for code execution — Piotr Swoboda <piotr.swoboda1@...>
I am learning Ruby from scratch using a beginner's tutorial. I have
[#389817] How to include a function from a different file in a module — "Andreas L." <andreas.lundgren@...>
Hi!
[#389824] Confection v0.0.1 released — transfire@...
Confection 0.0.1 has been released.
On Tue, Nov 08, 2011 at 02:26:31AM +0900, transfire@gmail.com wrote:
[#389826] Ruby OpenSSL: Why valid TLS certs are not detected? — Iñaki Baz Castillo <ibc@...>
Hi, I'm playing with Ruby OpenSSL in order to validate certificates.
One thing to note is that the github.com cert you've provided isn't
2011/11/7 John Downey <jdowney@gmail.com>:
[#389845] minitest-debugger 1.0.0 Released — Ryan Davis <ryand-ruby@...>
minitest-debugger version 1.0.0 has been released!
[#389857] ruby encryption & decryption using rsa — varma potthuri <pothuri_satish@...>
Concept: I want to encrypt a string(hello) should give say xxx(private
[#389858] Compiling Ruby Inline C code - resolving errors — Martin Hansen <mail@...>
I am trying to get this Ruby inline C code http://pastie.org/2825882 to
I was in doubt whether to use:
[#389861] About the main RubyGems application, gem — Kaye Ng <sbstn26@...>
Hi!
[#389868] Understanding the use of double pipes in Ruby — Fily Salas <fs_tigre@...>
Hi,
[#389879] Getting certain characters from a string — Reese Chappuis <c0dege3k@...>
I have a string that I need to get certain characters at a given index.
[#389895] Parsing data with ruby — Ronald Craft <admin@...>
Hiya,
[#389928] Forming a Ruby meetup group... — "Darryl L. Pierce" <mcpierce@...>
Where I work we have a local Ruby group that used to meet up, until the
One thing you can do is take some of the more interesting questions asked
[#389929] Can't get "or" or "||" to work. — james gallagher <lollyproductions@...>
Hi. I have a stupid question.
[#389938] How can I overwrite class variables — Fily Salas <fs_tigre@...>
Hi,
[#389950] The faster way to read files — "Noé Alejandro" <casanejo@...>
Does anybody know which is the fastest way to read a file? Lets say
Sequentially... The point is that I need to process each pair of files,
I mean, the final processing is about compare (preprocessed) content of
2011/11/11 NoAlejandro <casanejo@gmail.com>:
On Fri, Nov 11, 2011 at 10:07 PM, Ryan Davis <ryand-ruby@zenspider.com> wrote:
[#389964] Strings are not equal — "Mike S." <antsinyourpants128@...>
I am testing two strings to see if they are equal.
[#389966] Argument error --- How to solve? — Ar Ik <arsi.ikonen@...>
I´m at the very beginning with Ruby and give again and again this error
[#389968] Ruby script for creating TLS certificates — Iñaki Baz Castillo <ibc@...>
Hi, I've coded a Ruby script that creates autosigned TLS certificates
You actually send them what is called a certificate signing request (CSR).
2011/11/9 John Downey <jdowney@gmail.com>:
[#389993] Dividing a gem into 2 or 3 gems — Rahul Kumar <sentinel1879@...>
I have a gem that has been growing for a while (e.g. mygem). There's a
[#389994] How to kill an exist tcpserver or tcpsocket? — Fengfeng Li <lifengfeng@...>
Hi everyone,
[#390006] Navigating through the official Ruby documentation — Fily Salas <fs_tigre@...>
Hi,
[#390016] ruby is scripting language — "Harish M." <erharish43.malik@...>
Hello!
[#390021] How Am I to Understand This Class Behavior? — "Nik Z." <esperantoca@...>
Hi, Gurus,
[#390037] Reading CSV File — "Darren H." <dhulem1@...>
Hi all
[#390040] can't find/uninstall installed gems — Neubyr Neubyr <neubyr@...>
I am having some issues while trying to uninstall a gem. I am using Mac
[#390043] Hashery v1.5.0 released — transfire@...
Hashery 1.5.0 has been released.
[#390049] To convert a Ruby tk script to *.exe — "Manju M." <manjuvpm12@...>
Hi,
[#390059] Beginner: how to use gedcom parser — François Boone <francois.boone@...>
Hi,
[#390060] Windows Repository — Mario Ruiz <tcblues@...>
This is my situation. I have one machine called mygemserver and I've
I don't know much about Gem hosting, but don't you need a gem server to do
[#390061] windows pry editor setup — Kevin <darkintent@...>
Does anyone know the correct way to configure Pry's editor variable on
[#390064] referring to version numbers in a gem — Chad Perrin <code@...>
How do I specify and access a gem's version number within the code of the
On 11/11/2011 14:28, Chad Perrin wrote:
On Sat, Nov 12, 2011 at 05:28:15AM +0900, Chad Perrin wrote:
Keep the data where ever you want, Rubygems has tossed the FHS out the
[#390080] calculating the prime factors of a very large number — Ja xv <jeniferjblack@...>
question:
[#390093] Share stories about using Ruby outside of pet projects — Kevin <darkintent@...>
I recently decided to take another stab at Clojure and came across
On 12/11/11 08:21 , Kevin wrote:
[#390104] Using Ruby to install/manage something from source - Features? — Marc Heiler <shevegen@...>
Hi,
[#390105] Advanced Ruby: Eval over multiple Bindings? — Intransition <transfire@...>
This is an extremely advanced Ruby question. Given:
-----BEGIN PGP SIGNED MESSAGE-----
On Saturday, November 12, 2011 4:10:09 PM UTC-5, Quintus wrote:
[#390110] Syntax Error — "Darren H." <dhulem1@...>
Hi All,
[#390121] Using gets and split — Reese Chappuis <c0dege3k@...>
I'm working on a challenge that tells me that the input is given at the
hi Reese,
Ok, that does work- so the problem is with how the data is being inputted,
[#390140] model "lift-passengers" and concurrent programming — Roman Faceless <ya1krabe@...>
Hi,
[#390143] How to use csv files in ruby — Mrin alini <m.mrinali@...>
I am able to write parts of the code but I am not able to join the code
[#390153] Binding#with — Intransition <transfire@...>
Binding#with
On Sun, Nov 13, 2011 at 8:30 PM, Intransition <transfire@gmail.com> wrote:
[#390162] Noob question regarding custom method — Junayeed Ahnaf Nirjhor <zombiegenerator@...>
Hello,
"setter" methods that have "set" in the name are far more idiomatic of
On Mon, Nov 14, 2011 at 1:29 PM, Sam Rose <samwho@lbak.co.uk> wrote:
[#390163] Exclamation marks in method names — Sylvester Keil <sylvester.keil@...>
Dear all,
[#390173] cant install ruby using rvm on osx lion — "Tomas R." <jtomasrl@...>
% Total % Received % Xferd Average Speed Time Time Time
[#390184] Binding#self — Intransition <transfire@...>
Hi,
[#390193] Ruby for Windows — Jim Wood <info@...>
I'm interested in Ruby for Windows.
[#390196] Autocompletion of commands & arguments — Sophie <itsme213@...>
I want to build a Ruby app with the following broad properties
[#390197] search through a csv file — Aksh Akku <akshathakshu@...>
i have a person details csv file. I am trying to write a code to search
[#390204] Logical operator || — "Damián M. González" <gonzalezdamianm@...>
Ey guys. Look at this:
[#390209] Regex to divide document into sections? — Intransition <transfire@...>
Any expert regexp wrangler around here. I can't quite find a way to split a
Hi,
The actual content shouldn't really matter. Sorry, I should have been more
[#390219] Certificate ssl and encrypt... — Diego Soreira <diegosoreira@...>
Hi,
[#390220] SSH hangs for 30 sec on AIX — Claus Folke Brobak <cfb@...>
Environment:
[#390222] Literate programming and Ruby — Michael Sokol <mikaa123@...>
Hey there,
[#390238] RVM problem, plz help — Misha Ognev <b1368810@...>
Hi, I have this problem:
[#390241] Ruby, How Do I Love Thee? Let Me Count the Ways... — "Aaron D. Gifford" <astounding@...>
I just have to say that Ruby is very, very convenient.
[#390242] Speedup Ruby 1.9.3 on Windows a lot — Jarmo Pertman <jarmo.p@...>
Hello!
On Thu, Nov 17, 2011 at 12:06 AM, Jarmo Pertman <jarmo.p@gmail.com> wrote:
[#390257] Help a newbie-The page isn't redirecting properly — Linda Fay <lfay@...>
With good intention I was helping someone with a ruby site but now I've
[#390261] Possible to run Ruby on Apache Tomcat server? — Rm Mz <ruthmizzi@...>
This might be a bit of an unusual set up but I'd like to have Java
[#390279] Problem on hash with default value — "Florent G." <florent2@...>
Hi,
[#390295] WIN32OLE return type USERDEFINED — Dominic Sisneros <dsisnero@...>
I am trying to use WIN32OLE to automate Microstation
Hello
Try the following.
Hello,
> Ooops, sorry.
Hello,
2011/11/19 Masaki Suketa <masaki.suketa@nifty.ne.jp>
[#390303] Problem with action — pololo pololo <ulybkii@...>
Hi,
[#390306] Ruby-GNOME2 moves to GitHub — Kouhei Sutou <kou@...>
Hi!
[#390308] any command line tools for querying yaml files — Rahul Kumar <sentinel1879@...>
(Sorry, this is not exactly a ruby question).
On Fri, Nov 18, 2011 at 3:58 PM, Dave Baldwin <dave.baldwin@3dlabs.com> wrote:
[#390309] www.ruby-lang.org is back — Shugo Maeda <shugo@...>
Hello,
Thanks, i was trying it to find out which the latest 1.9.3 release is
On Fri, Nov 18, 2011 at 10:48:29PM +0900, R. Kumar wrote:
[#390328] Anyone know of free Ruby on Rails hosting for registered charities? — Mike Bethany <mikbe.tk@...>
I'm doing some volunteer web development for a Florida veteran's
[#390338] Newbie - cmd question — Otto Dydakt <ottodydakt@...>
I've literally JUST downloaded ruby from rubyinstaller.org.
OK thank you, I uninstalled & reinstalled, checking the three boxes at
did you type "irb" first to bring up the ruby command prompt?
Hi all,
Hussain A. wrote in post #1036281:
> There is an option in the installer to make Ruby and other Ruby provided
Hussain A. wrote in post #1036449:
> Are you talking about a fresh command prompt *after* you installed?
Hussain A. wrote in post #1036509:
> So C:\Ruby193\bin *is* in the PATH.
[#390365] How to run a program (Newbie) — Otto Dydakt <ottodydakt@...>
Another newbie question here:
[#390374] Principle of Best Principles — Intransition <transfire@...>
I seem to run into a couple of design issue a lot and I never know what is
On Sun, Nov 20, 2011 at 8:42 PM, Intransition <transfire@gmail.com> wrote:
As it turns out you (and others) are pretty spot on, though I'm not sure
[#390396] how to call Function argument into another ruby script. — hari mahesh <harismahesh@...>
Consider I have a ruby file called library.rb.
On Mon, Nov 21, 2011 at 6:55 PM, hari mahesh <harismahesh@gmail.com> wrote:
[#390425] run an script without waiting to be done — Mario Ruiz <tcblues@...>
Hi, I would like to know if it is possible to run an script without
On 11/22/2011 07:39 AM, Mario Ruiz wrote:
[#390442] Create Excel Sheet(.xls/.xlsx) — Mamba Black <micky.tour@...>
Hi,
[#390446] Newbie: Calling dll functions from Ruby for a customer dll — "Omran N." <omran_nazir@...>
Hello,
An example of calling a method would then be:
[#390449] private and protected — Николай <godsent@...>
Could anybody explain me this, please?
[#390458] need help with gsub a string — skolo pen <skolopen@...>
Lacking in regular expressions knowledge, I am having difficulty
[#390465] url normalization — rubix Rubix <aggouni2002@...>
Hi,
[#390474] NOKIGIRI XPATH — Ruby Mania <prateek123@...>
I have a long XML like below .. I wish to select DATA ("cdef" in this
On Thu, Nov 24, 2011 at 9:43 AM, Ruby Mania <prateek123@gmail.com> wrote:
Thanks a lot for help. But it matched CDEF and all nodes after that even
On Thu, Nov 24, 2011 at 12:30 PM, Ruby Mania <prateek123@gmail.com> wrote:
[#390484] check if a element with a specific value exists in a xml using REXML — "mythpills p." <mithunpillay@...>
i have attached a sample xml. I am currently using REXML ..basically i
[#390492] Understanding Ruby blocks — Fily Salas <fs_tigre@...>
Hi,
[#390496] How to make 1.9.2 my default version using RVM — Fily Salas <fs_tigre@...>
Hi,
ruby-1.9.2-p290:
Thanks for your help.
First of all thank you all for your help!
On 24/11/11 21:59, "Fily Salas" <fs_tigre@hotmail.com> wrote:
[#390528] set logger.progname on a per thread basis — Kassym Dorsel <k.dorsel@...>
I have this :
[#390535] Is high-speed sorting impossible with Ruby? — "Gaurav C." <chande.gaurav@...>
Well, first of all, I'm new to Ruby, and to this forum. So, hello. :)
Hi Matthias,
Here is a port of the fastest solution on that site in Ruby. It of course
This counting sort implementation is a great optimization you can do
Hi,
Joao Pedrosa wrote in post #1033884:
A big gain can be had by disabling the garbage collector. Here is my best
I've thrown various solutions up on github here:
Ryan Davis wrote in post #1034037:
Just playing with the code a little, more education than speed.
2011/11/28 Matthias W臘hter <matthias@waechter.wiz.at>
Douglas Seifert wrote in post #1033963:
>
Douglas Seifert wrote in post #1034017:
[#390563] Simplest way for secure, JSON-based client/server solution? — Robert Feldt <robert.feldt@...>
Dear ruby-talk'ers,
[#390566] Does the configure step of compiling work on OS X Snow Leopard? — Andrew Grimm <andrew.j.grimm@...>
I tried compiling the trunk version on OS X Snow Leopard, and it
[#390571] Your best Project — "Mathew S." <onetproductions@...>
What is you personal best app/project you have made.
[#390584] question about overloading — Vitit Kantabutra <vkantabu@...>
Back in 2007, somebody posted a question asking whether or not it is
On Sun, Nov 27, 2011 at 1:38 AM, Vitit Kantabutra <vkantabu@gmail.com>wrote:
[#390590] Creating 2-D array from 1-D array — "J. Marshal" <windbreiz@...>
Hello, I am relatively new to Ruby. I have an existing array:
[#390604] How to call an array from one ruby script to another — hari mahesh <harismahesh@...>
Can we call an array from one ruby script to another and access array
[#390638] Ruby Code help — Tridib Bandopadhyay <tridib04@...>
I am trying to print out the Garbage Collection behavior. I tried the
[#390639] Help Needed urgently — Tridib Bandopadhyay <tridib04@...>
I am able to implement manual memory management in Ruby.I can allocate
[#390650] Loading a faulty ruby file - forcing this — Marc Heiler <shevegen@...>
Hi.
[#390652] Garbage collection and define_finalizer — Garthy D <garthy_lmkltybr@...>
[#390659] What's wrong with this code? — "Kenley T." <kenleytan@...>
I made a program to motivate me for the last day of NaNoWriMo, but it
[#390689] Stupid question — James Gallagher <lollyproductions@...>
Hi everyone.
On Wed, Nov 30, 2011 at 09:10, James Gallagher <lollyproductions@mac.com> wrote:
On Wed, Nov 30, 2011 at 19:23, Dave Aronson
On Wed, Nov 30, 2011 at 14:26, Adam Prescott <adam@aprescott.com> wrote:
[#390706] errors with respond_to? and inject — "Sébastien M." <stkfdt@...>
Hello,
[#390715] DCell 0.0.1: Distributed actors for Ruby — Tony Arcieri <tony.arcieri@...>
DCell is a distributed actor framework for Ruby. Somewhat similar to DRb,
On Thu, Dec 01, 2011 at 05:49:10AM +0900, Tony Arcieri wrote:
Re: need spome help please :)
well.. it was only pice of code as whole one is long :P
but ok here it is:
require 'tk'
`chcp 65001`
root = TkRoot.new() {title "Migrator RUCH v1.03 sakej update"}
content = Tk::Tile::Frame.new(root) {padding "20 20 125 125"}.grid(
:sticky => 'nsew')
$content = content
TkGrid.columnconfigure root, 0, :weight => 1
TkGrid.rowconfigure root, 0, :weight => 1
# Deklaracja zmiennych globalnych
$psd = TkVariable.new
$miejscowosc = TkVariable.new
$service_check = TkVariable.new
#Ścieżki do plików
$file_protokol_path = TkVariable.new
$file_csq_path = TkVariable.new
$file_serwis_1_path = TkVariable.new
$file_serwis_2_path = TkVariable.new
$file_serwis_3_path = TkVariable.new
$file_modem_path = TkVariable.new
$file_sprzedaz_path = TkVariable.new
$file_plomba_path = TkVariable.new
$file_pos_path = TkVariable.new
$file_kableprzed_path = TkVariable.new
$file_kablepo_path = TkVariable.new
$file_posprzed_path = TkVariable.new
$file_name = TkVariable.new
# Nazwy plików plus rozszerzenia
$file_protokol_name = TkVariable.new
$file_protokol_ext = TkVariable.new
$file_csq_name = TkVariable.new
$file_csq_ext = TkVariable.new
$file_modem_name = TkVariable.new
$file_modem_ext = TkVariable.new
$file_serwis_1_name = TkVariable.new
$file_serwis_1_ext = TkVariable.new
$file_serwis_2_name = TkVariable.new
$file_serwis_2_ext = TkVariable.new
$file_serwis_3_name = TkVariable.new
$file_serwis_3_ext = TkVariable.new
$file_sprzedaz_name = TkVariable.new
$file_sprzedaz_ext = TkVariable.new
$file_plomba_name = TkVariable.new
$file_plomba_ext = TkVariable.new
$file_pos_name = TkVariable.new
$file_pos_ext = TkVariable.new
$file_kableprzed_name = TkVariable.new
$file_kableprzed_ext = TkVariable.new
$file_kablepo_name = TkVariable.new
$file_kablepo_ext = TkVariable.new
$file_posprzed_name = TkVariable.new
$file_posprzed_ext = TkVariable.new
$miejscowosc = TkVariable.new
# Pola na wprowadzenie wartości PSD i Miejscowości
psd = Tk::Tile::Entry.new(content) {width 6; textvariable $psd}.grid(
:column => 2, :row => 1, :sticky => 'we' )
miejscowosc = Tk::Tile::Entry.new(content) {width 20; textvariable
$miejscowosc}.grid(:column => 5, :row => 1, :sticky => 'we')
Tk::Tile::Label.new(content) {text 'PSD'}.grid( :column => 1, :row =>1,
:sticky => 'e')
Tk::Tile::Label.new(content) {text 'Miejscowość'}.grid( :column => 4,
:row => 1, :sticky => 'e')
# Protokół elektroniczny
Tk::Tile::Label.new(content) {text 'Protokol elektroniczny'}.grid(
:column => 1, :columnspan => 2, :row => 2, :sticky => 'e')
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.protokol_name(Tk.getOpenFile)}}.grid( :column => 4, :row =>
2, :sticky => 'nw', :padx => 15)
Tk::Tile::Label.new(content) {textvariable $file_protokol_name}.grid(
:column => 5, :row => 2, :sticky => 'ne', :columnspan => 4)
# Zdjęcie modemu
Tk::Tile::Label.new(content) {text 'Zdjęcie modemu'}.grid( :column => 1,
:columnspan => 2, :row => 3, :sticky => 'e')
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.modem_name(Tk.getOpenFile)}}.grid( :column => 4, :row => 3,
:sticky => 'nw', :padx => 15)
Tk::Tile::Label.new(content) {textvariable $file_modem_name}.grid(
:column => 5, :row => 3, :sticky => 'ne')
# Zdjęcie CSQ
Tk::Tile::Label.new(content) {text 'Zdjęcie CSQ'}.grid( :column => 1,
:columnspan => 2, :row => 4, :sticky => 'e')
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.csq_name(Tk.getOpenFile)}}.grid( :column => 4, :row => 4,
:sticky => 'nw', :padx => 15)
Tk::Tile::Label.new(content) {textvariable $file_csq_name}.grid( :column
=> 5, :row => 4, :sticky => 'ne')
#Zdjęcia 3 pierwszych stron książki serwisowej
Tk::Tile::Label.new(content) {text 'Zdjęcia książki serwisowej'}.grid(
:column => 1, :row => 5, :sticky => 'e')
Tk::Tile::Label.new(content) {text '1'}.grid( :column => 2, :row => 5,
:sticky => 'e')
Tk::Tile::Label.new(content) {text '3'}.grid( :column => 2, :row => 6,
:sticky => 'e')
Tk::Tile::Label.new(content) {text '4'}.grid( :column => 2, :row => 7,
:sticky => 'e')
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.serwis_1_name(Tk.getOpenFile)}}.grid( :column => 4, :row =>
5, :sticky => 'nw', :padx => 15)
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.serwis_2_name(Tk.getOpenFile)}}.grid( :column => 4, :row =>
6, :sticky => 'nw', :padx => 15)
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.seriws_3_name(Tk.getOpenFile)}}.grid( :column => 4, :row =>
7, :sticky => 'nw', :padx => 15)
Tk::Tile::Label.new(content) {textvariable $file_serwis_1_name}.grid(
:column => 5, :row => 5, :sticky => 'ne')
Tk::Tile::Label.new(content) {textvariable $file_serwis_2_name}.grid(
:column => 5, :row => 6, :sticky => 'ne')
Tk::Tile::Label.new(content) {textvariable $file_serwis_3_name}.grid(
:column => 5, :row => 7, :sticky => 'ne')
# Zdjęcie sprzedaż próbnej
Tk::Tile::Label.new(content) {text 'Zdjęcie sprzedaży próbnej'}.grid(
:column => 1, :columnspan => 2, :row => 9, :sticky => 'e')
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.sprzedaz_name(Tk.getOpenFile)}}.grid( :column => 4, :row =>
9, :sticky => 'nw', :padx => 15)
Tk::Tile::Label.new(content) {textvariable $file_sprzedaz_name}.grid(
:column => 5, :row => 9, :sticky => 'ne')
# Zdjęcie plomby serwisowej
Tk::Tile::Label.new(content) {text 'Zdjęcie plomby serwisowej'}.grid(
:column => 1, :columnspan => 2, :row => 10, :sticky => 'e')
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.plomba_name(Tk.getOpenFile)}}.grid( :column => 4, :row =>
10, :sticky => 'nw', :padx => 15)
Tk::Tile::Label.new(content) {textvariable $file_plomba_name}.grid(
:column => 5, :row => 10, :sticky => 'ne')
# Zdjęcie stanowiska POS
Tk::Tile::Label.new(content) {text 'Zdjęcie stanowiska POS'}.grid(
:column => 1, :columnspan => 2, :row => 11, :sticky => 'e')
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.pos_name(Tk.getOpenFile)}}.grid( :column => 4, :row => 11,
:sticky => 'nw', :padx => 15)
Tk::Tile::Label.new(content) {textvariable $file_pos_name}.grid( :column
=> 5, :row => 11, :sticky => 'ne')
# Zdjęcie kabli przed migracją
Tk::Tile::Label.new(content) {text 'Zdjęcie kabli przed migracją'}.grid(
:column => 1, :columnspan => 2, :row => 12, :sticky => 'e')
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.kableprzed_name(Tk.getOpenFile)}}.grid( :column => 4, :row
=> 12, :sticky => 'nw', :padx => 15)
Tk::Tile::Label.new(content) {textvariable $file_kableprzed_name}.grid(
:column => 5, :row => 12, :sticky => 'ne')
# Zdjęcie kabli po migracji
Tk::Tile::Label.new(content) {text 'Zdjęcie kabli po migracji'}.grid(
:column => 1, :columnspan => 2, :row => 13, :sticky => 'e')
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.kablepo_name(Tk.getOpenFile)}}.grid( :column => 4, :row =>
13, :sticky => 'nw', :padx => 15)
Tk::Tile::Label.new(content) {textvariable $file_kablepo_name}.grid(
:column => 5, :row => 13, :sticky => 'ne')
# Zdjęcie stanowiska POS przed migracją
Tk::Tile::Label.new(content) {text 'Zdjęcie stanowiska POS przed
migracją'}.grid( :column => 1, :columnspan => 2, :row => 14, :sticky =>
'e')
Tk::Tile::Button.new(content) {text '...'; command
{Generuj.new.posprzed_name(Tk.getOpenFile)}}.grid( :column => 4, :row =>
14, :sticky => 'nw', :padx => 15)
Tk::Tile::Label.new(content) {textvariable $file_posprzed_name}.grid(
:column => 5, :row => 14, :sticky => 'ne')
# Generowanie
Tk::Tile::Label.new(content) {text ''}.grid(:column => 2, :columnspan =>
2, :row => 15, :sticky => 'ne')
Tk::Tile::Button.new(content) {text 'Generuj'; command
{Generuj.new.execute}}.grid( :column => 4, :columnspan => 1, :row => 17,
:sticky => 's')
# Zamykanie programu
Tk::Tile::Button.new(content) {text 'Zamknij'; command {
root.destroy}}.grid(:column => 5, :columnspan => 1, :row => 17, :sticky
=> 'w' )
# Czy w psd była książka serwisowa
Tk::Tile::CheckButton.new(content) {text "Brak książki serwisowej";
variable $service_check; onvalue 'brak'; offvalue '1'; command
{Generuj.new.service_check}}.grid( :column => 3, :columnspan => 2, :row
=> 8, :sticky => 'e')
# Wyczyść wszystkie pola
Tk::Tile::Button.new(content) {text 'Wyczyść'; command
{Generuj.new.clear_all}}.grid(:column => 2, :columnspan => 2, :row =>17,
:sticky => 'w')
class Generuj
#
def service_check
if $service_check == 'brak' then
$file_serwis_1_name.value = "brak książki serwisowej w PSD"
$file_serwis_2_name.value = "brak książki serwisowej w PSD"
$file_serwis_3_name.value = "brak książki serwisowej w PSD"
else
$file_serwis_1_name.value = nil
$file_serwis_2_name.value = nil
$file_serwis_3_name.value = nil
end
end
# Nazwa pliku protokołu
def protokol_name(path)
$file_protokol_path.value = path
$file_protokol_name.value = File.basename(path, ".*")
$file_protokol_ext.value = File.extname(path)
end
# Nazwa pliku modemu
def modem_name(path)
$file_modem_path.value = path
$file_modem_name.value = File.basename(path, ".*")
$file_modem_ext.value = File.extname(path)
end
# Nazwa pliku csq
def csq_name(path)
$file_csq_path.value = path
$file_csq_name.value = File.basename(path, ".*")
$file_csq_ext.value = File.extname(path)
end
# Nazwa pliku serwis_1
def serwis_1_name(path)
$file_serwis_1_path.value = path
$file_serwis_1_name.value = File.basename(path, ".*")
$file_serwis_1_ext.value = File.extname(path)
end
# Nazwa pliku serwis_2
def serwis_2_name(path)
$file_serwis_2_path.value = path
$file_serwis_2_name.value = File.basename(path, ".*")
$file_serwis_2_ext.value = File.extname(path)
end
# Nazwa pliku serwis_3
def seriws_3_name(path)
$file_serwis_3_path.value = path
$file_serwis_3_name.value = File.basename(path, ".*")
$file_serwis_3_ext.value = File.extname(path)
end
# Nazwa pliku sprzedaży
def sprzedaz_name(path)
$file_sprzedaz_path.value = path
$file_sprzedaz_name.value = File.basename(path, ".*")
$file_sprzedaz_ext.value = File.extname(path)
end
# Nazwa pliku plomby
def plomba_name(path)
$file_plomba_path.value = path
$file_plomba_name.value = File.basename(path, ".*")
$file_plomba_ext.value = File.extname(path)
end
# Nazwa pliku pos
def pos_name(path)
$file_pos_path.value = path
$file_pos_name.value = File.basename(path, ".*")
$file_pos_ext.value = File.extname(path)
end
# Nazwa pliku kable przed migracją
def kableprzed_name(path)
$file_kableprzed_path.value = path
$file_kableprzed_name.value = File.basename(path, ".*")
$file_kableprzed_ext.value = File.extname(path)
end
# Nazwa pliku kable po migracji
def kablepo_name(path)
$file_kablepo_path.value = path
$file_kablepo_name.value = File.basename(path, ".*")
$file_kablepo_ext.value = File.extname(path)
end
# Nazwa pliku pos przed migracją
def posprzed_name(path)
$file_posprzed_path.value = path
$file_posprzed_name.value = File.basename(path, ".*")
$file_posprzed_ext.value = File.extname(path)
end
# Zmień nazwę pliku
def file_rename(path)
case path
when $file_protokol_path then $file_name.value =
String.new("potwierdzenie migracji w PSD") and file_ext =
$file_protokol_ext and old_file = $file_protokol_path
when $file_modem_path then $file_name.value = "potwierdzenie
inslatacji modemu GSM w PSD" and file_ext = $file_modem_ext and old_file
= $file_modem_path
when $file_csq_path then $file_name.value = "zasięg
stanowiska GSM w PSD" and file_ext = $file_csq_ext and old_file =
$file_csq_path
when $file_serwis_1_path then $file_name.value = "zdjęcie
książki serwisowej w PSD (1)" and file_ext = $file_serwis_1_ext and
old_file = $file_serwis_1_path
when $file_serwis_2_path then $file_name.value = "zdjęcie
książki serwisowej w PSD (2)" and file_ext = $file_serwis_2_ext and
old_file = $file_serwis_2_path
when $file_serwis_3_path then $file_name.value = "zdjęcie
książki serwisowej w PSD (3)" and file_ext = $file_serwis_3_ext and
old_file = $file_serwis_3_path
when $file_sprzedaz_path then $file_name.value = "potwierdzenie
sprzedaży próbnej w PSD" and file_ext = $file_sprzedaz_ext and old_file
= $file_sprzedaz_path
when $file_plomba_path then $file_name.value = "zdjęcie
plomby drukarki w PSD" and file_ext = $file_plomba_ext and old_file =
$file_plomba_path
when $file_pos_path then $file_name.value = "zdjęcie
stanowiska POS w PSD" and file_ext = $file_pos_ext and old_file =
$file_pos_path
when $file_kableprzed_path then $file_name.value = "stan
okablowania POS przed migracją w PSD " and file_ext =
$file_kableprzed_ext and old_file = $file_kableprzed_path
when $file_kablepo_path then $file_name.value = "stan
okablowania POS po migracji w PSD " and file_ext = $file_kablepo_ext and
old_file = $file_kablepo_path
when $file_posprzed_path then $file_name.value = "stan POS po
migracji w PSD " and file_ext = $file_posprzed_ext and old_file =
$file_posprzed_path
end
if path != nil or "#{path}".length != 0 then
File.rename("#{old_file}", "Ruch, #{$file_name} #{$psd} ,
#{$miejscowosc}#{file_ext}")
#else
# name_of_file = "Brak pliku Ruch, #{file_name}.txt"
# file = File.new(name_of_file, "w")
# file.write "Brak danych dla pliku: Ruch, #{file_name}.txt"
# file.close
end
$file_name.value = nil
end
# Zmień nazwy plików
def execute
if "#{$psd}".length != 6 or "#{$psd}".to_i == 0 then
Tk::messageBox :message => "Zły kod psd"
else
if not File.directory?("PSD #{$psd}, #{$miejscowosc}") then
Dir.mkdir( "PSD #{$psd}, #{$miejscowosc}" )
end
Dir.chdir( "PSD #{$psd}, #{$miejscowosc}" )
#$win = TkToplevel.new($content)
#$win['geometry'] = '300x200+500+200'
#Tk::Tile::Button.new($win) {text 'Zamknij'; command
{$win.destroy}}.grid( :column => 3, :row => 3, :sticky => 'w')
#Tk::Tile::Label.new($win) {textvariable $file_name}.grid(
:column => 2, :row => 2, :sticky => 'we');
# Zmień nazwę protokołu
file_rename($file_protokol_path)
file_rename($file_modem_path)
file_rename($file_csq_path)
file_rename($file_serwis_1_path)
file_rename($file_serwis_2_path)
file_rename($file_serwis_3_path)
file_rename($file_sprzedaz_path)
file_rename($file_plomba_path)
file_rename($file_pos_path)
file_rename($file_kableprzed_path)
file_rename($file_kablepo_path)
file_rename($file_posprzed_path)
if $service_check == "brak" then
file = File.new( "Brak książki serwisowej w PSD #{$psd},
#{$miesjcowosc}")
end
if all_files_correct? then
Tk::messageBox :message => "Wykonano pomyślnie"
else
Tk::messageBox :message => "Brakuje plików"
end
end
Dir.chdir("..")
end
# Uzupełnij braki
def complete_rest
if File.exist?("{$protokol_new}")
puts "isntnieje!"
else
puts "nie ma mnie!"
end
end
# Wyczyść wszystkie pola
def clear_all
$miejscowosc.value = nil
$psd.value = nil
$file_protokol_path.value = nil
$file_csq_path.value = nil
$file_serwis_1_path.value = nil
$file_serwis_2_path.value = nil
$file_serwis_3_path.value = nil
$file_modem_path.value = nil
$file_sprzedaz_path.value = nil
$file_plomba_path.value = nil
$file_pos_path.value = nil
$file_kableprzed_path.value = nil
$file_kablepo_path.value = nil
$file_posprzed_path.value = nil
$file_protokol_name.value = nil
$file_protokol_ext.value = nil
$file_csq_name.value = nil
$file_csq_ext.value = nil
$file_modem_name.value = nil
$file_modem_ext.value = nil
$file_serwis_1_name.value = nil
$file_serwis_1_ext.value = nil
$file_serwis_2_name.value = nil
$file_serwis_2_ext.value = nil
$file_serwis_3_name.value = nil
$file_serwis_3_ext.value = nil
$file_sprzedaz_name.value = nil
$file_sprzedaz_ext.value = nil
$file_plomba_name.value = nil
$file_plomba_ext.value = nil
$file_pos_name.value = nil
$file_pos_ext.value = nil
$file_kableprzed_ext.value = nil
$file_kableprzed_name.value = nil
$file_kablepo_ext.value = nil
$file_kablepo_name.value = nil
$file_posprzed_ext.value = nil
$file_posprzed_name.value = nil
$miejscowosc.value = nil
end
# Wszystkich plików
def all_files_correct?
if $service_check == "brak" then
@all_files = 6
else
@all_files = 9
end
i = 0
Dir['*.*'].each do |k|
i = i + 1
end
if i == @all_files then
return true
else
return false
end
end
end
#end
Tk.mainloop
--
Posted via http://www.ruby-forum.com/.