flux_base 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f9fc37c351728e5a3c7039dd8e0e5f5821e811f4a2d911d9a46ad757394e62b1
4
+ data.tar.gz: 0fd0b3da5c7bcccc8faa2e99a68c1bf72609414f7ae915ae68b71a54f3d32fc2
5
+ SHA512:
6
+ metadata.gz: 86e50a79b5b7f7f62c3a4eef8f44b6be822ad8020eab7d3e67e70ea4ea66cd9ac6262bbb0178603d7e7d84cd4dc2fcb616a7eb38d013cf7e929fd23ee8be2bd2
7
+ data.tar.gz: f432aa7e1b9ea9cfc8c3636bcba14d8a0fe511148de639d055df013448ab6a7dddd443837fcb1c0336d3e4c6bdc1fa6e38c530ae7451e62e9fba93ed6e25e913
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Luc Street
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,27 @@
1
+ # flux_base
2
+ A Rails engine providing sensible default gems and helpers for new applications.
3
+
4
+ ## Notable Features
5
+ - [rails_semantic_logger](https://github.com/rocketjob/rails_semantic_logger) with
6
+ [awesome_print](https://github.com/awesome-print/awesome_print)
7
+ - [slim-rails](https://github.com/slim-template/slim-rails)
8
+ - [whenever](https://github.com/javan/whenever)
9
+ - View helpers for [Bulma](https://bulma.io/) - just include `FluxBase::BulmaHelpers`
10
+ - Miscellaneous view helpers - just include `FluxBase::ApplicationHelper`
11
+
12
+ ## Installation
13
+ Create a new Rails application. Remove all default dependencies from your Gemfile and add the line:
14
+ ```ruby
15
+ gem 'flux_base'
16
+ ```
17
+
18
+ Then execute:
19
+ ```bash
20
+ $ bundle
21
+ ```
22
+
23
+ ## Contributing
24
+ Bug reports and pull requests are welcome on GitHub at https://github.com/lucis-fluxum/flux_base.
25
+
26
+ ## License
27
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require 'bundler/setup'
5
+ rescue LoadError
6
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
+ end
8
+
9
+ require 'rdoc/task'
10
+
11
+ RDoc::Task.new(:rdoc) do |rdoc|
12
+ rdoc.rdoc_dir = 'rdoc'
13
+ rdoc.title = 'FluxBase'
14
+ rdoc.options << '--line-numbers'
15
+ rdoc.rdoc_files.include('README.md')
16
+ rdoc.rdoc_files.include('lib/**/*.rb')
17
+ end
18
+
19
+ APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
20
+ load 'rails/tasks/engine.rake'
21
+
22
+ load 'rails/tasks/statistics.rake'
23
+
24
+ require 'bundler/gem_tasks'
25
+
26
+ require 'rake/testtask'
27
+
28
+ Rake::TestTask.new(:test) do |t|
29
+ t.libs << 'test'
30
+ t.pattern = 'test/**/*_test.rb'
31
+ t.verbose = false
32
+ end
33
+
34
+ task default: :test
@@ -0,0 +1 @@
1
+ //= link_directory ../stylesheets/flux_base .css
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FluxBase
4
+ class ApplicationController < ActionController::Base
5
+ protect_from_forgery with: :exception
6
+ end
7
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FluxBase
4
+ module ApplicationHelper
5
+ def application_includes
6
+ styles = stylesheet_link_tag('application', media: 'all', 'data-turbolinks-track': 'reload')
7
+ js = javascript_pack_tag('application', 'data-turbolinks-track': 'reload')
8
+ styles.concat(js)
9
+ end
10
+
11
+ # Generates pretty printed JSON for obj.
12
+ def display_json(obj)
13
+ JSON.pretty_generate(obj)
14
+ rescue JSON::GeneratorError
15
+ JSON.pretty_generate(JSON.parse(obj.to_json))
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FluxBase
4
+ module BulmaHelpers
5
+ # Add controls in the block passed to this method.
6
+ def actions_fieldset(title = '')
7
+ field_set_tag(title) do
8
+ content_tag(:div, class: 'field has-addons') do
9
+ yield
10
+ end
11
+ end.concat(tag(:hr))
12
+ end
13
+
14
+ def display_notice
15
+ return unless notice.present?
16
+
17
+ content_tag(:div, class: 'notification is-info') do
18
+ notice
19
+ end
20
+ end
21
+
22
+ def display_alert
23
+ return unless alert.present?
24
+
25
+ content_tag(:div, class: 'notification is-danger') do
26
+ alert
27
+ end
28
+ end
29
+
30
+ # Replaces the auto-generated errors div for record forms.
31
+ def display_errors(record)
32
+ return unless record.errors.any?
33
+
34
+ title = "#{pluralize(record.errors.count, 'error')} prohibited this #{record.class.name.downcase} from being saved:"
35
+ create_message(title, class: 'is-danger') do
36
+ content_tag(:ul) do
37
+ record.errors.full_messages.map do |msg|
38
+ content_tag(:li, msg)
39
+ end.inject(&:concat)
40
+ end
41
+ end
42
+ end
43
+
44
+ # Creates a Bulma message with the given title and options. Use a block to define the message body.
45
+ def create_message(title, options = {})
46
+ content_tag(:article, class: 'message ' + options.delete(:class), **options) do
47
+ header = content_tag(:div, title, class: 'message-header')
48
+ body = content_tag(:div, class: 'message-body') do
49
+ yield
50
+ end
51
+
52
+ header.concat(body)
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FluxBase
4
+ class ApplicationJob < ActiveJob::Base
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FluxBase
4
+ class ApplicationMailer < ActionMailer::Base
5
+ default from: 'from@example.com'
6
+ layout 'mailer'
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FluxBase
4
+ class ApplicationRecord < ActiveRecord::Base
5
+ self.abstract_class = true
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Flux base</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+
8
+ <%= stylesheet_link_tag 'flux_base/application', media: 'all' %>
9
+ </head>
10
+ <body>
11
+
12
+ <%= yield %>
13
+
14
+ </body>
15
+ </html>
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ FluxBase::Engine.routes.draw do
4
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'flux_base/engine'
4
+
5
+ module FluxBase
6
+ # Your code goes here...
7
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'jbuilder'
4
+ require 'rails_semantic_logger'
5
+ require 'slim-rails'
6
+ require 'turbolinks'
7
+ require 'webpacker'
8
+
9
+ if Rails.env == 'development' || Rails.env == 'test'
10
+ require 'byebug'
11
+
12
+ if Rails.env == 'development'
13
+ require 'spring/watcher/listen'
14
+ require 'web_console'
15
+ end
16
+ end
17
+
18
+ module FluxBase
19
+ class Engine < ::Rails::Engine
20
+ isolate_namespace FluxBase
21
+ end
22
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FluxBase
4
+ VERSION = '0.2.1'
5
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ # desc "Explaining what the task does"
3
+ # task :flux_base do
4
+ # # Task goes here
5
+ # end
metadata ADDED
@@ -0,0 +1,327 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flux_base
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
+ platform: ruby
6
+ authors:
7
+ - Luc Street
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-02-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: awesome_print
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.8.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.8.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bootsnap
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.4.6
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.4.6
41
+ - !ruby/object:Gem::Dependency
42
+ name: byebug
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 11.1.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 11.1.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: capybara
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 3.31.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 3.31.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: jbuilder
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 2.10.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 2.10.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: listen
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 3.2.1
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 3.2.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: puma
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 4.3.1
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 4.3.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: rails
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 6.0.1
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 6.0.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: rails_semantic_logger
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 4.4.3
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 4.4.3
139
+ - !ruby/object:Gem::Dependency
140
+ name: sass-rails
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 6.0.0
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 6.0.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: slim-rails
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 3.2.0
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 3.2.0
167
+ - !ruby/object:Gem::Dependency
168
+ name: spring
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 2.1.0
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 2.1.0
181
+ - !ruby/object:Gem::Dependency
182
+ name: spring-watcher-listen
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 2.0.1
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 2.0.1
195
+ - !ruby/object:Gem::Dependency
196
+ name: turbolinks
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: 5.2.1
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: 5.2.1
209
+ - !ruby/object:Gem::Dependency
210
+ name: web-console
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: 4.0.1
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: 4.0.1
223
+ - !ruby/object:Gem::Dependency
224
+ name: webpacker
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: 4.2.2
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: 4.2.2
237
+ - !ruby/object:Gem::Dependency
238
+ name: whenever
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: 1.0.0
244
+ type: :runtime
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: 1.0.0
251
+ - !ruby/object:Gem::Dependency
252
+ name: pg
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - "~>"
256
+ - !ruby/object:Gem::Version
257
+ version: 1.2.2
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - "~>"
263
+ - !ruby/object:Gem::Version
264
+ version: 1.2.2
265
+ - !ruby/object:Gem::Dependency
266
+ name: rubocop
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - "~>"
270
+ - !ruby/object:Gem::Version
271
+ version: '0.80'
272
+ type: :development
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - "~>"
277
+ - !ruby/object:Gem::Version
278
+ version: '0.80'
279
+ description:
280
+ email:
281
+ - lucis-fluxum@users.noreply.github.com
282
+ executables: []
283
+ extensions: []
284
+ extra_rdoc_files: []
285
+ files:
286
+ - LICENSE
287
+ - README.md
288
+ - Rakefile
289
+ - app/assets/config/flux_base_manifest.js
290
+ - app/assets/stylesheets/flux_base/application.css
291
+ - app/controllers/flux_base/application_controller.rb
292
+ - app/helpers/flux_base/application_helper.rb
293
+ - app/helpers/flux_base/bulma_helpers.rb
294
+ - app/jobs/flux_base/application_job.rb
295
+ - app/mailers/flux_base/application_mailer.rb
296
+ - app/models/flux_base/application_record.rb
297
+ - app/views/layouts/flux_base/application.html.erb
298
+ - config/routes.rb
299
+ - lib/flux_base.rb
300
+ - lib/flux_base/engine.rb
301
+ - lib/flux_base/version.rb
302
+ - lib/tasks/flux_base_tasks.rake
303
+ homepage: https://github.com/lucis-fluxum/flux_base
304
+ licenses:
305
+ - MIT
306
+ metadata: {}
307
+ post_install_message:
308
+ rdoc_options: []
309
+ require_paths:
310
+ - lib
311
+ required_ruby_version: !ruby/object:Gem::Requirement
312
+ requirements:
313
+ - - ">="
314
+ - !ruby/object:Gem::Version
315
+ version: '0'
316
+ required_rubygems_version: !ruby/object:Gem::Requirement
317
+ requirements:
318
+ - - ">="
319
+ - !ruby/object:Gem::Version
320
+ version: '0'
321
+ requirements: []
322
+ rubygems_version: 3.1.2
323
+ signing_key:
324
+ specification_version: 4
325
+ summary: A mountable engine providing sensible default gems and helpers for new Rails
326
+ applications.
327
+ test_files: []