swagger-docs 0.2.7 → 0.2.8

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
  SHA1:
3
- metadata.gz: 6967e0a36e6f1cc25402a43fda60f0bc05a20edc
4
- data.tar.gz: 5c29130f3e23ae163f11dd6d6493f18a173da361
3
+ metadata.gz: 8825dc5f25eba5d598ba46750cacffc9ef02323a
4
+ data.tar.gz: c5d933b4eff9eaeb938dfd60dd652b6a3c02dbe2
5
5
  SHA512:
6
- metadata.gz: 85b1277dab91eded46667469d7bc3fd95dee21001d995f08e0c410081fea39ea84cc35d97f06aeb6bb9dd1bb0ca1fe0f0f07f6d2ac45bcd666a88f29673d1d4c
7
- data.tar.gz: 3fffa2a1d4153a28db13ada078ac381cdc7b4408e00df6cfd1303c084c143e084423fa9b9c0cda485a1a22b4f34f300ff3de1e63e54d7a1504413fcf1978aa9b
6
+ metadata.gz: e1d3d4f181c1561d0c9bac1b9c4e018811f4d3361d9a96035084748ebcddf58276b27c2b4bd122f1ab350b5d76aedf26fb1643f44efd781d652c3f82f48bfe71
7
+ data.tar.gz: 8500d83f450776b2f077570ee4759618f34c8ce6da394feb8d87ab9ded7c7ab6cd65dd7df47b3e285403cc41019e5119cd28e5956f3a437b65a4f83c91904f32
@@ -1,3 +1,7 @@
1
+ ## 0.2.8
2
+
3
+ Accept success status (#134) - thanks to @dcarneiro
4
+
1
5
  ## 0.2.7
2
6
 
3
7
  - Fix issue "NoMethodError: undefined method `<' for false:FalseClass" (#133) - thanks to @heaven
@@ -62,7 +62,7 @@ module Swagger
62
62
 
63
63
  def response(status, text = nil, model = nil)
64
64
  if status.is_a? Symbol
65
- status == :ok if status == :success
65
+ status = :ok if status == :success
66
66
  status_code = Rack::Utils.status_code(status)
67
67
  response_messages << {:code => status_code, :responseModel => model, :message => text || status.to_s.titleize}
68
68
  else
@@ -108,7 +108,7 @@ module Swagger
108
108
  }.merge!(hash)
109
109
  self.required << name if required == :required
110
110
  end
111
-
111
+
112
112
  # helper method to generate enums
113
113
  def property_list(name, type, required, description = nil, allowed_values = [], hash = {})
114
114
  hash.merge!({allowable_values: {value_type: "LIST", values: allowed_values}})
@@ -1,5 +1,5 @@
1
1
  module Swagger
2
2
  module Docs
3
- VERSION = "0.2.7"
3
+ VERSION = "0.2.8"
4
4
  end
5
5
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Swagger::Docs::SwaggerDSL do
4
-
5
4
  subject { described_class.new() }
6
5
 
7
6
  describe "#response" do
@@ -9,7 +8,10 @@ describe Swagger::Docs::SwaggerDSL do
9
8
  subject.response(:ok, "Some sample text", "Tag")
10
9
  expect(subject.response_messages).to eq([{:code=>200, :responseModel=>"Tag", :message=>"Some sample text"}])
11
10
  end
12
- end
13
11
 
12
+ it "accept :success was an :ok status" do
13
+ subject.response(:success, "Some sample text", "Tag")
14
+ expect(subject.response_messages).to eq([{:code=>200, :responseModel=>"Tag", :message=>"Some sample text"}])
15
+ end
16
+ end
14
17
  end
15
-
@@ -5,8 +5,6 @@ describe Swagger::Docs::Generator do
5
5
  require "fixtures/controllers/application_controller"
6
6
  require "fixtures/controllers/ignored_controller"
7
7
 
8
- class FooParentController; end
9
-
10
8
  before(:each) do
11
9
  FileUtils.rm_rf(tmp_dir)
12
10
  stub_const('ActionController::Base', ApplicationController)
@@ -9,8 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Rich Hollis"]
10
10
  spec.email = ["richhollis@gmail.com"]
11
11
  spec.description = %q{Generates json files for rails apps to use with swagger-ui}
12
- spec.summary = %q{Generates swagger-ui json files for rails apps with APIs. You add the swagger DSL to your controller classes and then run one rake task to generate the json files.
13
- }
12
+ spec.summary = %q{Generates swagger-ui json files for rails apps with APIs. You add the swagger DSL to your controller classes and then run one rake task to generate the json files.}
14
13
  spec.homepage = "https://github.com/richhollis/swagger-docs"
15
14
  spec.license = "MIT"
16
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swagger-docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rich Hollis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-15 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler