glimmer-cs-calculator 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d93ed877d6e253a93f0cfbf23ddfb6d2dddf526a6cc311e9d0f98f69073623f
4
- data.tar.gz: cd774f43b245c75868f647b09c09fcac37709f0f6b8ef99783c2c6818fe74eb2
3
+ metadata.gz: db2e112e9ef0539b67b5cccbd7ba2715d39ce0197a28949f8eee7b9d6d6e004c
4
+ data.tar.gz: a026682096bf13357bacbfb3863bf0ac95729c016c1bfc04eb1d8bac22b21e39
5
5
  SHA512:
6
- metadata.gz: 3bac3aefcd30c6ac3ca82805001b0793e798ebfac79f029d29eabcf7689e5853087e77ae6467c1a6413ebcab24cd03957123e9457d7102f89d2a530c9c4dd09d
7
- data.tar.gz: 51bc9e0d3c9098132d15d45a0751b77918517fcdbe8abd04a178c5b376658e3c1e51fc3c12ab471b2c277fc345a7203ce629693effe63a9e7e6eb1dba9057409
6
+ metadata.gz: 9e10ea594879dadba4ebacc35657e147f0d0ecaf7e629391f096c005987896bf9f6003a974a9621f6e637a3d48c671afb40e033fbd7c73d8814e798b6f84ffea
7
+ data.tar.gz: 3165ca8deefc79c121cccb9d66c1a192b767ebf34d7c1e1c865e52e8731e0651074b5b696ae39d173382489111c27ea28cd069925e33579900bb0c2499885b24
data/README.md CHANGED
@@ -14,17 +14,17 @@ Glimmer Calculator on Linux
14
14
 
15
15
  ![Calculator](glimmer-cs-calculator-screenshot-linux.png)
16
16
 
17
- Glimmer Calculator on [Opal](https://github.com/AndyObtiva/glimmer-dsl-opal) (Web)
17
+ Glimmer Calculator on [Opal](#glimmer-dsl-for-opal) (Web)
18
18
 
19
- ![Calculator](glimmer-cs-calculator-screenshot-opal.png)
19
+ [![Calculator](glimmer-cs-calculator-screenshot-opal.png)](http://glimmer-cs-calculator-server.herokuapp.com)
20
20
 
21
21
  Glimmer Calculator is a sample desktop GUI application built with [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) (JRuby Desktop Development GUI Library).
22
22
 
23
23
  Architectural Pattern is MVP (Model View Presenter) thanks to [Glimmer data-binding](https://github.com/AndyObtiva/glimmer-dsl-swt#data-binding) support.
24
24
 
25
- Glimmer Calculator was developed test-first following TDD (Test Driven Development) after [Glimmer Scaffolding](https://github.com/AndyObtiva/glimmer-dsl-swt#scaffolding).
25
+ Glimmer Calculator was developed test-first following TDD (Test Driven Development) after [Glimmer Scaffolding](https://github.com/AndyObtiva/glimmer-dsl-swt#scaffolding).
26
26
 
27
- Design Patterns discovered in the process were Presenter/Facade and Command Pattern.
27
+ Design Patterns discovered in the process were Facade (Presenter) and Command Pattern.
28
28
 
29
29
  Here are the calculator commands under the [models directory](lib/models/glimmer/calculator):
30
30
 
@@ -36,12 +36,14 @@ Here are the calculator commands under the [models directory](lib/models/glimmer
36
36
 
37
37
  [<img alt="Glimmer Calculator Icon" src="glimmer-cs-calculator-icon.png" height=40 />Download Glimmer Calculator v1.1.3 GEM for Linux](#setup-instructions)
38
38
 
39
+ [<img alt="Glimmer Calculator Icon" src="glimmer-cs-calculator-icon.png" height=40 />Visit Glimmer Calculator v1.1.2 WEB for Opal](https://glimmer-cs-calculator-server.herokuapp.com)
40
+
39
41
  ## Platforms
40
42
 
41
43
  - Mac: Tested and [packaged](https://github.com/AndyObtiva/glimmer-dsl-swt#packaging--distribution) for Mac. ([Download Here](https://www.dropbox.com/s/2wbyy0z0w875n39/Glimmer%20Calculator-1.1.1.dmg?dl=1))
42
44
  - Windows: Tested and [packaged](https://github.com/AndyObtiva/glimmer-dsl-swt#packaging--distribution) for Windows. ([Download Here](https://www.dropbox.com/s/e8b586s2xgjn9bg/Glimmer%20Calculator-1.1.1.msi?dl=1))
43
45
  - Linux: Tested and [packaged](http://rubygems.org/gems/glimmer-cs-calculator) for Linux (Follow [setup instructions](#setup-instructions) to install [gem](http://rubygems.org/gems/glimmer-cs-calculator) and run `calculator` command)
44
- - Opal (Web): Tested with [Glimmer DSL for Opal](https://github.com/AndyObtiva/glimmer-dsl-opal)
46
+ - Opal (Web): Tested with [Glimmer DSL for Opal](https://github.com/AndyObtiva/glimmer-dsl-opal) and [deployed to Heroku](https://glimmer-cs-calculator-server.herokuapp.com). Visit https://glimmer-cs-calculator-server.herokuapp.com
45
47
 
46
48
  ## Development Environment Pre-requisites
47
49
 
@@ -50,6 +52,8 @@ Here are the calculator commands under the [models directory](lib/models/glimmer
50
52
 
51
53
  ## Setup Instructions
52
54
 
55
+ ### Glimmer DSL for SWT
56
+
53
57
  Install Calculator gem by running (`jgem`, `jruby -S gem`, or `gem` directly if you have RVM):
54
58
 
55
59
  ```
@@ -62,15 +66,15 @@ Afterwards, you may run `calculator` to bring up the calculator:
62
66
  calculator
63
67
  ```
64
68
 
65
- Note: If you cloned this project and bundle installed, you may invoke via `bin/calculator` instead.
69
+ Note: If you cloned this project and bundle installed, you may invoke via `bin/calculator` instead.
66
70
 
67
- ### Glimmer Custom Shell Reuse
71
+ #### Glimmer Custom Shell Reuse
68
72
 
69
- To reuse Calculator as a Glimmer Custom Shell inside another Glimmer application, add the
73
+ To reuse Calculator as a Glimmer Custom Shell inside another Glimmer application, add the
70
74
  following to the application's `Gemfile`:
71
75
 
72
76
  ```
73
- gem 'glimmer-cs-calculator', '1.1.3'
77
+ gem 'glimmer-cs-calculator', '1.1.4'
74
78
  ```
75
79
 
76
80
  Run:
@@ -81,6 +85,48 @@ jruby -S bundle
81
85
 
82
86
  And, then instantiate the Calculator custom shell in your Glimmer application via the `calculator` Glimmer DSL keyword.
83
87
 
88
+ ### Glimmer DSL for Opal
89
+
90
+ The app Rails server lives under: [server/glimmer-cs-calculator-server](server/glimmer-cs-calculator-server)
91
+
92
+ It is deployed to Heroku at: https://glimmer-cs-calculator-server.herokuapp.com
93
+
94
+ [Setup instructions](https://github.com/AndyObtiva/glimmer-dsl-opal#setup) from [Glimmer DSL for Opal](https://github.com/AndyObtiva/glimmer-dsl-opal) were followed in creating the Rails server.
95
+
96
+ This is the content of `app/assets/javascripts/application.rb`:
97
+
98
+ ```ruby
99
+ require 'glimmer-dsl-opal'
100
+
101
+ Document.ready? do
102
+ require 'glimmer-cs-calculator/launch'
103
+ end
104
+ ```
105
+
106
+ As you can see, Glimmer Calculator works as is by adding one require statement without needing to change a single line of its code thanks to [Glimmer DSL for Opal](https://github.com/AndyObtiva/glimmer-dsl-opal).
107
+
108
+ [![Calculator](glimmer-cs-calculator-screenshot-opal.png)](http://glimmer-cs-calculator-server.herokuapp.com)
109
+
110
+ #### CSS Themes
111
+
112
+ CSS can be applied externally in Rails onto any Rails Route serving an Opal app.
113
+
114
+ ##### Apple Calculator CSS Theme
115
+
116
+ Visit: http://glimmer-cs-calculator-server.herokuapp.com/welcomes/apple
117
+
118
+ [server/glimmer-cs-calculator-server/app/assets/stylesheets/welcomes_apple.scss](server/glimmer-cs-calculator-server/app/assets/stylesheets/welcomes_apple.scss)
119
+
120
+ [![Calculator](glimmer-cs-calculator-screenshot-opal-apple.png)](http://glimmer-cs-calculator-server.herokuapp.com/welcomes/apple)
121
+
122
+ ##### Tiles CSS Theme
123
+
124
+ Visit: http://glimmer-cs-calculator-server.herokuapp.com/welcomes/tiles
125
+
126
+ [server/glimmer-cs-calculator-server/app/assets/stylesheets/welcomes_tiles.scss](server/glimmer-cs-calculator-server/app/assets/stylesheets/welcomes_tiles.scss)
127
+
128
+ [![Calculator](glimmer-cs-calculator-screenshot-opal-tiles.png)](http://glimmer-cs-calculator-server.herokuapp.com/welcomes/tiles)
129
+
84
130
  ## Feature Suggestions
85
131
 
86
132
  [TODO.md](TODO.md)
@@ -109,4 +155,4 @@ Copyright (c) 2020 Andy Maleh. See [LICENSE.txt](LICENSE.txt) for further detail
109
155
 
110
156
  [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=40 />](https://github.com/AndyObtiva/glimmer) Built with [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) (JRuby Desktop Development GUI Library)
111
157
 
112
- Gladiator icon made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>
158
+ Glimmer Calculator icon made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.3
1
+ 1.1.4
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: glimmer-cs-calculator 1.1.3 ruby lib
5
+ # stub: glimmer-cs-calculator 1.1.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer-cs-calculator".freeze
9
- s.version = "1.1.3"
9
+ s.version = "1.1.4"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Andy Maleh".freeze]
14
- s.date = "2020-10-15"
14
+ s.date = "2021-08-03"
15
15
  s.description = "Calculator - Glimmer Custom Shell".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["glimmer-cs-calculator".freeze, "calculator".freeze]
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
46
46
  ]
47
47
  s.homepage = "http://github.com/AndyObtiva/glimmer-cs-calculator".freeze
48
48
  s.licenses = ["MIT".freeze]
49
- s.rubygems_version = "3.1.4".freeze
49
+ s.rubygems_version = "3.1.6".freeze
50
50
  s.summary = "Calculator - Glimmer Custom Shell".freeze
51
51
 
52
52
  if s.respond_to? :specification_version then
@@ -13,8 +13,8 @@ module Glimmer
13
13
  end
14
14
 
15
15
  def calculate
16
- calculation_result = BigDecimal.new(number1.to_s).send(operation_method, BigDecimal.new(number2.to_s)).to_f
17
- calculation_result.to_s.match(/\.0+$/) ? calculation_result.to_i : calculation_result
16
+ calculation_result = BigDecimal.new(number1.to_s).send(operation_method, BigDecimal.new(number2.to_s)).to_s('F')
17
+ calculation_result.match(/\.0+$/) ? calculation_result.to_i : calculation_result
18
18
  end
19
19
 
20
20
  # Subclasses must implement to indicate operation method on number (e.g. :+ for addition)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-cs-calculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-15 00:00:00.000000000 Z
11
+ date: 2021-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0'
168
168
  requirements: []
169
- rubygems_version: 3.1.4
169
+ rubygems_version: 3.1.6
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: Calculator - Glimmer Custom Shell