marley 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,38 @@
1
+ module Marley
2
+ class Client
3
+ # Here we define the Jamaica client class for Marley. This client
4
+ # is a simple HTML page that is intended to be run in a browser.
5
+ # It will have its actual UI metadata in the global variable '_jamaica_json'
6
+ # and onDocumentReady, this will be turned into the client UI.
7
+ def initialize(opts={})
8
+ @opts={:app_name => 'Application',:css => '', :js => ''}.merge(opts)
9
+ @client_dir="#{File.dirname(__FILE__)}/client/"
10
+ @libs = Dir.glob("#{@client_dir}*.js").sort
11
+ @styles = [ 'jamaica.css' ]
12
+ end
13
+ def joint(joint_d,joint_name)
14
+ [:css,:js].each do |ext|
15
+ fn="#{joint_d}#{joint_name}.#{ext.to_s}"
16
+ File.exists?(fn) && send(ext,File.new(fn,"r").read)
17
+ end
18
+ end
19
+ def css(add_css=nil)
20
+ @opts[:css]+=add_css if add_css
21
+ @opts[:css]
22
+ end
23
+ def js(add_js=nil)
24
+ @opts[:js]+=add_js if add_js
25
+ @opts[:js]
26
+ end
27
+ def to_s(json='')
28
+ <<-EOHTML
29
+ <head>
30
+ <title>#{@opts[:app_name]}</title>
31
+ <script type='text/javascript'>var _jamaica_json=#{json}; #{ @libs.map{ |l| File.new(l).read }.push(@opts[:js]).join("\n") }</script>
32
+ <style>#{ @styles.map{ |s| File.new("#{@client_dir}#{s}").read }.push(@opts[:css]).join("\n") }
33
+ </head>
34
+ <body></body>
35
+ EOHTML
36
+ end
37
+ end
38
+ end
@@ -12,7 +12,7 @@ module Marley
12
12
  @method=@instance.method(@method_name)
13
13
  end
14
14
  else #class method -- should yield 0 or more instances of model in an array
15
- @method_name=$request[:path][1]
15
+ @method_name=$request[:path][1].sub(/[\?\&\+]$/,'') rescue nil #ditch trailing characters, if any
16
16
  @method_name='list' if @method_name.nil? && $request[:verb]=='rest_get'
17
17
  if @method_name
18
18
  raise RoutingError unless @model.respond_to?(@method_name)
data/lib/marley/plugin.rb CHANGED
@@ -17,8 +17,11 @@ module Marley
17
17
  @opts[:required_plugins].to_a.each do |p|
18
18
  Marley.plugin(p).apply(klass)
19
19
  end
20
+ #below 4 lines vs 2 is for 1.8-1.9 and is fucking awful!
20
21
  plugin.constants.include?('ClassMethods') && resource.extend(plugin.const_get('ClassMethods'))
22
+ plugin.constants.include?(:ClassMethods) && resource.extend(plugin.const_get(:ClassMethods))
21
23
  plugin.constants.include?('InstanceMethods') && resource.send(:include, plugin.const_get('InstanceMethods'))
24
+ plugin.constants.include?(:InstanceMethods) && resource.send(:include, plugin.const_get(:InstanceMethods))
22
25
  if @opts[:lazy_class_attrs] || @opts[:class_attrs]
23
26
  resource.extend Marley::Utils::ClassAttrs
24
27
  end
data/lib/marley/reggae.rb CHANGED
@@ -40,7 +40,8 @@ module Marley
40
40
  end
41
41
  end
42
42
  def is_resource?
43
- [String, Symbol].include?(self[0].class) && Marley.constants.include?("reggae_#{self[0]}".camelcase)
43
+ #below is for 1.8-1.9 and is fucking awful!
44
+ [String, Symbol].include?(self[0].class) && (Marley.constants.include?("reggae_#{self[0]}".camelcase) || Marley.constants.include?("reggae_#{self[0]}".camelcase.to_sym))
44
45
  end
45
46
  def contents=(*args)
46
47
  self[2]=*args
@@ -117,7 +118,7 @@ module Marley
117
118
  end
118
119
  class ReggaeSchema < Array
119
120
  def initialize(*args)
120
- super
121
+ super
121
122
  replace(map{|spec| ReggaeColSpec.new(spec)})
122
123
  end
123
124
  def [](i)
@@ -0,0 +1,53 @@
1
+ #require 'rubygems'
2
+ require 'rdoc/forum_joint.rb'
3
+ require 'factory_girl'
4
+
5
+ #this kinda sucks...
6
+ Sequel::Model.send(:alias_method, :save!, :save)
7
+
8
+ USERS=5
9
+ TOPICS=5
10
+ TAGS=3
11
+ REPLIES=[4,2]
12
+ FactoryGirl.define do
13
+ [:name,:title,:tag,:content].each do |seq|
14
+ sequence seq do |n|
15
+ "#{seq.to_s}#{n}"
16
+ end
17
+ end
18
+ factory :user,:class => MR::User,:aliases => [:author,:recipient] do |n|
19
+ name
20
+ password 'asdfasdf'
21
+ confirm_password 'asdfasdf'
22
+ end
23
+ factory :post,:class => MR::PublicMessage do |n|
24
+ user
25
+ title
26
+ content
27
+ _public_tags ''
28
+ _private_tags ''
29
+ end
30
+ factory :private_message,:class => MR::PublicMessage do |n|
31
+ user
32
+ recipients ''
33
+ title
34
+ content
35
+ _private_tags ''
36
+ end
37
+ factory :public_tag,:class => MR::PublicTag do |n|
38
+ tag
39
+ end
40
+ factory :private_tag,:class => MR::PrivateTag do |n|
41
+ user
42
+ tag
43
+ end
44
+ end
45
+ USERS.times do
46
+ FactoryGirl.create(:user) do |u|
47
+ $request={:user => u}
48
+ TOPICS.times do
49
+ FactoryGirl.create(:post,:user_id => u[:id])
50
+ end
51
+ end
52
+ end
53
+
@@ -15,29 +15,29 @@ example: user1 sends message to user2
15
15
  >> @client1.create(@msg.set_values(:title => 'asdf',:recipients => 'xxx'),:code => 400)
16
16
  => [:error, {:error_type=>"validation", :error_details=>{:recipients=>["xxx is not a valid message recipient"]}, :description=>nil}]
17
17
  >> @client1.create(@msg.set_values(:title => 'asdf',:recipients => 'user2'))
18
- => [:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user2"], [:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 6, "asdf"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get=>"reply"}}, []]
18
+ => [:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user2"], [:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 6, "asdf"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get=>:reply}}, []]
19
19
 
20
20
  >> @client1.read
21
21
  => []
22
22
  >> @client3.read
23
23
  => []
24
24
  >> @client2.read
25
- => [[:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user2"], [:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 6, "asdf"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get=>"reply"}}, []]]
25
+ => [[:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user2"], [:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 6, "asdf"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get=>:reply}}, []]]
26
26
 
27
27
  example: user2 sends message to user3 and user4, each of which replies
28
28
 
29
29
  >> @msg=@client2.read({},:method => 'new')
30
30
  => [:instance, {:url=>"/private_message/", :schema=>[[:text, :recipients, 0, ""], [:integer, :user_id, 3, 2], [:text, :title, 4, nil], [:text, :content, 0, nil]], :name=>"private_message", :new_rec=>true, :actions=>nil}, nil]
31
31
  >> @client2.create(@msg.set_values(:title => 'message1',:recipients => 'user3,user4'))
32
- => [:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user3,user4"], [:text, :author, 2, "user2"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 2], [:text, :title, 6, "message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => ["reply", "reply_all"]}}, []]
32
+ => [:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user3,user4"], [:text, :author, 2, "user2"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 2], [:text, :title, 6, "message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => [:reply, :reply_all]}}, []]
33
33
  >> @client1.read
34
34
  => []
35
35
  >> @client2.read
36
36
  => []
37
37
  >> @client3.read
38
- => [[:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user3,user4"], [:text, :author, 2, "user2"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 2], [:text, :title, 6, "message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => ["reply", "reply_all"]}}, []]]
38
+ => [[:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user3,user4"], [:text, :author, 2, "user2"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 2], [:text, :title, 6, "message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => [:reply, :reply_all]}}, []]]
39
39
  >> @orig=@client4.read
40
- => [[:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user3,user4"], [:text, :author, 2, "user2"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 2], [:text, :title, 6, "message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => ["reply", "reply_all"]}}, []]]
40
+ => [[:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user3,user4"], [:text, :author, 2, "user2"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 2], [:text, :title, 6, "message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => [:reply, :reply_all]}}, []]]
41
41
 
42
42
  >> @u3r=@client3.read({},:url => @orig[0].url+'/reply')
43
43
  => [:instance, {:url=>"/private_message/", :schema=>[[:text, :recipients, 0, "user2"], [:integer, :user_id, 3, 3], [:text, :title, 4, "re: message1"], [:text, :content, 0, nil]], :name=>"private_message", :new_rec=>true, :actions=>nil}, nil]
@@ -45,15 +45,15 @@ example: user2 sends message to user3 and user4, each of which replies
45
45
  => [:instance, {:url=>"/private_message/", :schema=>[[:text, :recipients, 0, "user2,user4"], [:integer, :user_id, 3, 3], [:text, :title, 4, "re: message1"], [:text, :content, 0, nil]], :name=>"private_message", :new_rec=>true, :actions=>nil}, nil]
46
46
 
47
47
  >> @client3.create(@u3r)
48
- => [:instance, {:url=>"/private_message/2", :schema=>[[:text, :recipients, 2, "user2"], [:text, :author, 2, "user3"], [:integer, :id, 2, 2], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get=>"reply"}}, []]
48
+ => [:instance, {:url=>"/private_message/2", :schema=>[[:text, :recipients, 2, "user2"], [:text, :author, 2, "user3"], [:integer, :id, 2, 2], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get=>:reply}}, []]
49
49
  >> @client2.read
50
- => [[:instance, {:url=>"/private_message/2", :schema=>[[:text, :recipients, 2, "user2"], [:text, :author, 2, "user3"], [:integer, :id, 2, 2], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get=>"reply"}}, []]]
50
+ => [[:instance, {:url=>"/private_message/2", :schema=>[[:text, :recipients, 2, "user2"], [:text, :author, 2, "user3"], [:integer, :id, 2, 2], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get=>:reply}}, []]]
51
51
 
52
52
  >> @client3.create(@u3ra)
53
- => [:instance, {:url=>"/private_message/3", :schema=>[[:text, :recipients, 2, "user2,user4"], [:text, :author, 2, "user3"], [:integer, :id, 2, 3], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => ["reply", "reply_all"]}}, []]
53
+ => [:instance, {:url=>"/private_message/3", :schema=>[[:text, :recipients, 2, "user2,user4"], [:text, :author, 2, "user3"], [:integer, :id, 2, 3], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => [:reply, :reply_all]}}, []]
54
54
  >> @client2.read
55
- => [[:instance, {:url=>"/private_message/2", :schema=>[[:text, :recipients, 2, "user2"], [:text, :author, 2, "user3"], [:integer, :id, 2, 2], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get=>"reply"}}, []], [:instance, {:url=>"/private_message/3", :schema=>[[:text, :recipients, 2, "user2,user4"], [:text, :author, 2, "user3"], [:integer, :id, 2, 3], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => ["reply", "reply_all"]}}, []]]
55
+ => [[:instance, {:url=>"/private_message/2", :schema=>[[:text, :recipients, 2, "user2"], [:text, :author, 2, "user3"], [:integer, :id, 2, 2], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get=>:reply}}, []], [:instance, {:url=>"/private_message/3", :schema=>[[:text, :recipients, 2, "user2,user4"], [:text, :author, 2, "user3"], [:integer, :id, 2, 3], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => [:reply, :reply_all]}}, []]]
56
56
 
57
57
  >> @client4.read
58
- => [[:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user3,user4"], [:text, :author, 2, "user2"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 2], [:text, :title, 6, "message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => ["reply", "reply_all"]}}, []], [:instance, {:url=>"/private_message/3", :schema=>[[:text, :recipients, 2, "user2,user4"], [:text, :author, 2, "user3"], [:integer, :id, 2, 3], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => ["reply", "reply_all"]}}, []]]
58
+ => [[:instance, {:url=>"/private_message/1", :schema=>[[:text, :recipients, 2, "user3,user4"], [:text, :author, 2, "user2"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 2], [:text, :title, 6, "message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => [:reply, :reply_all]}}, []], [:instance, {:url=>"/private_message/3", :schema=>[[:text, :recipients, 2, "user2,user4"], [:text, :author, 2, "user3"], [:integer, :id, 2, 3], [:integer, :user_id, 3, 3], [:text, :title, 6, "re: message1"], [:text, :content, 2, nil]], :name=>"private_message", :new_rec=>false, :actions=>{:get => [:reply, :reply_all]}}, []]]
59
59
 
@@ -19,13 +19,13 @@ example: user1 writes, edits, deletes post
19
19
  => [:error, {:error_type=>"validation", :description=>nil, :error_details=>{:title=>["is required"]}}]
20
20
 
21
21
  >> @msg=@client1.create(@msg.set_values(:title => 'test'))
22
- => [:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 4, "test"], [:text, :content, 0, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>"reply", :delete=>"/public_message/1"}}, []]
22
+ => [:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 4, "test"], [:text, :content, 0, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>:reply, :delete=>"/public_message/1"}}, []]
23
23
 
24
24
  >> @client1.update(@msg.set_values(:content => 'asdf'),:url => @msg.url)
25
- => [:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 4, "test"], [:text, :content, 0, "asdf"]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>"reply", :delete=>"/public_message/1"}}, []]
25
+ => [:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 4, "test"], [:text, :content, 0, "asdf"]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>:reply, :delete=>"/public_message/1"}}, []]
26
26
 
27
27
  >> @client1.del({},:url => @msg.url)
28
- => [:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 4, "test"], [:text, :content, 0, "asdf"]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>"reply", :delete=>"/public_message/1"}}, []]
28
+ => [:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 4, "test"], [:text, :content, 0, "asdf"]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>:reply, :delete=>"/public_message/1"}}, []]
29
29
 
30
30
 
31
31
  example: two users, several messages
@@ -35,28 +35,28 @@ example: two users, several messages
35
35
  => [:instance, {:new_rec=>true, :actions=>nil, :url=>"/public_message/", :name=>"public_message", :schema=>[[:integer, :user_id, 3, 2], [:text, :title, 4, nil], [:text, :content, 0, nil]]}, nil]
36
36
 
37
37
  >> @u1m1=@client1.create(@u1msg.set_values(:title => 'usr1 msg1'))
38
- => [:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 4, "usr1 msg1"], [:text, :content, 0, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>"reply", :delete=>"/public_message/1"}}, []]
38
+ => [:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 4, "usr1 msg1"], [:text, :content, 0, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>:reply, :delete=>"/public_message/1"}}, []]
39
39
 
40
40
  >> @client3.read
41
- => [[:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 6, "usr1 msg1"], [:text, :content, 2, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>"reply"}}, []]]
41
+ => [[:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 6, "usr1 msg1"], [:text, :content, 2, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>:reply}}, []]]
42
42
 
43
43
  >> @u1m2=@client1.create(@u1msg.set_values(:title => 'usr1 msg2'))
44
- => [:instance, {:url=>"/public_message/2", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 2], [:integer, :user_id, 3, 1], [:text, :title, 4, "usr1 msg2"], [:text, :content, 0, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>"reply", :delete=>"/public_message/2"}}, []]
44
+ => [:instance, {:url=>"/public_message/2", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 2], [:integer, :user_id, 3, 1], [:text, :title, 4, "usr1 msg2"], [:text, :content, 0, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>:reply, :delete=>"/public_message/2"}}, []]
45
45
  >> @client3.read
46
- => [[:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 6, "usr1 msg1"], [:text, :content, 2, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>"reply"}}, []], [:instance, {:url=>"/public_message/2", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 2], [:integer, :user_id, 3, 1], [:text, :title, 6, "usr1 msg2"], [:text, :content, 2, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>"reply"}}, []]]
46
+ => [[:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 6, "usr1 msg1"], [:text, :content, 2, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>:reply}}, []], [:instance, {:url=>"/public_message/2", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 2], [:integer, :user_id, 3, 1], [:text, :title, 6, "usr1 msg2"], [:text, :content, 2, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>:reply}}, []]]
47
47
 
48
48
  >> @client3.update(@u1m1.set_values(:title => 'asdf'),:url => @u1m1.url,:code => 403)
49
49
  => [:error, {:error_type=>"authorization", :error_details=>nil, :description=>"You are not authorized for this operation"}]
50
50
  >> @client2.update(@u1m1.set_values(:title => 'asdf'),:url => @u1m1.url,:code => 403)
51
51
  => [:error, {:error_type=>"authorization", :error_details=>nil, :description=>"You are not authorized for this operation"}]
52
52
  >> @client1.update(@u1m1.set_values(:title => 'asdf'),:url => @u1m1.url)
53
- => [:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 4, "asdf"], [:text, :content, 0, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>"reply", :delete=>"/public_message/1"}}, []]
53
+ => [:instance, {:url=>"/public_message/1", :schema=>[[:text, :author, 2, "user1"], [:integer, :id, 2, 1], [:integer, :user_id, 3, 1], [:text, :title, 4, "asdf"], [:text, :content, 0, nil]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>:reply, :delete=>"/public_message/1"}}, []]
54
54
 
55
55
  >> @u2r1=@client2.read({},:url => @u1m1.url+'/reply')
56
56
  => [:instance, {:url=>"/public_message/", :schema=>[[:integer, :user_id, 3, 2], [:text, :title, 4, "re: asdf"], [:text, :content, 0, nil]], :name=>"public_message", :new_rec=>true, :actions=>nil}, nil]
57
57
 
58
58
  >> @client2.create(@u2r1.set_values(:content => 'xxxxxx'))
59
- => [:instance, {:url=>"/public_message/3", :schema=>[[:text, :author, 2, "user2"], [:integer, :id, 2, 3], [:integer, :user_id, 3, 2], [:text, :title, 4, "re: asdf"], [:text, :content, 0, "xxxxxx"]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>"reply", :delete=>"/public_message/3"}}, []]
59
+ => [:instance, {:url=>"/public_message/3", :schema=>[[:text, :author, 2, "user2"], [:integer, :id, 2, 3], [:integer, :user_id, 3, 2], [:text, :title, 4, "re: asdf"], [:text, :content, 0, "xxxxxx"]], :name=>"public_message", :new_rec=>false, :actions=>{:get=>:reply, :delete=>"/public_message/3"}}, []]
60
60
 
61
61
 
62
62
 
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marley
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ hash: 92329988
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 7
9
+ - 1
10
+ version: 0.7.1
5
11
  platform: ruby
6
12
  authors:
7
13
  - Herb Daily
@@ -9,49 +15,94 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2012-03-20 00:00:00 -03:00
13
- default_executable:
18
+ date: 2012-03-21 00:00:00 Z
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: sequel
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
20
25
  requirements:
21
26
  - - ~>
22
27
  - !ruby/object:Gem::Version
23
- version: "3.27"
24
- version:
28
+ hash: 869193570
29
+ segments:
30
+ - 3
31
+ version: "3"
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: rack
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
30
39
  requirements:
31
40
  - - ~>
32
41
  - !ruby/object:Gem::Version
33
- version: 1.2.2
34
- version:
42
+ hash: 32663276
43
+ segments:
44
+ - 2
45
+ version: "2"
46
+ type: :runtime
47
+ version_requirements: *id002
35
48
  - !ruby/object:Gem::Dependency
36
49
  name: json
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ~>
55
+ - !ruby/object:Gem::Version
56
+ hash: 349180216
57
+ segments:
58
+ - 1
59
+ - 6
60
+ version: "1.6"
37
61
  type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
64
+ name: sqlite3
65
+ prerelease: false
66
+ requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
40
68
  requirements:
41
69
  - - ~>
42
70
  - !ruby/object:Gem::Version
43
- version: 1.1.7
44
- version:
71
+ hash: 869193570
72
+ segments:
73
+ - 3
74
+ version: "3"
75
+ type: :development
76
+ version_requirements: *id004
45
77
  - !ruby/object:Gem::Dependency
46
- name: tdoc
78
+ name: rack-test
79
+ prerelease: false
80
+ requirement: &id005 !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ hash: 881230260
86
+ segments:
87
+ - 0
88
+ version: "0"
47
89
  type: :development
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
90
+ version_requirements: *id005
91
+ - !ruby/object:Gem::Dependency
92
+ name: tdoc
93
+ prerelease: false
94
+ requirement: &id006 !ruby/object:Gem::Requirement
95
+ none: false
50
96
  requirements:
51
97
  - - ~>
52
98
  - !ruby/object:Gem::Version
53
- version: 0.16.0
54
- version:
99
+ hash: 3846723
100
+ segments:
101
+ - 0
102
+ - 16
103
+ version: "0.16"
104
+ type: :development
105
+ version_requirements: *id006
55
106
  description: "Marley is a framework for quickly building RESTful web services and applications. Development is fast because Marley implements lots of sensible defaults, all of which can be overridden and most of which can be overridden easily. "
56
107
  email: herb.daily@safe-mail.net
57
108
  executables: []
@@ -69,24 +120,29 @@ files:
69
120
  - lib/marley/plugin.rb
70
121
  - lib/marley/resources.rb
71
122
  - lib/marley/router.rb
123
+ - lib/marley/utils.rb
124
+ - lib/marley/joint.rb
125
+ - lib/marley/controllers.rb
126
+ - lib/marley/errors.rb
127
+ - lib/marley/reggae.rb
128
+ - lib/client/marley/jamaica.rb
129
+ - lib/client/marley/client/jamaica.css
130
+ - lib/client/marley/client/_prevel-full.js
131
+ - lib/client/marley/client/prevel-ext.js
132
+ - lib/client/marley/client/jamaica.js
133
+ - lib/client/marley/client/reggae.js
72
134
  - lib/marley/joints/forum.rb
73
135
  - lib/marley/joints/messages.rb
74
136
  - lib/marley/joints/section.rb
75
137
  - lib/marley/joints/user.rb
76
138
  - lib/marley/joints/tags.rb
77
- - lib/marley/utils.rb
78
- - lib/marley/joint.rb
79
139
  - lib/marley/plugins/orm_rest_convenience.rb
80
140
  - lib/marley/plugins/rest_convenience.rb
81
- - lib/marley/controllers.rb
82
- - lib/marley/errors.rb
83
- - lib/marley/reggae.rb
84
141
  - rdoc/orm_rest_convenience_plugin.rb
85
142
  - rdoc/section_joint.rb
143
+ - rdoc/forum_load.rb
86
144
  - rdoc/forum_joint.rb
87
145
  - rdoc/tags_joint.rdoc
88
- - rdoc/user_joint/no_auth_provided.rdoc
89
- - rdoc/user_joint/exiting_users.rdoc
90
146
  - rdoc/messages_joint.rb
91
147
  - rdoc/messages_joint.rdoc
92
148
  - rdoc/hello.rb
@@ -95,21 +151,22 @@ files:
95
151
  - rdoc/example_plugin.rb
96
152
  - rdoc/plugins.rdoc
97
153
  - rdoc/example_joint.rb
98
- - rdoc/messages_joint/private_messages.rdoc
99
- - rdoc/messages_joint/public_messages.rdoc
100
154
  - rdoc/forum_joint.rdoc
101
155
  - rdoc/orm_rest_convenience_plugin.rdoc
102
- - rdoc/reggae/generate.rdoc
103
- - rdoc/reggae/parse.rdoc
104
156
  - rdoc/user_joint.rb
105
157
  - rdoc/joints.rdoc
106
158
  - rdoc/hello.rdoc
107
159
  - rdoc/tags_joint.rb
108
- - rdoc/tags_joint/announcements.rdoc
109
- - rdoc/tags_joint/secrets.rdoc
110
160
  - rdoc/reggae.rb
111
161
  - rdoc/reggae.rdoc
112
- has_rdoc: true
162
+ - rdoc/user_joint/no_auth_provided.rdoc
163
+ - rdoc/user_joint/exiting_users.rdoc
164
+ - rdoc/messages_joint/private_messages.rdoc
165
+ - rdoc/messages_joint/public_messages.rdoc
166
+ - rdoc/reggae/generate.rdoc
167
+ - rdoc/reggae/parse.rdoc
168
+ - rdoc/tags_joint/announcements.rdoc
169
+ - rdoc/tags_joint/secrets.rdoc
113
170
  homepage: http://github.com/herbdaily/marley
114
171
  licenses: []
115
172
 
@@ -119,21 +176,29 @@ rdoc_options: []
119
176
  require_paths:
120
177
  - lib
121
178
  required_ruby_version: !ruby/object:Gem::Requirement
179
+ none: false
122
180
  requirements:
123
181
  - - ">="
124
182
  - !ruby/object:Gem::Version
183
+ hash: 881230260
184
+ segments:
185
+ - 0
125
186
  version: "0"
126
- version:
127
187
  required_rubygems_version: !ruby/object:Gem::Requirement
188
+ none: false
128
189
  requirements:
129
190
  - - ">="
130
191
  - !ruby/object:Gem::Version
192
+ hash: 540260530
193
+ segments:
194
+ - 1
195
+ - 0
196
+ - 0
131
197
  version: 1.0.0
132
- version:
133
198
  requirements: []
134
199
 
135
200
  rubyforge_project:
136
- rubygems_version: 1.3.5
201
+ rubygems_version: 1.8.12
137
202
  signing_key:
138
203
  specification_version: 3
139
204
  summary: Irie default restful routes for models and other objects