voom-presenters 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile.lock +5 -3
- data/README.md +32 -3
- data/lib/voom/presenters-engine.rb +3 -2
- data/lib/voom/presenters/dsl/components/event.rb +2 -1
- data/lib/voom/presenters/dsl/lockable.rb +1 -5
- data/lib/voom/presenters/dsl/user_interface.rb +7 -1
- data/lib/voom/presenters/version.rb +1 -1
- data/lib/voom/presenters/web_client/app.rb +4 -4
- data/presenters.gemspec +2 -0
- data/public/style-bundle.js +2 -2
- data/scripts/bump.sh +1 -0
- data/scripts/release.sh +1 -0
- data/views/mdc/assets/js/components/events/loads.js +2 -1
- data/views/mdc/assets/scss/components/list.scss +4 -0
- data/views/mdc/assets/scss/components/select.scss +4 -0
- data/views/mdc/assets/scss/components/snackbar.scss +4 -0
- data/views/mdc/assets/scss/styles.scss +4 -0
- data/views/mdc/components/text_field.erb +1 -1
- data/views/mdc/package.json +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eac25e4fe021eaed13ad89d1d15a513b7ed3d22fe7eb4a9cdedc15c4878d7a43
|
4
|
+
data.tar.gz: 93b10d4ea9b84f8c944a730d810a4d63c338e59d859aa8cd4473dacbd5975651
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3297d3b8b8e5aa1b5fc8cf87b2774578d21e1502171e395731a3df436834d1b5c815c60cda46f7f5816f4685860adf2045a108e8516016cd33b896d46c0ff86
|
7
|
+
data.tar.gz: c9f976a58279589ef6924ab42b2eee3969de179ed956018f039853c0f9f3dff97dd7c93d783a6e18e7cf89c43b5b6a4f65bf2010a65d570606afb11b259f7539
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
1
|
+
2.5.1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
voom-presenters (0.1.
|
4
|
+
voom-presenters (0.1.12)
|
5
5
|
dry-configurable (> 0.1, <= 7.0)
|
6
6
|
dry-container (~> 0.6)
|
7
7
|
dry-inflector (~> 0.1)
|
@@ -27,6 +27,7 @@ GEM
|
|
27
27
|
dry-configurable (~> 0.1, >= 0.1.3)
|
28
28
|
dry-inflector (0.1.2)
|
29
29
|
ffi (1.9.23)
|
30
|
+
gem-release (2.0.1)
|
30
31
|
ice_nine (0.11.2)
|
31
32
|
json (2.1.0)
|
32
33
|
method_source (0.8.2)
|
@@ -99,6 +100,7 @@ PLATFORMS
|
|
99
100
|
|
100
101
|
DEPENDENCIES
|
101
102
|
bundler (~> 1.13)
|
103
|
+
gem-release (~> 2.0)
|
102
104
|
pry (~> 0.10)
|
103
105
|
rack-test (~> 0.8)
|
104
106
|
rake (~> 11.3)
|
@@ -112,7 +114,7 @@ DEPENDENCIES
|
|
112
114
|
webdrivers (~> 3.0)
|
113
115
|
|
114
116
|
RUBY VERSION
|
115
|
-
ruby 2.5.
|
117
|
+
ruby 2.5.1p57
|
116
118
|
|
117
119
|
BUNDLED WITH
|
118
|
-
1.16.
|
120
|
+
1.16.3
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Voom::Presenters
|
2
2
|
|
3
|
+
## TLDR;
|
4
|
+
Presenters are to HTML/User Interfaces what C is to assembly.
|
5
|
+
|
3
6
|
A Ruby DSL for describing user interfaces.
|
4
7
|
The semantics are adopted from [Material Design](https://material.io/).
|
5
8
|
|
@@ -7,6 +10,32 @@ A presenter generates a Presenter Object Model (POM).
|
|
7
10
|
A POM fully describes a user interface.
|
8
11
|
A POM client can fully render user interface from POM.
|
9
12
|
|
13
|
+
## What are voom-presenters?
|
14
|
+
|
15
|
+
* A Ruby user interface abstraction.
|
16
|
+
* A Ruby DSL to build a user interface.
|
17
|
+
* A power washer for building user interfaces.
|
18
|
+
|
19
|
+
## Why?
|
20
|
+
|
21
|
+
Building a user interface should like Ruby itself:
|
22
|
+
> ... a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.
|
23
|
+
|
24
|
+
Instead building a user interface has turned into:
|
25
|
+
> How many languages/technologies/frameworks do I need to learn to build a rich user interface/experience?"
|
26
|
+
|
27
|
+
A typical web client requires at a minimum the following: HTML, CSS, Javascript, in addition we need Ruby on the server, plus some SQL.
|
28
|
+
That is 5 technologies/languages.
|
29
|
+
Now lets talk about a new client like an iOS or Android client. If we go native, we can now add Java and Swift to that list. We are up to 7 technologies/languages!
|
30
|
+
We didn't even add any popular extras like coffeescript, haml, sass, and we left out frameworks.
|
31
|
+
|
32
|
+
What if you could write all my user interface in Ruby and have it rendered natively in ANY client? The voom-presenters _enable_ that. It is a Ruby DSL that describes a user interface.
|
33
|
+
It generates an intermediate Presenter Object Model (POM).
|
34
|
+
The POM is a declarative user interface that can be rendered by a POM client.
|
35
|
+
The core presenters gem provides a Web client as a fully functional reference implementation.
|
36
|
+
|
37
|
+
This concept was initially inspired by the Presenters concepts of Ivar Jacobson as presented by Robert Martin.
|
38
|
+
|
10
39
|
## Demo
|
11
40
|
|
12
41
|
[Demo](https://powerful-bastion-96181.herokuapp.com)
|
@@ -18,11 +47,11 @@ Or to run locally:
|
|
18
47
|
bundle install
|
19
48
|
rackup
|
20
49
|
|
21
|
-
open
|
50
|
+
open http://localhost:9292
|
22
51
|
|
23
52
|
To see the POM:
|
24
53
|
|
25
|
-
open
|
54
|
+
open http://localhost:9292/index.pom
|
26
55
|
|
27
56
|
|
28
57
|
## User Interface Engine
|
@@ -33,7 +62,7 @@ This example downloads the POM of the index page.
|
|
33
62
|
Then posts it to the reference web client.
|
34
63
|
That result is then saved to a file and opened up with a browser.
|
35
64
|
|
36
|
-
curl localhost:9292/pom
|
65
|
+
curl localhost:9292/index.pom > $TMPDIR/index.json && curl -d "@$TMPDIR/index.json" -X POST localhost:9292/index > $TMPDIR/index.html && open $TMPDIR/index.html
|
37
66
|
|
38
67
|
## Status
|
39
68
|
This project is in a pre-beta status. It is changing frequently as the first user interfaces are being built with it.
|
@@ -19,7 +19,7 @@ module Voom
|
|
19
19
|
BOOT = ->{
|
20
20
|
Voom::Presenters::Settings.configure do |config|
|
21
21
|
config.presenters.root = Rails.root.join('app')
|
22
|
-
|
22
|
+
config.presenters.deep_freeze = false
|
23
23
|
end
|
24
24
|
Voom::Presenters::App.boot!
|
25
25
|
}
|
@@ -33,7 +33,8 @@ module Voom
|
|
33
33
|
end
|
34
34
|
|
35
35
|
config.to_prepare do
|
36
|
-
RELOADER.
|
36
|
+
RELOADER.execute_if_updated
|
37
|
+
BOOT.call
|
37
38
|
end
|
38
39
|
end
|
39
40
|
end
|
@@ -12,11 +12,12 @@ module Voom
|
|
12
12
|
expand!
|
13
13
|
end
|
14
14
|
|
15
|
-
def loads(presenter=nil, path: nil, **params, &block)
|
15
|
+
def loads(presenter=nil, path: nil, target: nil, **params, &block)
|
16
16
|
@actions << Components::Action.new(parent: self,
|
17
17
|
type: :loads,
|
18
18
|
presenter: presenter,
|
19
19
|
path: path,
|
20
|
+
target: target,
|
20
21
|
params: params, &block)
|
21
22
|
end
|
22
23
|
|
@@ -17,7 +17,6 @@ module Voom
|
|
17
17
|
module DSL
|
18
18
|
class UserInterface
|
19
19
|
include DSL::Definer
|
20
|
-
include Lockable
|
21
20
|
include Components::Mixins::Common
|
22
21
|
include Components::Mixins::Helpers
|
23
22
|
include Components::Mixins::Dialogs
|
@@ -133,6 +132,13 @@ module Voom
|
|
133
132
|
end
|
134
133
|
end
|
135
134
|
|
135
|
+
def lock!
|
136
|
+
@locked = true
|
137
|
+
end
|
138
|
+
|
139
|
+
def locked?
|
140
|
+
@locked
|
141
|
+
end
|
136
142
|
end
|
137
143
|
end
|
138
144
|
end
|
@@ -15,7 +15,7 @@ module Voom
|
|
15
15
|
class App < Sinatra::Base
|
16
16
|
include Trace
|
17
17
|
set :root, File.expand_path('../../../../..', __FILE__)
|
18
|
-
set :router_, Router
|
18
|
+
set :router_, WebClient::Router
|
19
19
|
set :bind, '0.0.0.0'
|
20
20
|
set :views, Proc.new {File.join(root, "views", ENV['VIEW_ENGINE']||'mdc')}
|
21
21
|
|
@@ -66,9 +66,9 @@ module Voom
|
|
66
66
|
def snake_to_camel(hash, except: [])
|
67
67
|
Hash[hash.map {|k, v|
|
68
68
|
next [k, v] if except.include?(k)
|
69
|
-
|
70
|
-
|
71
|
-
[
|
69
|
+
new_key = k.to_s.split('_').collect(&:capitalize).join
|
70
|
+
new_key[0] = new_key[0].downcase
|
71
|
+
[new_key, v]}
|
72
72
|
]
|
73
73
|
end
|
74
74
|
|
data/presenters.gemspec
CHANGED
data/public/style-bundle.js
CHANGED
@@ -65,9 +65,9 @@
|
|
65
65
|
/************************************************************************/
|
66
66
|
/******/ ([
|
67
67
|
/* 0 */
|
68
|
-
/***/ (function(module, exports
|
68
|
+
/***/ (function(module, exports) {
|
69
69
|
|
70
|
-
|
70
|
+
throw new Error("Module build failed: \n@import \"@material/base/mixins\";\n^\n File to import not found or unreadable: /Users/derekgraham/rx/presenters/views/mdc/node_modules/@material/base/mixins.\n in /Users/derekgraham/rx/presenters/views/mdc/node_modules/@material/floating-label/mdc-floating-label.scss (line 18, column 1)");
|
71
71
|
|
72
72
|
/***/ })
|
73
73
|
/******/ ]);
|
data/scripts/bump.sh
CHANGED
data/scripts/release.sh
CHANGED
@@ -11,11 +11,12 @@ export class VLoads extends VUrls{
|
|
11
11
|
|
12
12
|
call(results) {
|
13
13
|
var url = this.buildURL(this.url, this.params);
|
14
|
+
var newWindow = this.options['target'] === '_blank';
|
14
15
|
var promiseObj = new Promise(function (resolve) {
|
15
16
|
console.log("Loading page: " + url);
|
16
17
|
results.push({action:'loads', statusCode: 200});
|
17
18
|
resolve(results);
|
18
|
-
window.location = url;
|
19
|
+
newWindow ? window.open(url) : window.location = url;
|
19
20
|
});
|
20
21
|
return promiseObj;
|
21
22
|
}
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<%= 'readonly' if comp.readonly %>
|
18
18
|
list="<%= comp.id %>-list"
|
19
19
|
<%= erb :"components/event", :locals => {events: comp.events, parent_id: "#{comp.id}-input"} %>>
|
20
|
-
<label class='mdc-floating-label' for="<%= comp.id
|
20
|
+
<label class='mdc-floating-label' for="<%= comp.id %>-input"><%= comp.label %></label>
|
21
21
|
<div class="mdc-line-ripple"></div>
|
22
22
|
<datalist id="<%= comp.id %>-list">
|
23
23
|
</datalist>
|
data/views/mdc/package.json
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
"@material/ripple": "^0.34.1",
|
31
31
|
"@material/select": "^0.34.1",
|
32
32
|
"@material/snackbar": "^0.35.0",
|
33
|
-
"@material/textfield": "^0.
|
33
|
+
"@material/textfield": "^0.37.1",
|
34
34
|
"@material/toolbar": "^0.34.1",
|
35
35
|
"@material/typography": "^0.34.0",
|
36
36
|
"flatpickr": "^4.4.6",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voom-presenters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Edens
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ice_nine
|
@@ -204,6 +204,20 @@ dependencies:
|
|
204
204
|
- - "~>"
|
205
205
|
- !ruby/object:Gem::Version
|
206
206
|
version: '3.0'
|
207
|
+
- !ruby/object:Gem::Dependency
|
208
|
+
name: gem-release
|
209
|
+
requirement: !ruby/object:Gem::Requirement
|
210
|
+
requirements:
|
211
|
+
- - "~>"
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: '2.0'
|
214
|
+
type: :development
|
215
|
+
prerelease: false
|
216
|
+
version_requirements: !ruby/object:Gem::Requirement
|
217
|
+
requirements:
|
218
|
+
- - "~>"
|
219
|
+
- !ruby/object:Gem::Version
|
220
|
+
version: '2.0'
|
207
221
|
description:
|
208
222
|
email:
|
209
223
|
- 'russell@voomify.com
|
@@ -569,7 +583,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
569
583
|
version: '0'
|
570
584
|
requirements: []
|
571
585
|
rubyforge_project:
|
572
|
-
rubygems_version: 2.7.
|
586
|
+
rubygems_version: 2.7.6
|
573
587
|
signing_key:
|
574
588
|
specification_version: 4
|
575
589
|
summary: Presenters Gem.
|