mournful_settings 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -71,4 +71,20 @@ To see a list of the available options use:
71
71
 
72
72
  puts OpenSSL::Cipher.ciphers
73
73
 
74
- See: http://ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/Cipher.html
74
+ See: http://ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/Cipher.html
75
+
76
+ == Integration with ActiveAdmin
77
+
78
+ Mournful settings contains a ActiveAdmin register file, that allow settings to
79
+ be managed from within the parent app's active_admin space. Of course
80
+ ActiveAdmin needs to be installed and working in the parent rails application,
81
+ for this to work.
82
+
83
+ To use the Mournful settings' ActiveAdmin register files, add this to the
84
+ active_admin initializer in your application.
85
+
86
+ config.load_paths << MournfulSettings.active_admin_load_path
87
+
88
+ Alternatively, copy lib/active_admin/admin/setting.rb to you app/admin within
89
+ the host rails app, and modify it as you desire.
90
+
@@ -0,0 +1,24 @@
1
+ ActiveAdmin.register Setting do
2
+
3
+ actions :all, :except => [:destroy]
4
+
5
+ index do
6
+ selectable_column
7
+ column :name
8
+ column :description
9
+ column :value
10
+ column :encrypted
11
+ default_actions
12
+ end
13
+
14
+ form do |f|
15
+ f.inputs "Details" do
16
+ f.input :name
17
+ f.input :description
18
+ f.input :value, :input_html => {:value => setting.value}
19
+ f.input :encrypted
20
+ end
21
+ f.buttons
22
+ end
23
+
24
+ end
@@ -1,3 +1,15 @@
1
1
  module MournfulSettings
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
4
+
5
+ # History
6
+ # =======
7
+ #
8
+ # 0.0.2: Add active admin option
9
+ # ------------------------------
10
+ # Adds active admin integration options.
11
+ #
12
+ # 0.0.1: First release
13
+ # --------------------
14
+ # Adds Settings model to host app, with encrypted data storage.
15
+ #
@@ -3,5 +3,9 @@ require_relative 'mournful_settings/setting'
3
3
  require_relative "mournful_settings/railtie" if defined?(Rails) # needed for rake tasks to be loaded into host app
4
4
 
5
5
  module MournfulSettings
6
+
7
+ def self.active_admin_load_path
8
+ File.expand_path("active_admin/admin", File.dirname(__FILE__))
9
+ end
6
10
 
7
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mournful_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -56,6 +56,7 @@ files:
56
56
  - lib/mournful_settings/setting.rb
57
57
  - lib/mournful_settings/railtie.rb
58
58
  - lib/mournful_settings.rb
59
+ - lib/active_admin/admin/settings.rb
59
60
  - lib/tasks/mournful_settings.rake
60
61
  - MIT-LICENSE
61
62
  - Rakefile