eskel 0.0.1
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 +15 -0
- data/.gitignore +6 -0
- data/Gemfile +2 -0
- data/LICENSE +20 -0
- data/README.md +9 -0
- data/Rakefile +11 -0
- data/eskel.gemspec +26 -0
- data/lib/eskel.rb +28 -0
- data/lib/eskel/application.rb +13 -0
- data/lib/eskel/application/dependencies.rb +26 -0
- data/lib/eskel/loader.rb +54 -0
- data/lib/eskel/logging.rb +25 -0
- data/lib/eskel/version.rb +7 -0
- metadata +126 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZTM4ZWRlOTY1ZGRjNDg3MGI5NzU1MGViNWIzMzAzNGZhNTBmZDU2MA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NDIzYzE4YmE5NjI4ODhiZWU2MTgxYTczOTY4ZDFhMDUzNDQzNWYxMg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
M2E3ZmJhNTdmMzdkOTExZTJmNzhlZTgwZjdlNjE0NjgzNGY1NTgxMjkwMzNk
|
10
|
+
NjY4M2E4ZWFmZDViYWMzMTllNjQ4NWViOWJjNjIwNDZmZTAyNGRiMDk1MDg5
|
11
|
+
NjY3OWNmZDdiYTUyMjNhODI1MmIzM2Q1MjkxMWVhMGI0YmIzMjM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ODJjZGQxMWYwZGQwZTk3MzVmZDdiOGUzMzFmNDUzNTgyODU4MDdjMjEwNDAw
|
14
|
+
ZjkxOWRmOWIxMmQ0MTE1MzAwYTMxMWViZTUyNjk0Zjk2NGFiN2UyMTczMjQ1
|
15
|
+
NjM5MWEwNzkzZjg5NjkwNDg0NzQ2ZGM1ZWMzYzc0ZGJhNDMwMmM=
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2014 Damian Caruso
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
data/eskel.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
$:.push File.expand_path('../lib', __FILE__)
|
2
|
+
require 'eskel/version'
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'eskel'
|
6
|
+
s.version = Eskel::VERSION
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.homepage = 'https://github.com/DamianCaruso/eskel'
|
9
|
+
s.summary = 'Ruby web app generator'
|
10
|
+
s.description = 'Ruby web app generator'
|
11
|
+
s.authors = ['Damian Caruso']
|
12
|
+
s.email = ['damian.caruso@gmail.com']
|
13
|
+
s.licenses = ['MIT']
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
s.require_paths = ['lib']
|
19
|
+
|
20
|
+
s.add_dependency 'cuba', '~> 3.3.0'
|
21
|
+
s.add_dependency 'dotenv', '~> 1.0.2'
|
22
|
+
s.add_dependency 'tilt', '~> 2.0.1'
|
23
|
+
|
24
|
+
s.add_development_dependency 'rake'
|
25
|
+
s.add_development_dependency 'minitest'
|
26
|
+
end
|
data/lib/eskel.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
require 'eskel/version'
|
4
|
+
require 'eskel/logging'
|
5
|
+
require 'eskel/application'
|
6
|
+
require 'eskel/loader'
|
7
|
+
|
8
|
+
module Eskel
|
9
|
+
extend Loader
|
10
|
+
extend Logging
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def root
|
14
|
+
Pathname.new(ESKEL_ROOT)
|
15
|
+
end
|
16
|
+
|
17
|
+
def env
|
18
|
+
@_env ||= (ENV['RACK_ENV'] || 'development').downcase.to_sym
|
19
|
+
end
|
20
|
+
|
21
|
+
def groups(*groups)
|
22
|
+
groups.unshift(:default, env)
|
23
|
+
groups.compact!
|
24
|
+
groups.uniq!
|
25
|
+
groups
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'cuba/render'
|
2
|
+
|
3
|
+
module Eskel
|
4
|
+
module ApplicationDependencies
|
5
|
+
def self.setup(app)
|
6
|
+
app.plugin Cuba::Render
|
7
|
+
app.settings[:render] ||= {}
|
8
|
+
app.settings[:render][:views] = File.expand_path('app/views', Dir.pwd)
|
9
|
+
end
|
10
|
+
|
11
|
+
module ClassMethods
|
12
|
+
def dependencies
|
13
|
+
[
|
14
|
+
'helpers/**/*.rb',
|
15
|
+
'middleware/**/*.rb',
|
16
|
+
'main.rb',
|
17
|
+
'routes/**/*.rb'
|
18
|
+
].flat_map { |path| Dir.glob("#{Eskel.root}/app/#{path}") }
|
19
|
+
end
|
20
|
+
|
21
|
+
def require_dependencies
|
22
|
+
Eskel.require_dependencies(dependencies)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/eskel/loader.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'dotenv'
|
2
|
+
|
3
|
+
module Eskel
|
4
|
+
module Loader
|
5
|
+
def before_load(&block)
|
6
|
+
@_before_load ||= []
|
7
|
+
@_before_load << block if block_given?
|
8
|
+
@_before_load
|
9
|
+
end
|
10
|
+
|
11
|
+
def after_load(&block)
|
12
|
+
@_after_load ||= []
|
13
|
+
@_after_load << block if block_given?
|
14
|
+
@_after_load
|
15
|
+
end
|
16
|
+
|
17
|
+
def load!
|
18
|
+
return false if loaded?
|
19
|
+
began_at = Time.now
|
20
|
+
Eskel.logger
|
21
|
+
before_load.each(&:call)
|
22
|
+
Dotenv.load root.join(".env.#{env}"), root.join('.env')
|
23
|
+
require_dependencies(*dependency_paths)
|
24
|
+
Eskel::Application.require_dependencies
|
25
|
+
after_load.each(&:call)
|
26
|
+
logger.info "Loaded Eskel in #{Time.now - began_at} seconds"
|
27
|
+
Thread.current[:eskel_loaded] = true
|
28
|
+
end
|
29
|
+
|
30
|
+
def loaded?
|
31
|
+
Thread.current[:eskel_loaded]
|
32
|
+
end
|
33
|
+
|
34
|
+
def require_dependencies(*paths)
|
35
|
+
files = paths.flatten.flat_map{ |path| Dir.glob(path).sort_by{ |filename| filename.count('/') } }.uniq
|
36
|
+
files.each { |rb| require rb }
|
37
|
+
end
|
38
|
+
|
39
|
+
def dependency_paths
|
40
|
+
@_dependency_paths ||= default_dependency_paths
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def default_dependency_paths
|
46
|
+
@default_dependency_paths ||= [
|
47
|
+
"#{root}/config/database.rb",
|
48
|
+
"#{root}/lib/**/*.rb",
|
49
|
+
"#{root}/app/models/**/*.rb",
|
50
|
+
"#{root}/config/initializers/*.rb"
|
51
|
+
]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'logger'
|
2
|
+
|
3
|
+
STDOUT.sync = true
|
4
|
+
|
5
|
+
module Eskel
|
6
|
+
module Logging
|
7
|
+
def self.stdout_logger
|
8
|
+
logger = Logger.new(STDOUT)
|
9
|
+
logger.level = Logger.const_get(([ENV['LOG_LEVEL'].to_s.upcase, 'INFO'] & %w[DEBUG INFO WARN ERROR FATAL UNKNOWN]).compact.first)
|
10
|
+
logger
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.logger
|
14
|
+
@_logger ||= stdout_logger
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.logger=(logger)
|
18
|
+
@_logger = logger
|
19
|
+
end
|
20
|
+
|
21
|
+
def logger
|
22
|
+
Eskel::Logging.logger
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: eskel
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Damian Caruso
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cuba
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.3.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.3.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dotenv
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.2
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.2
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: tilt
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.0.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.0.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Ruby web app generator
|
84
|
+
email:
|
85
|
+
- damian.caruso@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- .gitignore
|
91
|
+
- Gemfile
|
92
|
+
- LICENSE
|
93
|
+
- README.md
|
94
|
+
- Rakefile
|
95
|
+
- eskel.gemspec
|
96
|
+
- lib/eskel.rb
|
97
|
+
- lib/eskel/application.rb
|
98
|
+
- lib/eskel/application/dependencies.rb
|
99
|
+
- lib/eskel/loader.rb
|
100
|
+
- lib/eskel/logging.rb
|
101
|
+
- lib/eskel/version.rb
|
102
|
+
homepage: https://github.com/DamianCaruso/eskel
|
103
|
+
licenses:
|
104
|
+
- MIT
|
105
|
+
metadata: {}
|
106
|
+
post_install_message:
|
107
|
+
rdoc_options: []
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ! '>='
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ! '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
requirements: []
|
121
|
+
rubyforge_project:
|
122
|
+
rubygems_version: 2.2.2
|
123
|
+
signing_key:
|
124
|
+
specification_version: 4
|
125
|
+
summary: Ruby web app generator
|
126
|
+
test_files: []
|