matrack 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +2 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.rubocop.yml +237 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +73 -0
- data/Rakefile +6 -0
- data/bin/matrack +7 -0
- data/bin/setup +7 -0
- data/circle.yml +6 -0
- data/generators/generate/Gemfile +3 -0
- data/generators/generate/README.md +20 -0
- data/generators/generate/application.html.erb +18 -0
- data/generators/generate/application.rb +19 -0
- data/generators/generate/application_controller.rb +3 -0
- data/generators/generate/config.ru +12 -0
- data/generators/generate/invalid.html.erb +24 -0
- data/generators/generate/routes.rb +11 -0
- data/generators/generator.rb +78 -0
- data/generators/generator_base.rb +14 -0
- data/generators/mvc_gen.rb +57 -0
- data/index.html +604 -0
- data/lib/matrack.rb +32 -0
- data/lib/matrack/base_controller.rb +63 -0
- data/lib/matrack/dependencies.rb +6 -0
- data/lib/matrack/helper_tags.rb +59 -0
- data/lib/matrack/route.rb +15 -0
- data/lib/matrack/router.rb +42 -0
- data/lib/matrack/session.rb +21 -0
- data/lib/matrack/utility.rb +33 -0
- data/lib/matrack/version.rb +3 -0
- data/lib/orm/base_model.rb +57 -0
- data/lib/orm/data_manager.rb +57 -0
- data/lib/orm/data_utility.rb +33 -0
- data/lib/orm/fetch_queries.rb +53 -0
- data/lib/orm/queries.rb +47 -0
- data/lib/resources.rb +16 -0
- data/matrack.gemspec +43 -0
- metadata +268 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ddd38bfc1ccbea3174dcbbf9a2587593d3f56a56
|
4
|
+
data.tar.gz: 20c83d5c76640cf074fdbe2a19a1e40b726e7701
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bb1d761949b07f7ea0b70747d0dcb4d3a82f0b0c9f253e7b9e45d500a6cab6ccf24ced56078e14fbe024a0a3fdd42560ee064e559b5fe2def34d881b28279c09
|
7
|
+
data.tar.gz: 9e4c0557b28f3c9f5b2c71d038ee2b1f7a823f8dbbe0f86a0d0ef360131cfb54de25068af45a3665edeb5a9e9fadb95ae3a7b1f18393e1c32ab6fd55188a584b
|
data/.codeclimate.yml
ADDED
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,237 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- "spec/spec_helper.rb"
|
4
|
+
- "Gemfile"
|
5
|
+
- "Gemfile.lock"
|
6
|
+
- "Rakefile"
|
7
|
+
- "matrack.gemspec"
|
8
|
+
|
9
|
+
UseCache: false
|
10
|
+
Style/CollectionMethods:
|
11
|
+
Description: Preferred collection methods.
|
12
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
13
|
+
Enabled: true
|
14
|
+
PreferredMethods:
|
15
|
+
collect: map
|
16
|
+
collect!: map!
|
17
|
+
find: detect
|
18
|
+
find_all: select
|
19
|
+
reduce: inject
|
20
|
+
Style/DotPosition:
|
21
|
+
Description: Checks the position of the dot in multi-line method calls.
|
22
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
23
|
+
Enabled: true
|
24
|
+
EnforcedStyle: trailing
|
25
|
+
SupportedStyles:
|
26
|
+
- leading
|
27
|
+
- trailing
|
28
|
+
Style/FileName:
|
29
|
+
Description: Use snake_case for source file names.
|
30
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
31
|
+
Enabled: false
|
32
|
+
Exclude: []
|
33
|
+
Style/GuardClause:
|
34
|
+
Description: Check for conditionals that can be replaced with guard clauses
|
35
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
36
|
+
Enabled: false
|
37
|
+
MinBodyLength: 1
|
38
|
+
Style/IfUnlessModifier:
|
39
|
+
Description: Favor modifier if/unless usage when you have a single-line body.
|
40
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
41
|
+
Enabled: false
|
42
|
+
MaxLineLength: 80
|
43
|
+
Style/OptionHash:
|
44
|
+
Description: Don't use option hashes when you can use keyword arguments.
|
45
|
+
Enabled: false
|
46
|
+
Style/PercentLiteralDelimiters:
|
47
|
+
Description: Use `%`-literal delimiters consistently
|
48
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
49
|
+
Enabled: false
|
50
|
+
PreferredDelimiters:
|
51
|
+
"%": "()"
|
52
|
+
"%i": "()"
|
53
|
+
"%q": "()"
|
54
|
+
"%Q": "()"
|
55
|
+
"%r": "{}"
|
56
|
+
"%s": "()"
|
57
|
+
"%w": "()"
|
58
|
+
"%W": "()"
|
59
|
+
"%x": "()"
|
60
|
+
Style/PredicateName:
|
61
|
+
Description: Check the names of predicate methods.
|
62
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
63
|
+
Enabled: true
|
64
|
+
NamePrefix:
|
65
|
+
- is_
|
66
|
+
- has_
|
67
|
+
- have_
|
68
|
+
NamePrefixBlacklist:
|
69
|
+
- is_
|
70
|
+
Exclude:
|
71
|
+
- spec/**/*
|
72
|
+
Style/RaiseArgs:
|
73
|
+
Description: Checks the arguments passed to raise/fail.
|
74
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
75
|
+
Enabled: false
|
76
|
+
EnforcedStyle: exploded
|
77
|
+
SupportedStyles:
|
78
|
+
- compact
|
79
|
+
- exploded
|
80
|
+
Style/SignalException:
|
81
|
+
Description: Checks for proper usage of fail and raise.
|
82
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
83
|
+
Enabled: false
|
84
|
+
EnforcedStyle: semantic
|
85
|
+
SupportedStyles:
|
86
|
+
- only_raise
|
87
|
+
- only_fail
|
88
|
+
- semantic
|
89
|
+
Style/SingleLineBlockParams:
|
90
|
+
Description: Enforces the names of some block params.
|
91
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
|
92
|
+
Enabled: false
|
93
|
+
Methods:
|
94
|
+
- reduce:
|
95
|
+
- a
|
96
|
+
- e
|
97
|
+
- inject:
|
98
|
+
- a
|
99
|
+
- e
|
100
|
+
Style/SingleLineMethods:
|
101
|
+
Description: Avoid single-line methods.
|
102
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
103
|
+
Enabled: false
|
104
|
+
AllowIfMethodIsEmpty: true
|
105
|
+
Style/StringLiterals:
|
106
|
+
Description: Checks if uses of quotes match the configured preference.
|
107
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
108
|
+
Enabled: true
|
109
|
+
EnforcedStyle: double_quotes
|
110
|
+
SupportedStyles:
|
111
|
+
- single_quotes
|
112
|
+
- double_quotes
|
113
|
+
Style/StringLiteralsInInterpolation:
|
114
|
+
Description: Checks if uses of quotes inside expressions in interpolated strings
|
115
|
+
match the configured preference.
|
116
|
+
Enabled: true
|
117
|
+
EnforcedStyle: single_quotes
|
118
|
+
SupportedStyles:
|
119
|
+
- single_quotes
|
120
|
+
- double_quotes
|
121
|
+
Style/TrailingComma:
|
122
|
+
Description: Checks for trailing comma in parameter lists and literals.
|
123
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
|
124
|
+
Enabled: false
|
125
|
+
EnforcedStyleForMultiline: no_comma
|
126
|
+
SupportedStyles:
|
127
|
+
- comma
|
128
|
+
- no_comma
|
129
|
+
Metrics/AbcSize:
|
130
|
+
Description: A calculated magnitude based on number of assignments, branches, and
|
131
|
+
conditions.
|
132
|
+
Enabled: false
|
133
|
+
Max: 15
|
134
|
+
Metrics/ClassLength:
|
135
|
+
Description: Avoid classes longer than 100 lines of code.
|
136
|
+
Enabled: false
|
137
|
+
CountComments: false
|
138
|
+
Max: 100
|
139
|
+
Metrics/ModuleLength:
|
140
|
+
CountComments: false
|
141
|
+
Max: 100
|
142
|
+
Description: Avoid modules longer than 100 lines of code.
|
143
|
+
Enabled: false
|
144
|
+
Metrics/CyclomaticComplexity:
|
145
|
+
Description: A complexity metric that is strongly correlated to the number of test
|
146
|
+
cases needed to validate a method.
|
147
|
+
Enabled: false
|
148
|
+
Max: 6
|
149
|
+
Metrics/MethodLength:
|
150
|
+
Description: Avoid methods longer than 10 lines of code.
|
151
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
152
|
+
Enabled: false
|
153
|
+
CountComments: false
|
154
|
+
Max: 10
|
155
|
+
Metrics/ParameterLists:
|
156
|
+
Description: Avoid parameter lists longer than three or four parameters.
|
157
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
158
|
+
Enabled: false
|
159
|
+
Max: 5
|
160
|
+
CountKeywordArgs: true
|
161
|
+
Metrics/PerceivedComplexity:
|
162
|
+
Description: A complexity metric geared towards measuring complexity for a human
|
163
|
+
reader.
|
164
|
+
Enabled: false
|
165
|
+
Max: 7
|
166
|
+
Lint/AssignmentInCondition:
|
167
|
+
Description: Don't use assignment in conditions.
|
168
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
169
|
+
Enabled: false
|
170
|
+
AllowSafeAssignment: true
|
171
|
+
Style/InlineComment:
|
172
|
+
Description: Avoid inline comments.
|
173
|
+
Enabled: false
|
174
|
+
Style/AccessorMethodName:
|
175
|
+
Description: Check the naming of accessor methods for get_/set_.
|
176
|
+
Enabled: false
|
177
|
+
Style/Alias:
|
178
|
+
Description: Use alias_method instead of alias.
|
179
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
180
|
+
Enabled: false
|
181
|
+
Style/Documentation:
|
182
|
+
Description: Document classes and non-namespace modules.
|
183
|
+
Enabled: false
|
184
|
+
Style/DoubleNegation:
|
185
|
+
Description: Checks for uses of double negation (!!).
|
186
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
|
187
|
+
Enabled: false
|
188
|
+
Style/EachWithObject:
|
189
|
+
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
190
|
+
Enabled: false
|
191
|
+
Style/EmptyLiteral:
|
192
|
+
Description: Prefer literals to Array.new/Hash.new/String.new.
|
193
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
194
|
+
Enabled: false
|
195
|
+
Style/ModuleFunction:
|
196
|
+
Description: Checks for usage of `extend self` in modules.
|
197
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
198
|
+
Enabled: false
|
199
|
+
Style/OneLineConditional:
|
200
|
+
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
201
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
202
|
+
Enabled: false
|
203
|
+
Style/PerlBackrefs:
|
204
|
+
Description: Avoid Perl-style regex back references.
|
205
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
206
|
+
Enabled: false
|
207
|
+
Style/Send:
|
208
|
+
Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
|
209
|
+
may overlap with existing methods.
|
210
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
|
211
|
+
Enabled: false
|
212
|
+
Style/SpecialGlobalVars:
|
213
|
+
Description: Avoid Perl-style global variables.
|
214
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
215
|
+
Enabled: false
|
216
|
+
Style/VariableInterpolation:
|
217
|
+
Description: Don't interpolate global, instance and class variables directly in
|
218
|
+
strings.
|
219
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
|
220
|
+
Enabled: false
|
221
|
+
Style/WhenThen:
|
222
|
+
Description: Use when x then ... for one-line cases.
|
223
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
224
|
+
Enabled: false
|
225
|
+
Lint/EachWithObjectArgument:
|
226
|
+
Description: Check for immutable argument given to each_with_object.
|
227
|
+
Enabled: true
|
228
|
+
Lint/HandleExceptions:
|
229
|
+
Description: Don't suppress exception.
|
230
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
231
|
+
Enabled: false
|
232
|
+
Lint/LiteralInCondition:
|
233
|
+
Description: Checks of literals used in conditions.
|
234
|
+
Enabled: false
|
235
|
+
Lint/LiteralInInterpolation:
|
236
|
+
Description: Checks for literals used in interpolation.
|
237
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Olaide Ojewale
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Matrack
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
Matrack is a MVC ruby mini-framework, that is modelled after rails. Matrack takes majority of its inspiration from rails but it is not by any means as complex or robust as rails.
|
6
|
+
|
7
|
+
However, matrack is a good fit for simple applications. It makes available some of the great features of rails.
|
8
|
+
|
9
|
+
|
10
|
+
## Version
|
11
|
+
|
12
|
+
This is version 0.1.0 of matrack gem.
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
Add this line to your application's Gemfile:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
gem "matrack", "0.1.0"
|
20
|
+
```
|
21
|
+
|
22
|
+
And then execute:
|
23
|
+
|
24
|
+
$ bundle
|
25
|
+
|
26
|
+
Or install it yourself as:
|
27
|
+
|
28
|
+
$ gem install matrack
|
29
|
+
|
30
|
+
|
31
|
+
## Features
|
32
|
+
* Auto genration of necessary directories and files.
|
33
|
+
* Helpers.
|
34
|
+
* Generation of controllers and corresponding views from commandline line.
|
35
|
+
* Generation of models from commandline line.
|
36
|
+
* ORM
|
37
|
+
* Use of sessions
|
38
|
+
* Testing
|
39
|
+
* Custom model properties types e.g int, str, time and date.
|
40
|
+
* Starting server with the "s" or "server" keyword.
|
41
|
+
|
42
|
+
## Limitations
|
43
|
+
This version of the gem does not
|
44
|
+
* support model relationships.
|
45
|
+
* implement callbacks.
|
46
|
+
* support migration generation.
|
47
|
+
* generate a schema.
|
48
|
+
|
49
|
+
## Usage
|
50
|
+
|
51
|
+
Usage information can be found [here](https://github.com/andela-oojewale/matrack/wiki/Matrack).
|
52
|
+
|
53
|
+
## Development
|
54
|
+
|
55
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
56
|
+
|
57
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
58
|
+
|
59
|
+
## Contributing
|
60
|
+
|
61
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/andela-oojewale/matrack.
|
62
|
+
|
63
|
+
* Fork it ( https://github.com/andela-oojewale/matrack/fork)
|
64
|
+
* Create your feature branch (git checkout -b my-new-feature)
|
65
|
+
* Commit your changes (git commit -am 'Add some feature')
|
66
|
+
* Push to the branch (git push origin my-new-feature)
|
67
|
+
* Create a new Pull Request
|
68
|
+
|
69
|
+
|
70
|
+
## License
|
71
|
+
|
72
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
73
|
+
|
data/Rakefile
ADDED
data/bin/matrack
ADDED
data/bin/setup
ADDED
data/circle.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# My New App
|
2
|
+
|
3
|
+
Welcome to your new application built with matrack framework.
|
4
|
+
|
5
|
+
This README would normally document whatever steps are necessary to get the
|
6
|
+
application up and running.
|
7
|
+
|
8
|
+
Things you may want to cover:
|
9
|
+
|
10
|
+
* Ruby version
|
11
|
+
|
12
|
+
* System dependencies
|
13
|
+
|
14
|
+
* Configuration
|
15
|
+
|
16
|
+
* Database creation
|
17
|
+
|
18
|
+
* Database initialization
|
19
|
+
|
20
|
+
* How to run the test suite
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<head>
|
3
|
+
<meta charset= "UTF-8">
|
4
|
+
<title><%= title %></title>
|
5
|
+
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
6
|
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
|
7
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.4/css/materialize.min.css">
|
8
|
+
<%= include_stylesheet("application")%>
|
9
|
+
<%= display_favicon %>
|
10
|
+
<%= include_javascript("application")%>
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
|
15
|
+
<%= yield %>
|
16
|
+
|
17
|
+
</body>
|
18
|
+
</html>
|