sinatra-drumkit 0.1.0 → 0.2.0
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 +4 -4
- data/lib/sinatra/drumkit.rb +9 -2
- data/lib/sinatra/drumkit/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34212bbbbfe2445469d95e9cb35ec4ec0723e734
|
4
|
+
data.tar.gz: a473262be90e22cd8864f70f027f614887a0e471
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d9e7a6b6148877be3c5a3ec8712e2cb64195fa8da6d0070f22e5feb3bb25fc7c3bb57a7b2395611136575fdae0e1d435d0ac3829a480a9d2f3d0c9000bb1ac8
|
7
|
+
data.tar.gz: cbfdbfeadeb05a6c1f8e0cc41fa2429bd67c93fa1dd21945954fe5826cb259d3a1df16cff93ed2ca99d27bc9b08e070d61e4b743823b603b6207eb3a720378d0
|
data/lib/sinatra/drumkit.rb
CHANGED
@@ -25,7 +25,14 @@ module Sinatra
|
|
25
25
|
:const_missing, lambda { |const|
|
26
26
|
@searched ||= {}
|
27
27
|
raise "Class not found: #{const}" if @searched[const]
|
28
|
-
|
28
|
+
filename = const.to_s
|
29
|
+
.gsub('::', '/')
|
30
|
+
.gsub(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
|
31
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
32
|
+
.downcase
|
33
|
+
filepath = File.join(load_dir, "#{filename}.rb")
|
34
|
+
raise("Class file \"#{filepath}\" for #{const}") unless File.readable?(filepath)
|
35
|
+
require filepath
|
29
36
|
@searched[const] = true
|
30
37
|
const_get(const) || raise("Class not found: #{const}")
|
31
38
|
}
|
@@ -34,7 +41,7 @@ module Sinatra
|
|
34
41
|
end
|
35
42
|
|
36
43
|
def load_controllers(load_dir)
|
37
|
-
Dir[::File.join(load_dir, '
|
44
|
+
Dir[::File.join(load_dir, '**/*.rb')].each do |file|
|
38
45
|
instance_eval(File.read(file), file)
|
39
46
|
end
|
40
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-drumkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zachary Elliott
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.5.1
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: Provide clean MVC autoloading for sinatra
|