plug 0.1.15 → 0.1.16

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
  SHA1:
3
- metadata.gz: e17ce17b82f86550c238b434a1524e79de09d603
4
- data.tar.gz: 484c4c279b9a86e58b1297581cbd1e2a8537d2b2
3
+ metadata.gz: 4b0a9e497318907102cd0f8f45aa3c898a449637
4
+ data.tar.gz: b7d5901be42c8e4fe4f314eb7c93da2619de94ae
5
5
  SHA512:
6
- metadata.gz: 736df38bac871297d9680d4a00ba0647cdffc5dfe91f2e2b7a10953bc6d7e18d7f2cb59fa87670fda467b9ef735657aea2fb111b2ac5c22b899cd5c9a0c1cb0c
7
- data.tar.gz: f90d239f21f388e90c02b6b780da25ff987c347a86bbbe51854707ce306cd3866c90d207e58881adce76f5a50de238c993f9530e2248477cf049c385791852db
6
+ metadata.gz: 089488dc310a82f487f8b779b9e6c5e158831e589f03e57b39fc60e8ac088f7a756245026b0a2d2e94f58d5a3d8dfd05aad136da9ef0d93c7c3736ed4718f3c5
7
+ data.tar.gz: 86f1a3d14503f2f528670d8f217d2a727066bc5d64a0d8a523e424a90d421970ecc039ca96be03820568bfb36f8d422e4dbc67b14eafdea55c9ecd24741c9321
data/README.md CHANGED
@@ -89,6 +89,7 @@ Add buttons to the config block to perform rake tasks from the plug dashboard
89
89
  → rails g model MyModel name:string slug:string:index
90
90
  → rails db:migrate
91
91
  → rails db:migrate RAILS_ENV=test
92
+ → rake plug:install:migrations # Run this on the app to copy the new migrations
92
93
  ```
93
94
 
94
95
  ### Running the tests
@@ -62,7 +62,7 @@ module Plug
62
62
  if Rails.version.to_i < 5
63
63
  ActiveSupport::HashWithIndifferentAccess.new(params[:site_notice])
64
64
  else
65
- params.require(:site_notice).permit(:name, :notice, :state)
65
+ params.require(:site_notice).permit(:name, :notice, :state, :theme)
66
66
  end
67
67
  end
68
68
  end
@@ -0,0 +1,16 @@
1
+ require 'active_support/concern'
2
+
3
+ module Plug
4
+ module Concerns
5
+ module Themeable
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+
10
+ def icon
11
+ theme.split(';').last.split(':').last
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,6 +1,8 @@
1
1
  module Plug
2
2
  module Resources
3
3
  class SiteNotice < ActiveResource::Base
4
+ include Plug::Concerns::Themeable
5
+
4
6
  self.site = Plug.api_path
5
7
 
6
8
  def enabled?
@@ -2,5 +2,6 @@ module Plug
2
2
  class SiteNotice < ApplicationRecord
3
3
  include AASM
4
4
  include Plug::Concerns::ModelHelpers
5
+ include Plug::Concerns::Themeable
5
6
  end
6
7
  end
@@ -15,6 +15,9 @@
15
15
  .field
16
16
  = f.label :state
17
17
  = f.select :state, ['enabled', 'disabled']
18
+ .field
19
+ = f.label :theme
20
+ = f.select :theme, Plug.themes.map { |theme| [theme[:name], "#{theme[:style].to_a.map { |s| s.join(':') }.join(';')}"] }
18
21
  .actions.clearfix
19
22
  .float-left
20
23
  = link_to 'Back', site_notices_path, class: 'button'
@@ -0,0 +1,5 @@
1
+ class AddThemeToPlugSiteNotice < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :plug_site_notices, :theme, :string
4
+ end
5
+ end
@@ -9,7 +9,8 @@ module Plug
9
9
  :auth_password,
10
10
  :allow_delete,
11
11
  :buttons,
12
- :api_path
12
+ :api_path,
13
+ :themes
13
14
  ].freeze
14
15
 
15
16
  attr_accessor *VALID_OPTIONS_KEYS
@@ -1,3 +1,3 @@
1
1
  module Plug
2
- VERSION = '0.1.15'
2
+ VERSION = '0.1.16'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-04-06 00:00:00.000000000 Z
12
+ date: 2018-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -233,6 +233,7 @@ files:
233
233
  - app/mailers/plug/application_mailer.rb
234
234
  - app/models/plug/application_record.rb
235
235
  - app/models/plug/concerns/model_helpers.rb
236
+ - app/models/plug/concerns/themeable.rb
236
237
  - app/models/plug/feature.rb
237
238
  - app/models/plug/resources/site_notice.rb
238
239
  - app/models/plug/site_notice.rb
@@ -252,6 +253,7 @@ files:
252
253
  - db/migrate/20171207020316_create_plug_features.rb
253
254
  - db/migrate/20180128202026_add_notice_to_plug_features.rb
254
255
  - db/migrate/20180403024712_create_plug_site_notices.rb
256
+ - db/migrate/20180424015828_add_theme_to_plug_site_notice.rb
255
257
  - lib/generators/plug/install_generator.rb
256
258
  - lib/generators/plug/templates/plug.rb
257
259
  - lib/plug.rb
@@ -280,7 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
282
  version: '0'
281
283
  requirements: []
282
284
  rubyforge_project:
283
- rubygems_version: 2.6.13
285
+ rubygems_version: 2.5.1
284
286
  signing_key:
285
287
  specification_version: 4
286
288
  summary: Rails engine that can plug/unplug features