natural_resource 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4cc932341edaf95cc4c16bdaae6c5c38dc66b1e1
4
- data.tar.gz: 8c328befc1e46ded7a2b7d656277dac8eb3567e8
3
+ metadata.gz: c5402f5e6d02729166968634d49e080d16eb19a4
4
+ data.tar.gz: 03a9104d1886ce840291434a967a125291b7cd91
5
5
  SHA512:
6
- metadata.gz: 9228f8272aeda0d34a82e699669ea2572ae10392b0375bea5ef588ee1a930fa452584b238850d49102cb4c9c00d0c4b8d6cbfafada0e61cb2a8cb4527eb6f76b
7
- data.tar.gz: 4614e880b871eefab4d98330fb6a2bb9b0fd773aec95b96297750c7dd6e877b74c39b16d3201ac575be492f491d3263b7695e960a8ec3ee84aacc83e9d63cfc6
6
+ metadata.gz: 0cbd8de1d1824ed26feb61990e55684cc697bfb1a9f32ef743a22e7219a9f617e93690997a4f7f0eceaa21dbfd36c92542f9102fc8531a938b7c7abd48880b0f
7
+ data.tar.gz: 82f0cee11bb5133b4c74f3eec6b5d54f8b11c465373f305c35ecd222997560e5a4f2ff3c90c1ab9e63b0671fc96ecab9522949c2c379c359613703c1b928d61b
data/README.md CHANGED
@@ -4,7 +4,14 @@
4
4
 
5
5
  Natural Resource is a small but opinionated framework built ontop of some of our favourite gems. It is designed to speed up CRUD related activities whilst still maintaining sensible standards (e.g. Admin Panel, expandable principles for an API). It utilises [Pundit](https://github.com/elabs/pundit) for authorisation and [Ransack](https://github.com/activerecord-hackery/ransack) for searching and filtering.
6
6
 
7
- Sponsored by [Terracoding](http://terracoding.com)
7
+ Sponsored by [Terracoding](http://terracoding.com).
8
+
9
+ ## Why?
10
+
11
+ Our common use-case for Natural Resource is in any back-end/admin-style sections of a website. Rather than go for an out-the-box solution such as ActiveAdmin, where you have a good set of defaults but a non-rails extension pattern, we decided to speed up building a default rails-based solution, where extensions and additions are straightforward and easy to understand for anyone with basic rails understanding. The codebase is small and easy to build upon, whilst enforcing authorisation out-the-box.
12
+
13
+ We found the pattern straightforward and useful, and used the experience to help in building a standardised API using the same approach (with a couple of precondition extensions to pundit returning appropriate 412 HTTP responses). We may look to open-sourcing the API extensions soon too!
14
+
8
15
 
9
16
  # Getting Started
10
17
 
@@ -47,7 +47,9 @@ module NaturalResource
47
47
 
48
48
  private
49
49
 
50
- define_method :current_context do; end
50
+ unless instance_methods.include?(:current_context)
51
+ define_method :current_context do; end
52
+ end
51
53
 
52
54
  # Resource allocation methods
53
55
  define_method :query do
@@ -1,3 +1,3 @@
1
1
  module NaturalResource
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: natural_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert White
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-08 00:00:00.000000000 Z
11
+ date: 2016-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.10'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.10'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: sqlite3
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -153,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
167
  version: '0'
154
168
  requirements: []
155
169
  rubyforge_project:
156
- rubygems_version: 2.4.5.1
170
+ rubygems_version: 2.5.1
157
171
  signing_key:
158
172
  specification_version: 4
159
173
  summary: Small Rails Framework to speed up CRUD controllers