coprl 3.0.0.beta.1 → 3.0.0.beta.2

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: 6b79a737fee4f85758ae84d3b2341314b7b22accc1d02aef81c3df4178ceba52
4
- data.tar.gz: 29e693f813b61c335d5dfb30cd887864edb3e49cc39d56a5831dd466889447ea
3
+ metadata.gz: e11f41de6e5ebd00304df4a4cfe917123cf26cce95f02f8d9ead207f55204101
4
+ data.tar.gz: 0c65b1a3211123c2a2ed171fc811816e1646f5d9c5997b375d1bde5d2e979db2
5
5
  SHA512:
6
- metadata.gz: e3b2ab849e681cf84b696ce98f95f706ecc05d95bc6556f47c27f4ec00c6048da636813bc33d011afb0029db129994908137800c179a25e4a7532d192b641466
7
- data.tar.gz: e3dea9ecd5939a9161d0c65aca82e4bedc36a591910fc474b71fbbb50a2e2f89895275f5ea2b350afc7ca17ea431a0392014ee8c5ee950fa8062438c8d767cec
6
+ metadata.gz: efb2027ca9f8ec7863dbb946cf6cfab079b747300e3afb3af9d6c176e50a195950dcf3677db68834d7a601ffd9efda6a859abcc5d3471df615b295829c0ea11b
7
+ data.tar.gz: 9abeedcb34dcb334c6438f14ffe0cb2e78cd1d47ad39eea111b0ae368cd52dc36eba87697237cbf4bb603746e530e7036b699bd45d6d78998509d709ab4c613f
data/CHANGELOG.md CHANGED
@@ -1,31 +1,79 @@
1
- # [3.0.0-beta.1](https://github.com/rx/presenters/compare/v2.1.1...v3.0.0-beta.1) (2021-06-02)
1
+ # [3.0.0-beta.2](https://github.com/rx/presenters/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2021-06-03)
2
+
2
3
 
4
+ ### Bug Fixes
3
5
 
4
- * Coprl rename (#318) ([8acafd5](https://github.com/rx/presenters/commit/8acafd5e1a1f116c881ae79c59d069161d7ec2e6)), closes [#318](https://github.com/rx/presenters/issues/318) [#309](https://github.com/rx/presenters/issues/309) [#317](https://github.com/rx/presenters/issues/317) [#316](https://github.com/rx/presenters/issues/316) [#315](https://github.com/rx/presenters/issues/315) [#314](https://github.com/rx/presenters/issues/314) [#313](https://github.com/rx/presenters/issues/313) [#312](https://github.com/rx/presenters/issues/312) [#311](https://github.com/rx/presenters/issues/311) [#310](https://github.com/rx/presenters/issues/310) [#316](https://github.com/rx/presenters/issues/316) [#315](https://github.com/rx/presenters/issues/315) [#314](https://github.com/rx/presenters/issues/314) [#313](https://github.com/rx/presenters/issues/313) [#312](https://github.com/rx/presenters/issues/312) [#311](https://github.com/rx/presenters/issues/311) [#310](https://github.com/rx/presenters/issues/310)
6
+ * support for index presenters within Rails ([06b5fb9](https://github.com/rx/presenters/commit/06b5fb97e049db3f8670eef87979959d8bb1e63b))
5
7
 
8
+ # [3.0.0-beta.1](https://github.com/rx/presenters/compare/v2.1.1...v3.0.0-beta.1) (2021-06-02)
9
+
10
+ * Coprl module rename and Rails 5 and 6 native views (#318) ([8acafd5](https://github.com/rx/presenters/commit/8acafd5e1a1f116c881ae79c59d069161d7ec2e6)), closes [#318](https://github.com/rx/presenters/issues/318) [#309](https://github.com/rx/presenters/issues/309) [#317](https://github.com/rx/presenters/issues/317) [#316](https://github.com/rx/presenters/issues/316) [#315](https://github.com/rx/presenters/issues/315) [#314](https://github.com/rx/presenters/issues/314) [#313](https://github.com/rx/presenters/issues/313) [#312](https://github.com/rx/presenters/issues/312) [#311](https://github.com/rx/presenters/issues/311) [#310](https://github.com/rx/presenters/issues/310) [#316](https://github.com/rx/presenters/issues/316) [#315](https://github.com/rx/presenters/issues/315) [#314](https://github.com/rx/presenters/issues/314) [#313](https://github.com/rx/presenters/issues/313) [#312](https://github.com/rx/presenters/issues/312) [#311](https://github.com/rx/presenters/issues/311) [#310](https://github.com/rx/presenters/issues/310)
6
11
 
7
12
  ### BREAKING CHANGES
8
13
 
9
- * Rails Engine supporting native rails template views and partials.
10
- Plugin's are incompatible with this version due to Rails render rules requiring leading '_' and application directory.
14
+ #### Migrating from Presenters v2 to COPRL Presenters v3
15
+
16
+ ##### Clients
17
+ * Refactor module Voom => Coprl
18
+ * Replace in requires in app and lib files 'voom' => 'coprl'
19
+
20
+ ##### Plugins
21
+
22
+ The plugins have been modified to support Rails native views.
23
+ There is a generator that you can also use to generate a new plugin: `coprl generate plugin PLUGIN_NAME`.
24
+ In some cases generating a new plugin and moving over the code may be the preferred option.
25
+
26
+ The rest of this guide assumes you are going to migrate it over manualy.
27
+
28
+ ###### Module Rename
29
+ * Rename library directory `lib/voom` => 'lib/coprl'
30
+ * Refactor module `Voom` => `Coprl`
31
+ * Replace in `lib` files 'voom/' => `coprl/`
32
+
33
+ ###### View Changes
34
+
35
+ In the Coprl::Presenters::Plugins::PLUGIN_NAME::WebClientComponents
36
+ Add the following callback that points to your views directory
37
+
38
+ def view_dir_PLUGIN_NAME(pom)
39
+ File.join(__dir__, '../../../../../../..', 'views', 'components')
40
+ end
41
+
42
+ * Add an `application` directory under your view directory returned above.
43
+ * Add a `_` prefix to your templates.
44
+ * Change erb render calls in your templates `erb :"components/event"` => `partial "components/event"`
45
+ * Add raw calls to any javascript/css that you emitt from your templates, e.g., `<%= raw File.read(File.expand_path('../../../../../../public/c3.min.css', __dir__) ) %>`
46
+
47
+ **Recommended**
48
+
49
+ Move templates, javascript and css files into their own view directory at the root of the presenter.
50
+ This makes it easier to reason and find the appropriate parts of the plugin
51
+
52
+ # [2.1.1](https://github.com/rx/presenters/tree/2.1.1) (2021-04-26)
53
+
54
+ [Full Changelog](https://github.com/rx/presenters/compare/v2.1.1...2.1.0)
55
+
56
+ # [2.1.0](https://github.com/rx/presenters/tree/2.1.0) (2021-03-17)
57
+
58
+ [Full Changelog](https://github.com/rx/presenters/compare/v2.1.0...2.0.3)
11
59
 
12
- * Rails 5 work in progress. Not rending templates currently. Use Rails 6 until resoved.
60
+ # [2.0.3](https://github.com/rx/presenters/tree/2.0.3) (2021-03-11)
13
61
 
14
- * Fixed local path gemfile entry.
62
+ [Full Changelog](https://github.com/rx/presenters/compare/v2.0.3...2.0.2)
15
63
 
16
- * Removed puts debugging statements.
64
+ # [2.0.2](https://github.com/rx/presenters/tree/2.0.2) (2021-02-18)
17
65
 
18
- * Rails 5 changes to get template handlers to render correctly. Note: If you don't like the load speeds in dev mode, use Rails 6 instead. Rails 6 template speeds are 5 times faster in development.
66
+ [Full Changelog](https://github.com/rx/presenters/compare/v2.0.2...2.0.1)
19
67
 
20
- * Rendering templates even when empty is significantly slower in Rails than in Sinatra. So we prevent render calls a practice across all component templates. Only render what you are using is the rule of thumb, even if the calling template is wrapped with a `if comp` check.
68
+ # [2.0.1](https://github.com/rx/presenters/tree/2.0.1) (2020-12-23)
21
69
 
22
- * docs: Updated README
70
+ [Full Changelog](https://github.com/rx/presenters/compare/v2.0.1...2.0.0)
23
71
 
24
- Added more instructions on rails partials and general cleanup.
72
+ # [v2.0.0](https://github.com/rx/presenters/tree/v2.0.0) (2020-12-22)
25
73
 
26
- # Changelog
74
+ [Full Changelog](https://github.com/rx/presenters/compare/2.0.0...v1.0.0)
27
75
 
28
- ## [1.0.0](https://github.com/rx/presenters/tree/1.0.0) (2020-12-20)
76
+ # [1.0.0](https://github.com/rx/presenters/tree/1.0.0) (2020-12-20)
29
77
 
30
78
  [Full Changelog](https://github.com/rx/presenters/compare/v0.5.0...1.0.0)
31
79
 
data/README.md CHANGED
@@ -64,7 +64,7 @@ To see the POM:
64
64
  ### Rails
65
65
  Presenters are a view templating language in Rails.
66
66
  You can mix and match presenters with your existing views,
67
- use them as new views, or call them as partails in existing views.
67
+ use them as new views, or call them as partials in existing views.
68
68
 
69
69
  #### 1) Add presenters to Gemfile
70
70
  gem 'coprl'
@@ -86,7 +86,12 @@ Navigate to [locahost:3000/hello_world](http://127.0.0.1:3000/hello_world)
86
86
 
87
87
  Use the [Demo] to get example code to drop into your presenters.
88
88
 
89
- #### 5) Optionally -- use presenters as partials from ERB/HAML
89
+ #### Optional Setting the root route
90
+ If you name a presenter :index and want the root of the app to serve up that presenter add the following to your `config/initializers/routes.rb`
91
+
92
+ root 'coprl#show'
93
+
94
+ #### Optionally — use presenters as partials from ERB/HAML
90
95
  You can render a presenter as a partial from other templating laguages (erb, haml):
91
96
 
92
97
  <%= render 'show', presenter: 'hello_world' %>
data/coprl.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ['Russell Edens']
10
10
  spec.email = ["rx@russelledens.net\n"]
11
11
 
12
- spec.summary = 'COPRL Presenters Gem'
12
+ spec.summary = 'COmmon PResenter Language - A Ruby gem for joyfully writing modern user interfaces in Rack and Rails.'
13
13
  spec.homepage = 'http://github.com/rx/presenters'
14
14
  spec.license = 'MIT'
15
15
 
@@ -1,7 +1,7 @@
1
1
  module Coprl
2
2
  module Presenters
3
3
  module Version
4
- VERSION = '3.0.0.beta.1'
4
+ VERSION = '3.0.0.beta.2'
5
5
  end
6
6
  end
7
7
  end
@@ -9,6 +9,8 @@ class CoprlController < ApplicationController
9
9
  def load_pom
10
10
  return @pom if @pom
11
11
  presenter_name = namespaced_presenter(params)
12
+ fq_presenter_name = [presenter_name, 'index'].compact.join(':')
13
+ presenter_name = fq_presenter_name if Coprl::Presenters::App.registered?(fq_presenter_name)
12
14
  presenter = Coprl::Presenters::App[presenter_name].call
13
15
  context = params.dup.to_unsafe_hash
14
16
  router = Coprl::Presenters::WebClient::Router.new(base_url: request.base_url)
@@ -4,7 +4,8 @@ Coprl::Presenters::Rails::Engine.routes.draw do
4
4
  extend Coprl::Presenters::WebClient::Helpers::Rails::Namespaced
5
5
  def self.matches?(request)
6
6
  presenter = namespaced_presenter(request.params)
7
- presenter ? Coprl::Presenters::App.keys.include?(presenter) : false
7
+ fq_presenter = [presenter, 'index'].join(':')
8
+ presenter ? Coprl::Presenters::App.keys.include?(presenter) || Coprl::Presenters::App.registered?(fq_presenter) : false
8
9
  end
9
10
  end
10
11
  get ':namespace1/:namespace2/:presenter' => "coprl#show", constraints: PomExists
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coprl
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta.1
4
+ version: 3.0.0.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Edens
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-02 00:00:00.000000000 Z
11
+ date: 2021-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ice_nine
@@ -939,5 +939,6 @@ requirements: []
939
939
  rubygems_version: 3.1.4
940
940
  signing_key:
941
941
  specification_version: 4
942
- summary: COPRL Presenters Gem
942
+ summary: COmmon PResenter Language - A Ruby gem for joyfully writing modern user interfaces
943
+ in Rack and Rails.
943
944
  test_files: []