tiny_admin 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/tiny_admin.rb ADDED
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'phlex'
4
+ require 'roda'
5
+ require 'zeitwerk'
6
+
7
+ require 'singleton'
8
+ require 'yaml'
9
+
10
+ loader = Zeitwerk::Loader.for_gem
11
+ loader.setup
12
+
13
+ module TinyAdmin
14
+ def configure(&block)
15
+ block&.call(TinyAdmin::Settings.instance) || TinyAdmin::Settings.instance
16
+ end
17
+
18
+ def configure_from_file(file)
19
+ config = YAML.load_file(file, symbolize_names: true)
20
+ config.each do |key, value|
21
+ TinyAdmin::Settings.instance.send("#{key}=", value)
22
+ end
23
+ end
24
+
25
+ module_function :configure, :configure_from_file
26
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tiny_admin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mattia Roccoberton
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-04-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: phlex
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: roda
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.66'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.66'
41
+ - !ruby/object:Gem::Dependency
42
+ name: zeitwerk
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.6'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.6'
55
+ description: A compact and composible dashboard component for Ruby
56
+ email: mat@blocknot.es
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - LICENSE.txt
62
+ - README.md
63
+ - lib/tiny_admin.rb
64
+ - lib/tiny_admin/actions/basic_action.rb
65
+ - lib/tiny_admin/actions/index.rb
66
+ - lib/tiny_admin/actions/show.rb
67
+ - lib/tiny_admin/authentication.rb
68
+ - lib/tiny_admin/basic_app.rb
69
+ - lib/tiny_admin/context.rb
70
+ - lib/tiny_admin/field.rb
71
+ - lib/tiny_admin/plugins/active_record_repository.rb
72
+ - lib/tiny_admin/plugins/base_repository.rb
73
+ - lib/tiny_admin/plugins/no_auth.rb
74
+ - lib/tiny_admin/plugins/simple_auth.rb
75
+ - lib/tiny_admin/router.rb
76
+ - lib/tiny_admin/settings.rb
77
+ - lib/tiny_admin/utils.rb
78
+ - lib/tiny_admin/version.rb
79
+ - lib/tiny_admin/views/actions/index.rb
80
+ - lib/tiny_admin/views/actions/show.rb
81
+ - lib/tiny_admin/views/components/filters_form.rb
82
+ - lib/tiny_admin/views/components/flash.rb
83
+ - lib/tiny_admin/views/components/head.rb
84
+ - lib/tiny_admin/views/components/navbar.rb
85
+ - lib/tiny_admin/views/components/pagination.rb
86
+ - lib/tiny_admin/views/default_layout.rb
87
+ - lib/tiny_admin/views/pages/page_not_found.rb
88
+ - lib/tiny_admin/views/pages/record_not_found.rb
89
+ - lib/tiny_admin/views/pages/root.rb
90
+ - lib/tiny_admin/views/pages/simple_auth_login.rb
91
+ homepage: https://github.com/blocknotes/tiny_admin
92
+ licenses:
93
+ - MIT
94
+ metadata:
95
+ homepage_uri: https://github.com/blocknotes/tiny_admin
96
+ source_code_uri: https://github.com/blocknotes/tiny_admin
97
+ changelog_uri: https://github.com/blocknotes/tiny_admin/blob/master/CHANGELOG.md
98
+ rubygems_mfa_required: 'true'
99
+ post_install_message:
100
+ rdoc_options: []
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: 2.7.0
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ requirements: []
114
+ rubygems_version: 3.3.26
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: Tiny Admin
118
+ test_files: []