librelist archives

« back to archive

Package --> Unpackage

Package --> Unpackage

From:
Luka Povreslo
Date:
2014-09-26 @ 22:18
I wonder if there is a way to unpackage packaged shoes file so I can get
those files which are inside package out. Let's say if I wanted to update
an app to add a new feature and I would like to keep text files that I've
wrote inside .shy application it'd be cool if I just open a new folder and
add few new things and then package it again.

I have some other solutions on my mind such as editing inside-app files
inside of same application, 'though not sure what would be the
outcome...however I'm curious if unpackaging is possible and if it is, how
to do it?

Re: [shoes] Package --> Unpackage

From:
Cecil Coupe
Date:
2014-09-26 @ 22:31
Luka,
   I've been thinking/working on something similar:  An option to unpack 
the shy into a users directory before running the main app. There are 
some issues with the scheme that I haven't thought through so I can't 
promise it will happen.

Beware of writing your files inside the shy's directory. They don't get 
saved in the shy.

The shy is just a zipped up 'minitar'. You could write a Shoes app to 
unpack it. You just need to study the code that created it 
(lib/shoes/app_package.rb).

--Cecil

On 09/26/2014 04:18 PM, Luka Povreslo wrote:
> I wonder if there is a way to unpackage packaged shoes file so I can 
> get those files which are inside package out. Let's say if I wanted to 
> update an app to add a new feature and I would like to keep text files 
> that I've wrote inside .shy application it'd be cool if I just open a 
> new folder and add few new things and then package it again.
>
> I have some other solutions on my mind such as editing inside-app 
> files inside of same application, 'though not sure what would be the 
> outcome...however I'm curious if unpackaging is possible and if it is, 
> how to do it?
>
>

Re: [shoes] Package --> Unpackage

From:
Cecil Coupe
Date:
2014-09-27 @ 06:55
I'd rather do anything but debug that Windows hang problem and I will 
have to understand .shy better for my scheme to work.  So I wrote a a 
little Shoes app to show it is possible. It's less than perfect. You 
must pay attention to the comments I left in the code.

A shy has a 10 byte header, followed by some interesting yaml to 
understand in the future. and then a gziped tar.

Some one could write a nice Shy Explorer tool in Shoes if they wanted 
to. I suppose I'll have to debug that background hang issue first.

--Cecil
On 09/26/2014 04:18 PM, Luka Povreslo wrote:
> I wonder if there is a way to unpackage packaged shoes file so I can 
> get those files which are inside package out. Let's say if I wanted to 
> update an app to add a new feature and I would like to keep text files 
> that I've wrote inside .shy application it'd be cool if I just open a 
> new folder and add few new things and then package it again.
>
> I have some other solutions on my mind such as editing inside-app 
> files inside of same application, 'though not sure what would be the 
> outcome...however I'm curious if unpackaging is possible and if it is, 
> how to do it?
>
>

Re: [shoes] Package --> Unpackage

From:
Luka Povreslo
Date:
2014-09-29 @ 19:15
Cecil, it works fine. I've been testing .shy for a couple of days and it
behaves much different than just running application from a script. It
won't create simple text files, it only creates them inside .shy temporary
until it's closed. It can only 'remember things' when I save file as yaml,
like in sample, 'good-reminder', application. I don't know if this is noob
question or that's just the way it is with .shy?

Re: [shoes] Package --> Unpackage

From:
Cecil Coupe
Date:
2014-09-30 @ 19:40
Luka,

   When Shoes runs a shy it's expanded into a temp dir. When you run the 
shy again, it expands into a new temp dir. Anything you write in the 
first temp dir won't be in the 2nd temp dir.  It's a design 'feature'.

   What Shoes Apps (just like any other App)  should do is write their 
files in a user specified location like the sample unshy did by using 
ENV['HOME'] to build a path name or ask_save_folder (or is it 
ask_folder_save) so things don't get written where the user can't find 
them.

On 09/29/2014 01:15 PM, Luka Povreslo wrote:
> Cecil, it works fine. I've been testing .shy for a couple of days and 
> it behaves much different than just running application from a script. 
> It won't create simple text files, it only creates them inside .shy 
> temporary until it's closed. It can only 'remember things' when I save 
> file as yaml, like in sample, 'good-reminder', application. I don't 
> know if this is noob question or that's just the way it is with .shy?

Re: [shoes] Package --> Unpackage

From:
Luka Povreslo
Date:
2014-09-30 @ 22:39
Alright I think I've found a solution, I can prompt user when the app is
firstly started to choose saving directory(folder) and save that string to
ENV['USERPROFILE'] and load that string every time I start an app. It could
be pretty cool actually. :)

2014-09-30 21:40 GMT+02:00 Cecil Coupe <ccoupe@cableone.net>:

> Luka,
>
>    When Shoes runs a shy it's expanded into a temp dir. When you run the
> shy again, it expands into a new temp dir. Anything you write in the
> first temp dir won't be in the 2nd temp dir.  It's a design 'feature'.
>
>    What Shoes Apps (just like any other App)  should do is write their
> files in a user specified location like the sample unshy did by using
> ENV['HOME'] to build a path name or ask_save_folder (or is it
> ask_folder_save) so things don't get written where the user can't find
> them.
>
> On 09/29/2014 01:15 PM, Luka Povreslo wrote:
> > Cecil, it works fine. I've been testing .shy for a couple of days and
> > it behaves much different than just running application from a script.
> > It won't create simple text files, it only creates them inside .shy
> > temporary until it's closed. It can only 'remember things' when I save
> > file as yaml, like in sample, 'good-reminder', application. I don't
> > know if this is noob question or that's just the way it is with .shy?
>
>

Re: [shoes] Package --> Unpackage

From:
Cecil Coupe
Date:
2014-10-01 @ 06:48
Luka,
   You're on the right path but (there is always a but) - you can't 
permanently change ENV['USERPROFILE '] or ENV['MYCOOLSETTINGS'] for the 
next time your script runs. Any change to ENV only lasts as long as the 
script is running. What you're think about can only be done by writing 
to the Windows Registry and Shoes has no way of doing that and probably 
never will - it's not a good idea.

   Use File.join(ENV['HOME'] , '.shoes', 'LukaApps') and use that with 
'myapp.yaml' . If the path and file is not there when your script runs 
then ask the user where to create their data files, then use that answer 
and create the myapp.yaml file with their answer. If that file 
[HOME]/.shoes/LukaApps/myapp.yaml exists when your app starts up, then 
skip the the setup, read the yaml file to get their directory and you 
are good to go.  This scheme will work on Linux, OSX and Windows.  It 
doesn’t have to be .shoes or LukaApps or myapp.yaml. Those are only for 
illustration.

--Cecil

On 09/30/2014 04:39 PM, Luka Povreslo wrote:
> Alright I think I've found a solution, I can prompt user when the app 
> is firstly started to choose saving directory(folder) and save that 
> string to  ENV['USERPROFILE'] and load that string every time I start 
> an app. It could be pretty cool actually. :)
>
> 2014-09-30 21:40 GMT+02:00 Cecil Coupe <ccoupe@cableone.net 
> <mailto:ccoupe@cableone.net>>:
>
>     Luka,
>
>        When Shoes runs a shy it's expanded into a temp dir. When you
>     run the
>     shy again, it expands into a new temp dir. Anything you write in the
>     first temp dir won't be in the 2nd temp dir.  It's a design 'feature'.
>
>        What Shoes Apps (just like any other App)  should do is write their
>     files in a user specified location like the sample unshy did by using
>     ENV['HOME'] to build a path name or ask_save_folder (or is it
>     ask_folder_save) so things don't get written where the user can't find
>     them.
>
>     On 09/29/2014 01:15 PM, Luka Povreslo wrote:
>     > Cecil, it works fine. I've been testing .shy for a couple of
>     days and
>     > it behaves much different than just running application from a
>     script.
>     > It won't create simple text files, it only creates them inside .shy
>     > temporary until it's closed. It can only 'remember things' when
>     I save
>     > file as yaml, like in sample, 'good-reminder', application. I don't
>     > know if this is noob question or that's just the way it is with
>     .shy?
>
>

Re: [shoes] Package --> Unpackage

From:
Luka Povreslo
Date:
2014-10-01 @ 10:09
Yeah, I understand, I was thinking about the same thing that you've
described but maybe I haven't expressed myself in a right way. When using
windows I think ENV['USERPROFILE'] is equivalent to ENV['HOME'] but I get
slightly different output when testing it in irb. When I write
ENV['USERPROFILE'] I get C:/users/user and with 'HOME' I get C:\users\user.
So, do those slashes make the difference or is it just different output?

2014-10-01 8:48 GMT+02:00 Cecil Coupe <ccoupe@cableone.net>:

>  Luka,
>   You're on the right path but (there is always a but) - you can't
> permanently change ENV['USERPROFILE '] or ENV['MYCOOLSETTINGS'] for the
> next time your script runs. Any change to ENV only lasts as long as the
> script is running. What you're think about can only be done by writing to
> the Windows Registry and Shoes has no way of doing that and probably never
> will - it's not a good idea.
>
>   Use File.join(ENV['HOME'] , '.shoes', 'LukaApps') and use that with
> 'myapp.yaml' . If the path and file is not there when your script runs then
> ask the user where to create their data files, then use that answer and
> create the myapp.yaml file with their answer. If that file
> [HOME]/.shoes/LukaApps/myapp.yaml exists when your app starts up, then skip
> the the setup, read the yaml file to get their directory and you are good
> to go.  This scheme will work on Linux, OSX and Windows.  It doesn’t have
> to be .shoes or LukaApps or myapp.yaml. Those are only for illustration.
>
> --Cecil
>
>
> On 09/30/2014 04:39 PM, Luka Povreslo wrote:
>
> Alright I think I've found a solution, I can prompt user when the app is
> firstly started to choose saving directory(folder) and save that string to
> ENV['USERPROFILE'] and load that string every time I start an app. It could
> be pretty cool actually. :)
>
> 2014-09-30 21:40 GMT+02:00 Cecil Coupe <ccoupe@cableone.net>:
>
>> Luka,
>>
>>    When Shoes runs a shy it's expanded into a temp dir. When you run the
>> shy again, it expands into a new temp dir. Anything you write in the
>> first temp dir won't be in the 2nd temp dir.  It's a design 'feature'.
>>
>>    What Shoes Apps (just like any other App)  should do is write their
>> files in a user specified location like the sample unshy did by using
>> ENV['HOME'] to build a path name or ask_save_folder (or is it
>> ask_folder_save) so things don't get written where the user can't find
>> them.
>>
>> On 09/29/2014 01:15 PM, Luka Povreslo wrote:
>> > Cecil, it works fine. I've been testing .shy for a couple of days and
>> > it behaves much different than just running application from a script.
>> > It won't create simple text files, it only creates them inside .shy
>> > temporary until it's closed. It can only 'remember things' when I save
>> > file as yaml, like in sample, 'good-reminder', application. I don't
>> > know if this is noob question or that's just the way it is with .shy?
>>
>>
>
>