colonel_kurtz_ruby 0.1.0 → 0.2.0

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: 84cdddaa9cd13f6d929f2f0be71dd7f9254fdbb0
4
- data.tar.gz: 9187ae859dc491680917694605d807590d864947
3
+ metadata.gz: 74c1f3d095ab2ba08bfba4e099d8240c2aecb7ca
4
+ data.tar.gz: 7ca859d443dfae213bb375ad513f1ab0fedc5ecb
5
5
  SHA512:
6
- metadata.gz: 2c4994bd51c02a610b6c43ea5e05bf950534d59ba2bf9c1f1e64445b10648cbfba407bcd7cf47b596536f20512083c8a42ee6d6fc2a35c710cae44e5607402ed
7
- data.tar.gz: 89e62c64492f0132699ccbc8248fe86f506f7660ef31b118e86b1e2fa7939dad7eb4eb94da82b30639b67d1732904a5b5588c355f684ce480c637dec84bd7b4f
6
+ metadata.gz: f1b78306db8abd7fb4660b6d2158fe7ec8795d7a48eb37e69972ef03cd46ad6ee9825fa4a5d0e82ba1f4ff71aa0af64d289e26b25051625e92b6f3a6522221fd
7
+ data.tar.gz: f9c96de971b1c836534e187edccc07f1612121809acfbd49bfd9fae80e2b770a63b49c777b048bba9d4df04bb18548c75529a2fc7b643e2cab2d253fd0dea691
data/README.md CHANGED
@@ -51,10 +51,16 @@ block.type
51
51
  block.contents
52
52
  #=> { "html" => "<p>Example</p>" }
53
53
 
54
+ block.parent
55
+ #=> nil
56
+
54
57
  block.children
55
58
  #=> [
56
- #<ColonelKurtz::Block:0x007fb0eb7bf950....>
57
- ]
59
+ # <ColonelKurtz::Block:0x007fb0eb7bf950....>
60
+ #]
61
+
62
+ block.children[0].parent
63
+ #=> <ColonelKurtz::Block:0x047ae78820c3c0b24...>
58
64
  ```
59
65
 
60
66
  #### Model
@@ -104,3 +110,11 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
104
110
  5. Create a new Pull Request
105
111
 
106
112
  Viget (www.viget.com)
113
+
114
+ ***
115
+
116
+ <a href="http://code.viget.com">
117
+ <img src="http://code.viget.com/github-banner.png" alt="Code At Viget">
118
+ </a>
119
+
120
+ Visit [code.viget.com](http://code.viget.com) to see more projects from [Viget.](https://viget.com)
@@ -9,7 +9,13 @@ module ColonelKurtz
9
9
 
10
10
  define_method "#{field}_blocks" do
11
11
  begin
12
- JSON.parse(send(field)).map{ |data| ColonelKurtz::Block.new(data) }
12
+ content = send(field)
13
+
14
+ if content.is_a?(String)
15
+ content = JSON.parse(content)
16
+ end
17
+
18
+ content.map { |data| ColonelKurtz::Block.new(data) }
13
19
  rescue
14
20
  [] # TODO error handling
15
21
  end
@@ -2,7 +2,7 @@ module ColonelKurtz
2
2
 
3
3
  VERSION = [
4
4
  0, # major
5
- 1, # minor
5
+ 2, # minor
6
6
  0 # patch
7
7
  ].join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colonel_kurtz_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viget
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-09 00:00:00.000000000 Z
11
+ date: 2016-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.4.5
142
+ rubygems_version: 2.2.2
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: Ruby wrapper for Colonel Kurtz data