smort 0.0.1 → 0.0.2

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: d5c031f80c300eccb14f8e5ec1761f11ca52eb63
4
- data.tar.gz: fdbeb3e340bf6a3e015f37e0c3bb3ac207fd393d
3
+ metadata.gz: 971d1587ee782e6d509cbbef7fb116442dee9bcf
4
+ data.tar.gz: 3505f6c960412ab27d9ae392290b4d78d29f3ea2
5
5
  SHA512:
6
- metadata.gz: 1e05da8bdbf46b33c2ed7ce7e036dccb1a8a9194367d14031cd5822ea8e494516203c797c29cdbf41bb688a40998ef950c8aa38359ff8a5da0242177b9bef2df
7
- data.tar.gz: c04dbc65d90289350ad84f315d0016560fc9a5f25cb00ed4b22204b18aaf1804506cb329aba3f7dfbc38ee2f94b4567a5e1de4434e512002639dde2d72640f38
6
+ metadata.gz: 65286132c5357e6e08151008fc5d467565ba8c1d3738c9bdbbbfadc684529090267e54547e9ae94b8a015d7a97dca34e22abcd128b2a05eea355904da6b8b860
7
+ data.tar.gz: 091260420e72765ccd0741bdf5e12e81da446b3ff899ac286b29be66da60e0ebe12cbd24580c1b5b2145dd5915226315a5e720b98bbf76d56fe4a70b806788b5
@@ -0,0 +1,60 @@
1
+ # Smort ![Version](https://img.shields.io/gem/v/smort.svg?style=flat-square)
2
+
3
+ An erudite JSON schema and document manager
4
+
5
+ ![Smort](https://cloud.githubusercontent.com/assets/13771/7487388/5507ee4c-f36b-11e4-92b6-e5e74b921429.png)
6
+
7
+
8
+ ## Usage, Configuration &c.
9
+
10
+ ### Installation
11
+
12
+ If you like gems you can build one from this repository, or use RubyGems:
13
+
14
+ $ gem install smort
15
+
16
+ Native packages for Linux and OS X are provided on the [Releases page](https://github.com/sczizzo/smort/releases) in GitHub.
17
+
18
+ You can also try the [official Docker image](https://registry.hub.docker.com/u/sczizzo/smort)
19
+ based on the Linux package.
20
+
21
+ ### Usage
22
+
23
+ Just call for help!
24
+
25
+ $ smort help
26
+ Commands:
27
+ smort art # View the application art
28
+ smort help [COMMAND] # Describe available commands or one specific command
29
+ smort version # Echo the application version
30
+ smort web # Serve the Web interface
31
+
32
+ You're prolly interested in the `web` command:
33
+
34
+ $ smort help web
35
+ Usage:
36
+ smort web
37
+
38
+ Options:
39
+ -b, [--bind=BIND] # Set Sinatra interface
40
+ # Default: 0.0.0.0
41
+ -p, [--port=N] # Set Sinatra port
42
+ # Default: 4567
43
+ -e, [--environment=ENVIRONMENT] # Set Sinatra environment
44
+ # Default: development
45
+ -L, [--log=LOG] # Log to file instead of STDOUT
46
+ -V, [--debug], [--no-debug] # Enable DEBUG-level logging
47
+ -VV, [--trace], [--no-trace] # Enable TRACE-level logging
48
+
49
+ Serve the Web interface
50
+
51
+ ### Configuration
52
+
53
+ There is no configuration right now, but stay tuned!
54
+
55
+
56
+ ## Changelog
57
+
58
+ #### pre-release
59
+
60
+ - Skeleton, packaging support in place
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -1,5 +1,40 @@
1
1
  ;(function(){
2
2
  jQuery(document).ready(function($){
3
- console.log('Smort');
3
+ JSONEditor.defaults.options.theme = 'bootstrap3';
4
+ JSONEditor.defaults.options.iconlib = 'fontawesome4';
5
+
6
+ var editor = new JSONEditor(document.getElementById('editor'), {
7
+ ajax: true,
8
+ schema: {
9
+ $ref: "http://rawgit.com/jdorn/json-editor/master/examples/basic_person.json",
10
+ format: "grid"
11
+ },
12
+ disable_collapse: true,
13
+ disable_properties: true,
14
+ disable_edit_json: true,
15
+ no_additional_properties: true
16
+ });
17
+
18
+ editor.on('change',function() {
19
+ var errors = editor.validate();
20
+ var indicator = document.getElementById('submit');
21
+
22
+ if (errors.length) { // Not valid
23
+ indicator.className = 'btn btn-danger';
24
+ } else { // Valid
25
+ indicator.className = 'btn btn-success';
26
+ }
27
+ });
28
+
29
+ $('#submit').click(function() {
30
+ var errors = editor.validate();
31
+ if (errors.length) {
32
+ return false;
33
+ } else {
34
+ console.log(editor.getValue());
35
+ alert(editor.getValue());
36
+ }
37
+ });
38
+
4
39
  });
5
40
  })();
@@ -1,3 +1,7 @@
1
1
  body {
2
2
  margin: 2em;
3
+ }
4
+
5
+ #title {
6
+
3
7
  }
@@ -1,2 +1,9 @@
1
- <h1>Smort</h1>
2
- <p>An erudite JSON schema and document manager</p>
1
+ <div class='row'>
2
+ <div id='editor' class='medium-12 columns'></div>
3
+ </div>
4
+
5
+ <div class='row'>
6
+ <div class='medium-12-columns pull-right'>
7
+ <button id='submit' class='btn btn-danger'>Submit</button>
8
+ </div>
9
+ </div>
@@ -13,9 +13,34 @@
13
13
  <link href="/app/style/smort.css" rel="stylesheet" />
14
14
  </head>
15
15
  <body>
16
- <%= yield %>
16
+
17
+ <nav class="navbar navbar-inverse navbar-fixed-top">
18
+ <div class="container">
19
+ <div class="navbar-header">
20
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
21
+ <span class="sr-only">Toggle navigation</span>
22
+ </button>
23
+ <span class="navbar-brand">Smort</span>
24
+ </div>
25
+ <div id="navbar" class="navbar-collapse collapse">
26
+ <ul class="nav navbar-nav">
27
+ <li class="active"><a href="#schemas">Schemas</a></li>
28
+ <li><a href="#docs">Documents</a></li>
29
+ </ul>
30
+ <ul class="nav navbar-nav navbar-right">
31
+ <li><a href="#">&amp;c.</a></li>
32
+ </ul>
33
+ </div><!--/.nav-collapse -->
34
+ </div>
35
+ </nav>
36
+
37
+ <div class="container">
38
+ <%= yield %>
39
+ </div>
40
+
17
41
  <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
18
42
  <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
43
+ <script src="//rawgit.com/jdorn/json-editor/master/dist/jsoneditor.min.js"></script>
19
44
  <script src="/app/smort.js"></script>
20
45
  </body>
21
46
  </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smort
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer
@@ -88,7 +88,7 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - LICENSE
91
- - Readme.md
91
+ - README.md
92
92
  - VERSION
93
93
  - bin/smort
94
94
  - lib/smort.rb
data/Readme.md DELETED
@@ -1,3 +0,0 @@
1
- # Smort ![Version](https://img.shields.io/gem/v/smort.svg?style=flat-square)
2
-
3
- An erudite JSON schema and document manager