swag 0.0.0.8 → 0.0.0.9
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/lib/swag.rb +38 -21
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0efdb17a69f9969dcc295e5dc662e861ac884ae5
|
|
4
|
+
data.tar.gz: ca9f3d4b899adb812cee8adff393eb9a9c4b0fe5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de1ee296f49aeaab20d0567a9461aeb3e4c612cee2d124567d9589c8949bd58803a7df01e1df2776c8d1ef7c66ab7e4b5f463f5338ebc3b48214a09b5aa32e45
|
|
7
|
+
data.tar.gz: cbd21ededc10041c65684f4121897c1e893860552141fa1c69ecb598154ac352af13dc3a8d81ede7d958321bac4a2d2dddbbb3ddf24a8ac2a57dc277335e5c0d
|
data/lib/swag.rb
CHANGED
|
@@ -1,25 +1,42 @@
|
|
|
1
1
|
class Swag
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
def initialize
|
|
3
|
+
end
|
|
4
|
+
def self.hi
|
|
5
|
+
puts "Swag, world."
|
|
6
|
+
end
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
def self.check
|
|
9
|
+
puts "Checking your directory: #{Dir.pwd}"
|
|
10
|
+
if File.exist?("bin/rails")
|
|
11
|
+
puts "Rails App detected. Proceeding."
|
|
12
|
+
else
|
|
13
|
+
puts "You must be in a Rails root directory for Swag to work. Aborting."
|
|
14
|
+
abort
|
|
15
|
+
end
|
|
16
|
+
end
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
def self.checkControllers
|
|
19
|
+
puts "Checking controllers."
|
|
20
|
+
begin
|
|
21
|
+
Dir.foreach("app/controllers") do |c|
|
|
22
|
+
puts "Found #{c}"
|
|
23
|
+
end
|
|
24
|
+
rescue => ex
|
|
25
|
+
puts "Error while reading controllers."
|
|
26
|
+
puts ex.inspect
|
|
27
|
+
puts ex.backtrace
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.writePaths
|
|
32
|
+
puts "Writing paths."
|
|
33
|
+
begin
|
|
34
|
+
@controllerArray = self.readControllers
|
|
35
|
+
doc = open(doc.yml, 'w')
|
|
36
|
+
doc.truncate(0)
|
|
37
|
+
doc.write("info: Generated with Swag.\n")
|
|
38
|
+
doc.write("paths:\n")
|
|
39
|
+
@controllerArray.each {|c| doc.write("-#{c}\n")}
|
|
40
|
+
end
|
|
41
|
+
end
|
|
25
42
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: swag
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.0.
|
|
4
|
+
version: 0.0.0.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ethan Miller
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-08-
|
|
11
|
+
date: 2015-08-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: |-
|
|
14
14
|
A gem with which to generate YAML from a Rails app. Currently
|