flexite 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +12 -0
- data/Rakefile +40 -0
- data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.svg +288 -0
- data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/app/assets/images/flexite/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/flexite/glyphicons-halflings.png +0 -0
- data/app/assets/javascripts/flexite/application.js +18 -0
- data/app/assets/javascripts/flexite/bootstrap.min.js +7 -0
- data/app/assets/javascripts/flexite/common.js.erb +2 -0
- data/app/assets/javascripts/flexite/jquery.min.js +2 -0
- data/app/assets/javascripts/flexite/tree.js.erb +83 -0
- data/app/assets/javascripts/flexite/treeview.js +1335 -0
- data/app/assets/stylesheets/flexite/application.css +29 -0
- data/app/assets/stylesheets/flexite/bootstrap-treeview.min.css +1 -0
- data/app/assets/stylesheets/flexite/bootstrap.min.css +5 -0
- data/app/assets/stylesheets/flexite/configs.css +8 -0
- data/app/assets/stylesheets/flexite/entries.css +4 -0
- data/app/assets/stylesheets/flexite/tree.css +21 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/controllers/flexite/application_controller.rb +25 -0
- data/app/controllers/flexite/configs_controller.rb +61 -0
- data/app/controllers/flexite/entries_controller.rb +82 -0
- data/app/factories/flexite/base_factory.rb +7 -0
- data/app/factories/flexite/service_factory.rb +19 -0
- data/app/forms/flexite/base_form.rb +24 -0
- data/app/forms/flexite/config/form.rb +12 -0
- data/app/forms/flexite/entry/array_form.rb +11 -0
- data/app/forms/flexite/entry/form.rb +16 -0
- data/app/helpers/flexite/application_helper.rb +15 -0
- data/app/helpers/flexite/configs_helper.rb +4 -0
- data/app/helpers/flexite/entries_helper.rb +46 -0
- data/app/models/flexite/arr_entry.rb +35 -0
- data/app/models/flexite/bool_entry.rb +19 -0
- data/app/models/flexite/config.rb +64 -0
- data/app/models/flexite/entry.rb +30 -0
- data/app/models/flexite/int_entry.rb +13 -0
- data/app/models/flexite/str_entry.rb +2 -0
- data/app/models/flexite/sym_entry.rb +17 -0
- data/app/services/flexite/action_service/result.rb +44 -0
- data/app/services/flexite/action_service.rb +30 -0
- data/app/services/flexite/config/create_service.rb +25 -0
- data/app/services/flexite/config/update_service.rb +28 -0
- data/app/services/flexite/data/hash.rb +17 -0
- data/app/services/flexite/data/migrators/yaml.rb +62 -0
- data/app/services/flexite/data/new.rb +87 -0
- data/app/services/flexite/entry/array_create_service.rb +69 -0
- data/app/services/flexite/entry/array_update_service.rb +69 -0
- data/app/services/flexite/entry/create_service.rb +31 -0
- data/app/services/flexite/entry/destroy_array_entry_service.rb +25 -0
- data/app/services/flexite/entry/destroy_service.rb +22 -0
- data/app/services/flexite/entry/update_service.rb +26 -0
- data/app/simple_form/array_input.rb +13 -0
- data/app/views/flexite/application/index.html.haml +14 -0
- data/app/views/flexite/configs/_form.html.haml +7 -0
- data/app/views/flexite/configs/create.js.haml +3 -0
- data/app/views/flexite/configs/edit.js.haml +1 -0
- data/app/views/flexite/configs/index.json.erb +10 -0
- data/app/views/flexite/configs/new.js.haml +1 -0
- data/app/views/flexite/configs/update.js.haml +2 -0
- data/app/views/flexite/entries/_form.html.haml +11 -0
- data/app/views/flexite/entries/_new_array_entry_form.html.haml +7 -0
- data/app/views/flexite/entries/_popup.html.haml +18 -0
- data/app/views/flexite/entries/_types_dropdown.html.haml +8 -0
- data/app/views/flexite/entries/create.js.haml +4 -0
- data/app/views/flexite/entries/destroy.js.haml +4 -0
- data/app/views/flexite/entries/destroy_array_entry.js.haml +6 -0
- data/app/views/flexite/entries/edit.js.haml +1 -0
- data/app/views/flexite/entries/new.js.haml +1 -0
- data/app/views/flexite/entries/new_array_entry.js.haml +1 -0
- data/app/views/flexite/entries/select_type.js.haml +1 -0
- data/app/views/flexite/entries/types/_arr_entry.html.haml +19 -0
- data/app/views/flexite/entries/types/_bool_entry.html.haml +4 -0
- data/app/views/flexite/entries/types/_int_entry.html.haml +4 -0
- data/app/views/flexite/entries/types/_str_entry.html.haml +4 -0
- data/app/views/flexite/entries/types/_sym_entry.html.haml +1 -0
- data/app/views/flexite/entries/update.js.haml +1 -0
- data/app/views/flexite/shared/_messages.html.haml +5 -0
- data/app/views/flexite/shared/_show_flash.js.haml +5 -0
- data/app/views/layouts/flexite/application.html.haml +11 -0
- data/config/initializers/simple_form.rb +143 -0
- data/config/initializers/simple_form_bootstrap.rb +43 -0
- data/config/locales/simple_form.en.yml +26 -0
- data/config/routes.rb +17 -0
- data/db/migrate/20180503102555_create_flexite_configs.rb +14 -0
- data/db/migrate/20180503103109_create_flexite_entries.rb +14 -0
- data/lib/flexite/cached_node.rb +19 -0
- data/lib/flexite/configuration.rb +24 -0
- data/lib/flexite/engine.rb +18 -0
- data/lib/flexite/flexy.rb +13 -0
- data/lib/flexite/nodes_hash.rb +5 -0
- data/lib/flexite/version.rb +3 -0
- data/lib/flexite.rb +44 -0
- data/lib/tasks/flexite_tasks.rake +20 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/application.yml +599 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +40 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/flexite.rb +5 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +39 -0
- data/test/dummy/db/seeds.rb +3 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +86588 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/tmp/cache/assets/C67/060/sprockets%2Ffaf176441f0544dd2b51901280044b40 +0 -0
- data/test/dummy/tmp/cache/assets/C9D/530/sprockets%2Fdcd49c063327c12052812f41c20a8e74 +0 -0
- data/test/dummy/tmp/cache/assets/CA3/270/sprockets%2F502b740063f8ec15e7e12811da71c772 +0 -0
- data/test/dummy/tmp/cache/assets/CDC/060/sprockets%2F8ff1d307d1b36810549d0829722b7aea +0 -0
- data/test/dummy/tmp/cache/assets/CDE/120/sprockets%2F5fd8b3fa3724451579552aed373410ce +0 -0
- data/test/dummy/tmp/cache/assets/CF8/980/sprockets%2F4e5077b95460dc34d7c9d7d9880e7b47 +0 -0
- data/test/dummy/tmp/cache/assets/D00/4C0/sprockets%2F603c6d7b825c2f4a6422b3d4af4e6203 +0 -0
- data/test/dummy/tmp/cache/assets/D00/C40/sprockets%2F999847c008fb4ce26fff5607c39d8358 +0 -0
- data/test/dummy/tmp/cache/assets/D09/A30/sprockets%2F2a71e20a2f3544acb51956504cd8d8e9 +0 -0
- data/test/dummy/tmp/cache/assets/D0D/E60/sprockets%2F90ea9eaa4671ec2d76703bae31972634 +0 -0
- data/test/dummy/tmp/cache/assets/D2A/160/sprockets%2Fbe17d4d0be4b381500e2824bbe273d70 +0 -0
- data/test/dummy/tmp/cache/assets/D2E/700/sprockets%2Fb21f85e0940bbcb3a8914c9cb0b07218 +0 -0
- data/test/dummy/tmp/cache/assets/D39/CD0/sprockets%2F0e8f6981475e49ea9fe14698fa57e4e9 +0 -0
- data/test/dummy/tmp/cache/assets/D40/590/sprockets%2F181dd5673b58f1ec4c89e50028bfad60 +0 -0
- data/test/dummy/tmp/cache/assets/D46/870/sprockets%2Fd880bdf72c5d0009b88fda8521439dc8 +0 -0
- data/test/dummy/tmp/cache/assets/D48/5F0/sprockets%2Fe6a83afb2d92f4692ffb391b5285a518 +0 -0
- data/test/dummy/tmp/cache/assets/D4B/A20/sprockets%2Febde89014596e655c35df9c4a01ee636 +0 -0
- data/test/dummy/tmp/cache/assets/D54/A50/sprockets%2Ff49839d906f69fd92904ebac07a3a38e +0 -0
- data/test/dummy/tmp/cache/assets/D69/B50/sprockets%2F4186e2787004e19ceb0c4afed46cf04b +0 -0
- data/test/dummy/tmp/cache/assets/D6D/C20/sprockets%2F112e96fea93f5f1e31d2077f1cdaf283 +0 -0
- data/test/dummy/tmp/cache/assets/D7A/8F0/sprockets%2F8eefc5f9824d950317a5c4a2e68b3c4e +0 -0
- data/test/dummy/tmp/cache/assets/DB3/360/sprockets%2F24b1f98ad736884b91d6ebeb2fc68ed8 +0 -0
- data/test/dummy/tmp/cache/assets/DD2/E90/sprockets%2Ff01f48c96ba588d15b20dd57ed3ccb7f +0 -0
- data/test/dummy/tmp/cache/assets/DEE/0C0/sprockets%2Feedcd74856542eedb5ea3ab1b1502ca4 +0 -0
- data/test/dummy/tmp/cache/assets/DF1/210/sprockets%2Ff4fe7dba1445ba1b668aaa1bd34ca984 +0 -0
- data/test/dummy/tmp/cache/assets/E44/790/sprockets%2Fefb8d8ea9e97da9d675a8bfa1d5de343 +0 -0
- data/test/fixtures/flexite/configs.yml +7 -0
- data/test/fixtures/flexite/entries.yml +13 -0
- data/test/flexite_test.rb +7 -0
- data/test/functional/flexite/configs_controller_test.rb +51 -0
- data/test/functional/flexite/entries_controller_test.rb +51 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/flexite/config_test.rb +9 -0
- data/test/unit/flexite/entry_test.rb +9 -0
- data/test/unit/helpers/flexite/configs_helper_test.rb +6 -0
- data/test/unit/helpers/flexite/entries_helper_test.rb +6 -0
- metadata +366 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Flexite
|
4
|
+
class ConfigsControllerTest < ActionController::TestCase
|
5
|
+
setup do
|
6
|
+
@config = configs(:one)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should get index" do
|
10
|
+
get :index
|
11
|
+
assert_response :success
|
12
|
+
assert_not_nil assigns(:configs)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get new" do
|
16
|
+
get :new
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should create config" do
|
21
|
+
assert_difference('Config.count') do
|
22
|
+
post :create, config: { name: @config.name }
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_redirected_to config_path(assigns(:config))
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should show config" do
|
29
|
+
get :show, id: @config
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should get edit" do
|
34
|
+
get :edit, id: @config
|
35
|
+
assert_response :success
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should update config" do
|
39
|
+
put :update, id: @config, config: { name: @config.name }
|
40
|
+
assert_redirected_to config_path(assigns(:config))
|
41
|
+
end
|
42
|
+
|
43
|
+
test "should destroy config" do
|
44
|
+
assert_difference('Config.count', -1) do
|
45
|
+
delete :destroy, id: @config
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_redirected_to configs_path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Flexite
|
4
|
+
class EntriesControllerTest < ActionController::TestCase
|
5
|
+
setup do
|
6
|
+
@entry = entries(:one)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should get index" do
|
10
|
+
get :index
|
11
|
+
assert_response :success
|
12
|
+
assert_not_nil assigns(:entries)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get new" do
|
16
|
+
get :new
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should create entry" do
|
21
|
+
assert_difference('Entry.count') do
|
22
|
+
post :create, entry: { type: @entry.type, value: @entry.value }
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_redirected_to entry_path(assigns(:entry))
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should show entry" do
|
29
|
+
get :show, id: @entry
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should get edit" do
|
34
|
+
get :edit, id: @entry
|
35
|
+
assert_response :success
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should update entry" do
|
39
|
+
put :update, id: @entry, entry: { type: @entry.type, value: @entry.value }
|
40
|
+
assert_redirected_to entry_path(assigns(:entry))
|
41
|
+
end
|
42
|
+
|
43
|
+
test "should destroy entry" do
|
44
|
+
assert_difference('Entry.count', -1) do
|
45
|
+
delete :destroy, id: @entry
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_redirected_to entries_path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
8
|
+
|
9
|
+
# Load support files
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
|
+
|
12
|
+
# Load fixtures from the engine
|
13
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
14
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
15
|
+
end
|