ditty 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/.pryrc +0 -0
- data/.rspec +0 -0
- data/.rubocop.yml +0 -0
- data/.travis.yml +4 -1
- data/Gemfile.ci +0 -0
- data/License.txt +0 -0
- data/Rakefile +3 -0
- data/Readme.md +0 -0
- data/config.ru +0 -0
- data/ditty.gemspec +1 -1
- data/lib/ditty.rb +18 -30
- data/lib/ditty/components/app.rb +7 -5
- data/lib/ditty/controllers/application.rb +0 -0
- data/lib/ditty/controllers/audit_logs.rb +0 -0
- data/lib/ditty/controllers/component.rb +0 -0
- data/lib/ditty/controllers/main.rb +0 -0
- data/lib/ditty/controllers/roles.rb +0 -0
- data/lib/ditty/controllers/users.rb +0 -0
- data/lib/ditty/db.rb +0 -0
- data/lib/ditty/helpers/authentication.rb +0 -0
- data/lib/ditty/helpers/component.rb +0 -0
- data/lib/ditty/helpers/pundit.rb +0 -0
- data/lib/ditty/helpers/views.rb +0 -0
- data/lib/ditty/helpers/wisper.rb +0 -0
- data/lib/ditty/listener.rb +0 -0
- data/lib/ditty/models/audit_log.rb +1 -1
- data/lib/ditty/models/base.rb +2 -0
- data/lib/ditty/models/identity.rb +1 -1
- data/lib/ditty/models/role.rb +1 -1
- data/lib/ditty/models/user.rb +1 -1
- data/lib/ditty/policies/application_policy.rb +0 -0
- data/lib/ditty/policies/audit_log_policy.rb +0 -0
- data/lib/ditty/policies/identity_policy.rb +0 -0
- data/lib/ditty/policies/role_policy.rb +0 -0
- data/lib/ditty/policies/user_policy.rb +0 -0
- data/lib/ditty/rake_tasks.rb +0 -0
- data/lib/ditty/seed.rb +0 -0
- data/lib/ditty/services/logger.rb +0 -0
- data/lib/ditty/version.rb +1 -1
- data/migrate/20170207_base_tables.rb +0 -0
- data/migrate/20170208_audit_log.rb +0 -0
- data/migrate/20170416_audit_log_details.rb +0 -0
- data/public/browserconfig.xml +0 -0
- data/public/images/apple-icon.png +0 -0
- data/public/images/favicon-16x16.png +0 -0
- data/public/images/favicon-32x32.png +0 -0
- data/public/images/launcher-icon-1x.png +0 -0
- data/public/images/launcher-icon-2x.png +0 -0
- data/public/images/launcher-icon-4x.png +0 -0
- data/public/images/mstile-150x150.png +0 -0
- data/public/images/safari-pinned-tab.svg +0 -0
- data/public/manifest.json +0 -0
- data/views/404.haml +0 -0
- data/views/audit_logs/index.haml +0 -0
- data/views/error.haml +0 -0
- data/views/identity/login.haml +0 -0
- data/views/identity/register.haml +0 -0
- data/views/index.haml +0 -0
- data/views/layout.haml +0 -0
- data/views/partials/delete_form.haml +0 -0
- data/views/partials/footer.haml +0 -0
- data/views/partials/form_control.haml +0 -0
- data/views/partials/navbar.haml +0 -0
- data/views/partials/notifications.haml +0 -0
- data/views/partials/pager.haml +0 -0
- data/views/partials/sidebar.haml +0 -0
- data/views/roles/display.haml +0 -0
- data/views/roles/edit.haml +0 -0
- data/views/roles/form.haml +0 -0
- data/views/roles/index.haml +0 -0
- data/views/roles/new.haml +0 -0
- data/views/users/display.haml +0 -0
- data/views/users/edit.haml +0 -0
- data/views/users/identity.haml +0 -0
- data/views/users/index.haml +0 -0
- data/views/users/new.haml +0 -0
- data/views/users/profile.haml +0 -0
- data/views/users/user.haml +0 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e117d869f435ccaf97c5e0ed465a2464695d0e1
|
4
|
+
data.tar.gz: 0eaa19a3ed0647b95abf5593ca4a89a98f043e5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfe1b8c443b4ae745c8e45c9e660c6819f49d9af0062f486f3c5d24d4f9f2383a52cde548c3dfc6c6f4a2406d21b680af6abba5d85e35120ff9675c8eb087215
|
7
|
+
data.tar.gz: 076b68ddde52ccdede169bdf493aa63adb1ea28ffcec0f764791e460e4e3e744e382af61d950b0d6b624ef55e9b425a13d9817af3b5b292472dd98f8bc9afd6b
|
data/.gitignore
CHANGED
File without changes
|
data/.pryrc
CHANGED
File without changes
|
data/.rspec
CHANGED
File without changes
|
data/.rubocop.yml
CHANGED
File without changes
|
data/.travis.yml
CHANGED
@@ -7,7 +7,10 @@ rvm:
|
|
7
7
|
gemfile: Gemfile.ci
|
8
8
|
env:
|
9
9
|
- DATABASE_URL="sqlite::memory:" RACK_ENV=test
|
10
|
-
before_install:
|
10
|
+
before_install:
|
11
|
+
- gem install bundler -v 1.12.5
|
12
|
+
before_script:
|
13
|
+
- bundle exec rake ditty:prep
|
11
14
|
addons:
|
12
15
|
code_climate:
|
13
16
|
repo_token: 289860573c6284a8e277de86848caba84d840be49e35f3601bcd672ab40d1e35
|
data/Gemfile.ci
CHANGED
File without changes
|
data/License.txt
CHANGED
File without changes
|
data/Rakefile
CHANGED
data/Readme.md
CHANGED
File without changes
|
data/config.ru
CHANGED
File without changes
|
data/ditty.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.summary = 'Sinatra Based Application Framework'
|
14
14
|
spec.description = 'Sinatra Based Application Framework'
|
15
15
|
spec.homepage = 'https://github.com/eagerelk/ditty'
|
16
|
-
spec.license = '
|
16
|
+
spec.license = 'MIT'
|
17
17
|
|
18
18
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
19
|
spec.bindir = 'exe'
|
data/lib/ditty.rb
CHANGED
@@ -67,45 +67,38 @@ module Ditty
|
|
67
67
|
|
68
68
|
# Return a hash of controllers with their routes as keys: `{ '/users' => Ditty::Controllers::Users }`
|
69
69
|
def self.routes
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
@routes = routes
|
70
|
+
components.inject({}) do |memo, comp|
|
71
|
+
memo.merge! comp[1].routes if comp[1].respond_to?(:routes)
|
72
|
+
memo
|
73
|
+
end.compact
|
75
74
|
end
|
76
75
|
|
77
76
|
# Return an ordered list of navigation items:
|
78
77
|
# `[{order:0, link:'/users/', text:'Users'}, {order:1, link:'/roles/', text:'Roles'}]
|
79
78
|
def self.navigation
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
@navigation = navigation
|
79
|
+
components.inject([]) do |memo, comp|
|
80
|
+
memo.concat comp[1].navigation if comp[1].respond_to?(:navigation)
|
81
|
+
memo
|
82
|
+
end
|
85
83
|
end
|
86
84
|
|
87
85
|
def self.migrations
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
def self.migrations=(migrations)
|
92
|
-
@migrations = migrations
|
86
|
+
components.map do |_name, comp|
|
87
|
+
comp.migrations if comp.respond_to?(:migrations)
|
88
|
+
end.compact
|
93
89
|
end
|
94
90
|
|
95
91
|
def self.seeders
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
def self.seeders=(seeders)
|
100
|
-
@seeders = seeders
|
92
|
+
components.map do |_name, comp|
|
93
|
+
comp.seeder if comp.respond_to?(:seeder)
|
94
|
+
end.compact
|
101
95
|
end
|
102
96
|
|
103
97
|
def self.workers
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
@workers = workers
|
98
|
+
components.inject([]) do |memo, comp|
|
99
|
+
memo.concat comp.workers if comp.respond_to?(:workers)
|
100
|
+
memo
|
101
|
+
end
|
109
102
|
end
|
110
103
|
|
111
104
|
module Base
|
@@ -123,11 +116,6 @@ module Ditty
|
|
123
116
|
extend(component::ClassMethods) if defined?(component::ClassMethods)
|
124
117
|
|
125
118
|
component.configure(self, *args, &block) if component.respond_to?(:configure)
|
126
|
-
Components.navigation.concat component.navigation if component.respond_to?(:navigation)
|
127
|
-
Components.routes.merge! component.routes if component.respond_to?(:routes)
|
128
|
-
Components.migrations << component.migrations if component.respond_to?(:migrations)
|
129
|
-
Components.seeders << component.seeder if component.respond_to?(:seeder)
|
130
|
-
Components.workers.concat component.workers if component.respond_to?(:workers)
|
131
119
|
nil
|
132
120
|
end
|
133
121
|
end
|
data/lib/ditty/components/app.rb
CHANGED
@@ -4,7 +4,10 @@ require 'ditty'
|
|
4
4
|
|
5
5
|
module Ditty
|
6
6
|
class App
|
7
|
-
def self.
|
7
|
+
def self.load
|
8
|
+
controllers = File.expand_path('../../controllers', __FILE__)
|
9
|
+
Dir.glob("#{controllers}/*.rb").each { |f| require f }
|
10
|
+
|
8
11
|
require 'ditty/models/user'
|
9
12
|
require 'ditty/models/role'
|
10
13
|
require 'ditty/models/identity'
|
@@ -25,8 +28,7 @@ module Ditty
|
|
25
28
|
end
|
26
29
|
|
27
30
|
def self.routes
|
28
|
-
|
29
|
-
Dir.glob("#{controllers}/*.rb").each { |f| require f }
|
31
|
+
load
|
30
32
|
{
|
31
33
|
'/' => ::Ditty::Main,
|
32
34
|
'/users' => ::Ditty::Users,
|
@@ -36,7 +38,7 @@ module Ditty
|
|
36
38
|
end
|
37
39
|
|
38
40
|
def self.navigation
|
39
|
-
|
41
|
+
load
|
40
42
|
|
41
43
|
[
|
42
44
|
{
|
@@ -54,7 +56,7 @@ module Ditty
|
|
54
56
|
|
55
57
|
def self.seeder
|
56
58
|
proc do
|
57
|
-
|
59
|
+
load
|
58
60
|
|
59
61
|
::Ditty::Role.find_or_create(name: 'super_admin')
|
60
62
|
::Ditty::Role.find_or_create(name: 'admin')
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/ditty/db.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/lib/ditty/helpers/pundit.rb
CHANGED
File without changes
|
data/lib/ditty/helpers/views.rb
CHANGED
File without changes
|
data/lib/ditty/helpers/wisper.rb
CHANGED
File without changes
|
data/lib/ditty/listener.rb
CHANGED
File without changes
|
data/lib/ditty/models/base.rb
CHANGED
data/lib/ditty/models/role.rb
CHANGED
data/lib/ditty/models/user.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/ditty/rake_tasks.rb
CHANGED
File without changes
|
data/lib/ditty/seed.rb
CHANGED
File without changes
|
File without changes
|
data/lib/ditty/version.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/public/browserconfig.xml
CHANGED
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
|
data/public/manifest.json
CHANGED
File without changes
|
data/views/404.haml
CHANGED
File without changes
|
data/views/audit_logs/index.haml
CHANGED
File without changes
|
data/views/error.haml
CHANGED
File without changes
|
data/views/identity/login.haml
CHANGED
File without changes
|
File without changes
|
data/views/index.haml
CHANGED
File without changes
|
data/views/layout.haml
CHANGED
File without changes
|
File without changes
|
data/views/partials/footer.haml
CHANGED
File without changes
|
File without changes
|
data/views/partials/navbar.haml
CHANGED
File without changes
|
File without changes
|
data/views/partials/pager.haml
CHANGED
File without changes
|
data/views/partials/sidebar.haml
CHANGED
File without changes
|
data/views/roles/display.haml
CHANGED
File without changes
|
data/views/roles/edit.haml
CHANGED
File without changes
|
data/views/roles/form.haml
CHANGED
File without changes
|
data/views/roles/index.haml
CHANGED
File without changes
|
data/views/roles/new.haml
CHANGED
File without changes
|
data/views/users/display.haml
CHANGED
File without changes
|
data/views/users/edit.haml
CHANGED
File without changes
|
data/views/users/identity.haml
CHANGED
File without changes
|
data/views/users/index.haml
CHANGED
File without changes
|
data/views/users/new.haml
CHANGED
File without changes
|
data/views/users/profile.haml
CHANGED
File without changes
|
data/views/users/user.haml
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ditty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jurgens du Toit
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -406,7 +406,7 @@ files:
|
|
406
406
|
- views/users/user.haml
|
407
407
|
homepage: https://github.com/eagerelk/ditty
|
408
408
|
licenses:
|
409
|
-
-
|
409
|
+
- MIT
|
410
410
|
metadata: {}
|
411
411
|
post_install_message:
|
412
412
|
rdoc_options: []
|
@@ -424,7 +424,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
424
424
|
version: '0'
|
425
425
|
requirements: []
|
426
426
|
rubyforge_project:
|
427
|
-
rubygems_version: 2.6.
|
427
|
+
rubygems_version: 2.6.13
|
428
428
|
signing_key:
|
429
429
|
specification_version: 4
|
430
430
|
summary: Sinatra Based Application Framework
|