voom-presenters 0.1.11 → 0.1.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cb169d26f7fad513a95f6c795bd62778331584a72b9bac22e910f7f139d0c5e
4
- data.tar.gz: 7ae6ceca50528a8b80a739bc0107c95a99a3707178e356279bb270201c8718b5
3
+ metadata.gz: eac25e4fe021eaed13ad89d1d15a513b7ed3d22fe7eb4a9cdedc15c4878d7a43
4
+ data.tar.gz: 93b10d4ea9b84f8c944a730d810a4d63c338e59d859aa8cd4473dacbd5975651
5
5
  SHA512:
6
- metadata.gz: 9018c3db67d4b62fa0c74eb70a538afd7eded319e1f8aa876330f39a33fb0bcfc2362b3c6df5fe6aa9294b8b43260bfda57aac22762529378bfd0470cce79bd5
7
- data.tar.gz: 72086fa0a47925a717ad47fb05b9a07b1184dd211c93ec747dd04d0366eaf435f13a87da4a88c0c39dc603d13794f12c3794bb4bd07f7e0284cf1a5d3c058915
6
+ metadata.gz: d3297d3b8b8e5aa1b5fc8cf87b2774578d21e1502171e395731a3df436834d1b5c815c60cda46f7f5816f4685860adf2045a108e8516016cd33b896d46c0ff86
7
+ data.tar.gz: c9f976a58279589ef6924ab42b2eee3969de179ed956018f039853c0f9f3dff97dd7c93d783a6e18e7cf89c43b5b6a4f65bf2010a65d570606afb11b259f7539
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.0
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.10)
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.0p0
117
+ ruby 2.5.1p57
116
118
 
117
119
  BUNDLED WITH
118
- 1.16.1
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 htt://localhost:9292
50
+ open http://localhost:9292
22
51
 
23
52
  To see the POM:
24
53
 
25
- open htt://localhost:9292/pom
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/index > $TMPDIR/index.json && curl -d "@$TMPDIR/index.json" -X POST localhost:9292/index > $TMPDIR/index.html && open $TMPDIR/index.html
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
- # config.presenters.deep_freeze = false
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.execute
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
 
@@ -2,12 +2,8 @@ module Voom
2
2
  module Presenters
3
3
  module DSL
4
4
  module Lockable
5
- def lock!
6
- @locked = true
7
- end
8
-
9
5
  def locked?
10
- @locked || frozen?
6
+ @parent.send(:locked?)
11
7
  end
12
8
  end
13
9
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Voom
2
2
  module Presenters
3
- VERSION = '0.1.11'.freeze
3
+ VERSION = '0.1.12'.freeze
4
4
  end
5
5
  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
- newKey = k.to_s.split('_').collect(&:capitalize).join
70
- newKey[0] = newKey[0].downcase
71
- [newKey, v]}
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
@@ -34,4 +34,6 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency 'bundler', '~> 1.13'
35
35
  spec.add_development_dependency 'rake', '~> 11.3'
36
36
  spec.add_development_dependency 'rspec', '~> 3.0'
37
+ spec.add_development_dependency 'gem-release', '~> 2.0'
38
+
37
39
  end
@@ -65,9 +65,9 @@
65
65
  /************************************************************************/
66
66
  /******/ ([
67
67
  /* 0 */
68
- /***/ (function(module, exports, __webpack_require__) {
68
+ /***/ (function(module, exports) {
69
69
 
70
- module.exports = __webpack_require__.p + "../../public/bundle.css";
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
@@ -1,3 +1,4 @@
1
1
  #!/usr/bin/env bash
2
+ # Docs: https://github.com/svenfuchs/gem-release#gem-release
2
3
  gem bump
3
4
 
data/scripts/release.sh CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env bash
2
+ # Docs: https://github.com/svenfuchs/gem-release#gem-release
2
3
  gem tag
3
4
  gem release
4
5
 
@@ -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,4 +17,8 @@
17
17
  }
18
18
  }
19
19
 
20
+ .mdc-list-item__meta {
21
+ white-space: nowrap;
22
+ }
23
+
20
24
 
@@ -13,4 +13,8 @@ select {
13
13
  font-size: 14px;
14
14
  line-height: 1.15;
15
15
  margin: 0;
16
+ }
17
+
18
+ .mdc-select__label--float-above {
19
+ white-space: nowrap;
16
20
  }
@@ -3,3 +3,7 @@
3
3
  .v-snackbar{
4
4
  display: none;
5
5
  }
6
+
7
+ .mdc-snackbar {
8
+ z-index: 9999;
9
+ }
@@ -4,6 +4,10 @@
4
4
 
5
5
  .v-error-message {
6
6
  color: $v-theme-error-message;
7
+ margin: 20px;
8
+ padding: 20px;
9
+ border: 1px solid $v-theme-error-message;
10
+ font-weight: bold;
7
11
  }
8
12
 
9
13
  .v-hidden {
@@ -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 %>"><%= comp.label %></label>
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>
@@ -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.34.1",
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.11
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-09 00:00:00.000000000 Z
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.3
586
+ rubygems_version: 2.7.6
573
587
  signing_key:
574
588
  specification_version: 4
575
589
  summary: Presenters Gem.