yodatra 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -0
- data/LICENSE +9 -0
- data/README +6 -0
- data/lib/yodatra/base.rb +17 -0
- data/lib/yodatra/boot.rb +35 -0
- data/lib/yodatra/initializers.rb +20 -0
- data/lib/yodatra/version.rb +3 -0
- data/lib/yodatra.rb +1 -0
- data/yodatra.gemspec +21 -0
- metadata +155 -0
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 Paul B. (github.com/popox)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README
ADDED
data/lib/yodatra/base.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'sinatra/base'
|
2
|
+
require 'sinatra/reloader'
|
3
|
+
|
4
|
+
require File.expand_path '../boot', __FILE__
|
5
|
+
require File.expand_path '../initializers', __FILE__
|
6
|
+
|
7
|
+
|
8
|
+
module Yodatra
|
9
|
+
class Base < Sinatra::Base
|
10
|
+
configure :development do
|
11
|
+
register Sinatra::Reloader
|
12
|
+
end
|
13
|
+
|
14
|
+
register Yodatra::Boot
|
15
|
+
register Yodatra::Initializers
|
16
|
+
end
|
17
|
+
end
|
data/lib/yodatra/boot.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'sinatra/activerecord'
|
2
|
+
|
3
|
+
module Yodatra
|
4
|
+
class Base < Sinatra::Base
|
5
|
+
set(:booted, false)
|
6
|
+
set(:booting, true)
|
7
|
+
set(:models_directory, 'app/models')
|
8
|
+
set(:controllers_directory, 'app/controllers')
|
9
|
+
end
|
10
|
+
|
11
|
+
module Boot
|
12
|
+
def booting= done
|
13
|
+
super
|
14
|
+
register Yodatra::Boot
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.registered app
|
18
|
+
raise "Check it out O'man! You're trying to boot the app [#{app}] which is already booted!" if app.booted
|
19
|
+
if app.booting
|
20
|
+
# ActiveRecord
|
21
|
+
app.register Sinatra::ActiveRecordExtension
|
22
|
+
# Models
|
23
|
+
Dir["#{app.models_directory}/**/*.rb"].sort.each do |file_path|
|
24
|
+
require File.expand_path file_path
|
25
|
+
end
|
26
|
+
# Controllers
|
27
|
+
Dir["#{app.controllers_directory}/**/*.rb"].sort.each do |file_path|
|
28
|
+
require File.expand_path file_path
|
29
|
+
end
|
30
|
+
app.set :booting, false
|
31
|
+
app.set :booted, true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'sinatra/base'
|
2
|
+
|
3
|
+
module Yodatra
|
4
|
+
class Base < Sinatra::Base
|
5
|
+
set(:config_directory, "config/initializers")
|
6
|
+
end
|
7
|
+
|
8
|
+
module Initializers
|
9
|
+
def config_directory= path
|
10
|
+
super
|
11
|
+
register Yodatra::Initializers
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.registered app
|
15
|
+
Dir["#{app.config_directory}/**/*.rb"].sort.each do |file_path|
|
16
|
+
require File.expand_path file_path
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/yodatra.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'yodatra/base'
|
data/yodatra.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
2
|
+
require 'yodatra/version'
|
3
|
+
|
4
|
+
Gem::Specification.new 'yodatra', Yodatra::VERSION do |s|
|
5
|
+
s.description = "Yodatra is a minimalistic framework built on top of Sinatra."
|
6
|
+
s.summary = "Classy backend development with the speed of Sinatra and the power of ActiveRecord"
|
7
|
+
s.authors = ["Paul Bonaud"]
|
8
|
+
s.email = "paul+st@bonaud.fr"
|
9
|
+
s.homepage = "http://squareteam.github.io/yodatra"
|
10
|
+
s.license = 'MIT'
|
11
|
+
s.files = `git ls-files`.split("\n") - %w[.gitignore .travis.yml]
|
12
|
+
s.test_files = s.files.select { |p| p =~ /^spec\/.*_spec.rb/ }
|
13
|
+
s.extra_rdoc_files = s.files.select { |p| p =~ /^README/ } << 'LICENSE'
|
14
|
+
s.rdoc_options = %w[--line-numbers --inline-source --title Yodatra --main README.rdoc --encoding=UTF-8]
|
15
|
+
|
16
|
+
s.add_dependency 'rack', '~> 1.4'
|
17
|
+
s.add_dependency 'sinatra', '~> 1.4.4', '>= 1.4.4'
|
18
|
+
s.add_dependency 'sinatra-activerecord'
|
19
|
+
s.add_dependency 'sinatra-contrib', '~> 1.4.2', '>= 1.4.2'
|
20
|
+
s.add_dependency 'rack-protection', '~> 1.4'
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: yodatra
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Paul Bonaud
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-01-26 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rack
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.4'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.4'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: sinatra
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.4.4
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.4.4
|
41
|
+
type: :runtime
|
42
|
+
prerelease: false
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ~>
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 1.4.4
|
49
|
+
- - ! '>='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: 1.4.4
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: sinatra-activerecord
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
type: :runtime
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: sinatra-contrib
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.4.2
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 1.4.2
|
79
|
+
type: :runtime
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ~>
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 1.4.2
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.4.2
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: rack-protection
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
none: false
|
94
|
+
requirements:
|
95
|
+
- - ~>
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '1.4'
|
98
|
+
type: :runtime
|
99
|
+
prerelease: false
|
100
|
+
version_requirements: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ~>
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '1.4'
|
106
|
+
description: Yodatra is a minimalistic framework built on top of Sinatra.
|
107
|
+
email: paul+st@bonaud.fr
|
108
|
+
executables: []
|
109
|
+
extensions: []
|
110
|
+
extra_rdoc_files:
|
111
|
+
- README
|
112
|
+
- LICENSE
|
113
|
+
files:
|
114
|
+
- Gemfile
|
115
|
+
- LICENSE
|
116
|
+
- README
|
117
|
+
- lib/yodatra.rb
|
118
|
+
- lib/yodatra/base.rb
|
119
|
+
- lib/yodatra/boot.rb
|
120
|
+
- lib/yodatra/initializers.rb
|
121
|
+
- lib/yodatra/version.rb
|
122
|
+
- yodatra.gemspec
|
123
|
+
homepage: http://squareteam.github.io/yodatra
|
124
|
+
licenses:
|
125
|
+
- MIT
|
126
|
+
post_install_message:
|
127
|
+
rdoc_options:
|
128
|
+
- --line-numbers
|
129
|
+
- --inline-source
|
130
|
+
- --title
|
131
|
+
- Yodatra
|
132
|
+
- --main
|
133
|
+
- README.rdoc
|
134
|
+
- --encoding=UTF-8
|
135
|
+
require_paths:
|
136
|
+
- lib
|
137
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
|
+
none: false
|
145
|
+
requirements:
|
146
|
+
- - ! '>='
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
149
|
+
requirements: []
|
150
|
+
rubyforge_project:
|
151
|
+
rubygems_version: 1.8.25
|
152
|
+
signing_key:
|
153
|
+
specification_version: 3
|
154
|
+
summary: Classy backend development with the speed of Sinatra and the power of ActiveRecord
|
155
|
+
test_files: []
|