upframework 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +37 -3
- data/app/searches/upframework/base_search.rb +9 -0
- data/lib/upframework/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d88db49c9f1f7137b98b936cf13792218150eb0cb61c6278ff11fee45f9c8c05
|
4
|
+
data.tar.gz: 5263d90be331e0459b6f3e735052758a539b2a9466987765041df221b8cb572a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 801d5101e0aadd229c9c698dc43dd9850d896fb244274a388d3bcb5df3596a2d83ce3a08ab0645eb4d154d487bdfa8629d63332d4cbf17245c8b1aa1b8eed439
|
7
|
+
data.tar.gz: f21de820db493c15daea315e7fff83439ec5c286da810b22860e6b981e45417c45ea08c201cccc53fb45ac319212c652f6ce77c02ee0bfa1601a58b0fa974d63
|
data/README.md
CHANGED
@@ -1,8 +1,42 @@
|
|
1
1
|
# Upframework
|
2
|
-
|
2
|
+
Add features on top of Rails, Especially for APIs. This was created to make structural code reusable to other projects (not solving the same problem all over again). And to make the main application less bloated and only contain domain specific code as much as possible.
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
#### The following features are available.
|
5
|
+
- Creates (create, read, update, destroy) action methods for resources.
|
6
|
+
- Has render helpers for API or socket responses. ex. Converting models to its designated serializer.
|
7
|
+
- Converts snake case request params (from js standard) to underscore params (ruby standard)
|
8
|
+
- Searches layer under app/searches. Usually used for form searches.
|
9
|
+
- Services layer under app/services. For single responsibility domain-specific logic code.
|
10
|
+
- Exception notifier and API error response handler.
|
11
|
+
|
12
|
+
## Basic Usage
|
13
|
+
####Controllers
|
14
|
+
```ruby
|
15
|
+
#app/controllers
|
16
|
+
class ProjectsController < Upframework::ResourcesController
|
17
|
+
end
|
18
|
+
```
|
19
|
+
|
20
|
+
####Searches
|
21
|
+
```ruby
|
22
|
+
#app/searches
|
23
|
+
class ProjectSearch < Upframework::BaseSearch
|
24
|
+
end
|
25
|
+
```
|
26
|
+
|
27
|
+
####Services
|
28
|
+
```ruby
|
29
|
+
#app/services
|
30
|
+
class Project::SubmitService < Upframework::BaseService
|
31
|
+
end
|
32
|
+
```
|
33
|
+
|
34
|
+
####Routes
|
35
|
+
app/services
|
36
|
+
```ruby
|
37
|
+
#config/routes
|
38
|
+
mount Upframework::Engine => /path
|
39
|
+
```
|
6
40
|
|
7
41
|
## Installation
|
8
42
|
Add this line to your application's Gemfile:
|
@@ -20,4 +20,13 @@ class Upframework::BaseSearch < Upframework::BaseService
|
|
20
20
|
def present_value?(field)
|
21
21
|
instance_variable_get("@#{field}").present?
|
22
22
|
end
|
23
|
+
|
24
|
+
module ExecuteWrapper
|
25
|
+
def execute
|
26
|
+
super
|
27
|
+
paginate_scope
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
include ExecuteWrapper
|
23
32
|
end
|
data/lib/upframework/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upframework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jude_cali
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|