glimmer 0.1.11.470 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.markdown +104 -66
- data/bin/girb +1 -3
- data/bin/glimmer +1 -1
- data/lib/glimmer_application.rb +35 -76
- data/vendor/swt/linux/swt.jar +0 -0
- data/vendor/swt/mac/swt.jar +0 -0
- data/vendor/swt/windows/swt.jar +0 -0
- metadata +15 -55
- data/.coveralls.yml +0 -1
- data/.rspec +0 -2
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/Gemfile +0 -14
- data/RELEASE.md +0 -15
- data/Rakefile +0 -43
- data/TODO.md +0 -12
- data/VERSION +0 -1
- data/bin/girb_runner.rb +0 -1
- data/glimmer.gemspec +0 -160
- data/images/Bitter-sweet.jpg +0 -0
- data/samples/contactmanager/contact.rb +0 -9
- data/samples/contactmanager/contact_manager.rb +0 -71
- data/samples/contactmanager/contact_manager_presenter.rb +0 -24
- data/samples/contactmanager/contact_repository.rb +0 -24
- data/samples/hello_combo.rb +0 -36
- data/samples/hello_list_multi_selection.rb +0 -46
- data/samples/hello_list_single_selection.rb +0 -36
- data/samples/hello_tab.rb +0 -26
- data/samples/hello_world.rb +0 -10
- data/samples/hellocomputed/contact.rb +0 -19
- data/samples/hellocomputed/hello_computed.rb +0 -68
- data/samples/login.rb +0 -92
- data/samples/tictactoe/tic_tac_toe.rb +0 -64
- data/samples/tictactoe/tic_tac_toe_board.rb +0 -146
- data/spec/lib/command_handlers/models/observable_model_spec.rb +0 -22
- data/spec/lib/command_handlers/models/r_widget_spec.rb +0 -52
- data/spec/lib/glimmer__combo_data_binding__spec.rb +0 -130
- data/spec/lib/glimmer__constant__spec.rb +0 -30
- data/spec/lib/glimmer__data_binding__spec.rb +0 -404
- data/spec/lib/glimmer__list_data_binding__spec.rb +0 -224
- data/spec/lib/glimmer__listeners__spec.rb +0 -60
- data/spec/lib/glimmer__shine_data_binding__spec.rb +0 -89
- data/spec/lib/glimmer__tab_item__spec.rb +0 -55
- data/spec/lib/glimmer__table_data_binding__spec.rb +0 -121
- data/spec/lib/glimmer__tree_data_binding__spec.rb +0 -113
- data/spec/lib/glimmer_spec.rb +0 -251
- data/spec/lib/xml/glimmer_xml_spec.rb +0 -154
- data/spec/samples/contactmanager/contact_manager_presenter_spec.rb +0 -81
- data/spec/samples/tictactoe/tic_tac_toe_spec.rb +0 -263
- data/spec/spec_helper.rb +0 -124
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 52feeb8724180301066a34a46f53812abd3975f5413c06eaf4f1301bacf62703
         | 
| 4 | 
            +
              data.tar.gz: 413747747c1529ded93d5b21bb6574ad080672c123ee9c8f38d2d33d5d2d3abd
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 946ed669ac4a23c87c057cd357ce2d3a0b85f94fd0019186deea8d797bbfafdc4487ec1b88bbe0aafad5b4e47af656a7d8a81e222f02c9afda67284681b33039
         | 
| 7 | 
            +
              data.tar.gz: 7e83c22ea9c23b5d4028e9063b7c235ac8e3724cf2e9f638b03b1a9d7acbce74aabbbb75faf4df4ef2de4fe17cd064585c04deb830f8f0895fc7d8490bcf52c5
         | 
    
        data/README.markdown
    CHANGED
    
    | @@ -5,18 +5,29 @@ Glimmer is a cross-platform Ruby desktop development library. Glimmer's main inn | |
| 5 5 |  | 
| 6 6 | 
             
            You may learn more by reading this article: [Eclipse Zone Tutorial](http://eclipse.dzone.com/articles/an-introduction-glimmer)
         | 
| 7 7 |  | 
| 8 | 
            -
            
         | 
| 9 | 
            -
             | 
| 10 8 | 
             
            ## Example
         | 
| 11 9 |  | 
| 10 | 
            +
            Code (`hello_world.rb`):
         | 
| 12 11 | 
             
            ```ruby
         | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 17 | 
            -
             | 
| 18 | 
            -
                 | 
| 12 | 
            +
            include Glimmer
         | 
| 13 | 
            +
             | 
| 14 | 
            +
            shell {
         | 
| 15 | 
            +
              text "Glimmer"
         | 
| 16 | 
            +
              label {
         | 
| 17 | 
            +
                text "Hello World!"
         | 
| 18 | 
            +
              }
         | 
| 19 | 
            +
            }.open
         | 
| 20 | 
            +
            ```
         | 
| 21 | 
            +
             | 
| 22 | 
            +
            Run:
         | 
| 19 23 | 
             
            ```
         | 
| 24 | 
            +
            glimmer hello_world.rb
         | 
| 25 | 
            +
            ```
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            Glimmer app:
         | 
| 28 | 
            +
             | 
| 29 | 
            +
            
         | 
| 30 | 
            +
             | 
| 20 31 |  | 
| 21 32 | 
             
            ## Resources
         | 
| 22 33 |  | 
| @@ -25,86 +36,89 @@ You may learn more by reading this article: [Eclipse Zone Tutorial](http://eclip | |
| 25 36 | 
             
            * [RubyConf 2008 Video](https://confreaks.tv/videos/rubyconf2008-desktop-development-with-glimmer)
         | 
| 26 37 | 
             
            * [Code Blog](http://andymaleh.blogspot.com/search/label/Glimmer)
         | 
| 27 38 |  | 
| 28 | 
            -
            ##  | 
| 39 | 
            +
            ## Background
         | 
| 29 40 |  | 
| 30 | 
            -
             | 
| 41 | 
            +
            Ruby is a dynamically-typed object-oriented language, which provides great productivity gains due to its powerful expressive syntax and dynamic nature. While it is proven by the Ruby on Rails framework for web development, it currently lacks a robust platform-independent framework for building desktop applications. Given that Java libraries can now be utilized in Ruby code through JRuby, Eclipse technologies, such as SWT, JFace, and RCP can help fill the gap of desktop application development with Ruby.
         | 
| 42 | 
            +
             | 
| 43 | 
            +
            ## Pre-requisites
         | 
| 31 44 |  | 
| 32 | 
            -
             | 
| 45 | 
            +
            * Java SE Runtime Environment 7 or higher (find at https://www.oracle.com/java/technologies/javase-downloads.html)
         | 
| 46 | 
            +
            * JRuby 9.2.10.0 (supporting Ruby 2.5.x syntax) (find at https://www.jruby.org/download)
         | 
| 33 47 |  | 
| 34 | 
            -
             | 
| 48 | 
            +
            On **Mac** and **Linux**, an easy way to obtain JRuby is through [RVM](http://rvm.io) by running:
         | 
| 35 49 |  | 
| 36 50 | 
             
            ```bash
         | 
| 37 | 
            -
            rvm install jruby-9.2. | 
| 51 | 
            +
            rvm install jruby-9.2.10.0
         | 
| 38 52 | 
             
            ```
         | 
| 39 53 |  | 
| 40 54 | 
             
            ## Setup
         | 
| 41 55 |  | 
| 42 56 | 
             
            Please follow these instructions to make the `glimmer` command available on your system.
         | 
| 43 57 |  | 
| 44 | 
            -
            ### Option 1:  | 
| 58 | 
            +
            ### Option 1: Direct Install
         | 
| 45 59 |  | 
| 46 | 
            -
             | 
| 60 | 
            +
            Run this command to install directly:
         | 
| 47 61 | 
             
            ```
         | 
| 48 | 
            -
             | 
| 62 | 
            +
            jgem install glimmer -v 0.2.0
         | 
| 49 63 | 
             
            ```
         | 
| 50 64 |  | 
| 51 | 
            -
             | 
| 65 | 
            +
            ### Option 2: Bundler
         | 
| 66 | 
            +
             | 
| 67 | 
            +
            Add the following to `Gemfile`:
         | 
| 52 68 | 
             
            ```
         | 
| 53 | 
            -
             | 
| 69 | 
            +
            jgem 'glimmer', '~> 0.2.0'
         | 
| 54 70 | 
             
            ```
         | 
| 55 71 |  | 
| 56 | 
            -
             | 
| 57 | 
            -
             | 
| 58 | 
            -
            Run this command to get directly:
         | 
| 72 | 
            +
            And, then run:
         | 
| 59 73 | 
             
            ```
         | 
| 60 | 
            -
             | 
| 74 | 
            +
            bundle install
         | 
| 61 75 | 
             
            ```
         | 
| 62 76 |  | 
| 63 | 
            -
            ##  | 
| 77 | 
            +
            ## Glimmer command
         | 
| 64 78 |  | 
| 65 79 | 
             
            Usage:
         | 
| 66 80 | 
             
            ```
         | 
| 67 | 
            -
            glimmer  | 
| 68 | 
            -
            ```
         | 
| 69 | 
            -
             | 
| 70 | 
            -
            Example 1:
         | 
| 71 | 
            -
            ```
         | 
| 72 | 
            -
            glimmer hello_combo.rb
         | 
| 81 | 
            +
            glimmer application.rb
         | 
| 73 82 | 
             
            ```
         | 
| 74 | 
            -
            This runs the Glimmer application `hello_combo.rb` (if the SWT Jar is missing, it downloads it and sets it up first.)
         | 
| 75 83 |  | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 78 | 
            -
            glimmer --setup hello_combo.rb
         | 
| 79 | 
            -
            ```
         | 
| 80 | 
            -
            This performs setup and then runs the Glimmer application `hello_combo.rb` (downloads and sets up the SWT jar whether present or not)
         | 
| 84 | 
            +
            Runs a Glimmer application using JRuby, automatically preloading
         | 
| 85 | 
            +
            the glimmer ruby gem and SWT jar dependency.
         | 
| 81 86 |  | 
| 82 | 
            -
            Example | 
| 87 | 
            +
            Example:
         | 
| 83 88 | 
             
            ```
         | 
| 84 | 
            -
            glimmer  | 
| 89 | 
            +
            glimmer hello_world.rb
         | 
| 85 90 | 
             
            ```
         | 
| 86 | 
            -
            This  | 
| 91 | 
            +
            This runs the Glimmer application hello_world.rb
         | 
| 87 92 |  | 
| 88 | 
            -
            ## Syntax
         | 
| 93 | 
            +
            ## Glimmer DSL Syntax
         | 
| 89 94 |  | 
| 90 | 
            -
             | 
| 91 | 
            -
            https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fswt%2Fwidgets%2Fpackage-summary.html
         | 
| 95 | 
            +
            ### Widgets
         | 
| 92 96 |  | 
| 93 | 
            -
             | 
| 97 | 
            +
            Glimmer UIs (user interfaces) are modeled with widgets (wrappers around the SWT library widgets found here: https://help.eclipse.org/2019-12/topic/org.eclipse.platform.doc.isv/guide/swt_widgets_controls.htm?cp=2_0_7_0_0).
         | 
| 94 98 |  | 
| 95 | 
            -
             | 
| 96 | 
            -
            - `button` for `org.eclipse.swt.widgets.Button`
         | 
| 97 | 
            -
            - `label` for `org.eclipse.swt.widgets.Label`
         | 
| 98 | 
            -
            - `table_column` for `org.eclipse.swt.widgets.TableColumn`
         | 
| 99 | 
            +
            In Glimmer DSL, widgets are declared with lowercase underscored naming (you may look at usage examples in the `samples` directory).
         | 
| 99 100 |  | 
| 100 101 | 
             
            The `shell` widget is always the outermost widget containing all others in a desktop windowed application.
         | 
| 101 102 |  | 
| 102 | 
            -
             | 
| 103 | 
            +
            Other widget examples:
         | 
| 104 | 
            +
            - `button`: wrapper for `org.eclipse.swt.widgets.Button`
         | 
| 105 | 
            +
            - `label`: wrapper for `org.eclipse.swt.widgets.Label`
         | 
| 106 | 
            +
            - `tab_folder`: wrapper for `org.eclipse.swt.widgets.TabFolder`
         | 
| 107 | 
            +
            - `tab_item`: wrapper for `org.eclipse.swt.widgets.TabItem`
         | 
| 108 | 
            +
            - `table`: wrapper for `org.eclipse.swt.widgets.Table`
         | 
| 109 | 
            +
            - `table_column`: wrapper for `org.eclipse.swt.widgets.TableColumn`
         | 
| 110 | 
            +
            - `tree`: wrapper for `org.eclipse.swt.widgets.Tree`
         | 
| 111 | 
            +
             | 
| 112 | 
            +
            ### Widget Properties
         | 
| 113 | 
            +
             | 
| 114 | 
            +
            Widget properties (e.g. `text`) may be set with methods matching their names in lower snakecase.
         | 
| 103 115 |  | 
| 104 116 | 
             
            Widget property examples:
         | 
| 105 117 | 
             
            - `text` to set text value of a `label`
         | 
| 106 118 | 
             
            - `gridData` to set grid data of a `composite`
         | 
| 107 119 |  | 
| 120 | 
            +
            ### Data-Binding
         | 
| 121 | 
            +
             | 
| 108 122 | 
             
            Data-binding is done with `bind` command following widget property to bind and taking model and bindable attribute as arguments.
         | 
| 109 123 |  | 
| 110 124 | 
             
            Data-binding examples:
         | 
| @@ -121,17 +135,28 @@ The third example demonstrates computed value data binding whereby the value of | |
| 121 135 |  | 
| 122 136 | 
             
            You may learn more about Glimmer's syntax by reading the Eclipse Zone Tutorial mentioned in resources and opening up the samples under the `samples` folder.
         | 
| 123 137 |  | 
| 124 | 
            -
            ##  | 
| 138 | 
            +
            ## Samples
         | 
| 125 139 |  | 
| 126 | 
            -
             | 
| 140 | 
            +
            Check the "samples" folder for examples on how to write Glimmer applications. To run them, make sure to install the `glimmer` gem first and then use the `glimmer` command.
         | 
| 127 141 |  | 
| 128 | 
            -
             | 
| 142 | 
            +
            Example:
         | 
| 129 143 |  | 
| 130 | 
            -
             | 
| 144 | 
            +
            ```
         | 
| 145 | 
            +
            glimmer samples/hello_world.rb
         | 
| 146 | 
            +
            ```
         | 
| 131 147 |  | 
| 132 | 
            -
            ##  | 
| 148 | 
            +
            ## SWT Reference
         | 
| 133 149 |  | 
| 134 | 
            -
             | 
| 150 | 
            +
            https://www.eclipse.org/swt/docs.php
         | 
| 151 | 
            +
             | 
| 152 | 
            +
            Here is a list of SWT widgets:
         | 
| 153 | 
            +
             | 
| 154 | 
            +
            https://help.eclipse.org/2019-12/topic/org.eclipse.platform.doc.isv/guide/swt_widgets_controls.htm?cp=2_0_7_0_0
         | 
| 155 | 
            +
             | 
| 156 | 
            +
             | 
| 157 | 
            +
            ## Girb (Glimmer irb)
         | 
| 158 | 
            +
             | 
| 159 | 
            +
            With Glimmer installed, you may run want to run `girb` instead of standard `irb` to have SWT preloaded and the Glimmer library required and included for quick Glimmer coding/testing.
         | 
| 135 160 |  | 
| 136 161 | 
             
            ## Logging
         | 
| 137 162 |  | 
| @@ -159,26 +184,39 @@ D, [2017-07-21T19:23:12.878434 #35707] DEBUG -- : WidgetCommandHandler will hand | |
| 159 184 | 
             
            D, [2017-07-21T19:23:12.878798 #35707] DEBUG -- : widget styles are: [:multi]
         | 
| 160 185 | 
             
            ```
         | 
| 161 186 |  | 
| 162 | 
            -
            ##  | 
| 187 | 
            +
            ## Raw JRuby Command
         | 
| 163 188 |  | 
| 164 | 
            -
             | 
| 189 | 
            +
            If there is a need to run Glimmer directly via the `jruby` command, you
         | 
| 190 | 
            +
            may run the following:
         | 
| 165 191 |  | 
| 166 | 
            -
             | 
| 167 | 
            -
             | 
| 192 | 
            +
            ```
         | 
| 193 | 
            +
            jruby -J-classpath "path_to/swt.jar" -r glimmer -S application.rb
         | 
| 194 | 
            +
            ```
         | 
| 168 195 |  | 
| 169 | 
            -
             | 
| 196 | 
            +
            The `-J-classpath` option specifies the `swt.jar` file path, which can be a
         | 
| 197 | 
            +
            manually downloaded version of SWT, or otherwise the one included in the gem. You can lookup the one included in the gem by running `jgem which glimmer` to find the gem path and then look through the `vendor` directory.
         | 
| 170 198 |  | 
| 171 | 
            -
             | 
| 199 | 
            +
            The `-r` option preloads (requires) the `glimmer` library in Ruby.
         | 
| 172 200 |  | 
| 173 | 
            -
             | 
| 201 | 
            +
            The `-S` option specifies a script to run.
         | 
| 174 202 |  | 
| 175 | 
            -
             | 
| 203 | 
            +
            ## Platform Support
         | 
| 204 | 
            +
             | 
| 205 | 
            +
            Glimmer runs on Mac, Windows, and Linux
         | 
| 206 | 
            +
             | 
| 207 | 
            +
            ### Mac Support
         | 
| 208 | 
            +
             | 
| 209 | 
            +
            Mac is well supported with the `glimmer` command. However, if there is a reason to use the raw jruby command, you need to pass an extra option (`-J-XstartOnFirstThread`) to JRuby on the Mac.
         | 
| 210 | 
            +
             | 
| 211 | 
            +
            Example:
         | 
| 212 | 
            +
            ```
         | 
| 213 | 
            +
            jruby -J-XstartOnFirstThread -J-classpath "path_to/swt.jar" -r glimmer -S application.rb
         | 
| 214 | 
            +
            ```
         | 
| 176 215 |  | 
| 177 216 | 
             
            ## Feature Suggestions
         | 
| 178 217 |  | 
| 179 218 | 
             
            These features have been suggested. You might see them in a future version of Glimmer. You are welcome to contribute more feature suggestions.
         | 
| 180 219 |  | 
| 181 | 
            -
            - Nested binding via attribute expressions (e.g. `bind(person, "address.city")`)
         | 
| 182 220 | 
             
            - bind_collection: an iterator that enables spawning widgets based on a collection (e.g. spawn 2 `AddressWidget`s if `user.addresses` bind collection contains 2 addresses)
         | 
| 183 221 |  | 
| 184 222 | 
             
            ## Contributing to Glimmer
         | 
| @@ -187,18 +225,18 @@ Please follow these instructions if you would like to help us develop Glimmer: | |
| 187 225 |  | 
| 188 226 | 
             
            1. Download and extract the ["SWT binary and source"](http://download.eclipse.org/eclipse/downloads/drops4/R-4.7-201706120950/#SWT).
         | 
| 189 227 | 
             
            2. Add swt.jar to your Java CLASSPATH environment (e.g. `export CLASSPATH="$CLASSPATH:/path_to_swt_jar/swt.jar"`)
         | 
| 190 | 
            -
            3. Download and setup  | 
| 191 | 
            -
            4. Install bundler ( | 
| 228 | 
            +
            3. Download and setup JRuby (`rvm install jruby-9.2.10.0`)
         | 
| 229 | 
            +
            4. Install bundler (jgem install bundler)
         | 
| 192 230 | 
             
            5. Install project required gems (bundle install)
         | 
| 193 231 | 
             
            6. Write a program that requires the file "lib/glimmer.rb" (or glimmer gem) and has the UI class (view) include the Glimmer module
         | 
| 194 232 | 
             
            7. Run your program with `bin/glimmer` or jruby (pass `-J-XstartOnFirstThread` option if on the Mac)
         | 
| 195 233 |  | 
| 196 234 | 
             
            ## Contributors
         | 
| 197 235 |  | 
| 198 | 
            -
            *  | 
| 236 | 
            +
            * Andy Maleh (Founder)
         | 
| 199 237 | 
             
            * Dennis Theisen
         | 
| 200 238 |  | 
| 201 239 | 
             
            ## License
         | 
| 202 240 |  | 
| 203 | 
            -
            Copyright (c) 2007- | 
| 241 | 
            +
            Copyright (c) 2007-2020 Andy Maleh.
         | 
| 204 242 | 
             
            See LICENSE.txt for further details.
         | 
    
        data/bin/girb
    CHANGED
    
    | @@ -1,5 +1,3 @@ | |
| 1 1 | 
             
            #!/usr/bin/env ruby
         | 
| 2 | 
            -
            require 'os'
         | 
| 3 2 | 
             
            require_relative '../lib/glimmer_application'
         | 
| 4 | 
            -
             | 
| 5 | 
            -
            system "ruby #{additional_options} -J-classpath \"#{GlimmerApplication::SWT_JAR_FILE}\" -S irb -r #{File.expand_path(File.join(__FILE__, '..', 'girb_runner.rb'))}"
         | 
| 3 | 
            +
            GlimmerApplication.launch('irb')
         | 
    
        data/bin/glimmer
    CHANGED
    
    
    
        data/lib/glimmer_application.rb
    CHANGED
    
    | @@ -1,98 +1,57 @@ | |
| 1 | 
            -
            require 'net/http'
         | 
| 2 | 
            -
            require 'fileutils'
         | 
| 3 1 | 
             
            require 'os'
         | 
| 4 2 |  | 
| 5 3 | 
             
            class GlimmerApplication
         | 
| 6 | 
            -
               | 
| 7 | 
            -
               | 
| 4 | 
            +
              OPERATING_SYSTEMS_SUPPORTED = ["mac", "windows", "linux"]
         | 
| 5 | 
            +
              TEXT_USAGE = <<-MULTILINE
         | 
| 6 | 
            +
            Usage: glimmer application.rb
         | 
| 8 7 |  | 
| 9 | 
            -
             | 
| 8 | 
            +
            Runs a Glimmer application using JRuby, automatically preloading
         | 
| 9 | 
            +
            the glimmer ruby gem and SWT jar dependency.
         | 
| 10 10 |  | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
                "linux_x86" => "http://mirror.csclub.uwaterloo.ca/eclipse/eclipse/downloads/drops4/R-4.7-201706120950/swt-4.7-gtk-linux-x86.zip",
         | 
| 15 | 
            -
                "windows_x86_64" => "http://mirror.csclub.uwaterloo.ca/eclipse/eclipse/downloads/drops4/R-4.7-201706120950/swt-4.7-win32-win32-x86_64.zip",
         | 
| 16 | 
            -
                "windows_x86" => "http://eclipse.mirror.rafal.ca/eclipse/downloads/drops4/R-4.7-201706120950/swt-4.7-win32-win32-x86.zip"
         | 
| 17 | 
            -
              }
         | 
| 11 | 
            +
            Example: glimmer hello_world.rb
         | 
| 12 | 
            +
            This runs the Glimmer application hello_world.rb
         | 
| 13 | 
            +
              MULTILINE
         | 
| 18 14 |  | 
| 19 | 
            -
               | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
              # Accepts the following options string:
         | 
| 23 | 
            -
              # --setup app_file_path.rb
         | 
| 24 | 
            -
              # or
         | 
| 25 | 
            -
              # --setup
         | 
| 26 | 
            -
              # or
         | 
| 27 | 
            -
              # app_file_path.rb
         | 
| 28 | 
            -
              def initialize(options)
         | 
| 29 | 
            -
                @setup_requested = options.first == '--setup'
         | 
| 30 | 
            -
                @application = setup_requested? ? options[1] : options.first
         | 
| 31 | 
            -
              end
         | 
| 32 | 
            -
             | 
| 33 | 
            -
              def start
         | 
| 34 | 
            -
                usage unless setup_requested? || application
         | 
| 35 | 
            -
             | 
| 36 | 
            -
                setup if setup_requested? || !File.exist?(SWT_JAR_FILE)
         | 
| 37 | 
            -
             | 
| 38 | 
            -
                if application
         | 
| 39 | 
            -
                  puts "Starting Glimmer Application #{application}"
         | 
| 40 | 
            -
                  system "ruby #{additional_options} -J-classpath \"#{SWT_JAR_FILE}\" #{application}"
         | 
| 15 | 
            +
              class << self
         | 
| 16 | 
            +
                def platform_os
         | 
| 17 | 
            +
                  OPERATING_SYSTEMS_SUPPORTED.detect {|os| OS.send("#{os}?")}
         | 
| 41 18 | 
             
                end
         | 
| 42 | 
            -
              end
         | 
| 43 | 
            -
             | 
| 44 | 
            -
              def usage
         | 
| 45 | 
            -
                puts <<-MULTILINE
         | 
| 46 | 
            -
            Usage: glimmer [--setup] [application_ruby_file_path.rb]
         | 
| 47 | 
            -
             | 
| 48 | 
            -
            Example 1: glimmer hello_combo.rb
         | 
| 49 | 
            -
            This runs the Glimmer application hello_combo.rb
         | 
| 50 | 
            -
            If the SWT Jar is missing, it downloads it and sets it up first.
         | 
| 51 19 |  | 
| 52 | 
            -
             | 
| 53 | 
            -
             | 
| 54 | 
            -
             | 
| 55 | 
            -
             | 
| 56 | 
            -
            Example 3: glimmer --setup
         | 
| 57 | 
            -
            This downloads and sets up the SWT jar whether missing or not.
         | 
| 58 | 
            -
                MULTILINE
         | 
| 59 | 
            -
              end
         | 
| 20 | 
            +
                def swt_jar_file
         | 
| 21 | 
            +
                  @swt_jar_file ||= File.expand_path(File.join(__FILE__, '..', '..', 'vendor', 'swt', platform_os, 'swt.jar'))
         | 
| 22 | 
            +
                end
         | 
| 60 23 |  | 
| 61 | 
            -
             | 
| 62 | 
            -
             | 
| 63 | 
            -
                 | 
| 64 | 
            -
                download(SWT_ZIP_FILE)
         | 
| 65 | 
            -
                puts "Unzipping #{SWT_ZIP_FILE}"
         | 
| 66 | 
            -
                `unzip -o #{SWT_ZIP_FILE} -d #{File.dirname(SWT_ZIP_FILE)}`
         | 
| 67 | 
            -
                puts "Finished unzipping"
         | 
| 68 | 
            -
              end
         | 
| 24 | 
            +
                def jruby_os_specific_options
         | 
| 25 | 
            +
                  OS.mac? ? "-J-XstartOnFirstThread" : ""
         | 
| 26 | 
            +
                end
         | 
| 69 27 |  | 
| 70 | 
            -
             | 
| 71 | 
            -
             | 
| 72 | 
            -
                puts "Downloading #{uri}"
         | 
| 73 | 
            -
                File.open(file, 'w') do |f|
         | 
| 74 | 
            -
                  f.write(Net::HTTP.get(uri))
         | 
| 28 | 
            +
                def jruby_command_options
         | 
| 29 | 
            +
                  "#{jruby_os_specific_options} -J-classpath \"#{swt_jar_file}\" -r glimmer"
         | 
| 75 30 | 
             
                end
         | 
| 76 | 
            -
                puts "Finished downloading"
         | 
| 77 | 
            -
              end
         | 
| 78 31 |  | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 32 | 
            +
                def launch(application)
         | 
| 33 | 
            +
                  system "jruby #{jruby_command_options} -S #{application}"
         | 
| 34 | 
            +
                end
         | 
| 81 35 | 
             
              end
         | 
| 82 36 |  | 
| 83 | 
            -
              def  | 
| 84 | 
            -
                 | 
| 37 | 
            +
              def initialize(application_path)
         | 
| 38 | 
            +
                @application_path = application_path
         | 
| 85 39 | 
             
              end
         | 
| 86 40 |  | 
| 87 | 
            -
              def  | 
| 88 | 
            -
                 | 
| 41 | 
            +
              def start
         | 
| 42 | 
            +
                if @application_path
         | 
| 43 | 
            +
                  run_application
         | 
| 44 | 
            +
                else
         | 
| 45 | 
            +
                  display_usage
         | 
| 46 | 
            +
                end
         | 
| 89 47 | 
             
              end
         | 
| 90 48 |  | 
| 91 | 
            -
              def  | 
| 92 | 
            -
                 | 
| 49 | 
            +
              def run_application
         | 
| 50 | 
            +
                puts "Starting Glimmer Application #{@application_path}"
         | 
| 51 | 
            +
                self.class.launch(@application_path)
         | 
| 93 52 | 
             
              end
         | 
| 94 53 |  | 
| 95 | 
            -
              def  | 
| 96 | 
            -
                 | 
| 54 | 
            +
              def display_usage
         | 
| 55 | 
            +
                puts TEXT_USAGE
         | 
| 97 56 | 
             
              end
         | 
| 98 57 | 
             
            end
         | 
| Binary file | 
| Binary file | 
| Binary file | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: glimmer
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.2.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - AndyMaleh
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020- | 
| 11 | 
            +
            date: 2020-03-01 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -17,8 +17,8 @@ dependencies: | |
| 17 17 | 
             
                  - !ruby/object:Gem::Version
         | 
| 18 18 | 
             
                    version: 3.1.0
         | 
| 19 19 | 
             
              name: facets
         | 
| 20 | 
            -
              prerelease: false
         | 
| 21 20 | 
             
              type: :runtime
         | 
| 21 | 
            +
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 24 | 
             
                - - '='
         | 
| @@ -31,8 +31,8 @@ dependencies: | |
| 31 31 | 
             
                  - !ruby/object:Gem::Version
         | 
| 32 32 | 
             
                    version: 1.0.0
         | 
| 33 33 | 
             
              name: os
         | 
| 34 | 
            -
              prerelease: false
         | 
| 35 34 | 
             
              type: :runtime
         | 
| 35 | 
            +
              prerelease: false
         | 
| 36 36 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 37 | 
             
                requirements:
         | 
| 38 38 | 
             
                - - '='
         | 
| @@ -45,8 +45,8 @@ dependencies: | |
| 45 45 | 
             
                  - !ruby/object:Gem::Version
         | 
| 46 46 | 
             
                    version: 3.5.0
         | 
| 47 47 | 
             
              name: rspec-mocks
         | 
| 48 | 
            -
              prerelease: false
         | 
| 49 48 | 
             
              type: :development
         | 
| 49 | 
            +
              prerelease: false
         | 
| 50 50 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 51 | 
             
                requirements:
         | 
| 52 52 | 
             
                - - "~>"
         | 
| @@ -59,8 +59,8 @@ dependencies: | |
| 59 59 | 
             
                  - !ruby/object:Gem::Version
         | 
| 60 60 | 
             
                    version: 3.5.0
         | 
| 61 61 | 
             
              name: rspec
         | 
| 62 | 
            -
              prerelease: false
         | 
| 63 62 | 
             
              type: :development
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 64 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 65 | 
             
                requirements:
         | 
| 66 66 | 
             
                - - "~>"
         | 
| @@ -73,8 +73,8 @@ dependencies: | |
| 73 73 | 
             
                  - !ruby/object:Gem::Version
         | 
| 74 74 | 
             
                    version: 2.3.0
         | 
| 75 75 | 
             
              name: rdoc
         | 
| 76 | 
            -
              prerelease: false
         | 
| 77 76 | 
             
              type: :development
         | 
| 77 | 
            +
              prerelease: false
         | 
| 78 78 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 79 | 
             
                requirements:
         | 
| 80 80 | 
             
                - - "~>"
         | 
| @@ -87,8 +87,8 @@ dependencies: | |
| 87 87 | 
             
                  - !ruby/object:Gem::Version
         | 
| 88 88 | 
             
                    version: 2.3.9
         | 
| 89 89 | 
             
              name: jeweler
         | 
| 90 | 
            -
              prerelease: false
         | 
| 91 90 | 
             
              type: :development
         | 
| 91 | 
            +
              prerelease: false
         | 
| 92 92 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 93 93 | 
             
                requirements:
         | 
| 94 94 | 
             
                - - "~>"
         | 
| @@ -101,8 +101,8 @@ dependencies: | |
| 101 101 | 
             
                  - !ruby/object:Gem::Version
         | 
| 102 102 | 
             
                    version: 0.8.5
         | 
| 103 103 | 
             
              name: coveralls
         | 
| 104 | 
            -
              prerelease: false
         | 
| 105 104 | 
             
              type: :development
         | 
| 105 | 
            +
              prerelease: false
         | 
| 106 106 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 107 107 | 
             
                requirements:
         | 
| 108 108 | 
             
                - - '='
         | 
| @@ -115,8 +115,8 @@ dependencies: | |
| 115 115 | 
             
                  - !ruby/object:Gem::Version
         | 
| 116 116 | 
             
                    version: 0.10.0
         | 
| 117 117 | 
             
              name: simplecov
         | 
| 118 | 
            -
              prerelease: false
         | 
| 119 118 | 
             
              type: :development
         | 
| 119 | 
            +
              prerelease: false
         | 
| 120 120 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 121 121 | 
             
                requirements:
         | 
| 122 122 | 
             
                - - "~>"
         | 
| @@ -129,8 +129,8 @@ dependencies: | |
| 129 129 | 
             
                  - !ruby/object:Gem::Version
         | 
| 130 130 | 
             
                    version: 0.8.1
         | 
| 131 131 | 
             
              name: puts_debuggerer
         | 
| 132 | 
            -
              prerelease: false
         | 
| 133 132 | 
             
              type: :development
         | 
| 133 | 
            +
              prerelease: false
         | 
| 134 134 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 135 135 | 
             
                requirements:
         | 
| 136 136 | 
             
                - - "~>"
         | 
| @@ -147,22 +147,10 @@ extra_rdoc_files: | |
| 147 147 | 
             
            - LICENSE.txt
         | 
| 148 148 | 
             
            - README.markdown
         | 
| 149 149 | 
             
            files:
         | 
| 150 | 
            -
            - ".coveralls.yml"
         | 
| 151 | 
            -
            - ".rspec"
         | 
| 152 | 
            -
            - ".ruby-gemset"
         | 
| 153 | 
            -
            - ".ruby-version"
         | 
| 154 | 
            -
            - Gemfile
         | 
| 155 150 | 
             
            - LICENSE.txt
         | 
| 156 151 | 
             
            - README.markdown
         | 
| 157 | 
            -
            - RELEASE.md
         | 
| 158 | 
            -
            - Rakefile
         | 
| 159 | 
            -
            - TODO.md
         | 
| 160 | 
            -
            - VERSION
         | 
| 161 152 | 
             
            - bin/girb
         | 
| 162 | 
            -
            - bin/girb_runner.rb
         | 
| 163 153 | 
             
            - bin/glimmer
         | 
| 164 | 
            -
            - glimmer.gemspec
         | 
| 165 | 
            -
            - images/Bitter-sweet.jpg
         | 
| 166 154 | 
             
            - lib/command_handler.rb
         | 
| 167 155 | 
             
            - lib/command_handler_chain_factory.rb
         | 
| 168 156 | 
             
            - lib/command_handler_chain_link.rb
         | 
| @@ -212,36 +200,9 @@ files: | |
| 212 200 | 
             
            - lib/xml_command_handlers/xml_name_space_command_handler.rb
         | 
| 213 201 | 
             
            - lib/xml_command_handlers/xml_tag_command_handler.rb
         | 
| 214 202 | 
             
            - lib/xml_command_handlers/xml_text_command_handler.rb
         | 
| 215 | 
            -
            -  | 
| 216 | 
            -
            -  | 
| 217 | 
            -
            -  | 
| 218 | 
            -
            - samples/contactmanager/contact_repository.rb
         | 
| 219 | 
            -
            - samples/hello_combo.rb
         | 
| 220 | 
            -
            - samples/hello_list_multi_selection.rb
         | 
| 221 | 
            -
            - samples/hello_list_single_selection.rb
         | 
| 222 | 
            -
            - samples/hello_tab.rb
         | 
| 223 | 
            -
            - samples/hello_world.rb
         | 
| 224 | 
            -
            - samples/hellocomputed/contact.rb
         | 
| 225 | 
            -
            - samples/hellocomputed/hello_computed.rb
         | 
| 226 | 
            -
            - samples/login.rb
         | 
| 227 | 
            -
            - samples/tictactoe/tic_tac_toe.rb
         | 
| 228 | 
            -
            - samples/tictactoe/tic_tac_toe_board.rb
         | 
| 229 | 
            -
            - spec/lib/command_handlers/models/observable_model_spec.rb
         | 
| 230 | 
            -
            - spec/lib/command_handlers/models/r_widget_spec.rb
         | 
| 231 | 
            -
            - spec/lib/glimmer__combo_data_binding__spec.rb
         | 
| 232 | 
            -
            - spec/lib/glimmer__constant__spec.rb
         | 
| 233 | 
            -
            - spec/lib/glimmer__data_binding__spec.rb
         | 
| 234 | 
            -
            - spec/lib/glimmer__list_data_binding__spec.rb
         | 
| 235 | 
            -
            - spec/lib/glimmer__listeners__spec.rb
         | 
| 236 | 
            -
            - spec/lib/glimmer__shine_data_binding__spec.rb
         | 
| 237 | 
            -
            - spec/lib/glimmer__tab_item__spec.rb
         | 
| 238 | 
            -
            - spec/lib/glimmer__table_data_binding__spec.rb
         | 
| 239 | 
            -
            - spec/lib/glimmer__tree_data_binding__spec.rb
         | 
| 240 | 
            -
            - spec/lib/glimmer_spec.rb
         | 
| 241 | 
            -
            - spec/lib/xml/glimmer_xml_spec.rb
         | 
| 242 | 
            -
            - spec/samples/contactmanager/contact_manager_presenter_spec.rb
         | 
| 243 | 
            -
            - spec/samples/tictactoe/tic_tac_toe_spec.rb
         | 
| 244 | 
            -
            - spec/spec_helper.rb
         | 
| 203 | 
            +
            - vendor/swt/linux/swt.jar
         | 
| 204 | 
            +
            - vendor/swt/mac/swt.jar
         | 
| 205 | 
            +
            - vendor/swt/windows/swt.jar
         | 
| 245 206 | 
             
            homepage: http://github.com/AndyObtiva/glimmer
         | 
| 246 207 | 
             
            licenses:
         | 
| 247 208 | 
             
            - MIT
         | 
| @@ -261,8 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 261 222 | 
             
                - !ruby/object:Gem::Version
         | 
| 262 223 | 
             
                  version: '0'
         | 
| 263 224 | 
             
            requirements: []
         | 
| 264 | 
            -
             | 
| 265 | 
            -
            rubygems_version: 2.7.10
         | 
| 225 | 
            +
            rubygems_version: 3.0.6
         | 
| 266 226 | 
             
            signing_key:
         | 
| 267 227 | 
             
            specification_version: 4
         | 
| 268 228 | 
             
            summary: Desktop application development library
         |