redsnow 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c108ce59dd6673b6811fd10745031465b752fd87
4
- data.tar.gz: d92e537229e9a0c19acf887ec13209ed8948cc05
3
+ metadata.gz: 8e802932e6b9f11326595b119e1518d9e23464c3
4
+ data.tar.gz: a53782c42fd6fadf4efbfe0aee8071930b793908
5
5
  SHA512:
6
- metadata.gz: 553dd1900ee7bb0aaf180dfee28a106a84acfc00513358e841f1591df5c43baaf48ee92b14b3094bc28d4b44380d73965a89c083151a64d5fc7ca3e1e550a3b5
7
- data.tar.gz: 8ed43be3d25a0c670f92874633d41bf87be22528178cb5308bf5980b444841a045dd6890900e900509c17807ed684fa1b797971991e15621f7149b5fa5a62580
6
+ metadata.gz: 045cc18d064010d0457a93d2fbe1bc0c1864b8d3c517166cced3ba5e355647347c919915707d9e90b58b61de216b84403409ce05be7eb0b4214ff0c027e895d2
7
+ data.tar.gz: 9061c9bd3b8796561eb489a4afe401c6bb34f784c49deed7493e7f6ed7f7111043da4fbba3871073972e25cc8714f82efdcb144ec8b28481e18c26a950194a5e
@@ -1,4 +1,5 @@
1
1
  # Changelog
2
+ - 0.1.2 - Fix collection of resources inside ResourceGroup [PR#13](https://github.com/apiaryio/redsnow/pull/13)
2
3
  - 0.1.1 - Add bundler to dependency
3
4
  - 0.1.0 - Snow Crash updated to [0.12.1](https://github.com/apiaryio/snowcrash/releases/tag/v0.12.1)
4
5
  - 0.0.8 - Add support for [Parse Result](https://github.com/apiaryio/api-blueprint-ast/blob/master/Parse%20Result.md)
@@ -317,10 +317,9 @@ module RedSnow
317
317
  resource_size = sc_resource_collection_size - 1
318
318
  for index in 0..resource_size do
319
319
  sc_resource_handle = RedSnow::Binding.sc_resource_handle(sc_resource_collection_handle, index)
320
- res = Resource.new(sc_resource_handle)
320
+ @resources << Resource.new(sc_resource_handle)
321
321
  end
322
322
  end
323
- @resources << res
324
323
  end
325
324
 
326
325
  end
@@ -1,4 +1,4 @@
1
1
  module RedSnow
2
2
  # Gem version
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
@@ -36,14 +36,37 @@ class RedSnowParsingTest < Test::Unit::TestCase
36
36
  source = <<-STR
37
37
  # Group Name
38
38
  _description_
39
+
40
+ ## My Resource [/resource]
41
+ Resource description
42
+
43
+ ## My Alternative Resource [/alternative_resource]
44
+ Alternative resource description
45
+
39
46
  STR
40
47
 
41
48
  @result = RedSnow.parse(source.unindent)
49
+ @resource_group = @result.ast.resource_groups[0]
50
+ @resource = @resource_group.resources[0]
51
+ @alternative_resource = @resource_group.resources[1]
42
52
  end
53
+
43
54
  should "have resource group" do
44
55
  assert_equal 1, @result.ast.resource_groups.count
45
- assert_equal "Name", @result.ast.resource_groups[0].name
46
- assert_equal "_description_\n", @result.ast.resource_groups[0].description
56
+ assert_equal "Name", @resource_group.name
57
+ assert_equal "_description_\n\n", @resource_group.description
58
+ end
59
+
60
+ should "have resource" do
61
+ assert_equal "/resource", @resource.uri_template
62
+ assert_equal "My Resource", @resource.name
63
+ assert_equal "Resource description\n\n", @resource.description
64
+ end
65
+
66
+ should "have alternative resource" do
67
+ assert_equal "/alternative_resource", @alternative_resource.uri_template
68
+ assert_equal "My Alternative Resource", @alternative_resource.name
69
+ assert_equal "Alternative resource description\n\n", @alternative_resource.description
47
70
  end
48
71
  end
49
72
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redsnow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ladislav Prskavec
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-20 00:00:00.000000000 Z
11
+ date: 2014-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi