nacelle 0.1.0 → 0.2.3

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
- SHA1:
3
- metadata.gz: 22e80566ff4a1407bd07ac2519ceb84f45c354e7
4
- data.tar.gz: 129e8cbbdf6c777549d17c55ae0bb0141fbdd681
2
+ SHA256:
3
+ metadata.gz: e1f1085de0621c2e719504861113bc39da5d848ff607ab198d2964715df09e6b
4
+ data.tar.gz: aac00e17a51ba515161aabea95ea870526e7b655f71ea595f457a11547f218b5
5
5
  SHA512:
6
- metadata.gz: 4c59cebe992329fc4bb80659005da6867fe1a9241d68b44d8a2f08747edff8401562dec8f3518307222cfdeb0ae52d5faae03324998c83e9fc2f1a56914a5c53
7
- data.tar.gz: 6f85b7a28a057fce45eaae53dd818f0a09d252573b6cdfbb834b4cd004dd54f8ac5e760c059414c94f9c3a20538b6eff28a5cd802a7b85377c5aba38f5998fbe
6
+ metadata.gz: 8f4eaffbb71f804e2920910f2af323586d8fb401c973559c41f951da05ebf6705ac7779fad183e95ccf034543bcc55128612c7c9016f3849ce263f7e85f1637b
7
+ data.tar.gz: 37139948b268cd49d8484d72bad33cc9dfe870cd2eb9a6b259cfdc9b44ef1fd343c1a3d313dea94dcd13f88113c06b84e56ab36b7b025c8619622502281d8eb6
@@ -0,0 +1,36 @@
1
+ name: CI
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ strategy:
6
+ fail-fast: false
7
+ matrix:
8
+ gemfile: [ rails_5.1, rails_5.2, rails_6.0, rails_6.1, rails_7.0 ]
9
+ ruby: [ 2.4, 2.5, 2.6, 2.7, '3.0' ]
10
+ exclude:
11
+ - gemfile: rails_5.1
12
+ ruby: 3.0
13
+ - gemfile: rails_5.2
14
+ ruby: 3.0
15
+ - gemfile: rails_6.0
16
+ ruby: 2.4
17
+ - gemfile: rails_6.1
18
+ ruby: 2.4
19
+ - gemfile: rails_7.0
20
+ ruby: 2.4
21
+ - gemfile: rails_7.0
22
+ ruby: 2.5
23
+ - gemfile: rails_7.0
24
+ ruby: 2.6
25
+
26
+ runs-on: ubuntu-latest
27
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
28
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
29
+ steps:
30
+ - uses: actions/checkout@v2
31
+ - uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: ${{ matrix.ruby }}
34
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
35
+ - run: bundle exec rake
36
+
data/.gitignore CHANGED
@@ -7,3 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /.ruby-version
11
+ /.byebug_history
data/Appraisals ADDED
@@ -0,0 +1,27 @@
1
+ appraise "rails-5.1" do
2
+ gem "rails", "~>5.1.0"
3
+ gem "sprockets", "~>3.0"
4
+ end
5
+
6
+ appraise "rails-5.2" do
7
+ gem "rails", "~>5.2.0"
8
+ gem "sprockets", "~>3.0"
9
+ end
10
+
11
+ appraise "rails-6.0" do
12
+ gem "rails", "~>6.0.0"
13
+ gem "sprockets", "~>3.0"
14
+ gem "capybara", "~>3.35.0" # 3.36 requires ruby 2.6+
15
+ end
16
+
17
+ appraise "rails-6.1" do
18
+ gem "rails", "~>6.1.0"
19
+ gem "sprockets", "~>3.0"
20
+ gem "capybara", "~>3.35.0" # 3.36 requires ruby 2.6+
21
+ end
22
+
23
+ appraise "rails-7.0" do
24
+ gem "rails", "~>7.0.0"
25
+ gem "sprockets", "~>3.0"
26
+ end
27
+
data/Gemfile CHANGED
@@ -2,3 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in nacelle.gemspec
4
4
  gemspec
5
+
6
+ gem "rails", "~>6.1.0"
7
+ gem "sprockets", "~>3.0"
data/README.md CHANGED
@@ -1,8 +1,15 @@
1
1
  # Nacelle
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/nacelle`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![CI Status](https://github.com/botandrose/nacelle/workflows/CI/badge.svg?branch=master)](https://github.com/botandrose/nacelle/actions?query=workflow%3ACI+branch%3Amaster)
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ Rails engine for inserting magic blocks into CMS content via cells.
6
+
7
+ In your CMS content:
8
+ ```html
9
+ <cell name="my_account/form" />
10
+ ```
11
+
12
+ The Nacelle middleware will replace this with the result of MyAccountCell#form.
6
13
 
7
14
  ## Installation
8
15
 
@@ -12,17 +19,19 @@ Add this line to your application's Gemfile:
12
19
  gem 'nacelle'
13
20
  ```
14
21
 
15
- And then execute:
22
+ # Optional CKEditor integration
16
23
 
17
- $ bundle
24
+ Cells you want to show up in the cell selection menu must inherit from Nacelle::Cell.
18
25
 
19
- Or install it yourself as:
26
+ ```javascript
27
+ // ckeditor/config.js
20
28
 
21
- $ gem install nacelle
29
+ //= require nacelle/ckeditor
30
+ ...
31
+ config.extraPlugins = 'cells';
22
32
 
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
33
+ // finally, add 'InsertCell' to your toolbar config
34
+ ```
26
35
 
27
36
  ## Development
28
37
 
@@ -32,7 +41,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
41
 
33
42
  ## Contributing
34
43
 
35
- 1. Fork it ( https://github.com/[my-github-username]/nacelle/fork )
44
+ 1. Fork it ( https://github.com/botandrose/nacelle/fork )
36
45
  2. Create your feature branch (`git checkout -b my-new-feature`)
37
46
  3. Commit your changes (`git commit -am 'Add some feature'`)
38
47
  4. Push to the branch (`git push origin my-new-feature`)
data/Rakefile CHANGED
@@ -1 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
@@ -0,0 +1,25 @@
1
+ CKEDITOR.dialog.add "cellDialog", (editor) ->
2
+ title: "Insert Cell"
3
+ minWidth: 400
4
+ minHeight: 200
5
+ contents: [
6
+ id: "main"
7
+ elements: [
8
+ type: "select"
9
+ id: "cellName"
10
+ label: "Select Cell"
11
+ items: []
12
+ ]
13
+ ]
14
+
15
+ onShow: ->
16
+ $.getJSON "/nacelle/cells.json", (data) =>
17
+ select = @getContentElement("main", "cellName")
18
+ for item in data.cells
19
+ select.add item.name, item.id
20
+
21
+ onOk: ->
22
+ cell = editor.document.createElement("cell")
23
+ cell.setAttribute "name", @getValueOf("main", "cellName")
24
+ editor.insertElement cell
25
+
@@ -0,0 +1,16 @@
1
+ CKEDITOR.plugins.add "cells",
2
+ icons: "insertcell"
3
+ init: (editor) ->
4
+ editor.addCommand "insertCellDialog", new CKEDITOR.dialogCommand("cellDialog")
5
+
6
+ CKEDITOR.dialog.add "cellDialog", "/assets/ckeditor/plugins/cells/dialogs/cells.js"
7
+
8
+ editor.ui.addButton "InsertCell",
9
+ label: "Insert Cell"
10
+ command: "insertCellDialog"
11
+ icon: "/assets/ckeditor/plugins/cells/icons/insertcell.png"
12
+
13
+ CKEDITOR.dtd.$empty.cell = 1
14
+ CKEDITOR.dtd.$nonEditable.cell = 1
15
+ CKEDITOR.dtd.$object.cell = 1
16
+
@@ -0,0 +1,2 @@
1
+ //= require ./cells/plugin
2
+ //= require ./cells/dialogs/cells
@@ -0,0 +1 @@
1
+ //= require ../ckeditor/plugins/cells.js
@@ -0,0 +1,9 @@
1
+ require "nacelle/cells_serializer"
2
+
3
+ module Nacelle
4
+ class CellsController < ApplicationController
5
+ def index
6
+ render json: CellsSerializer.new
7
+ end
8
+ end
9
+ end
data/config/routes.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  Rails.application.routes.draw do
2
- namespace :admin do
3
- get "cells" => "cells#index"
2
+ namespace :nacelle do
3
+ resources :cells, only: :index
4
4
  end
5
5
  end
6
6
 
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_RETRY: "1"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~>5.1.0"
6
+ gem "sprockets", "~>3.0"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,165 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ nacelle (0.2.3)
5
+ cells (~> 3.0)
6
+ rails
7
+ sprockets-rails
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actioncable (5.1.7)
13
+ actionpack (= 5.1.7)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (~> 0.6.1)
16
+ actionmailer (5.1.7)
17
+ actionpack (= 5.1.7)
18
+ actionview (= 5.1.7)
19
+ activejob (= 5.1.7)
20
+ mail (~> 2.5, >= 2.5.4)
21
+ rails-dom-testing (~> 2.0)
22
+ actionpack (5.1.7)
23
+ actionview (= 5.1.7)
24
+ activesupport (= 5.1.7)
25
+ rack (~> 2.0)
26
+ rack-test (>= 0.6.3)
27
+ rails-dom-testing (~> 2.0)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
+ actionview (5.1.7)
30
+ activesupport (= 5.1.7)
31
+ builder (~> 3.1)
32
+ erubi (~> 1.4)
33
+ rails-dom-testing (~> 2.0)
34
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
+ activejob (5.1.7)
36
+ activesupport (= 5.1.7)
37
+ globalid (>= 0.3.6)
38
+ activemodel (5.1.7)
39
+ activesupport (= 5.1.7)
40
+ activerecord (5.1.7)
41
+ activemodel (= 5.1.7)
42
+ activesupport (= 5.1.7)
43
+ arel (~> 8.0)
44
+ activesupport (5.1.7)
45
+ concurrent-ruby (~> 1.0, >= 1.0.2)
46
+ i18n (>= 0.7, < 2)
47
+ minitest (~> 5.1)
48
+ tzinfo (~> 1.1)
49
+ addressable (2.8.0)
50
+ public_suffix (>= 2.0.2, < 5.0)
51
+ appraisal (2.4.1)
52
+ bundler
53
+ rake
54
+ thor (>= 0.14.0)
55
+ arel (8.0.0)
56
+ builder (3.2.4)
57
+ byebug (11.1.3)
58
+ capybara (3.32.2)
59
+ addressable
60
+ mini_mime (>= 0.1.3)
61
+ nokogiri (~> 1.8)
62
+ rack (>= 1.6.0)
63
+ rack-test (>= 0.6.3)
64
+ regexp_parser (~> 1.5)
65
+ xpath (~> 3.2)
66
+ cells (3.11.3)
67
+ actionpack (>= 3.0)
68
+ railties (>= 3.0)
69
+ uber (~> 0.0.8)
70
+ concurrent-ruby (1.1.9)
71
+ crass (1.0.6)
72
+ diff-lcs (1.5.0)
73
+ erubi (1.10.0)
74
+ globalid (0.4.2)
75
+ activesupport (>= 4.2.0)
76
+ i18n (1.8.11)
77
+ concurrent-ruby (~> 1.0)
78
+ loofah (2.13.0)
79
+ crass (~> 1.0.2)
80
+ nokogiri (>= 1.5.9)
81
+ mail (2.7.1)
82
+ mini_mime (>= 0.1.1)
83
+ method_source (1.0.0)
84
+ mini_mime (1.1.2)
85
+ mini_portile2 (2.4.0)
86
+ minitest (5.15.0)
87
+ nio4r (2.5.8)
88
+ nokogiri (1.10.10)
89
+ mini_portile2 (~> 2.4.0)
90
+ public_suffix (4.0.6)
91
+ rack (2.2.3)
92
+ rack-test (1.1.0)
93
+ rack (>= 1.0, < 3)
94
+ rails (5.1.7)
95
+ actioncable (= 5.1.7)
96
+ actionmailer (= 5.1.7)
97
+ actionpack (= 5.1.7)
98
+ actionview (= 5.1.7)
99
+ activejob (= 5.1.7)
100
+ activemodel (= 5.1.7)
101
+ activerecord (= 5.1.7)
102
+ activesupport (= 5.1.7)
103
+ bundler (>= 1.3.0)
104
+ railties (= 5.1.7)
105
+ sprockets-rails (>= 2.0.0)
106
+ rails-dom-testing (2.0.3)
107
+ activesupport (>= 4.2.0)
108
+ nokogiri (>= 1.6)
109
+ rails-html-sanitizer (1.4.2)
110
+ loofah (~> 2.3)
111
+ railties (5.1.7)
112
+ actionpack (= 5.1.7)
113
+ activesupport (= 5.1.7)
114
+ method_source
115
+ rake (>= 0.8.7)
116
+ thor (>= 0.18.1, < 2.0)
117
+ rake (13.0.6)
118
+ regexp_parser (1.8.2)
119
+ rspec (3.10.0)
120
+ rspec-core (~> 3.10.0)
121
+ rspec-expectations (~> 3.10.0)
122
+ rspec-mocks (~> 3.10.0)
123
+ rspec-core (3.10.1)
124
+ rspec-support (~> 3.10.0)
125
+ rspec-expectations (3.10.1)
126
+ diff-lcs (>= 1.2.0, < 2.0)
127
+ rspec-support (~> 3.10.0)
128
+ rspec-mocks (3.10.2)
129
+ diff-lcs (>= 1.2.0, < 2.0)
130
+ rspec-support (~> 3.10.0)
131
+ rspec-support (3.10.3)
132
+ sprockets (3.7.2)
133
+ concurrent-ruby (~> 1.0)
134
+ rack (> 1, < 3)
135
+ sprockets-rails (3.2.2)
136
+ actionpack (>= 4.0)
137
+ activesupport (>= 4.0)
138
+ sprockets (>= 3.0.0)
139
+ thor (1.1.0)
140
+ thread_safe (0.3.6)
141
+ tzinfo (1.2.9)
142
+ thread_safe (~> 0.1)
143
+ uber (0.0.15)
144
+ websocket-driver (0.6.5)
145
+ websocket-extensions (>= 0.1.0)
146
+ websocket-extensions (0.1.5)
147
+ xpath (3.2.0)
148
+ nokogiri (~> 1.8)
149
+
150
+ PLATFORMS
151
+ ruby
152
+
153
+ DEPENDENCIES
154
+ appraisal
155
+ bundler
156
+ byebug
157
+ capybara
158
+ nacelle!
159
+ rails (~> 5.1.0)
160
+ rake
161
+ rspec
162
+ sprockets (~> 3.0)
163
+
164
+ BUNDLED WITH
165
+ 2.2.32
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~>5.2.0"
6
+ gem "sprockets", "~>3.0"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,171 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ nacelle (0.2.3)
5
+ cells (~> 3.0)
6
+ rails
7
+ sprockets-rails
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actioncable (5.2.6)
13
+ actionpack (= 5.2.6)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (>= 0.6.1)
16
+ actionmailer (5.2.6)
17
+ actionpack (= 5.2.6)
18
+ actionview (= 5.2.6)
19
+ activejob (= 5.2.6)
20
+ mail (~> 2.5, >= 2.5.4)
21
+ rails-dom-testing (~> 2.0)
22
+ actionpack (5.2.6)
23
+ actionview (= 5.2.6)
24
+ activesupport (= 5.2.6)
25
+ rack (~> 2.0, >= 2.0.8)
26
+ rack-test (>= 0.6.3)
27
+ rails-dom-testing (~> 2.0)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
+ actionview (5.2.6)
30
+ activesupport (= 5.2.6)
31
+ builder (~> 3.1)
32
+ erubi (~> 1.4)
33
+ rails-dom-testing (~> 2.0)
34
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
+ activejob (5.2.6)
36
+ activesupport (= 5.2.6)
37
+ globalid (>= 0.3.6)
38
+ activemodel (5.2.6)
39
+ activesupport (= 5.2.6)
40
+ activerecord (5.2.6)
41
+ activemodel (= 5.2.6)
42
+ activesupport (= 5.2.6)
43
+ arel (>= 9.0)
44
+ activestorage (5.2.6)
45
+ actionpack (= 5.2.6)
46
+ activerecord (= 5.2.6)
47
+ marcel (~> 1.0.0)
48
+ activesupport (5.2.6)
49
+ concurrent-ruby (~> 1.0, >= 1.0.2)
50
+ i18n (>= 0.7, < 2)
51
+ minitest (~> 5.1)
52
+ tzinfo (~> 1.1)
53
+ addressable (2.8.0)
54
+ public_suffix (>= 2.0.2, < 5.0)
55
+ appraisal (2.4.1)
56
+ bundler
57
+ rake
58
+ thor (>= 0.14.0)
59
+ arel (9.0.0)
60
+ builder (3.2.4)
61
+ byebug (11.1.3)
62
+ capybara (3.32.2)
63
+ addressable
64
+ mini_mime (>= 0.1.3)
65
+ nokogiri (~> 1.8)
66
+ rack (>= 1.6.0)
67
+ rack-test (>= 0.6.3)
68
+ regexp_parser (~> 1.5)
69
+ xpath (~> 3.2)
70
+ cells (3.11.3)
71
+ actionpack (>= 3.0)
72
+ railties (>= 3.0)
73
+ uber (~> 0.0.8)
74
+ concurrent-ruby (1.1.9)
75
+ crass (1.0.6)
76
+ diff-lcs (1.5.0)
77
+ erubi (1.10.0)
78
+ globalid (0.4.2)
79
+ activesupport (>= 4.2.0)
80
+ i18n (1.8.11)
81
+ concurrent-ruby (~> 1.0)
82
+ loofah (2.13.0)
83
+ crass (~> 1.0.2)
84
+ nokogiri (>= 1.5.9)
85
+ mail (2.7.1)
86
+ mini_mime (>= 0.1.1)
87
+ marcel (1.0.2)
88
+ method_source (1.0.0)
89
+ mini_mime (1.1.2)
90
+ mini_portile2 (2.4.0)
91
+ minitest (5.15.0)
92
+ nio4r (2.5.8)
93
+ nokogiri (1.10.10)
94
+ mini_portile2 (~> 2.4.0)
95
+ public_suffix (4.0.6)
96
+ rack (2.2.3)
97
+ rack-test (1.1.0)
98
+ rack (>= 1.0, < 3)
99
+ rails (5.2.6)
100
+ actioncable (= 5.2.6)
101
+ actionmailer (= 5.2.6)
102
+ actionpack (= 5.2.6)
103
+ actionview (= 5.2.6)
104
+ activejob (= 5.2.6)
105
+ activemodel (= 5.2.6)
106
+ activerecord (= 5.2.6)
107
+ activestorage (= 5.2.6)
108
+ activesupport (= 5.2.6)
109
+ bundler (>= 1.3.0)
110
+ railties (= 5.2.6)
111
+ sprockets-rails (>= 2.0.0)
112
+ rails-dom-testing (2.0.3)
113
+ activesupport (>= 4.2.0)
114
+ nokogiri (>= 1.6)
115
+ rails-html-sanitizer (1.4.2)
116
+ loofah (~> 2.3)
117
+ railties (5.2.6)
118
+ actionpack (= 5.2.6)
119
+ activesupport (= 5.2.6)
120
+ method_source
121
+ rake (>= 0.8.7)
122
+ thor (>= 0.19.0, < 2.0)
123
+ rake (13.0.6)
124
+ regexp_parser (1.8.2)
125
+ rspec (3.10.0)
126
+ rspec-core (~> 3.10.0)
127
+ rspec-expectations (~> 3.10.0)
128
+ rspec-mocks (~> 3.10.0)
129
+ rspec-core (3.10.1)
130
+ rspec-support (~> 3.10.0)
131
+ rspec-expectations (3.10.1)
132
+ diff-lcs (>= 1.2.0, < 2.0)
133
+ rspec-support (~> 3.10.0)
134
+ rspec-mocks (3.10.2)
135
+ diff-lcs (>= 1.2.0, < 2.0)
136
+ rspec-support (~> 3.10.0)
137
+ rspec-support (3.10.3)
138
+ sprockets (3.7.2)
139
+ concurrent-ruby (~> 1.0)
140
+ rack (> 1, < 3)
141
+ sprockets-rails (3.2.2)
142
+ actionpack (>= 4.0)
143
+ activesupport (>= 4.0)
144
+ sprockets (>= 3.0.0)
145
+ thor (1.1.0)
146
+ thread_safe (0.3.6)
147
+ tzinfo (1.2.9)
148
+ thread_safe (~> 0.1)
149
+ uber (0.0.15)
150
+ websocket-driver (0.7.5)
151
+ websocket-extensions (>= 0.1.0)
152
+ websocket-extensions (0.1.5)
153
+ xpath (3.2.0)
154
+ nokogiri (~> 1.8)
155
+
156
+ PLATFORMS
157
+ ruby
158
+
159
+ DEPENDENCIES
160
+ appraisal
161
+ bundler
162
+ byebug
163
+ capybara
164
+ nacelle!
165
+ rails (~> 5.2.0)
166
+ rake
167
+ rspec
168
+ sprockets (~> 3.0)
169
+
170
+ BUNDLED WITH
171
+ 2.2.32
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~>6.0.0"
6
+ gem "sprockets", "~>3.0"
7
+ gem "capybara", "~>3.35.0"
8
+
9
+ gemspec path: "../"