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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/swag.rb +38 -21
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00af4994579ef5e61f3485ed55f890270b620661
4
- data.tar.gz: 1c7d31d04200e6c2126dc4381a9c44333ae90a35
3
+ metadata.gz: 0efdb17a69f9969dcc295e5dc662e861ac884ae5
4
+ data.tar.gz: ca9f3d4b899adb812cee8adff393eb9a9c4b0fe5
5
5
  SHA512:
6
- metadata.gz: a9fb33d46f59b8a226a83ae56a3e55ad337ec291451740d440078e252805aaf6dc8fee3efbaaa18dbf9fadc6f5cd55cdb884da9e913f859460de2018607d84a4
7
- data.tar.gz: eaa962055f7a0a2d6085f1bccad182806b2e9a0d281fc3127e4e630fbc9daad947263f88add4f317b18b35c08753cee117107320af8a7441539a2ff20e68d546
6
+ metadata.gz: de1ee296f49aeaab20d0567a9461aeb3e4c612cee2d124567d9589c8949bd58803a7df01e1df2776c8d1ef7c66ab7e4b5f463f5338ebc3b48214a09b5aa32e45
7
+ data.tar.gz: cbd21ededc10041c65684f4121897c1e893860552141fa1c69ecb598154ac352af13dc3a8d81ede7d958321bac4a2d2dddbbb3ddf24a8ac2a57dc277335e5c0d
data/lib/swag.rb CHANGED
@@ -1,25 +1,42 @@
1
1
  class Swag
2
- def self.hi
3
- puts "Swag, world."
4
- end
2
+ def initialize
3
+ end
4
+ def self.hi
5
+ puts "Swag, world."
6
+ end
5
7
 
6
- def self.check
7
- puts "Checking your directory: #{Dir.pwd}"
8
- if File.exist?("bin/rails")
9
- puts "Rails App detected. Proceeding."
10
- else
11
- puts "You must be in a Rails root directory for Swag to work."
12
- abort
13
- end
14
- end
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
- def self.checkControllers
17
- puts "Checking controllers."
18
- begin
19
- Dir.foreach("app/controllers") {|x| puts "Found #{x}"}
20
-
21
- rescue Exception
22
- puts "Error while looking for controllers."
23
- end
24
- end
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.8
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-03 00:00:00.000000000 Z
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