togostanza 0.0.9 → 0.1.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: c7c657a540bba573a0221497038dc7c045649f8d
4
- data.tar.gz: c42f88cfe45373134a3ca4977abd2878d58cd4ba
3
+ metadata.gz: e38816d3b16afcba919e38ba4ca126a63e7d16cc
4
+ data.tar.gz: 632c4eaaf28b9b7bcdc22709323ad1880af10019
5
5
  SHA512:
6
- metadata.gz: eab8bc96b45b0bd78af9e6bab7212e3c5b0da72a5e7ffd3bebbbeb4922839ede45c285d730e051255bd4f0cfeabc530bcc88a9e415e1983db953e6a084f7404d
7
- data.tar.gz: 9dc62a623a21dbe7c397abebafb163e4ff2d663b42121ffce760d42365b3dcd885851de6f891dc3fbfc76fb038ee429e675fad703b4f98895bfe87b158580de0
6
+ metadata.gz: 69b7b057eb8e4bf844949cbc361b2d702282c07d22e1a914fb2207bfca57bebc11386906bf72879506006002ae267958e9ce60cf2df2e3f4b03325dbfe1ba60c
7
+ data.tar.gz: 375aa3a896cc1c1253682bcc70c6b19d8589c3de0a7d0be98b8608e12cf4013b68afb586695d10e016f114fca4d6a5491dd082e94f21848ef0fd5a36aed9faee
@@ -25,6 +25,10 @@ module TogoStanza
25
25
  haml :index
26
26
  end
27
27
 
28
+ get '/:id.json' do |id|
29
+ json Stanza.find(id).new(params).context
30
+ end
31
+
28
32
  get '/:id' do |id|
29
33
  Stanza.find(id).new(params).render
30
34
  end
@@ -1,3 +1,3 @@
1
1
  module TogoStanza
2
- VERSION = '0.0.9'
2
+ VERSION = '0.1.0'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  class FooStanza < TogoStanza::Stanza::Base
2
- property :name do
3
- 'foo'
2
+ property :name do |name|
3
+ name || 'foo'
4
4
  end
5
5
 
6
6
  resource :foo_resource do
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'API' do
4
+ it 'should return properties as JSON' do
5
+ visit '/foo.json?name=nsgc'
6
+
7
+ json = JSON.parse(page.body)
8
+ json.should include('name' => 'nsgc')
9
+ end
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: togostanza
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keita Urashima
@@ -278,6 +278,7 @@ files:
278
278
  - spec/dummy/foo_stanza/lib/foo_stanza.rb
279
279
  - spec/dummy/foo_stanza/stanza.rb
280
280
  - spec/dummy/foo_stanza/template.hbs
281
+ - spec/features/api_spec.rb
281
282
  - spec/features/help_spec.rb
282
283
  - spec/features/listing_spec.rb
283
284
  - spec/features/rendering_spec.rb
@@ -331,6 +332,7 @@ test_files:
331
332
  - spec/dummy/foo_stanza/lib/foo_stanza.rb
332
333
  - spec/dummy/foo_stanza/stanza.rb
333
334
  - spec/dummy/foo_stanza/template.hbs
335
+ - spec/features/api_spec.rb
334
336
  - spec/features/help_spec.rb
335
337
  - spec/features/listing_spec.rb
336
338
  - spec/features/rendering_spec.rb