sethyates-content_manager 0.3.0 → 0.3.2

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{content_manager}
5
- s.version = "0.3.0"
5
+ s.version = "0.3.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Seth Yates"]
data/lib/content_item.rb CHANGED
@@ -63,6 +63,14 @@ class ContentItem
63
63
  ContentItem.connection[url] = hash
64
64
  end
65
65
 
66
+ def to_yaml
67
+ attributes.to_yaml
68
+ end
69
+
70
+ def to_json
71
+ attributes.to_json
72
+ end
73
+
66
74
  def method_missing(name, *arguments)
67
75
  if arguments.length > 0
68
76
  attributes[name.to_s.chomp('=')] = arguments.first
@@ -6,12 +6,12 @@ module Rack
6
6
 
7
7
  def call(env)
8
8
  item = ContentItem.find_first_by_url(env["REQUEST_PATH"])
9
- if item.nil?
10
- @app.call(env)
11
- else
9
+ unless item.nil?
12
10
  response = Rack::Response.new
13
11
  response.write "Hi there"
14
12
  response.finish
13
+ else
14
+ @app.call(env)
15
15
  end
16
16
  end
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sethyates-content_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Yates