alephant-renderer 0.3.0 → 1.0.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: 5939b61cda95b8530e3fc4a9e982c8680a1fee1d
4
- data.tar.gz: 42c614cb7cf2742c79c074743190f8d66410a63e
3
+ metadata.gz: ad4f4e0d04e590adb1c3a2c5be57aa71dc61f8ba
4
+ data.tar.gz: 863a7c8383bd228eeadbf70f2267b1539135bca7
5
5
  SHA512:
6
- metadata.gz: 89dbff62069088d5ed93517361493fc55ca735f749cbd2836a28b7e764417b6f4081a6590cef4dc87b32b4baad1c83a0e348257deafd1b32919502c6b304cd6f
7
- data.tar.gz: 67cf30110e1e1a7171579c210d28c000fffec793c8998b08dee3ba5d67f0c315a4f89b20c3fde8f019177127ba9e792b72e16a8585bce51c4c3ccb647273ad36
6
+ metadata.gz: 5c0b3f0df66da551e058e2a7b50cd1318ad63c33f4d36cc78f15dc3689965b8adf16e20d925854ee5309912416f895156208f71228f0f2e68e4d96d54d0f59a3
7
+ data.tar.gz: 0514d2fa6fe42f5c92d5fe7c70f3a4f928ae0cbc04a5521923800a4e00f0fe338529eb82d06ab8bbf29120c795779d462c3e0bcb6dd7e4d8d2c2424e21170cd0
@@ -0,0 +1,11 @@
1
+ require "json"
2
+
3
+ module Alephant
4
+ module Renderer
5
+ class Response < Struct.new(:content)
6
+ def to_json
7
+ JSON.generate "content" => content
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Renderer
3
- VERSION = "0.3.0"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -0,0 +1,15 @@
1
+ require "spec_helper"
2
+
3
+ describe Alephant::Renderer::Response do
4
+ subject { described_class.new content }
5
+ let(:content) { "<h1>foo</h1>" }
6
+
7
+ describe "#to_json" do
8
+ let(:expected_structure) { "content" => content }
9
+
10
+ specify do
11
+ expect(JSON.parse subject.to_json).to eq expected_structure
12
+ end
13
+ end
14
+ end
15
+
@@ -1,10 +1,12 @@
1
1
  $: << File.join(File.dirname(__FILE__),"..", "lib")
2
2
 
3
3
  require 'pry'
4
+ require "json"
4
5
 
5
6
  require 'alephant/renderer'
6
7
  require 'alephant/renderer/views'
7
8
  require 'alephant/renderer/views/json'
8
9
  require 'alephant/renderer/views/html'
9
10
  require 'alephant/renderer/view_mapper'
11
+ require "alephant/renderer/response"
10
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alephant-renderer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Kenny
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-12 00:00:00.000000000 Z
11
+ date: 2015-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -223,6 +223,7 @@ files:
223
223
  - Rakefile
224
224
  - alephant-renderer.gemspec
225
225
  - lib/alephant/renderer.rb
226
+ - lib/alephant/renderer/response.rb
226
227
  - lib/alephant/renderer/version.rb
227
228
  - lib/alephant/renderer/view_mapper.rb
228
229
  - lib/alephant/renderer/views.rb
@@ -234,6 +235,7 @@ files:
234
235
  - spec/fixtures/components/foo/models/json.rb
235
236
  - spec/integration/spec_helper.rb
236
237
  - spec/renderer_spec.rb
238
+ - spec/response_spec.rb
237
239
  - spec/spec_helper.rb
238
240
  - spec/view_mapper_spec.rb
239
241
  - spec/views_json_spec.rb
@@ -268,6 +270,7 @@ test_files:
268
270
  - spec/fixtures/components/foo/models/json.rb
269
271
  - spec/integration/spec_helper.rb
270
272
  - spec/renderer_spec.rb
273
+ - spec/response_spec.rb
271
274
  - spec/spec_helper.rb
272
275
  - spec/view_mapper_spec.rb
273
276
  - spec/views_json_spec.rb