api_scaffold 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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f457af2521d265949c3121cd7f36ff820c9395667bf0016c87b3eaf279a01b9
|
|
4
|
+
data.tar.gz: 0ca9d6d85026dffe2cffc8d88b9c6a5622e4d1c3fb90f123a934bbc0cca9a4b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8da7da2d33b04d3c20b9baf7fea21dc5b1de996af11cc59466861c41543b3b7e9dfe5d511237f0a4d90f19b16e702fa399928da80165b38d4e2228125a9335a3
|
|
7
|
+
data.tar.gz: da0656791b4a4f41dfcae15ce1292458e76d25a49304220523226259a0560cec847ab655fcd92ddeb7a6ed46748b0f1937bc3b17c930f78e051829d0e4a2b8bd
|
data/lib/api_scaffold/version.rb
CHANGED
|
@@ -38,12 +38,12 @@ module ApiScaffold
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def add_routes
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
# Include tabs and line break for proper formatting
|
|
42
|
+
routes_string = " resources :#{controller_name}\n"
|
|
43
|
+
# Inject into file following the api scope and v1 namespace
|
|
44
|
+
inject_into_file 'config/routes.rb', after: " scope :api, defaults: { format: :json } do\n namespace :#{prefix} do\n" do
|
|
45
|
+
routes_string
|
|
46
|
+
end
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def create_serializer_files
|