fern-api 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fern/api/version.rb +1 -1
- data/lib/fern/api.rb +12 -16
- data/lib/{fern_api.rb → fern-api.rb} +0 -0
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41fbd75c6e06e6f6ad81071060b134ee8d16376d
|
4
|
+
data.tar.gz: d8e4743dbed7572ec410e05df30868f398d5d843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3e59c0b2e98731a603799ad47f694caabedc7bf7be43d25475f3f0883c128eb7c2484321f7e1dca23dc9fc85c52d5574aa64787e53ff34421226903e825cee4
|
7
|
+
data.tar.gz: c5b566d13f292a7de52d20250fbb19c23ce467c75c79f5d7b53b5d6915d1008a94383a4fb5c72e312ca0a14be36a2b2495018bb3a36607af6141ec27a24798b8
|
data/lib/fern/api/version.rb
CHANGED
data/lib/fern/api.rb
CHANGED
@@ -2,28 +2,24 @@ require 'fern/api/endpoint'
|
|
2
2
|
|
3
3
|
module Fern
|
4
4
|
module Api
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
VERBS = %i[delete connect get head options patch post put trace].freeze
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
included do
|
10
|
+
class_eval { class_attribute :fern }
|
11
|
+
self.fern = {}
|
12
|
+
end
|
11
13
|
|
14
|
+
class_methods do
|
12
15
|
def endpoint(name, &block)
|
16
|
+
fern[name] = {}
|
13
17
|
Endpoint.new(self, name: name, &block)
|
14
18
|
end
|
15
19
|
|
16
|
-
|
17
|
-
if VERBS.include?(method_name)
|
18
|
-
endpoint(args[0], &block)
|
19
|
-
else
|
20
|
-
super
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def respond_to_missing?(method_name, include_private = false)
|
25
|
-
VERBS.include?(method_name) || super
|
26
|
-
end
|
20
|
+
VERBS.each { |verb| alias_method verb, :endpoint }
|
27
21
|
end
|
28
22
|
end
|
29
23
|
end
|
24
|
+
|
25
|
+
ActiveSupport.on_load(:action_controller) { include Fern::Api }
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fern-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Kestell
|
@@ -38,16 +38,44 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activesupport
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: actionpack
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5.0'
|
41
69
|
description: API DSL for Fern.
|
42
70
|
email: kyle@kestell.org
|
43
71
|
executables: []
|
44
72
|
extensions: []
|
45
73
|
extra_rdoc_files: []
|
46
74
|
files:
|
75
|
+
- lib/fern-api.rb
|
47
76
|
- lib/fern/api.rb
|
48
77
|
- lib/fern/api/endpoint.rb
|
49
78
|
- lib/fern/api/version.rb
|
50
|
-
- lib/fern_api.rb
|
51
79
|
homepage: https://github.com/kkestell/fern-api
|
52
80
|
licenses:
|
53
81
|
- MIT
|