ns_settings_ui 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rubocop.yml +14 -0
  4. data/.rubocop_u2i.yml +54 -0
  5. data/Appraisals +5 -0
  6. data/Gemfile +16 -0
  7. data/Guardfile +79 -0
  8. data/MIT-LICENSE +20 -0
  9. data/README.md +65 -0
  10. data/Rakefile +28 -0
  11. data/app/assets/images/ns_settings_ui/.keep +0 -0
  12. data/app/assets/javascripts/ns_settings_ui/application.js +13 -0
  13. data/app/assets/javascripts/ns_settings_ui/jquery.liveFilter.js +50 -0
  14. data/app/assets/stylesheets/ns_settings_ui/application.css +15 -0
  15. data/app/assets/stylesheets/ns_settings_ui/settings.css.scss +21 -0
  16. data/app/controllers/ns_settings_ui/application_controller.rb +4 -0
  17. data/app/controllers/ns_settings_ui/settings_controller.rb +29 -0
  18. data/app/helpers/ns_settings_ui/application_helper.rb +17 -0
  19. data/app/helpers/ns_settings_ui/settings_helper.rb +15 -0
  20. data/app/models/ns_settings_ui/setting.rb +26 -0
  21. data/app/views/ns_settings_ui/settings/_edit.html.erb +12 -0
  22. data/app/views/ns_settings_ui/settings/_setting_row.html.erb +6 -0
  23. data/app/views/ns_settings_ui/settings/_update.js.erb +3 -0
  24. data/app/views/ns_settings_ui/settings/index.html.erb +21 -0
  25. data/bin/rails +13 -0
  26. data/bin/rspec +15 -0
  27. data/config/routes.rb +7 -0
  28. data/db/migrate/20151210214903_create_ns_settings_ui_settings.rb +15 -0
  29. data/db/migrate/20151215081718_add_value_type_to_ns_settings_ui_settings.rb +5 -0
  30. data/gemfiles/rails_3.2.gemfile +7 -0
  31. data/gemfiles/rails_4.2.gemfile +7 -0
  32. data/lib/ns_settings_ui/engine.rb +9 -0
  33. data/lib/ns_settings_ui/version.rb +3 -0
  34. data/lib/ns_settings_ui.rb +6 -0
  35. data/lib/tasks/ns_settings_ui_tasks.rake +4 -0
  36. data/ns_settings_ui.gemspec +37 -0
  37. data/spec/controllers/ns_settings_ui/settings_controller_spec.rb +61 -0
  38. data/spec/dummy/README.rdoc +261 -0
  39. data/spec/dummy/Rakefile +7 -0
  40. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  41. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  42. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  43. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  44. data/spec/dummy/app/mailers/.gitkeep +0 -0
  45. data/spec/dummy/app/models/.gitkeep +0 -0
  46. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  47. data/spec/dummy/config/application.rb +55 -0
  48. data/spec/dummy/config/application.rb~ +64 -0
  49. data/spec/dummy/config/boot.rb +10 -0
  50. data/spec/dummy/config/database.yml +25 -0
  51. data/spec/dummy/config/environment.rb +5 -0
  52. data/spec/dummy/config/environments/development.rb +30 -0
  53. data/spec/dummy/config/environments/production.rb +67 -0
  54. data/spec/dummy/config/environments/test.rb +34 -0
  55. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  56. data/spec/dummy/config/initializers/inflections.rb +15 -0
  57. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  58. data/spec/dummy/config/initializers/ns_settings_ui.rb +4 -0
  59. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  60. data/spec/dummy/config/initializers/session_store.rb +8 -0
  61. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  62. data/spec/dummy/config/locales/en.yml +5 -0
  63. data/spec/dummy/config/routes.rb +3 -0
  64. data/spec/dummy/config.ru +4 -0
  65. data/spec/dummy/db/development.sqlite3 +0 -0
  66. data/spec/dummy/db/schema.rb +25 -0
  67. data/spec/dummy/db/test.sqlite3 +0 -0
  68. data/spec/dummy/lib/assets/.gitkeep +0 -0
  69. data/spec/dummy/log/.gitkeep +0 -0
  70. data/spec/dummy/log/development.log +17213 -0
  71. data/spec/dummy/log/test.log +0 -0
  72. data/spec/dummy/public/404.html +26 -0
  73. data/spec/dummy/public/422.html +26 -0
  74. data/spec/dummy/public/500.html +25 -0
  75. data/spec/dummy/public/favicon.ico +0 -0
  76. data/spec/dummy/script/rails +6 -0
  77. data/spec/helpers/ns_settings_ui/settings_helper_spec.rb +27 -0
  78. data/spec/models/ns_settings_ui/setting_spec.rb +114 -0
  79. data/spec/spec_helper.rb +40 -0
  80. data/spec/spec_helper.rb~ +37 -0
  81. data/spec/support/blueprints.rb +3 -0
  82. data/test/dummy/README.rdoc +28 -0
  83. data/test/dummy/Rakefile +6 -0
  84. data/test/dummy/app/assets/images/.keep +0 -0
  85. data/test/dummy/app/assets/javascripts/application.js +13 -0
  86. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  87. data/test/dummy/app/controllers/application_controller.rb +5 -0
  88. data/test/dummy/app/controllers/concerns/.keep +0 -0
  89. data/test/dummy/app/helpers/application_helper.rb +2 -0
  90. data/test/dummy/app/mailers/.keep +0 -0
  91. data/test/dummy/app/models/.keep +0 -0
  92. data/test/dummy/app/models/concerns/.keep +0 -0
  93. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  94. data/test/dummy/bin/bundle +3 -0
  95. data/test/dummy/bin/rails +4 -0
  96. data/test/dummy/bin/rake +4 -0
  97. data/test/dummy/config/application.rb +22 -0
  98. data/test/dummy/config/boot.rb +5 -0
  99. data/test/dummy/config/database.yml +25 -0
  100. data/test/dummy/config/environment.rb +5 -0
  101. data/test/dummy/config/environments/development.rb +37 -0
  102. data/test/dummy/config/environments/production.rb +78 -0
  103. data/test/dummy/config/environments/test.rb +39 -0
  104. data/test/dummy/config/initializers/assets.rb +8 -0
  105. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  106. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  107. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  108. data/test/dummy/config/initializers/inflections.rb +16 -0
  109. data/test/dummy/config/initializers/mime_types.rb +4 -0
  110. data/test/dummy/config/initializers/session_store.rb +3 -0
  111. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  112. data/test/dummy/config/locales/en.yml +23 -0
  113. data/test/dummy/config/routes.rb +3 -0
  114. data/test/dummy/config/secrets.yml +22 -0
  115. data/test/dummy/config.ru +4 -0
  116. data/test/dummy/lib/assets/.keep +0 -0
  117. data/test/dummy/log/.keep +0 -0
  118. data/test/dummy/public/404.html +67 -0
  119. data/test/dummy/public/422.html +67 -0
  120. data/test/dummy/public/500.html +66 -0
  121. data/test/dummy/public/favicon.ico +0 -0
  122. data/test/integration/navigation_test.rb +9 -0
  123. data/test/ns_settings_ui_test.rb +7 -0
  124. data/test/test_helper.rb +15 -0
  125. metadata +424 -0
@@ -0,0 +1,67 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to nil and saved in location specified by config.assets.prefix
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end
@@ -0,0 +1,34 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot.
11
+ config.eager_load = false
12
+
13
+ # Configure static asset server for tests with Cache-Control for performance
14
+ config.serve_static_assets = true
15
+ config.static_cache_control = 'public, max-age=3600'
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Print deprecation notices to the stderr
33
+ config.active_support.deprecation = :stderr
34
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,4 @@
1
+ if defined?(NsSettingsUi)
2
+ NsSettingsUi.layout = nil
3
+ NsSettingsUi.parent_controller = ActionController::Base
4
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = '8be7c38639bf940757c926a9d3f156a7cbf7a966ea45115bc571580c25b58b20e00f650384b23fa59373972b5700fee78cbe07800449596f26804c7015a75044'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ mount NsSettingsUi::Engine => '/ns_settings_ui'
3
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
Binary file
@@ -0,0 +1,25 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20151215081718) do
15
+ create_table 'ns_settings_ui_settings', force: true do |t|
16
+ t.string 'key', null: false
17
+ t.string 'value'
18
+ t.string 'default_value'
19
+ t.datetime 'created_at', null: false
20
+ t.datetime 'updated_at', null: false
21
+ t.integer 'value_type', default: 0
22
+ end
23
+
24
+ add_index 'ns_settings_ui_settings', ['key'], name: 'index_ns_settings_ui_settings_on_key'
25
+ end
Binary file
File without changes
File without changes