glimmer 0.1.11.470 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/.coveralls.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
repo_token: dvAuyH3RuZ3lslleCHAeovxv0kQpFdrsB
|
data/.rspec
DELETED
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
glimmer
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
jruby-9.2.9.0
|
data/Gemfile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
source 'http://rubygems.org'
|
2
|
-
|
3
|
-
gem 'facets', '3.1.0'
|
4
|
-
gem 'os', '1.0.0'
|
5
|
-
|
6
|
-
group :development do
|
7
|
-
gem "rspec-mocks", "~> 3.5.0"
|
8
|
-
gem "rspec", "~> 3.5.0"
|
9
|
-
gem "rdoc", "~> 2.3.0"
|
10
|
-
gem "jeweler", "~> 2.3.9"
|
11
|
-
gem "coveralls", "= 0.8.5", require: false
|
12
|
-
gem "simplecov", "~> 0.10.0", require: nil
|
13
|
-
gem "puts_debuggerer", "~> 0.8.1"
|
14
|
-
end
|
data/RELEASE.md
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# Release Notes
|
2
|
-
|
3
|
-
** 0.1.11.470 **
|
4
|
-
- Nested property data binding support
|
5
|
-
|
6
|
-
** 0.1.10.470 **
|
7
|
-
- Support Tree data-binding (one-way from model to tree)
|
8
|
-
|
9
|
-
** 0.1.8.470 **
|
10
|
-
- girb support
|
11
|
-
|
12
|
-
** 0.1.5.470 **
|
13
|
-
- Glimmer now uses a Ruby Logger in debug mode to provide helpful debugging information
|
14
|
-
- Glimmer has a smart new Ruby shell script for executing applications
|
15
|
-
- Glimmer now downloads swt.jar automatically when missing (e.g. 1st run) on Mac, Windows, and Linux, and for x86 and x86-64 CPU architectures.
|
data/Rakefile
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler'
|
3
|
-
require 'os'
|
4
|
-
require_relative 'lib/glimmer_application'
|
5
|
-
begin
|
6
|
-
Bundler.setup(:default, :development)
|
7
|
-
rescue Bundler::BundlerError => e
|
8
|
-
$stderr.puts e.message
|
9
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
-
exit e.status_code
|
11
|
-
end
|
12
|
-
require 'rake'
|
13
|
-
|
14
|
-
begin
|
15
|
-
jeweler_required = require 'jeweler'
|
16
|
-
rescue Exception
|
17
|
-
jeweler_required = nil
|
18
|
-
end
|
19
|
-
unless jeweler_required.nil?
|
20
|
-
Jeweler::Tasks.new do |gem|
|
21
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
22
|
-
gem.name = "glimmer"
|
23
|
-
gem.homepage = "http://github.com/AndyObtiva/glimmer"
|
24
|
-
gem.license = "MIT"
|
25
|
-
gem.summary = %Q{Desktop application development library}
|
26
|
-
gem.description = %Q{JRuby Desktop UI DSL + Data-Binding library that enables easy and efficient authoring of user-interfaces using the robust platform-independent Eclipse SWT library}
|
27
|
-
gem.email = "andy.am@gmail.com"
|
28
|
-
gem.authors = ["AndyMaleh"]
|
29
|
-
gem.executables = ['glimmer', 'girb']
|
30
|
-
# dependencies defined in Gemfile
|
31
|
-
end
|
32
|
-
Jeweler::RubygemsDotOrgTasks.new
|
33
|
-
end
|
34
|
-
|
35
|
-
require 'rspec/core'
|
36
|
-
require 'rspec/core/rake_task'
|
37
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
38
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
39
|
-
additional_options = OS.mac? ? "-J-XstartOnFirstThread" : ""
|
40
|
-
spec.ruby_opts = ["#{additional_options} -J-classpath \"#{GlimmerApplication::SWT_JAR_FILE}\" -Xcli.debug=true --debug"]
|
41
|
-
end
|
42
|
-
|
43
|
-
task :default => :spec
|
data/TODO.md
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
# TODO
|
2
|
-
|
3
|
-
Here is a list of tasks to do (please delete once done):
|
4
|
-
|
5
|
-
* Support Tree databinding (bidirectional)
|
6
|
-
* Figure out what is missing from table databinding (bidirectional?)
|
7
|
-
* Explore rewriting shine with Ruby 2 support
|
8
|
-
* Add a startup progress dialog (consider Glimmer branding)
|
9
|
-
* Externalize constants to make easily configurable
|
10
|
-
* Extract ListenerParent into its own file from WidgetListenerCommandHandler
|
11
|
-
* Nested databinding support
|
12
|
-
* Enhance XML DSL support (special characters, CDATA, escaped characters (#, {, }, .))
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.1.11.470
|
data/bin/girb_runner.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require_relative '../lib/glimmer'
|
data/glimmer.gemspec
DELETED
@@ -1,160 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: glimmer 0.1.11.470 ruby lib
|
6
|
-
|
7
|
-
Gem::Specification.new do |s|
|
8
|
-
s.name = "glimmer".freeze
|
9
|
-
s.version = "0.1.11.470"
|
10
|
-
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib".freeze]
|
13
|
-
s.authors = ["AndyMaleh".freeze]
|
14
|
-
s.date = "2020-02-26"
|
15
|
-
s.description = "JRuby Desktop UI DSL + Data-Binding library that enables easy and efficient authoring of user-interfaces using the robust platform-independent Eclipse SWT library".freeze
|
16
|
-
s.email = "andy.am@gmail.com".freeze
|
17
|
-
s.executables = ["glimmer".freeze, "girb".freeze]
|
18
|
-
s.extra_rdoc_files = [
|
19
|
-
"LICENSE.txt",
|
20
|
-
"README.markdown"
|
21
|
-
]
|
22
|
-
s.files = [
|
23
|
-
".coveralls.yml",
|
24
|
-
".rspec",
|
25
|
-
".ruby-gemset",
|
26
|
-
".ruby-version",
|
27
|
-
"Gemfile",
|
28
|
-
"LICENSE.txt",
|
29
|
-
"README.markdown",
|
30
|
-
"RELEASE.md",
|
31
|
-
"Rakefile",
|
32
|
-
"TODO.md",
|
33
|
-
"VERSION",
|
34
|
-
"bin/girb",
|
35
|
-
"bin/girb_runner.rb",
|
36
|
-
"bin/glimmer",
|
37
|
-
"glimmer.gemspec",
|
38
|
-
"images/Bitter-sweet.jpg",
|
39
|
-
"lib/command_handler.rb",
|
40
|
-
"lib/command_handler_chain_factory.rb",
|
41
|
-
"lib/command_handler_chain_link.rb",
|
42
|
-
"lib/command_handlers.rb",
|
43
|
-
"lib/command_handlers/bind_command_handler.rb",
|
44
|
-
"lib/command_handlers/combo_selection_data_binding_command_handler.rb",
|
45
|
-
"lib/command_handlers/data_binding_command_handler.rb",
|
46
|
-
"lib/command_handlers/list_selection_data_binding_command_handler.rb",
|
47
|
-
"lib/command_handlers/models/block_observer.rb",
|
48
|
-
"lib/command_handlers/models/list_selection_binding.rb",
|
49
|
-
"lib/command_handlers/models/model_binding.rb",
|
50
|
-
"lib/command_handlers/models/observable_array.rb",
|
51
|
-
"lib/command_handlers/models/observable_model.rb",
|
52
|
-
"lib/command_handlers/models/observer.rb",
|
53
|
-
"lib/command_handlers/models/r_runnable.rb",
|
54
|
-
"lib/command_handlers/models/r_shell.rb",
|
55
|
-
"lib/command_handlers/models/r_tab_item_composite.rb",
|
56
|
-
"lib/command_handlers/models/r_widget.rb",
|
57
|
-
"lib/command_handlers/models/r_widget_listener.rb",
|
58
|
-
"lib/command_handlers/models/r_widget_packages.rb",
|
59
|
-
"lib/command_handlers/models/table_items_binding.rb",
|
60
|
-
"lib/command_handlers/models/tree_items_binding.rb",
|
61
|
-
"lib/command_handlers/models/widget_binding.rb",
|
62
|
-
"lib/command_handlers/shell_command_handler.rb",
|
63
|
-
"lib/command_handlers/tab_item_command_handler.rb",
|
64
|
-
"lib/command_handlers/table_column_properties_data_binding_command_handler.rb",
|
65
|
-
"lib/command_handlers/table_items_data_binding_command_handler.rb",
|
66
|
-
"lib/command_handlers/tree_items_data_binding_command_handler.rb",
|
67
|
-
"lib/command_handlers/tree_properties_data_binding_command_handler.rb",
|
68
|
-
"lib/command_handlers/widget_command_handler.rb",
|
69
|
-
"lib/command_handlers/widget_listener_command_handler.rb",
|
70
|
-
"lib/command_handlers/widget_method_command_handler.rb",
|
71
|
-
"lib/glimmer.rb",
|
72
|
-
"lib/glimmer_application.rb",
|
73
|
-
"lib/parent.rb",
|
74
|
-
"lib/shine.rb",
|
75
|
-
"lib/string.rb",
|
76
|
-
"lib/symbol.rb",
|
77
|
-
"lib/xml_command_handlers.rb",
|
78
|
-
"lib/xml_command_handlers/html_command_handler.rb",
|
79
|
-
"lib/xml_command_handlers/models/depth_first_search_iterator.rb",
|
80
|
-
"lib/xml_command_handlers/models/name_space_visitor.rb",
|
81
|
-
"lib/xml_command_handlers/models/node.rb",
|
82
|
-
"lib/xml_command_handlers/models/node_visitor.rb",
|
83
|
-
"lib/xml_command_handlers/models/xml_visitor.rb",
|
84
|
-
"lib/xml_command_handlers/xml_command_handler.rb",
|
85
|
-
"lib/xml_command_handlers/xml_name_space_command_handler.rb",
|
86
|
-
"lib/xml_command_handlers/xml_tag_command_handler.rb",
|
87
|
-
"lib/xml_command_handlers/xml_text_command_handler.rb",
|
88
|
-
"samples/contactmanager/contact.rb",
|
89
|
-
"samples/contactmanager/contact_manager.rb",
|
90
|
-
"samples/contactmanager/contact_manager_presenter.rb",
|
91
|
-
"samples/contactmanager/contact_repository.rb",
|
92
|
-
"samples/hello_combo.rb",
|
93
|
-
"samples/hello_list_multi_selection.rb",
|
94
|
-
"samples/hello_list_single_selection.rb",
|
95
|
-
"samples/hello_tab.rb",
|
96
|
-
"samples/hello_world.rb",
|
97
|
-
"samples/hellocomputed/contact.rb",
|
98
|
-
"samples/hellocomputed/hello_computed.rb",
|
99
|
-
"samples/login.rb",
|
100
|
-
"samples/tictactoe/tic_tac_toe.rb",
|
101
|
-
"samples/tictactoe/tic_tac_toe_board.rb",
|
102
|
-
"spec/lib/command_handlers/models/observable_model_spec.rb",
|
103
|
-
"spec/lib/command_handlers/models/r_widget_spec.rb",
|
104
|
-
"spec/lib/glimmer__combo_data_binding__spec.rb",
|
105
|
-
"spec/lib/glimmer__constant__spec.rb",
|
106
|
-
"spec/lib/glimmer__data_binding__spec.rb",
|
107
|
-
"spec/lib/glimmer__list_data_binding__spec.rb",
|
108
|
-
"spec/lib/glimmer__listeners__spec.rb",
|
109
|
-
"spec/lib/glimmer__shine_data_binding__spec.rb",
|
110
|
-
"spec/lib/glimmer__tab_item__spec.rb",
|
111
|
-
"spec/lib/glimmer__table_data_binding__spec.rb",
|
112
|
-
"spec/lib/glimmer__tree_data_binding__spec.rb",
|
113
|
-
"spec/lib/glimmer_spec.rb",
|
114
|
-
"spec/lib/xml/glimmer_xml_spec.rb",
|
115
|
-
"spec/samples/contactmanager/contact_manager_presenter_spec.rb",
|
116
|
-
"spec/samples/tictactoe/tic_tac_toe_spec.rb",
|
117
|
-
"spec/spec_helper.rb"
|
118
|
-
]
|
119
|
-
s.homepage = "http://github.com/AndyObtiva/glimmer".freeze
|
120
|
-
s.licenses = ["MIT".freeze]
|
121
|
-
s.rubygems_version = "2.7.10".freeze
|
122
|
-
s.summary = "Desktop application development library".freeze
|
123
|
-
|
124
|
-
if s.respond_to? :specification_version then
|
125
|
-
s.specification_version = 4
|
126
|
-
|
127
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
128
|
-
s.add_runtime_dependency(%q<facets>.freeze, ["= 3.1.0"])
|
129
|
-
s.add_runtime_dependency(%q<os>.freeze, ["= 1.0.0"])
|
130
|
-
s.add_development_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
|
131
|
-
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
132
|
-
s.add_development_dependency(%q<rdoc>.freeze, ["~> 2.3.0"])
|
133
|
-
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
|
134
|
-
s.add_development_dependency(%q<coveralls>.freeze, ["= 0.8.5"])
|
135
|
-
s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.10.0"])
|
136
|
-
s.add_development_dependency(%q<puts_debuggerer>.freeze, ["~> 0.8.1"])
|
137
|
-
else
|
138
|
-
s.add_dependency(%q<facets>.freeze, ["= 3.1.0"])
|
139
|
-
s.add_dependency(%q<os>.freeze, ["= 1.0.0"])
|
140
|
-
s.add_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
|
141
|
-
s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
142
|
-
s.add_dependency(%q<rdoc>.freeze, ["~> 2.3.0"])
|
143
|
-
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
|
144
|
-
s.add_dependency(%q<coveralls>.freeze, ["= 0.8.5"])
|
145
|
-
s.add_dependency(%q<simplecov>.freeze, ["~> 0.10.0"])
|
146
|
-
s.add_dependency(%q<puts_debuggerer>.freeze, ["~> 0.8.1"])
|
147
|
-
end
|
148
|
-
else
|
149
|
-
s.add_dependency(%q<facets>.freeze, ["= 3.1.0"])
|
150
|
-
s.add_dependency(%q<os>.freeze, ["= 1.0.0"])
|
151
|
-
s.add_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
|
152
|
-
s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
|
153
|
-
s.add_dependency(%q<rdoc>.freeze, ["~> 2.3.0"])
|
154
|
-
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
|
155
|
-
s.add_dependency(%q<coveralls>.freeze, ["= 0.8.5"])
|
156
|
-
s.add_dependency(%q<simplecov>.freeze, ["~> 0.10.0"])
|
157
|
-
s.add_dependency(%q<puts_debuggerer>.freeze, ["~> 0.8.1"])
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
data/images/Bitter-sweet.jpg
DELETED
Binary file
|
@@ -1,71 +0,0 @@
|
|
1
|
-
require_relative "contact_manager_presenter"
|
2
|
-
require_relative "../../lib/glimmer"
|
3
|
-
|
4
|
-
class RWidget
|
5
|
-
include_package 'org.eclipse.jface.viewers'
|
6
|
-
end
|
7
|
-
|
8
|
-
class ContactManager
|
9
|
-
extend Glimmer
|
10
|
-
|
11
|
-
include_package 'org.eclipse.swt'
|
12
|
-
include_package 'org.eclipse.swt.widgets'
|
13
|
-
include_package 'org.eclipse.swt.layout'
|
14
|
-
include_package 'org.eclipse.jface.viewers'
|
15
|
-
|
16
|
-
contact_manager_presenter = ContactManagerPresenter.new
|
17
|
-
|
18
|
-
shell {
|
19
|
-
text "Contact Manager"
|
20
|
-
composite {
|
21
|
-
composite {
|
22
|
-
layout GridLayout.new(2, false)
|
23
|
-
label {text "First &Name: "}
|
24
|
-
text {
|
25
|
-
text bind(contact_manager_presenter, :first_name)
|
26
|
-
}
|
27
|
-
label {text "&Last Name: "}
|
28
|
-
text {
|
29
|
-
text bind(contact_manager_presenter, :last_name)
|
30
|
-
}
|
31
|
-
label {text "&Email: "}
|
32
|
-
text {
|
33
|
-
text bind(contact_manager_presenter, :email)
|
34
|
-
}
|
35
|
-
}
|
36
|
-
|
37
|
-
table {
|
38
|
-
layout_data GridData.new(:fill.swt_constant, :fill.swt_constant, true, true)
|
39
|
-
table_column {
|
40
|
-
text "First Name"
|
41
|
-
width 80
|
42
|
-
}
|
43
|
-
table_column {
|
44
|
-
text "Last Name"
|
45
|
-
width 80
|
46
|
-
}
|
47
|
-
table_column {
|
48
|
-
text "Email"
|
49
|
-
width 120
|
50
|
-
}
|
51
|
-
items bind(contact_manager_presenter, :results),
|
52
|
-
column_properties(:first_name, :last_name, :email)
|
53
|
-
}
|
54
|
-
composite {
|
55
|
-
layout GridLayout.new(2, false)
|
56
|
-
button {
|
57
|
-
text "&List"
|
58
|
-
on_widget_selected {
|
59
|
-
contact_manager_presenter.list
|
60
|
-
}
|
61
|
-
}
|
62
|
-
button {
|
63
|
-
text "&Find"
|
64
|
-
on_widget_selected {
|
65
|
-
contact_manager_presenter.find
|
66
|
-
}
|
67
|
-
}
|
68
|
-
}
|
69
|
-
}
|
70
|
-
}.open
|
71
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require_relative "contact_repository"
|
2
|
-
|
3
|
-
class ContactManagerPresenter
|
4
|
-
attr_accessor :results
|
5
|
-
@@contact_attributes = [:first_name, :last_name, :email]
|
6
|
-
@@contact_attributes.each {|attribute_name| attr_accessor attribute_name}
|
7
|
-
|
8
|
-
def initialize
|
9
|
-
@contact_repository = ContactRepository.new
|
10
|
-
@results = []
|
11
|
-
end
|
12
|
-
|
13
|
-
def list
|
14
|
-
self.results=@contact_repository.find({})
|
15
|
-
end
|
16
|
-
|
17
|
-
def find
|
18
|
-
filter_map = {}
|
19
|
-
@@contact_attributes.each do |attribute_name|
|
20
|
-
filter_map[attribute_name] = self.send(attribute_name) if self.send(attribute_name)
|
21
|
-
end
|
22
|
-
self.results=@contact_repository.find(filter_map)
|
23
|
-
end
|
24
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require_relative "contact"
|
2
|
-
|
3
|
-
class ContactRepository
|
4
|
-
def initialize
|
5
|
-
@contacts = [
|
6
|
-
Contact.new(:first_name => "Anne", :last_name => "Sweeney", :email => "anne@sweeny.com"),
|
7
|
-
Contact.new(:first_name => "Beatrice", :last_name => "Jung", :email => "beatrice@jung.com"),
|
8
|
-
Contact.new(:first_name => "Frank", :last_name => "Deelio", :email => "frank@deelio.com"),
|
9
|
-
Contact.new(:first_name => "franky", :last_name => "miller", :email => "frank@miller.com"),
|
10
|
-
]
|
11
|
-
end
|
12
|
-
|
13
|
-
def find(attribute_filter_map)
|
14
|
-
@contacts.find_all do |contact|
|
15
|
-
match = true
|
16
|
-
attribute_filter_map.keys.each do |attribute_name|
|
17
|
-
contact_value = contact.send(attribute_name).downcase
|
18
|
-
filter_value = attribute_filter_map[attribute_name].downcase
|
19
|
-
match = false unless contact_value.match(filter_value)
|
20
|
-
end
|
21
|
-
match
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/samples/hello_combo.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require_relative "../lib/glimmer"
|
2
|
-
|
3
|
-
class Person
|
4
|
-
attr_accessor :country, :country_options
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
self.country_options=["", "Canada", "US", "Mexico"]
|
8
|
-
self.country = "Canada"
|
9
|
-
end
|
10
|
-
|
11
|
-
def reset_country
|
12
|
-
self.country = "Canada"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
class HelloCombo
|
17
|
-
include Glimmer
|
18
|
-
def launch
|
19
|
-
person = Person.new
|
20
|
-
shell {
|
21
|
-
composite {
|
22
|
-
combo(:read_only) {
|
23
|
-
selection bind(person, :country)
|
24
|
-
}
|
25
|
-
button {
|
26
|
-
text "Reset"
|
27
|
-
on_widget_selected do
|
28
|
-
person.reset_country
|
29
|
-
end
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}.open
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
HelloCombo.new.launch
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require_relative "../lib/glimmer"
|
2
|
-
|
3
|
-
class Person
|
4
|
-
attr_accessor :provinces, :provinces_options
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
self.provinces_options=[
|
8
|
-
"",
|
9
|
-
"Quebec",
|
10
|
-
"Ontario",
|
11
|
-
"Manitoba",
|
12
|
-
"Saskatchewan",
|
13
|
-
"Alberta",
|
14
|
-
"British Columbia",
|
15
|
-
"Nova Skotia",
|
16
|
-
"Newfoundland"
|
17
|
-
]
|
18
|
-
self.provinces = ["Quebec", "Manitoba", "Alberta"]
|
19
|
-
end
|
20
|
-
|
21
|
-
def reset_provinces
|
22
|
-
self.provinces = ["Quebec", "Manitoba", "Alberta"]
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
class HelloListMultiSelection
|
27
|
-
include Glimmer
|
28
|
-
def launch
|
29
|
-
person = Person.new
|
30
|
-
shell {
|
31
|
-
composite {
|
32
|
-
list(:multi) {
|
33
|
-
selection bind(person, :provinces)
|
34
|
-
}
|
35
|
-
button {
|
36
|
-
text "Reset"
|
37
|
-
on_widget_selected do
|
38
|
-
person.reset_provinces
|
39
|
-
end
|
40
|
-
}
|
41
|
-
}
|
42
|
-
}.open
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
HelloListMultiSelection.new.launch
|