appril 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/appril.gemspec +3 -3
- data/boilerplate/app/Rakefile +1 -0
- data/boilerplate/app/base/core.coffee +143 -0
- data/boilerplate/app/base/helpers/application_helpers.rb +1 -0
- data/boilerplate/app/base/templates/access_denied.html +3 -0
- data/boilerplate/app/base/templates/layout.html +11 -0
- data/boilerplate/app/base/templates/layouts/main.html +1 -0
- data/boilerplate/app/base/templates/layouts/none.html +1 -0
- data/boilerplate/app/package.json +6 -0
- data/boilerplate/app/tmp/.ignore +0 -0
- data/boilerplate/app/var/.ignore +0 -0
- data/{app → boilerplate/app}/webpack.config.js +2 -0
- data/boilerplate/crudle/Gemfile +6 -0
- data/boilerplate/crudle/base/core.coffee +128 -0
- data/boilerplate/crudle/generators/api/client.coffee +11 -0
- data/boilerplate/crudle/generators/api/editor.html +0 -0
- data/boilerplate/crudle/generators/api/server.rb +26 -0
- data/boilerplate/crudle/package.json +7 -0
- data/docker/run +4 -6
- data/lib/appril/cli/app/install.rb +7 -4
- data/lib/appril/cli/app/update.rb +1 -1
- data/lib/appril/cli/app.rb +2 -1
- data/lib/appril/cli.rb +19 -12
- data/lib/appril/version.rb +1 -1
- metadata +45 -32
- data/app/Rakefile +0 -1
- data/app/base/core.coffee +0 -91
- data/app/package.json +0 -5
- /data/{app → boilerplate/app}/.gitignore +0 -0
- /data/{app → boilerplate/app}/.pryrc +0 -0
- /data/{app → boilerplate/app}/Gemfile +0 -0
- /data/{app → boilerplate/app}/base/api/.ignore +0 -0
- /data/{app → boilerplate/app}/base/base_controller.rb +0 -0
- /data/{app → boilerplate/app}/base/boot.rb +0 -0
- /data/{app/base/helpers/application_helpers.rb → boilerplate/app/base/helpers/application_helpers.coffee} +0 -0
- /data/{app → boilerplate/app}/base/load.rb +0 -0
- /data/{app → boilerplate/app}/base/load_controllers.rb +0 -0
- /data/{app → boilerplate/app}/base/rtcp_controller.rb +0 -0
- /data/{app → boilerplate/app}/config/config.rb +0 -0
- /data/{app → boilerplate/app}/config/config.yml +0 -0
- /data/{app → boilerplate/app}/config/env/development.yml +0 -0
- /data/{app → boilerplate/app}/config/env/production.yml +0 -0
- /data/{app → boilerplate/app}/config/env/stage.yml +0 -0
- /data/{app → boilerplate/app}/config/env/test.yml +0 -0
- /data/{app → boilerplate/app}/config.ru +0 -0
- /data/{app → boilerplate/app}/core/Gemfile +0 -0
- /data/{app → boilerplate/app}/core/boot.rb +0 -0
- /data/{app → boilerplate/app}/core/generate_configs.rb +0 -0
- /data/{app → boilerplate/app}/core/load.rb +0 -0
- /data/{app → boilerplate/app}/core/load_controllers.rb +0 -0
- /data/{app → boilerplate/app}/generators/api/.ignore +0 -0
- /data/{app → boilerplate/app}/public/.ignore +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7125903a6b44eb9b35374a65019e001a434f0da7
|
4
|
+
data.tar.gz: 85ca91bed437b1672b372c4bd38f666b3a50ecfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0cf0b7bdf78b228535aee9f43745dbcdfc638b91fc1ed4e5ba7b8153099ecf888c37e2a719e61429d234795580f6d3ec929957aadc9eee5d64b1fc202a39f8b
|
7
|
+
data.tar.gz: 6c0b9f9b486a46e81aee2ef514d0226053f716a546cc60c49487d94205231ef7b5441aa50b112019df14eba2bfcb0ed29d84b705d0e4be223914af208a92481a
|
data/appril.gemspec
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
require File.expand_path('../lib/appril/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
|
-
spec.name
|
6
|
-
spec.version
|
5
|
+
spec.name = 'appril'
|
6
|
+
spec.version = Appril::VERSION
|
7
7
|
spec.authors = ['Slee Woo']
|
8
8
|
spec.email = ['mail@sleewoo.com']
|
9
9
|
spec.summary = [spec.name, spec.version]*'-',
|
10
10
|
spec.description = 'Opinionated framework for building opinionated web applications'
|
11
|
-
spec.homepage = 'https://github.com/
|
11
|
+
spec.homepage = 'https://github.com/appril/' + spec.name
|
12
12
|
spec.license = 'MIT'
|
13
13
|
|
14
14
|
spec.files = Dir['**/{*,.[a-z]*}'].reject {|e| e =~ /(gem|lock)\z/}
|
@@ -0,0 +1 @@
|
|
1
|
+
require File.expand_path('../core/load', __FILE__)
|
@@ -0,0 +1,143 @@
|
|
1
|
+
_ =
|
2
|
+
merge: require('lodash/merge')
|
3
|
+
has: require('lodash/has')
|
4
|
+
isFunction: require('lodash/isFunction')
|
5
|
+
#end
|
6
|
+
|
7
|
+
Core = require('appril')
|
8
|
+
Page = require('appril-page')
|
9
|
+
Render = require('appril-ractive')
|
10
|
+
Reporter = require('appril-reporter')
|
11
|
+
|
12
|
+
require 'appril-polyfills'
|
13
|
+
|
14
|
+
CONSIDER_IDLE_AFTER = 5 * 60
|
15
|
+
|
16
|
+
window.Cfg = {}
|
17
|
+
window.Util = {}
|
18
|
+
window.App = {}
|
19
|
+
# window.Alert = require('appril-alert')
|
20
|
+
|
21
|
+
for k, v of require('appril-util')
|
22
|
+
Util[k] = v
|
23
|
+
#end
|
24
|
+
|
25
|
+
# for k, v of require('appril-datetime')
|
26
|
+
# Util[k] = v
|
27
|
+
# #end
|
28
|
+
|
29
|
+
for k, v of require('helpers/application_helpers.coffee')
|
30
|
+
Util[k] = v
|
31
|
+
#end
|
32
|
+
|
33
|
+
Object.freeze(Util)
|
34
|
+
|
35
|
+
Render.default_el = -> '#content'
|
36
|
+
Render.global_data = -> {App: App, Cfg: Cfg, Util: Util}
|
37
|
+
Render.global_handlers = -> {}
|
38
|
+
|
39
|
+
for name, controller of Core.controllers
|
40
|
+
App[name] = controller
|
41
|
+
#end
|
42
|
+
|
43
|
+
Core.on_initialize = (msg) ->
|
44
|
+
if window.Cfg = msg.data.cfg
|
45
|
+
delete msg.data.cfg
|
46
|
+
Object.freeze(Cfg)
|
47
|
+
#end
|
48
|
+
|
49
|
+
for k, v of msg.data
|
50
|
+
App[k] = v
|
51
|
+
#end
|
52
|
+
|
53
|
+
Reporter CONSIDER_IDLE_AFTER, (status) ->
|
54
|
+
# close connection if user went away
|
55
|
+
Core.disconnect() if status == 'away'
|
56
|
+
#end
|
57
|
+
#end
|
58
|
+
|
59
|
+
templates =
|
60
|
+
none: require('templates/layouts/none')
|
61
|
+
main: require('templates/layouts/main')
|
62
|
+
access_denied: require('templates/access_denied')
|
63
|
+
#end
|
64
|
+
|
65
|
+
partials = {}
|
66
|
+
|
67
|
+
deploy_api = (api) ->
|
68
|
+
|
69
|
+
env = _.merge({
|
70
|
+
render: Render,
|
71
|
+
render_component: Render.component,
|
72
|
+
render_string: Render.string
|
73
|
+
}, new Page)
|
74
|
+
|
75
|
+
layout = if _.has(api, 'layout')
|
76
|
+
if api.layout == false
|
77
|
+
'none'
|
78
|
+
else
|
79
|
+
api.layout
|
80
|
+
else
|
81
|
+
'main'
|
82
|
+
#end
|
83
|
+
|
84
|
+
if App.body
|
85
|
+
# do not re-render body if current api uses same layout as previous one
|
86
|
+
return new api(env) if App.body.layout == layout
|
87
|
+
#end
|
88
|
+
|
89
|
+
components = {}
|
90
|
+
|
91
|
+
App.body = env.render
|
92
|
+
el: 'body'
|
93
|
+
template: templates[layout] || templates.none
|
94
|
+
partials: partials
|
95
|
+
components: components
|
96
|
+
data: {}
|
97
|
+
|
98
|
+
oncomplete: ->
|
99
|
+
this.layout = layout
|
100
|
+
new api(env)
|
101
|
+
#end
|
102
|
+
#end
|
103
|
+
#end
|
104
|
+
|
105
|
+
previous_api = null
|
106
|
+
Core.on_controller_matched = (controller, context) ->
|
107
|
+
|
108
|
+
controller.load (api) ->
|
109
|
+
context.save()
|
110
|
+
|
111
|
+
api.controller = controller
|
112
|
+
|
113
|
+
if previous_api?.teardown
|
114
|
+
previous_api.teardown()
|
115
|
+
#end
|
116
|
+
previous_api = api
|
117
|
+
|
118
|
+
if _.has(api, 'acl')
|
119
|
+
unless _.isFunction(api.acl)
|
120
|
+
throw new Error("#{controller.name}.acl should be a function")
|
121
|
+
|
122
|
+
if api.acl()
|
123
|
+
deploy_api(api)
|
124
|
+
else
|
125
|
+
Render
|
126
|
+
el: 'body'
|
127
|
+
template: templates.main
|
128
|
+
partials: partials
|
129
|
+
oncomplete: ->
|
130
|
+
Render(template: templates.access_denied)
|
131
|
+
#end
|
132
|
+
|
133
|
+
else
|
134
|
+
deploy_api(api)
|
135
|
+
#end
|
136
|
+
|
137
|
+
#end
|
138
|
+
#end
|
139
|
+
|
140
|
+
document.addEventListener 'DOMContentLoaded', ->
|
141
|
+
# make sure this matches the RTCPController URL
|
142
|
+
Core.connect('__rtcp__')
|
143
|
+
#end
|
@@ -0,0 +1 @@
|
|
1
|
+
# this file will be loaded before other files found in helpers/ folder
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
6
|
+
<script type="text/javascript">window.module = {}</script>
|
7
|
+
<script src="/app/core.js"></script>
|
8
|
+
<link rel="stylesheet" href="/app/core.css">
|
9
|
+
</head>
|
10
|
+
<body></body>
|
11
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<div id="content"></div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<div id="content"></div>
|
File without changes
|
File without changes
|
@@ -0,0 +1,128 @@
|
|
1
|
+
_ =
|
2
|
+
merge: require('lodash/merge')
|
3
|
+
has: require('lodash/has')
|
4
|
+
isFunction: require('lodash/isFunction')
|
5
|
+
#end
|
6
|
+
|
7
|
+
Core = require('appril')
|
8
|
+
Page = require('appril-page')
|
9
|
+
Render = require('appril-ractive')
|
10
|
+
Reporter = require('appril-reporter')
|
11
|
+
|
12
|
+
require 'appril-polyfills'
|
13
|
+
|
14
|
+
CONSIDER_IDLE_AFTER = 5 * 60
|
15
|
+
|
16
|
+
window.Cfg = {}
|
17
|
+
window.Util = {}
|
18
|
+
window.App = {}
|
19
|
+
# window.Alert = require('appril-alert')
|
20
|
+
|
21
|
+
for k, v of require('appril-util')
|
22
|
+
Util[k] = v
|
23
|
+
#end
|
24
|
+
|
25
|
+
# for k, v of require('appril-datetime')
|
26
|
+
# Util[k] = v
|
27
|
+
# #end
|
28
|
+
|
29
|
+
for k, v of require('helpers/application_helpers.coffee')
|
30
|
+
Util[k] = v
|
31
|
+
#end
|
32
|
+
|
33
|
+
Object.freeze(Util)
|
34
|
+
|
35
|
+
Render.default_el = -> '#content'
|
36
|
+
Render.global_data = -> {App: App, Cfg: Cfg, Util: Util}
|
37
|
+
Render.global_handlers = -> {}
|
38
|
+
|
39
|
+
for name, controller of Core.controllers
|
40
|
+
App[name] = controller
|
41
|
+
#end
|
42
|
+
|
43
|
+
Core.on_initialize = (msg) ->
|
44
|
+
if window.Cfg = msg.data.cfg
|
45
|
+
delete msg.data.cfg
|
46
|
+
Object.freeze(Cfg)
|
47
|
+
|
48
|
+
for k, v of msg.data
|
49
|
+
App[k] = v
|
50
|
+
#end
|
51
|
+
|
52
|
+
Reporter CONSIDER_IDLE_AFTER, (status) ->
|
53
|
+
# close connection if user went away
|
54
|
+
Core.disconnect() if status == 'away'
|
55
|
+
#end
|
56
|
+
#end
|
57
|
+
|
58
|
+
templates =
|
59
|
+
none: require('templates/layouts/none')
|
60
|
+
main: require('templates/layouts/main')
|
61
|
+
access_denied: require('templates/access_denied')
|
62
|
+
#end
|
63
|
+
|
64
|
+
partials = {}
|
65
|
+
|
66
|
+
CrudleLayout = require('crudle/layout')
|
67
|
+
CrudleList = require('crudle/list/component')
|
68
|
+
CrudleEditor = require('crudle/editor/component')
|
69
|
+
|
70
|
+
deploy_api = (api) ->
|
71
|
+
|
72
|
+
page = new Page
|
73
|
+
env = _.merge({
|
74
|
+
render: Render
|
75
|
+
render_component: Render.component
|
76
|
+
render_string: Render.string
|
77
|
+
}, page)
|
78
|
+
|
79
|
+
crudle_layout = CrudleLayout(api.controller.ws, page)
|
80
|
+
crudle_layout.partials.menu = require('templates/menu')
|
81
|
+
crudle_layout.data.url = api.controller.url
|
82
|
+
|
83
|
+
api(
|
84
|
+
env,
|
85
|
+
crudle_layout,
|
86
|
+
CrudleList(api.controller.ws, page),
|
87
|
+
CrudleEditor(api.controller.ws, page)
|
88
|
+
)
|
89
|
+
#end
|
90
|
+
|
91
|
+
previous_api = null
|
92
|
+
Core.on_controller_matched = (controller, context) ->
|
93
|
+
|
94
|
+
controller.load (api) ->
|
95
|
+
context.save()
|
96
|
+
|
97
|
+
api.controller = controller
|
98
|
+
|
99
|
+
if previous_api?.teardown
|
100
|
+
previous_api.teardown()
|
101
|
+
#end
|
102
|
+
previous_api = api
|
103
|
+
|
104
|
+
if _.has(api, 'acl')
|
105
|
+
unless _.isFunction(api.acl)
|
106
|
+
throw new Error("#{controller.name}.acl should be a function")
|
107
|
+
|
108
|
+
if api.acl()
|
109
|
+
deploy_api(api)
|
110
|
+
else
|
111
|
+
Render
|
112
|
+
el: 'body'
|
113
|
+
template: templates.main
|
114
|
+
partials: partials
|
115
|
+
oncomplete: ->
|
116
|
+
Render(template: templates.access_denied)
|
117
|
+
#end
|
118
|
+
|
119
|
+
else
|
120
|
+
deploy_api(api)
|
121
|
+
#end
|
122
|
+
#end
|
123
|
+
#end
|
124
|
+
|
125
|
+
document.addEventListener 'DOMContentLoaded', ->
|
126
|
+
# make sure this matches the RTCPController URL.
|
127
|
+
Core.connect('__rtcp__')
|
128
|
+
#end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# refer to underlying controller as self.controller
|
2
|
+
|
3
|
+
self = (env, layout, list, editor) ->
|
4
|
+
editor.partials.editor = require('./editor')
|
5
|
+
layout.components =
|
6
|
+
list: env.render_component(list)
|
7
|
+
editor: env.render_component(editor)
|
8
|
+
env.render(layout)
|
9
|
+
#end
|
10
|
+
|
11
|
+
module.exports = self
|
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class CONTROLLER_NAME < BaseController
|
2
|
+
include Crudle::Controller
|
3
|
+
|
4
|
+
private
|
5
|
+
def model; DO_NOT_FORGET_TO_ADD_MODEL end
|
6
|
+
|
7
|
+
# def order; end
|
8
|
+
|
9
|
+
# def filter_by_name params, dataset
|
10
|
+
# return if params[:name].nil? || params[:name].empty?
|
11
|
+
# dataset.where('name LIKE ?', params[:name] + '%')
|
12
|
+
# end
|
13
|
+
|
14
|
+
# def list_serializer item
|
15
|
+
# serializer(item)
|
16
|
+
# end
|
17
|
+
|
18
|
+
# def editor_serializer item
|
19
|
+
# serializer(item)
|
20
|
+
# end
|
21
|
+
|
22
|
+
# def serializer item
|
23
|
+
# item
|
24
|
+
# end
|
25
|
+
|
26
|
+
end
|
data/docker/run
CHANGED
@@ -26,12 +26,10 @@ env_prompt() {
|
|
26
26
|
[ "$(echo " {environments} " | grep -E "\s$APP_ENV\s")" = "" ] && env_prompt
|
27
27
|
}
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
env_prompt
|
34
|
-
fi
|
29
|
+
echo "Let's set APP_ENV"
|
30
|
+
echo "{environments}"
|
31
|
+
echo -n "> "
|
32
|
+
env_prompt
|
35
33
|
|
36
34
|
set -e
|
37
35
|
|
@@ -4,16 +4,19 @@ module Appril
|
|
4
4
|
class Install
|
5
5
|
include Helpers
|
6
6
|
|
7
|
-
def initialize dir, namespace: nil, working_dir_opted: false
|
8
|
-
install(dir, working_dir_opted)
|
7
|
+
def initialize dir, namespace: nil, working_dir_opted: false, crudle_app: false
|
8
|
+
install(dir, working_dir_opted, crudle_app)
|
9
9
|
make_executable(dir / 'core/generate_configs.rb')
|
10
10
|
add_namespace(dir, namespace) if namespace
|
11
11
|
puts "Done. All files installed into #{dir}"
|
12
12
|
end
|
13
13
|
|
14
|
-
def install dir, working_dir_opted
|
15
|
-
src = working_dir_opted ?
|
14
|
+
def install dir, working_dir_opted, crudle_app
|
15
|
+
src = working_dir_opted ? APP_DIR.to_path + '/.' : APP_DIR
|
16
16
|
FileUtils.cp_r(src, dir)
|
17
|
+
if crudle_app
|
18
|
+
FileUtils.cp_r(CRUDLE_DIR.to_path + '/.', dir)
|
19
|
+
end
|
17
20
|
cleanup(dir)
|
18
21
|
end
|
19
22
|
|
data/lib/appril/cli/app.rb
CHANGED
data/lib/appril/cli.rb
CHANGED
@@ -7,7 +7,8 @@ require 'appril/cli/helpers'
|
|
7
7
|
require 'appril/cli/assertions'
|
8
8
|
|
9
9
|
module Appril
|
10
|
-
BASE_DIR = Pathname.new(File.expand_path('../../..', __FILE__))
|
10
|
+
BASE_DIR = Pathname.new(File.expand_path('../../..', __FILE__))
|
11
|
+
BOILERPLATE_DIR = BASE_DIR / 'boilerplate'
|
11
12
|
|
12
13
|
class CLI
|
13
14
|
include Helpers
|
@@ -34,25 +35,30 @@ module Appril
|
|
34
35
|
|
35
36
|
def usage
|
36
37
|
puts "
|
38
|
+
Arguments in round brackets are required.
|
39
|
+
Arguments in square brackets are optional.
|
40
|
+
|
41
|
+
|
37
42
|
=== Install a new app ===
|
38
|
-
$ appril
|
43
|
+
$ appril (app || a) (install || i) (dir || .) [-crudle]
|
44
|
+
* If -crudle option provided it will install a Crudle app
|
39
45
|
|
40
46
|
=== Update existing app ===
|
41
|
-
$ appril
|
47
|
+
$ appril (app || a) (update || u) (dir || .)
|
42
48
|
|
43
49
|
=== Generate a new API ===
|
44
|
-
$ appril
|
50
|
+
$ appril (generate || g) (api) (api name) (dir || .)
|
45
51
|
|
46
|
-
=== Install Docker
|
47
|
-
$ appril
|
52
|
+
=== Install Docker builder ===
|
53
|
+
$ appril (docker || d) (install || i) (dir || .)
|
48
54
|
|
49
|
-
=== Update Docker
|
50
|
-
$ appril
|
55
|
+
=== Update Docker builder ===
|
56
|
+
$ appril (docker || d) (update || u) (dir || .)
|
51
57
|
|
52
58
|
=== Build Docker image and install run script ===
|
53
|
-
$ appril
|
54
|
-
If -u option provided it will only update the run script without building the image.
|
55
|
-
If -p option provided it will try to push the image to Docker registry after successful build.
|
59
|
+
$ appril (docker || d) (build || b) (dir || .) [-u] [-p]
|
60
|
+
* If -u option provided it will only update the run script without building the image.
|
61
|
+
* If -p option provided it will try to push the image to Docker registry after successful build.
|
56
62
|
|
57
63
|
=== Usage ===
|
58
64
|
$ appril [-h || --help]
|
@@ -71,7 +77,8 @@ module Appril
|
|
71
77
|
|
72
78
|
app_install(dir, {
|
73
79
|
working_dir_opted: working_dir_opted?(opted_dir),
|
74
|
-
namespace: extract_namespace(args)
|
80
|
+
namespace: extract_namespace(args),
|
81
|
+
crudle_app: args.find {|a| a == '-crudle'}
|
75
82
|
})
|
76
83
|
|
77
84
|
when 'u', 'update'
|
data/lib/appril/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appril
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Slee Woo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rocketio
|
@@ -48,36 +48,49 @@ extra_rdoc_files: []
|
|
48
48
|
files:
|
49
49
|
- Gemfile
|
50
50
|
- Rakefile
|
51
|
-
- app/.gitignore
|
52
|
-
- app/.pryrc
|
53
|
-
- app/Gemfile
|
54
|
-
- app/Rakefile
|
55
|
-
- app/base/api/.ignore
|
56
|
-
- app/base/base_controller.rb
|
57
|
-
- app/base/boot.rb
|
58
|
-
- app/base/core.coffee
|
59
|
-
- app/base/helpers/application_helpers.rb
|
60
|
-
- app/base/load.rb
|
61
|
-
- app/base/load_controllers.rb
|
62
|
-
- app/base/rtcp_controller.rb
|
63
|
-
- app/config.ru
|
64
|
-
- app/config/config.rb
|
65
|
-
- app/config/config.yml
|
66
|
-
- app/config/env/development.yml
|
67
|
-
- app/config/env/production.yml
|
68
|
-
- app/config/env/stage.yml
|
69
|
-
- app/config/env/test.yml
|
70
|
-
- app/core/Gemfile
|
71
|
-
- app/core/boot.rb
|
72
|
-
- app/core/generate_configs.rb
|
73
|
-
- app/core/load.rb
|
74
|
-
- app/core/load_controllers.rb
|
75
|
-
- app/generators/api/.ignore
|
76
|
-
- app/package.json
|
77
|
-
- app/public/.ignore
|
78
|
-
- app/webpack.config.js
|
79
51
|
- appril.gemspec
|
80
52
|
- bin/appril
|
53
|
+
- boilerplate/app/.gitignore
|
54
|
+
- boilerplate/app/.pryrc
|
55
|
+
- boilerplate/app/Gemfile
|
56
|
+
- boilerplate/app/Rakefile
|
57
|
+
- boilerplate/app/base/api/.ignore
|
58
|
+
- boilerplate/app/base/base_controller.rb
|
59
|
+
- boilerplate/app/base/boot.rb
|
60
|
+
- boilerplate/app/base/core.coffee
|
61
|
+
- boilerplate/app/base/helpers/application_helpers.coffee
|
62
|
+
- boilerplate/app/base/helpers/application_helpers.rb
|
63
|
+
- boilerplate/app/base/load.rb
|
64
|
+
- boilerplate/app/base/load_controllers.rb
|
65
|
+
- boilerplate/app/base/rtcp_controller.rb
|
66
|
+
- boilerplate/app/base/templates/access_denied.html
|
67
|
+
- boilerplate/app/base/templates/layout.html
|
68
|
+
- boilerplate/app/base/templates/layouts/main.html
|
69
|
+
- boilerplate/app/base/templates/layouts/none.html
|
70
|
+
- boilerplate/app/config.ru
|
71
|
+
- boilerplate/app/config/config.rb
|
72
|
+
- boilerplate/app/config/config.yml
|
73
|
+
- boilerplate/app/config/env/development.yml
|
74
|
+
- boilerplate/app/config/env/production.yml
|
75
|
+
- boilerplate/app/config/env/stage.yml
|
76
|
+
- boilerplate/app/config/env/test.yml
|
77
|
+
- boilerplate/app/core/Gemfile
|
78
|
+
- boilerplate/app/core/boot.rb
|
79
|
+
- boilerplate/app/core/generate_configs.rb
|
80
|
+
- boilerplate/app/core/load.rb
|
81
|
+
- boilerplate/app/core/load_controllers.rb
|
82
|
+
- boilerplate/app/generators/api/.ignore
|
83
|
+
- boilerplate/app/package.json
|
84
|
+
- boilerplate/app/public/.ignore
|
85
|
+
- boilerplate/app/tmp/.ignore
|
86
|
+
- boilerplate/app/var/.ignore
|
87
|
+
- boilerplate/app/webpack.config.js
|
88
|
+
- boilerplate/crudle/Gemfile
|
89
|
+
- boilerplate/crudle/base/core.coffee
|
90
|
+
- boilerplate/crudle/generators/api/client.coffee
|
91
|
+
- boilerplate/crudle/generators/api/editor.html
|
92
|
+
- boilerplate/crudle/generators/api/server.rb
|
93
|
+
- boilerplate/crudle/package.json
|
81
94
|
- docker/Dockerfile
|
82
95
|
- docker/run
|
83
96
|
- docker/skel/build.sh
|
@@ -101,7 +114,7 @@ files:
|
|
101
114
|
- lib/appril/cli/helpers.rb
|
102
115
|
- lib/appril/rtcp_controller.rb
|
103
116
|
- lib/appril/version.rb
|
104
|
-
homepage: https://github.com/
|
117
|
+
homepage: https://github.com/appril/appril
|
105
118
|
licenses:
|
106
119
|
- MIT
|
107
120
|
metadata: {}
|
@@ -124,5 +137,5 @@ rubyforge_project:
|
|
124
137
|
rubygems_version: 2.5.1
|
125
138
|
signing_key:
|
126
139
|
specification_version: 4
|
127
|
-
summary: '["appril-0.0.
|
140
|
+
summary: '["appril-0.0.1", "Opinionated framework for building opinionated web applications"]'
|
128
141
|
test_files: []
|
data/app/Rakefile
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require File.expand_path('../core/boot', __FILE__)
|
data/app/base/core.coffee
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
_ =
|
2
|
-
merge: require('lodash/merge')
|
3
|
-
#end
|
4
|
-
|
5
|
-
CONSIDER_IDLE_AFTER = 5 * 60
|
6
|
-
|
7
|
-
Core = require('appril')
|
8
|
-
Page = require('appril/page')
|
9
|
-
Load = require('appril/load')
|
10
|
-
Render = require('appril/render')
|
11
|
-
ActivityObserver = require('appril/activity_observer')
|
12
|
-
|
13
|
-
# require 'appril/polyfills'
|
14
|
-
|
15
|
-
window.App = {}
|
16
|
-
|
17
|
-
for k, v of require('appril/util')
|
18
|
-
App[k] = v
|
19
|
-
#end
|
20
|
-
|
21
|
-
# for k, v of require('appril/util/datetime')
|
22
|
-
# App[k] = v
|
23
|
-
# #end
|
24
|
-
#
|
25
|
-
# for k, v of require('appril/util/alert')
|
26
|
-
# App[k] = v
|
27
|
-
# #end
|
28
|
-
|
29
|
-
Render.default_el = '#content'
|
30
|
-
Render.global_data = {App: App}
|
31
|
-
Render.global_handlers = {}
|
32
|
-
|
33
|
-
|
34
|
-
Core.on_initialize = (msg) ->
|
35
|
-
|
36
|
-
for k, v of msg.data
|
37
|
-
App[k] = v
|
38
|
-
#end
|
39
|
-
|
40
|
-
ActivityObserver CONSIDER_IDLE_AFTER, (status) ->
|
41
|
-
# close connection if user went away
|
42
|
-
Core.disconnect() if status == 'away'
|
43
|
-
#end
|
44
|
-
|
45
|
-
#end
|
46
|
-
|
47
|
-
|
48
|
-
Core.on_controllers_ready = (controllers) ->
|
49
|
-
for name, controller of controllers
|
50
|
-
App[name] = controller
|
51
|
-
#end
|
52
|
-
#end
|
53
|
-
|
54
|
-
|
55
|
-
deploy_api = (api) ->
|
56
|
-
try
|
57
|
-
App.layout?.teardown()
|
58
|
-
#end
|
59
|
-
|
60
|
-
env = _.merge({
|
61
|
-
render: Render,
|
62
|
-
render_component: Render.component,
|
63
|
-
render_string: Render.string
|
64
|
-
}, new Page)
|
65
|
-
|
66
|
-
App.layout = env.render
|
67
|
-
el: 'body'
|
68
|
-
template: "<div id='#{Render.default_el}'></div>"
|
69
|
-
oncomplete: ->
|
70
|
-
new api(env)
|
71
|
-
#end
|
72
|
-
#end
|
73
|
-
#end
|
74
|
-
|
75
|
-
|
76
|
-
Core.on_controller_matched = (controller, context) ->
|
77
|
-
controller.load (api) ->
|
78
|
-
context.save()
|
79
|
-
deploy_api(api)
|
80
|
-
#end
|
81
|
-
|
82
|
-
# Core.on_socket_open = (socket) ->
|
83
|
-
|
84
|
-
# Core.on_socket_close = ->
|
85
|
-
|
86
|
-
document.addEventListener 'DOMContentLoaded', ->
|
87
|
-
# make sure this matches the RTCPController URL.
|
88
|
-
# if URL differs on various environments determine effective environment and use appropriate URL.
|
89
|
-
# a good approach to determine effective environment is to look into window.location.hostname
|
90
|
-
Core.connect('__rtcp__')
|
91
|
-
#end
|
data/app/package.json
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|