The Inbox: Installer-Core-cmm.428.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Installer-Core-cmm.428.mcz

commits-2
Chris Muller uploaded a new version of Installer-Core to project The Inbox:
http://source.squeak.org/inbox/Installer-Core-cmm.428.mcz

==================== Summary ====================

Name: Installer-Core-cmm.428
Author: cmm
Time: 8 April 2019, 12:28:03.307324 am
UUID: 45c1899a-1b8e-42bf-9360-584797cf4a91
Ancestors: Installer-Core-cmm.427, Installer-Core-tcj.426

Allow installation of github projects via the scripts at the top in their readme files, without first having to manually ensure Metacello is installed.

        Metacello new
                baseline: 'NameOfTheProject';
                repository: 'github://...';
                load

=============== Diff against Installer-Core-tcj.426 ===============

Item was changed:
  ----- Method: Installer class>>ensureRecentMetacello (in category 'scripts') -----
  ensureRecentMetacello
  "Copied and adapted from https://github.com/Metacello/metacello/blob/master/README.md"
 
  | metacello |
  ((Smalltalk classNamed: #WebClient)
  ifNil: [ false ]
  ifNotNil: [ :webClient |
  [ (webClient httpHead: 'https://github.com') isSuccess ]
  on: Error
  do: [ false ] ])
  ifFalse: [ ^self inform: 'Could not connect to "https://github.com".\\You need an internet connection and SSL support\to install (or update) Metacello.\\Please fix those issues and try again.' translated withCRs ].
 
+ metacello := Smalltalk classNamed: #Metacello.
+ (metacello name = #Metacello) ifFalse: [
- metacello := (Smalltalk classNamed: #Metacello) ifNil: [
  "Get the Metacello configuration (for Squeak users)"
  Installer gemsource
  project: 'metacello';
  addPackage: 'ConfigurationOfMetacello';
  install.
 
  "Bootstrap Metacello Preview, using mcz files (#'previewBootstrap' symbolic version"
  ((Smalltalk classNamed: #ConfigurationOfMetacello) project
  version: #'previewBootstrap') load.
 
  Smalltalk classNamed: #Metacello ].
 
  "Now load latest version of Metacello"
  metacello new
  baseline: 'Metacello';
  repository: 'github://Metacello/metacello:master/repository';
  get.
  metacello new
  baseline: 'Metacello';
  repository: 'github://Metacello/metacello:master/repository';
  load: #('default' 'Metacello-Help').
  !

Item was added:
+ Object subclass: #MetacelloStub
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Installer-Core'!
+
+ !MetacelloStub commentStamp: 'cmm 4/8/2019 00:27' prior: 0!
+ MetacelloStub is a loose reference to Metacello.!

Item was added:
+ ----- Method: MetacelloStub class>>doesNotUnderstand: (in category 'overriding') -----
+ doesNotUnderstand: aMessage
+ Installer ensureRecentMetacello.
+ Installer installGitInfrastructure.
+ ^ aMessage sendTo: (Smalltalk classNamed: #Metacello)!

Item was added:
+ ----- Method: MetacelloStub class>>initialize (in category 'initialize-release') -----
+ initialize
+ Smalltalk
+ at: #Metacello
+ ifAbsentPut: [ self ]!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Installer-Core-cmm.428.mcz

Chris Muller-3
I didn't grok Fabio's idea at first.  It saves having to click any
menu at all.  Brilliant.



On Mon, Apr 8, 2019 at 12:28 AM <[hidden email]> wrote:

>
> Chris Muller uploaded a new version of Installer-Core to project The Inbox:
> http://source.squeak.org/inbox/Installer-Core-cmm.428.mcz
>
> ==================== Summary ====================
>
> Name: Installer-Core-cmm.428
> Author: cmm
> Time: 8 April 2019, 12:28:03.307324 am
> UUID: 45c1899a-1b8e-42bf-9360-584797cf4a91
> Ancestors: Installer-Core-cmm.427, Installer-Core-tcj.426
>
> Allow installation of github projects via the scripts at the top in their readme files, without first having to manually ensure Metacello is installed.
>
>         Metacello new
>                 baseline: 'NameOfTheProject';
>                 repository: 'github://...';
>                 load
>
> =============== Diff against Installer-Core-tcj.426 ===============
>
> Item was changed:
>   ----- Method: Installer class>>ensureRecentMetacello (in category 'scripts') -----
>   ensureRecentMetacello
>         "Copied and adapted from https://github.com/Metacello/metacello/blob/master/README.md"
>
>         | metacello |
>         ((Smalltalk classNamed: #WebClient)
>                 ifNil: [ false ]
>                 ifNotNil: [ :webClient |
>                         [ (webClient httpHead: 'https://github.com') isSuccess ]
>                                 on: Error
>                                 do: [ false ] ])
>                 ifFalse: [ ^self inform: 'Could not connect to "https://github.com".\\You need an internet connection and SSL support\to install (or update) Metacello.\\Please fix those issues and try again.' translated withCRs ].
>
> +       metacello := Smalltalk classNamed: #Metacello.
> +       (metacello name = #Metacello) ifFalse: [
> -       metacello := (Smalltalk classNamed: #Metacello) ifNil: [
>                 "Get the Metacello configuration (for Squeak users)"
>                 Installer gemsource
>                         project: 'metacello';
>                         addPackage: 'ConfigurationOfMetacello';
>                         install.
>
>                 "Bootstrap Metacello Preview, using mcz files (#'previewBootstrap' symbolic version"
>                 ((Smalltalk classNamed: #ConfigurationOfMetacello) project
>                         version: #'previewBootstrap') load.
>
>                 Smalltalk classNamed: #Metacello ].
>
>         "Now load latest version of Metacello"
>         metacello new
>                 baseline: 'Metacello';
>                 repository: 'github://Metacello/metacello:master/repository';
>                 get.
>         metacello new
>                 baseline: 'Metacello';
>                 repository: 'github://Metacello/metacello:master/repository';
>                 load: #('default' 'Metacello-Help').
>   !
>
> Item was added:
> + Object subclass: #MetacelloStub
> +       instanceVariableNames: ''
> +       classVariableNames: ''
> +       poolDictionaries: ''
> +       category: 'Installer-Core'!
> +
> + !MetacelloStub commentStamp: 'cmm 4/8/2019 00:27' prior: 0!
> + MetacelloStub is a loose reference to Metacello.!
>
> Item was added:
> + ----- Method: MetacelloStub class>>doesNotUnderstand: (in category 'overriding') -----
> + doesNotUnderstand: aMessage
> +       Installer ensureRecentMetacello.
> +       Installer installGitInfrastructure.
> +       ^ aMessage sendTo: (Smalltalk classNamed: #Metacello)!
>
> Item was added:
> + ----- Method: MetacelloStub class>>initialize (in category 'initialize-release') -----
> + initialize
> +       Smalltalk
> +               at: #Metacello
> +               ifAbsentPut: [ self ]!
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Installer-Core-cmm.428.mcz

fniephaus


On Mon, 8 Apr 2019 at 7:33 am, Chris Muller <[hidden email]> wrote:
I didn't grok Fabio's idea at first.  It saves having to click any
menu at all.  Brilliant.

Great! This is almost exactly how I imagined it. I'm not sure it makes sense to load both Metacello and the Git infrastructure at the same time. Not sure if the Git infra depends on Metacello, but Metacello definitely does not depend on the Git tools.

Could we just add a GitBrowser item to the Tools menu and install the Git infrastructure when it's clicked for the first time?

One more question: Would it be better to prompt the user to confirm the installation of Metacello and Git (as in "Do you want to install X? (A connection to the Internet is required).")? Let's say I'm offline and click on GitBrowser, then I'd know stuff needs to be loaded from the web. Otherwise, I'd probably just see a debugger.

Fabio 





On Mon, Apr 8, 2019 at 12:28 AM <[hidden email]> wrote:
>
> Chris Muller uploaded a new version of Installer-Core to project The Inbox:
> http://source.squeak.org/inbox/Installer-Core-cmm.428.mcz
>
> ==================== Summary ====================
>
> Name: Installer-Core-cmm.428
> Author: cmm
> Time: 8 April 2019, 12:28:03.307324 am
> UUID: 45c1899a-1b8e-42bf-9360-584797cf4a91
> Ancestors: Installer-Core-cmm.427, Installer-Core-tcj.426
>
> Allow installation of github projects via the scripts at the top in their readme files, without first having to manually ensure Metacello is installed.
>
>         Metacello new
>                 baseline: 'NameOfTheProject';
>                 repository: 'github://...';
>                 load
>
> =============== Diff against Installer-Core-tcj.426 ===============
>
> Item was changed:
>   ----- Method: Installer class>>ensureRecentMetacello (in category 'scripts') -----
>   ensureRecentMetacello
>         "Copied and adapted from https://github.com/Metacello/metacello/blob/master/README.md"
>
>         | metacello |
>         ((Smalltalk classNamed: #WebClient)
>                 ifNil: [ false ]
>                 ifNotNil: [ :webClient |
>                         [ (webClient httpHead: 'https://github.com') isSuccess ]
>                                 on: Error
>                                 do: [ false ] ])
>                 ifFalse: [ ^self inform: 'Could not connect to "https://github.com".\\You need an internet connection and SSL support\to install (or update) Metacello.\\Please fix those issues and try again.' translated withCRs ].
>
> +       metacello := Smalltalk classNamed: #Metacello.
> +       (metacello name = #Metacello) ifFalse: [
> -       metacello := (Smalltalk classNamed: #Metacello) ifNil: [
>                 "Get the Metacello configuration (for Squeak users)"
>                 Installer gemsource
>                         project: 'metacello';
>                         addPackage: 'ConfigurationOfMetacello';
>                         install.
>
>                 "Bootstrap Metacello Preview, using mcz files (#'previewBootstrap' symbolic version"
>                 ((Smalltalk classNamed: #ConfigurationOfMetacello) project
>                         version: #'previewBootstrap') load.
>
>                 Smalltalk classNamed: #Metacello ].
>
>         "Now load latest version of Metacello"
>         metacello new
>                 baseline: 'Metacello';
>                 repository: 'github://Metacello/metacello:master/repository';
>                 get.
>         metacello new
>                 baseline: 'Metacello';
>                 repository: 'github://Metacello/metacello:master/repository';
>                 load: #('default' 'Metacello-Help').
>   !
>
> Item was added:
> + Object subclass: #MetacelloStub
> +       instanceVariableNames: ''
> +       classVariableNames: ''
> +       poolDictionaries: ''
> +       category: 'Installer-Core'!
> +
> + !MetacelloStub commentStamp: 'cmm 4/8/2019 00:27' prior: 0!
> + MetacelloStub is a loose reference to Metacello.!
>
> Item was added:
> + ----- Method: MetacelloStub class>>doesNotUnderstand: (in category 'overriding') -----
> + doesNotUnderstand: aMessage
> +       Installer ensureRecentMetacello.
> +       Installer installGitInfrastructure.
> +       ^ aMessage sendTo: (Smalltalk classNamed: #Metacello)!
>
> Item was added:
> + ----- Method: MetacelloStub class>>initialize (in category 'initialize-release') -----
> + initialize
> +       Smalltalk
> +               at: #Metacello
> +               ifAbsentPut: [ self ]!
>
>



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Installer-Core-cmm.428.mcz

Levente Uzonyi
In reply to this post by commits-2
On Mon, 8 Apr 2019, [hidden email] wrote:

> Chris Muller uploaded a new version of Installer-Core to project The Inbox:
> http://source.squeak.org/inbox/Installer-Core-cmm.428.mcz
>
> ==================== Summary ====================
>
> Name: Installer-Core-cmm.428
> Author: cmm
> Time: 8 April 2019, 12:28:03.307324 am
> UUID: 45c1899a-1b8e-42bf-9360-584797cf4a91
> Ancestors: Installer-Core-cmm.427, Installer-Core-tcj.426
>
> Allow installation of github projects via the scripts at the top in their readme files, without first having to manually ensure Metacello is installed.
>
> Metacello new
> baseline: 'NameOfTheProject';
> repository: 'github://...';
> load
>
> =============== Diff against Installer-Core-tcj.426 ===============
>
> Item was changed:
>  ----- Method: Installer class>>ensureRecentMetacello (in category 'scripts') -----
>  ensureRecentMetacello
>   "Copied and adapted from https://github.com/Metacello/metacello/blob/master/README.md"
>
>   | metacello |
>   ((Smalltalk classNamed: #WebClient)
>   ifNil: [ false ]
>   ifNotNil: [ :webClient |
>   [ (webClient httpHead: 'https://github.com') isSuccess ]
>   on: Error
>   do: [ false ] ])
>   ifFalse: [ ^self inform: 'Could not connect to "https://github.com".\\You need an internet connection and SSL support\to install (or update) Metacello.\\Please fix those issues and try again.' translated withCRs ].
>
> + metacello := Smalltalk classNamed: #Metacello.
> + (metacello name = #Metacello) ifFalse: [
> - metacello := (Smalltalk classNamed: #Metacello) ifNil: [

This trick deserves a comment. It relies on the loose implementation of
#classNamed: of Environment and existence of Object >> #name. Both of
which I'd rather see changed.

Levente

P.S.: I also don't see why Git Infrastructure is installed along with
Metacello. I use the latter but not the former (yet). I agree with Fabio's
suggestion in his response.

>   "Get the Metacello configuration (for Squeak users)"
>   Installer gemsource
>   project: 'metacello';
>   addPackage: 'ConfigurationOfMetacello';
>   install.
>
>   "Bootstrap Metacello Preview, using mcz files (#'previewBootstrap' symbolic version"
>   ((Smalltalk classNamed: #ConfigurationOfMetacello) project
>   version: #'previewBootstrap') load.
>
>   Smalltalk classNamed: #Metacello ].
>
>   "Now load latest version of Metacello"
>   metacello new
>   baseline: 'Metacello';
>   repository: 'github://Metacello/metacello:master/repository';
>   get.
>   metacello new
>   baseline: 'Metacello';
>   repository: 'github://Metacello/metacello:master/repository';
>   load: #('default' 'Metacello-Help').
>  !
>
> Item was added:
> + Object subclass: #MetacelloStub
> + instanceVariableNames: ''
> + classVariableNames: ''
> + poolDictionaries: ''
> + category: 'Installer-Core'!
> +
> + !MetacelloStub commentStamp: 'cmm 4/8/2019 00:27' prior: 0!
> + MetacelloStub is a loose reference to Metacello.!
>
> Item was added:
> + ----- Method: MetacelloStub class>>doesNotUnderstand: (in category 'overriding') -----
> + doesNotUnderstand: aMessage
> + Installer ensureRecentMetacello.
> + Installer installGitInfrastructure.
> + ^ aMessage sendTo: (Smalltalk classNamed: #Metacello)!
>
> Item was added:
> + ----- Method: MetacelloStub class>>initialize (in category 'initialize-release') -----
> + initialize
> + Smalltalk
> + at: #Metacello
> + ifAbsentPut: [ self ]!

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Installer-Core-cmm.428.mcz

Jakob Reschke
In reply to this post by fniephaus
Am Mo., 8. Apr. 2019 um 10:22 Uhr schrieb Fabio Niephaus <[hidden email]>:


On Mon, 8 Apr 2019 at 7:33 am, Chris Muller <[hidden email]> wrote:
I didn't grok Fabio's idea at first.  It saves having to click any
menu at all.  Brilliant.

+1, "It's a kind of magic" ♫ but it's short to read and both resolves the discussion and improves the UX.
 
 Not sure if the Git infra depends on Metacello, but Metacello definitely does not depend on the Git tools.

Correct. And Metacello is not required to run the Git tools either, but it is used to load them (loading them without Metacello would require lot's of manual steps).
I would also rather like to see the two separated. Loading the Git tools also loads some other stuff that's not in trunk.
 
Could we just add a GitBrowser item to the Tools menu and install the Git infrastructure when it's clicked for the first time?

+1 as alternative for the disputed Do menu entry
 
One more question: Would it be better to prompt the user to confirm the installation of Metacello and Git (as in "Do you want to install X? (A connection to the Internet is required).")? Let's say I'm offline and click on GitBrowser, then I'd know stuff needs to be loaded from the web. Otherwise, I'd probably just see a debugger.

Seems justified.


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Installer-Core-cmm.428.mcz

Jakob Reschke
In reply to this post by Levente Uzonyi
Am Mo., 8. Apr. 2019 um 13:57 Uhr schrieb Levente Uzonyi <[hidden email]>:
>  ----- Method: Installer class>>ensureRecentMetacello (in category 'scripts') -----
>  ensureRecentMetacello
>       "Copied and adapted from https://github.com/Metacello/metacello/blob/master/README.md"
>
>       | metacello |
>       ((Smalltalk classNamed: #WebClient)
>               ifNil: [ false ]
>               ifNotNil: [ :webClient |
>                       [ (webClient httpHead: 'https://github.com') isSuccess ]
>                               on: Error
>                               do: [ false ] ])
>               ifFalse: [ ^self inform: 'Could not connect to "https://github.com".\\You need an internet connection and SSL support\to install (or update) Metacello.\\Please fix those issues and try again.' translated withCRs ].
>
> +     metacello := Smalltalk classNamed: #Metacello.
> +     (metacello name = #Metacello) ifFalse: [
> -     metacello := (Smalltalk classNamed: #Metacello) ifNil: [

This trick deserves a comment. It relies on the loose implementation of
#classNamed: of Environment and existence of Object >> #name. Both of
which I'd rather see changed.

    metacello := Smalltalk classNamed: #Metacello.
    metacello = MetacelloStub ifFalse: [

instead + a comment maybe?