contact_manager 1.0.0 → 1.0.1

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: da527969ce6fd98138bdef3127469852a8b33c366f380e1a882cb5fdc89f5624
4
- data.tar.gz: 2ee57d438aed53cc3c21bf0100e9e2826a1e89e64688ef4d7aa837910978c0ea
3
+ metadata.gz: 04edebb2044b590afbb91c5c7e7f11639961db6e7a2621f7bd06504627f5cbe4
4
+ data.tar.gz: 4c1cb31660c00b45f5c06bdbde0aa623c1245ce7bdfa1dd4c1d21bea778af979
5
5
  SHA512:
6
- metadata.gz: 85aa0ae30fd630b7a51b3264781e35c1a05aa1d99a394aae054e172097aa389bbfece26bb54c7723c5bc7f37de56511ca0672854ce3f643c23d881342f3c2904
7
- data.tar.gz: 11d3cf705f2bf0eee3b1de13f8f810f035467fd5342f3681c2fafa0a1c19c29448c43101bdc517553bc862112397c5bfa226ff1926838eeb2b2cadf3f41a1945
6
+ metadata.gz: e73518b23676065f6a9eca40e01a6ba5ac559bc34969c64986efe1d5469ef85f478c28780c6a937a05dfc1c7dfc3ed1729db8d1f147ccde62f579633abab9149
7
+ data.tar.gz: 0fd740849272fe1f8d28255ea5046af0333ac0e437e6acaf0af605a7631828988be5a467bc2efc606f8ed818066249389b7e19e4ee96db99808a1a76a5582e88
data/README.md CHANGED
@@ -1,31 +1,52 @@
1
- # <img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=85 /> Contact Manager 1.0.0
1
+ # <img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=85 /> Contact Manager 1.0.1
2
2
  ## [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-swt/master/images/glimmer-logo-hi-res.png" height=40 /> Glimmer Application](https://github.com/AndyObtiva/glimmer-dsl-swt)
3
3
  [![Gem Version](https://badge.fury.io/rb/contact_manager.svg)](http://badge.fury.io/rb/contact_manager)
4
4
 
5
5
  Contact Manager is a [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) sample leveraging [SQLite DB](https://www.sqlite.org/index.html) via [ActiveRecord](https://rubygems.org/gems/activerecord).
6
6
 
7
+ Learn more in the blog post: [Using ActiveRecord with SQLite DB in a JRuby Desktop App](https://andymaleh.blogspot.com/2022/06/using-activerecord-with-sqlite-db-in.html?m=0).
8
+
7
9
  ![Contact Manager Screenshot](/screenshots/contact-manager.gif)
8
10
 
11
+ ## Requirements
12
+
13
+ 1. Store contacts having the following attributes:
14
+ - First Name
15
+ - Last Name
16
+ - Email
17
+ - Phone
18
+ - Street
19
+ - City
20
+ - State/Province
21
+ - Zip/Postal Code
22
+ - Country
23
+ 2. List stored contacts
24
+ 3. Search stored contacts by any of the contact attributes.
25
+ 4. Sort contacts by First Name, Last Name, Email, Phone, or Full Address
26
+ 5. Edit a stored contact
27
+ 6. Delete a stored contact
28
+ 7. Delete all stored contacts
29
+
9
30
  ## Setup
10
31
 
11
32
  ### Option 1: Install Native Executable Package
12
33
 
13
- [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=40 /> Contact Manager 1.0.0 (Mac Catalina 10.15.7 x86_64 DMG)](https://www.dropbox.com/s/swc0jl7joy29m84/Contact%20Manager-1.0.0-x64-catalina-10.15.7.dmg?dl=1)
34
+ [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=40 /> Contact Manager 1.0.1 (Mac Catalina 10.15.7 x86_64 DMG)](https://www.dropbox.com/s/fh0nhbf9gg755kc/Contact%20Manager-1.0.1-x86_64-catalina-10.15.7.dmg?dl=1)
14
35
 
15
- [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=40 /> Contact Manager 1.0.0 (Windows 10.0.19043 x86_64 MSI)](https://www.dropbox.com/s/tan8hbv3qk959t7/Contact%20Manager-1.0.0-x64-Windows-10.0.19043.msi?dl=1)
36
+ [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=40 /> Contact Manager 1.0.1 (Windows 10.0.19043 x86_64 MSI)](https://www.dropbox.com/s/nnknffe77iyiat8/Contact%20Manager-1.0.1-x86_64-windows-10.0.19043.msi?dl=1)
16
37
 
17
- [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=40 /> Contact Manager 1.0.0 (Linux x86_64 DEB)](https://www.dropbox.com/s/v6pckxcpw4quafx/contact-manager_1.0.0-1_amd64.deb?dl=1)
38
+ [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=40 /> Contact Manager 1.0.1 (Linux x86_64 DEB)](https://www.dropbox.com/s/mpr0wl9re7l30uq/contact-manager_1.0.1-1_amd64.deb?dl=1)
18
39
 
19
- [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=40 /> Contact Manager 1.0.0 (Linux x86_64 RPM)](https://www.dropbox.com/s/4dby42ux7ebyv6n/contact-manager-1.0.0-1.x86_64.rpm?dl=1)
40
+ [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=40 /> Contact Manager 1.0.1 (Linux x86_64 RPM)](https://www.dropbox.com/s/7lw9ktnikx3m5es/contact-manager-1.0.1-1.x86_64.rpm?dl=1)
20
41
 
21
42
  ### Option 2: Install Ruby Gem
22
43
 
23
- Start by setting up [JDK 18](https://www.oracle.com/java/technologies/downloads) & [JRuby 9.3.3.0](https://www.jruby.org/) (+ [RVM](http://rvm.io/) on Mac/Linux) just as per [Glimmer DSL for SWT prerequisites](https://github.com/AndyObtiva/glimmer-dsl-swt#pre-requisites).
44
+ Start by setting up [JDK 18](https://www.oracle.com/java/technologies/downloads) & [JRuby 9.3.4.0](https://www.jruby.org/) (+ [RVM](http://rvm.io/) on Mac/Linux) just as per [Glimmer DSL for SWT prerequisites](https://github.com/AndyObtiva/glimmer-dsl-swt#pre-requisites).
24
45
 
25
46
  Install Ruby gem:
26
47
 
27
48
  ```
28
- gem install contact_manager -v1.0.0
49
+ gem install contact_manager -v1.0.1
29
50
  ```
30
51
 
31
52
  Run:
@@ -36,7 +57,7 @@ contact_manager
36
57
 
37
58
  ### Option 3: Clone Project Locally
38
59
 
39
- Start by setting up [JDK 18](https://www.oracle.com/java/technologies/downloads) & [JRuby 9.3.3.0](https://www.jruby.org/) (+ [RVM](http://rvm.io/) on Mac/Linux) just as per [Glimmer DSL for SWT prerequisites](https://github.com/AndyObtiva/glimmer-dsl-swt#pre-requisites).
60
+ Start by setting up [JDK 18](https://www.oracle.com/java/technologies/downloads) & [JRuby 9.3.4.0](https://www.jruby.org/) (+ [RVM](http://rvm.io/) on Mac/Linux) just as per [Glimmer DSL for SWT prerequisites](https://github.com/AndyObtiva/glimmer-dsl-swt#pre-requisites).
40
61
 
41
62
  Clone:
42
63
 
@@ -96,15 +117,21 @@ glimmer "package[rpm]"
96
117
 
97
118
  Contact Manager follows the [Model-View-Presenter](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter) flavor of [MVC](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller), so the View communicates to the Model via a Presenter, which is an enhanced Controller that enables bidirectional attribute data-binding between the Model and the View.
98
119
 
99
- The View uses `contact_form`, `contact_table`, and `contact_manager_menu_bar` custom widgets (components)
120
+ The View uses `contact_form`, `contact_table`, and `contact_manager_menu_bar` custom widgets (components).
121
+
122
+ The Contact Manager graphical user interface leverages the [Master-Detail Interface Pattern](https://en.wikipedia.org/wiki/Master%E2%80%93detail_interface) by displaying a master list via `contact_table` and allowing navigation by selecting a `Contact` and displaying its details for editing in `contact_form`.
123
+
124
+ `contact_table` leverages the `table` widget, which has automatic in-memory sort support. `contact_table` also comes with a 'Delete...' right-click menu item (aka contextual pop up menu item) for deleting a selected `Contact` row.
125
+
126
+ `contact_manager_menu_bar` provides top menu bar actions like 'New', 'Save', 'Delete...', and 'Delete All...'
100
127
 
101
128
  The Model layer includes a `Contact` and `ContactRepository` ([DDD Repository Pattern](https://www.domainlanguage.com/wp-content/uploads/2016/05/DDD_Reference_2015-03.pdf)) in addition to `ContactPresenter` (which is both a Controller and a Model at a higher level).
102
129
 
103
- `Contact` follows the [Active Record Pattern](https://en.wikipedia.org/wiki/Active_record_pattern) for [Object Relational Mapping](https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping) to store objects in a [SQLite](https://www.sqlite.org/index.html) relational database.
130
+ `Contact` follows the [Active Record Pattern](https://en.wikipedia.org/wiki/Active_record_pattern) for [Object Relational Mapping](https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping) to store objects in a [SQLite](https://www.sqlite.org/index.html) relational database table called `contacts` via a [migration](/db/migrate/20220411211513_create_contacts.rb). It also implements [ActiveRecord Validations](https://guides.rubyonrails.org/active_record_validations.html) for `first_name`, `last_name`, `email`, `phone`, and `zip_or_postal_code` fields.
104
131
 
105
- The Contact Manager graphical user interface leverages the [Master-Detail Interface Pattern](https://en.wikipedia.org/wiki/Master%E2%80%93detail_interface).
132
+ `ContactRepository` provides the ability to search through all `Contact`s using the [ActiveRecord Query Interface](https://guides.rubyonrails.org/active_record_querying.html), triggered indirectly by `ContactPresenter` when typing into a `text` field that is on top of the `contact_table` .
106
133
 
107
- The database is stored at `~/db/
134
+ The database is stored at `File.join(Dir.home, 'db/contact_manager.sqlite3')`
108
135
 
109
136
  ## TODO
110
137
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -32,7 +32,20 @@ class ContactManager
32
32
  }
33
33
 
34
34
  menu_item {
35
- text '&Delete All...'
35
+ text '&Delete...'
36
+ accelerator ACCELERATOR_KEY, :d
37
+
38
+ on_widget_selected do
39
+ result = message_box(:yes, :no) {
40
+ text 'Delete'
41
+ message 'Are you sure you want to delete the selected contact?'
42
+ }.open
43
+ contact_presenter.destroy_current_contact if result == swt(:yes)
44
+ end
45
+ }
46
+
47
+ menu_item {
48
+ text 'Dele&te All...'
36
49
 
37
50
  on_widget_selected do
38
51
  result = message_box(:yes, :no) {
@@ -58,10 +58,14 @@ class ContactManager
58
58
 
59
59
  menu {
60
60
  menu_item {
61
- text '&Delete'
61
+ text '&Delete...'
62
62
 
63
63
  on_widget_selected do
64
- contact_presenter.destroy_current_contact
64
+ result = message_box(:yes, :no) {
65
+ text 'Delete'
66
+ message 'Are you sure you want to delete the selected contact?'
67
+ }.open
68
+ contact_presenter.destroy_current_contact if result == swt(:yes)
65
69
  end
66
70
  }
67
71
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contact_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-03 00:00:00.000000000 Z
11
+ date: 2022-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -132,7 +132,6 @@ files:
132
132
  - app/contact_manager/view/contact_table.rb
133
133
  - bin/contact_manager
134
134
  - config/warble.rb
135
- - db/database.sqlite3
136
135
  - db/db.rb
137
136
  - db/migrate.rb
138
137
  - db/migrate/20220411211513_create_contacts.rb
data/db/database.sqlite3 DELETED
Binary file