apiql 0.1.0 → 0.1.1
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/README.md +24 -2
- data/apiql.gemspec +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bbded1678a2f87e16c36aba467e427750d595d7da6f5ee7a99c3a282a495748
|
4
|
+
data.tar.gz: 4da0fc38f413a99f3205087430425b8df6517eff28e9675668aca488d90494a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5201be091148a26ec08de7092a0852c806dc44bfdab3f51cbdbd0789df5189e47483fe678260778371808836c6b4e2e4c4c16955ae113cb76cbd1e0befca57ba
|
7
|
+
data.tar.gz: d81b99f5b248df08eb685215bff5d2bd38211b36ab8006616c4c5ab21c3f52a5b876161167cd846b92e8322b1ee020a3bb01a6b9f8c4ab745e8002853b7ba8bc
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ class UserAPIQL < ::APIQL
|
|
9
9
|
def me
|
10
10
|
authorize! :show, ::User
|
11
11
|
|
12
|
-
context.current_user
|
12
|
+
context.current_user
|
13
13
|
end
|
14
14
|
|
15
15
|
def authenticate(email, password)
|
@@ -58,7 +58,7 @@ end
|
|
58
58
|
```
|
59
59
|
# JS:
|
60
60
|
|
61
|
-
application.js:
|
61
|
+
assets/javascripts/application.js:
|
62
62
|
|
63
63
|
```javascript
|
64
64
|
APIQL.endpoint = "/"
|
@@ -94,3 +94,25 @@ logout() {
|
|
94
94
|
}
|
95
95
|
|
96
96
|
```
|
97
|
+
|
98
|
+
You can use initializer like this for authorization using cancancan gem:
|
99
|
+
|
100
|
+
config/initializers/apiql.rb:
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
class APIQL
|
104
|
+
delegate :authorize!, to: :context
|
105
|
+
|
106
|
+
class Context
|
107
|
+
def authorize!(*args)
|
108
|
+
ability.authorize!(*args)
|
109
|
+
end
|
110
|
+
|
111
|
+
private
|
112
|
+
|
113
|
+
def ability
|
114
|
+
@ability ||= ::Ability::Factory.build_ability_for(current_user)
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
```
|
data/apiql.gemspec
CHANGED
@@ -4,12 +4,12 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'apiql'
|
7
|
-
spec.version = '0.1.
|
7
|
+
spec.version = '0.1.1'
|
8
8
|
spec.authors = ['Dmitry Silchenko']
|
9
9
|
spec.email = ['dmitry@desofto.com']
|
10
10
|
|
11
|
-
spec.summary = '
|
12
|
-
spec.description = '
|
11
|
+
spec.summary = 'Implementation of the API language similar to GraphQL for Ruby on Rails'
|
12
|
+
spec.description = 'Implementation of the API language similar to GraphQL for Ruby on Rails'
|
13
13
|
spec.homepage = 'https://github.com/desofto/apiql'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
@@ -21,4 +21,4 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_development_dependency 'bundler', '~> 1.11'
|
22
22
|
spec.add_development_dependency 'rake', '~> 11.0'
|
23
23
|
spec.add_development_dependency 'pry', '~> 0.10'
|
24
|
-
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apiql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Silchenko
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.10'
|
55
|
-
description:
|
55
|
+
description: Implementation of the API language similar to GraphQL for Ruby on Rails
|
56
56
|
email:
|
57
57
|
- dmitry@desofto.com
|
58
58
|
executables: []
|
@@ -87,5 +87,5 @@ rubyforge_project:
|
|
87
87
|
rubygems_version: 2.7.6
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
|
-
summary:
|
90
|
+
summary: Implementation of the API language similar to GraphQL for Ruby on Rails
|
91
91
|
test_files: []
|