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 +4 -4
- data/CHANGELOG.md +61 -13
- data/README.md +7 -2
- data/coprl.gemspec +1 -1
- data/lib/coprl/presenters/version.rb +1 -1
- data/rails-engine/app/controllers/coprl_controller.rb +2 -0
- data/rails-engine/config/routes.rb +2 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e11f41de6e5ebd00304df4a4cfe917123cf26cce95f02f8d9ead207f55204101
|
4
|
+
data.tar.gz: 0c65b1a3211123c2a2ed171fc811816e1646f5d9c5997b375d1bde5d2e979db2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efb2027ca9f8ec7863dbb946cf6cfab079b747300e3afb3af9d6c176e50a195950dcf3677db68834d7a601ffd9efda6a859abcc5d3471df615b295829c0ea11b
|
7
|
+
data.tar.gz: 9abeedcb34dcb334c6438f14ffe0cb2e78cd1d47ad39eea111b0ae368cd52dc36eba87697237cbf4bb603746e530e7036b699bd45d6d78998509d709ab4c613f
|
data/CHANGELOG.md
CHANGED
@@ -1,31 +1,79 @@
|
|
1
|
-
# [3.0.0-beta.
|
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
|
-
*
|
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
|
-
|
10
|
-
|
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
|
-
|
60
|
+
# [2.0.3](https://github.com/rx/presenters/tree/2.0.3) (2021-03-11)
|
13
61
|
|
14
|
-
|
62
|
+
[Full Changelog](https://github.com/rx/presenters/compare/v2.0.3...2.0.2)
|
15
63
|
|
16
|
-
|
64
|
+
# [2.0.2](https://github.com/rx/presenters/tree/2.0.2) (2021-02-18)
|
17
65
|
|
18
|
-
|
66
|
+
[Full Changelog](https://github.com/rx/presenters/compare/v2.0.2...2.0.1)
|
19
67
|
|
20
|
-
|
68
|
+
# [2.0.1](https://github.com/rx/presenters/tree/2.0.1) (2020-12-23)
|
21
69
|
|
22
|
-
|
70
|
+
[Full Changelog](https://github.com/rx/presenters/compare/v2.0.1...2.0.0)
|
23
71
|
|
24
|
-
|
72
|
+
# [v2.0.0](https://github.com/rx/presenters/tree/v2.0.0) (2020-12-22)
|
25
73
|
|
26
|
-
|
74
|
+
[Full Changelog](https://github.com/rx/presenters/compare/2.0.0...v1.0.0)
|
27
75
|
|
28
|
-
|
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
|
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
|
-
####
|
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 = '
|
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
|
|
@@ -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
|
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.
|
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-
|
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:
|
942
|
+
summary: COmmon PResenter Language - A Ruby gem for joyfully writing modern user interfaces
|
943
|
+
in Rack and Rails.
|
943
944
|
test_files: []
|