api_me 0.3.6 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/api_me.gemspec +1 -1
- data/lib/api_me/version.rb +1 -1
- data/lib/generators/api_me/controller/controller_generator.rb +27 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0658898c8db26ece5dcf4eba4465c41a4c944007
|
4
|
+
data.tar.gz: 1ac19dc633b67d85039621edee0c9afc06e0f76c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9011c9ca170a159c3802421d85662be738038e32337655ef74a412ddacd48dc12727cff413db45217c8fbb4294493e34ba2728b3d2148a3bfb572fb3f6a66195
|
7
|
+
data.tar.gz: 5bf8be52281acd86adc7a8316893e2a55b543ca6b22d46bc6e79be11ad8a1d5854142a668515963fa93ef037a3074342f65f91ee5aa75f6553b24977d0011453
|
data/api_me.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
s.add_runtime_dependency 'activerecord', '>= 3.2.0'
|
22
22
|
s.add_runtime_dependency 'activesupport', '>= 3.2.0'
|
23
|
-
s.add_runtime_dependency 'pundit', '~> 0
|
23
|
+
s.add_runtime_dependency 'pundit', '~> 1.0'
|
24
24
|
s.add_runtime_dependency 'active_model_serializers', '~> 0.8.0'
|
25
25
|
s.add_runtime_dependency 'search_object', '~> 1.0'
|
26
26
|
|
data/lib/api_me/version.rb
CHANGED
@@ -13,6 +13,7 @@ module ApiMe
|
|
13
13
|
controllers_namespace,
|
14
14
|
controllers_api_version,
|
15
15
|
"#{plural_name}_controller.rb")
|
16
|
+
insert_after_version(plural_name)
|
16
17
|
end
|
17
18
|
|
18
19
|
def controllers_namespace
|
@@ -67,7 +68,32 @@ module ApiMe
|
|
67
68
|
end
|
68
69
|
end
|
69
70
|
|
70
|
-
|
71
|
+
private
|
72
|
+
|
73
|
+
def insert_after_version(resource_name)
|
74
|
+
maybe_create_api_v1_namespace
|
75
|
+
|
76
|
+
in_root do
|
77
|
+
insert_into_file(
|
78
|
+
'config/routes.rb',
|
79
|
+
" resources :#{resource_name}\n",
|
80
|
+
after: "namespace :#{controllers_api_version} do\n"
|
81
|
+
)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def maybe_create_api_v1_namespace
|
86
|
+
in_root do
|
87
|
+
unless File.readlines('config/routes.rb').grep("namespace #{controllers_namespace} do")
|
88
|
+
route <<-ROUTE
|
89
|
+
namespace :#{controllers_namespace} do
|
90
|
+
namespace :#{controllers_api_version} do
|
91
|
+
end
|
92
|
+
end
|
93
|
+
ROUTE
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
71
97
|
end
|
72
98
|
end
|
73
99
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_me
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Clopton
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '0
|
48
|
+
version: '1.0'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '0
|
55
|
+
version: '1.0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: active_model_serializers
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
233
|
rubyforge_project:
|
234
|
-
rubygems_version: 2.
|
234
|
+
rubygems_version: 2.4.6
|
235
235
|
signing_key:
|
236
236
|
specification_version: 4
|
237
237
|
summary: Api Me
|