optimus_prime 0.1.1 → 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: 79382a0cd439f8c3e2fe3e39036c3733de719e53
4
- data.tar.gz: b476f6bd79cdbc27eb13beb59fd61262830ca617
3
+ metadata.gz: ba1a83012d6f90cfd997d9b14d627540fde4748d
4
+ data.tar.gz: 60fad1b9d85c06245a57ea46b5e931f71e3502db
5
5
  SHA512:
6
- metadata.gz: 225dd5cd8d2e15f6f11127e74c4e091e69a467000ab6032518dd37fcc48c1b53c0aa807e0eda7eb490c4963f1911375e69c28f024cb1e7d34b9175a9666a6c4d
7
- data.tar.gz: 1a96b86edca6c5d89e6ddc614f0488ee60b18f6baf85913c21f857d342e42fdf27952b040fa70bce12521a418feee5d9dc85286302962f0d4d6b2d62dc54b6ed
6
+ metadata.gz: 45ae1393325e37b22fc003048b371e71571a1758db5d15f6f9bf12a8f4a811d106c164d530670cac0606f7d024f9a8ecfc04bae8feb864a1603e47fe94c535f1
7
+ data.tar.gz: ae9c6d64e7f25dde83975cdf92ec7374785ffc3ad746a32471378f4c1837897e659123d154d3ef290ef3e135fcfe593682092f257edff256b5c88590d026e819
data/Gemfile CHANGED
@@ -4,3 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem "sinatra"
7
+ gem "pry"
data/README.md CHANGED
@@ -44,11 +44,21 @@ response = Faraday.get("http://localhost:7002/get/users")
44
44
  response.body #=> " response... "
45
45
  ```
46
46
 
47
- ## POST requests:
47
+ ## POST requests - creating data:
48
48
  ```ruby
49
- op.prime("users", " response... ", status_code: 201)
50
- response = Faraday.post("http://localhost:7002/get/users", { some data })
49
+ op.prime("users/1", {}, status_code: 201)
50
+ response = Faraday.post("http://localhost:7002/get/users/1", { created: true }.to_json)
51
51
  response.status #=> 201 - Created
52
+ response.body #=> { created: true }
53
+ ```
54
+
55
+ ## PUT requests - editing data:
56
+ ```ruby
57
+ op.prime("users/1", { age: 21 }, status_code: 201, persited: true)
58
+ response = Faraday.post("http://localhost:7002/get/users/1", { updated_at: "2013" }.to_json)
59
+ response.status #=> 201 - Created
60
+
61
+ Faraday.get("http://localhost:7002/get/users/1").body #=> { age: 21, updated_at: true }
52
62
  ```
53
63
 
54
64
  ## Changing Content Type:
@@ -87,6 +97,8 @@ from its directory.
87
97
  * Support DELETE, HEAD, PUT http methods
88
98
  * Support REGEX as a path
89
99
  * Support html templates
100
+
101
+
90
102
  ## Contributing
91
103
 
92
104
  1. Fork it ( https://github.com/[my-github-username]/optimus_prime/fork )
@@ -8,6 +8,25 @@ module OptimusPrime
8
8
 
9
9
  set :public_folder, __dir__ + "/server/public"
10
10
 
11
+ put "/get/*" do
12
+ path = self.env["REQUEST_URI"].sub("/get/", "")
13
+ response = responses[path]
14
+ return 404 if response.nil?
15
+
16
+ if response[:requested_with]
17
+ return 404 unless eval("request.body.string.include?('#{response[:requested_with]}')")
18
+ end
19
+
20
+ sleep(response[:sleep].to_i) if response[:sleep]
21
+
22
+ if response[:persisted]
23
+ new_body = params.tap { |p| p.delete("splat"); p.delete("captures") }
24
+
25
+ @@responses[path][:body] = JSON.parse(response[:body]).merge!(new_body).to_json
26
+ end
27
+ 201
28
+ end
29
+
11
30
  post "/get/*" do
12
31
  path = self.env["REQUEST_URI"].sub("/get/", "")
13
32
  response = responses[path]
@@ -17,6 +36,10 @@ module OptimusPrime
17
36
  return 404 unless eval("request.body.string.include?('#{response[:requested_with]}')")
18
37
  end
19
38
 
39
+
40
+ new_body = params.tap { |p| p.delete("splat"); p.delete("captures") }
41
+ @@responses[path][:body] = new_body.to_json
42
+
20
43
  content_type(response[:content_type])
21
44
  status(response[:status_code])
22
45
 
@@ -43,7 +66,7 @@ module OptimusPrime
43
66
 
44
67
  post "/prime" do
45
68
  path = params["path_name"]
46
- responses[path] = { content_type: (params["content_type"] || :html), body: params["response"], status_code: (params["status_code"] || 200), requested_with: (params["requested_with"] || false), sleep: (params["sleep"] || false) }
69
+ responses[path] = { content_type: (params["content_type"] || :html), body: params["response"], status_code: (params["status_code"] || 200), requested_with: (params["requested_with"] || false), sleep: (params["sleep"] || false), persisted: (params["persisted"] || false) }
47
70
  201
48
71
  end
49
72
 
@@ -1,3 +1,3 @@
1
1
  module OptimusPrime
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1551,3 +1551,780 @@ Thin web server (v1.6.2 codename Doc Brown)
1551
1551
  Debugging ON
1552
1552
  Maximum connections set to 1024
1553
1553
  Listening on 0.0.0.0:7002, CTRL+C to stop
1554
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1555
+ Using rack adapter
1556
+ Thin web server (v1.6.2 codename Doc Brown)
1557
+ Debugging ON
1558
+ Maximum connections set to 1024
1559
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1560
+ Exiting!
1561
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1562
+ Using rack adapter
1563
+ Thin web server (v1.6.2 codename Doc Brown)
1564
+ Debugging ON
1565
+ Maximum connections set to 1024
1566
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1567
+ {"text"=>"I have been persisted", "splat"=>["persisted"], "captures"=>["persisted"]}
1568
+ Exiting!
1569
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1570
+ Using rack adapter
1571
+ Thin web server (v1.6.2 codename Doc Brown)
1572
+ Debugging ON
1573
+ Maximum connections set to 1024
1574
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1575
+ {"text"=>"I have been persisted", "splat"=>["persisted"], "captures"=>["persisted"]}
1576
+ text=I+have+been+persisted
1577
+ Exiting!
1578
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1579
+ Using rack adapter
1580
+ Thin web server (v1.6.2 codename Doc Brown)
1581
+ Debugging ON
1582
+ Maximum connections set to 1024
1583
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1584
+ Waiting for 1 connection(s) to finish, can take up to 30 sec, CTRL+C to stop now
1585
+ Exiting!
1586
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1587
+ Using rack adapter
1588
+ Thin web server (v1.6.2 codename Doc Brown)
1589
+ Debugging ON
1590
+ Maximum connections set to 1024
1591
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1592
+ {"text"=>"I have been persisted"}
1593
+ Exiting!
1594
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1595
+ Using rack adapter
1596
+ Thin web server (v1.6.2 codename Doc Brown)
1597
+ Debugging ON
1598
+ Maximum connections set to 1024
1599
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1600
+ Waiting for 1 connection(s) to finish, can take up to 30 sec, CTRL+C to stop now
1601
+ Exiting!
1602
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1603
+ Using rack adapter
1604
+ Thin web server (v1.6.2 codename Doc Brown)
1605
+ Debugging ON
1606
+ Maximum connections set to 1024
1607
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1608
+ Waiting for 1 connection(s) to finish, can take up to 30 sec, CTRL+C to stop now
1609
+ Exiting!
1610
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1611
+ Using rack adapter
1612
+ Thin web server (v1.6.2 codename Doc Brown)
1613
+ Debugging ON
1614
+ Maximum connections set to 1024
1615
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1616
+ Exiting!
1617
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1618
+ Using rack adapter
1619
+ Thin web server (v1.6.2 codename Doc Brown)
1620
+ Debugging ON
1621
+ Maximum connections set to 1024
1622
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1623
+ Waiting for 1 connection(s) to finish, can take up to 30 sec, CTRL+C to stop now
1624
+ Exiting!
1625
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1626
+ Using rack adapter
1627
+ Thin web server (v1.6.2 codename Doc Brown)
1628
+ Debugging ON
1629
+ Maximum connections set to 1024
1630
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1631
+ {:content_type=>:html, :body=>"{\"text\":\"\"}", :status_code=>200, :requested_with=>false, :sleep=>false, :persisted=>"true"}
1632
+ {"persisted"=>{:content_type=>:html, :body=>"{\"text\":\"\"}", :status_code=>200, :requested_with=>false, :sleep=>false, :persisted=>"true"}}
1633
+ Exiting!
1634
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1635
+ Using rack adapter
1636
+ Thin web server (v1.6.2 codename Doc Brown)
1637
+ Debugging ON
1638
+ Maximum connections set to 1024
1639
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1640
+ Exiting!
1641
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1642
+ Using rack adapter
1643
+ Thin web server (v1.6.2 codename Doc Brown)
1644
+ Debugging ON
1645
+ Maximum connections set to 1024
1646
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1647
+ Exiting!
1648
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1649
+ Using rack adapter
1650
+ Thin web server (v1.6.2 codename Doc Brown)
1651
+ Debugging ON
1652
+ Maximum connections set to 1024
1653
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1654
+ Exiting!
1655
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1656
+ Using rack adapter
1657
+ Thin web server (v1.6.2 codename Doc Brown)
1658
+ Debugging ON
1659
+ Maximum connections set to 1024
1660
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1661
+ Exiting!
1662
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1663
+ Using rack adapter
1664
+ Thin web server (v1.6.2 codename Doc Brown)
1665
+ Debugging ON
1666
+ Maximum connections set to 1024
1667
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1668
+ Exiting!
1669
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1670
+ Using rack adapter
1671
+ Thin web server (v1.6.2 codename Doc Brown)
1672
+ Debugging ON
1673
+ Maximum connections set to 1024
1674
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1675
+ Waiting for 1 connection(s) to finish, can take up to 30 sec, CTRL+C to stop now
1676
+ Exiting!
1677
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1678
+ Using rack adapter
1679
+ Thin web server (v1.6.2 codename Doc Brown)
1680
+ Debugging ON
1681
+ Maximum connections set to 1024
1682
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1683
+ Exiting!
1684
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1685
+ Using rack adapter
1686
+ Thin web server (v1.6.2 codename Doc Brown)
1687
+ Debugging ON
1688
+ Maximum connections set to 1024
1689
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1690
+ {"age"=>"21", "text"=>"I have been created", "splat"=>["posts/1"], "captures"=>["posts/1"]}
1691
+ Exiting!
1692
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1693
+ Using rack adapter
1694
+ Thin web server (v1.6.2 codename Doc Brown)
1695
+ Debugging ON
1696
+ Maximum connections set to 1024
1697
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1698
+ {"age"=>"21", "category"=>"user", "text"=>"I have been created", "splat"=>["posts/1"], "captures"=>["posts/1"]}
1699
+ Waiting for 2 connection(s) to finish, can take up to 30 sec, CTRL+C to stop now
1700
+ Exiting!
1701
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1702
+ Using rack adapter
1703
+ Thin web server (v1.6.2 codename Doc Brown)
1704
+ Debugging ON
1705
+ Maximum connections set to 1024
1706
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1707
+ Exiting!
1708
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1709
+ Using rack adapter
1710
+ Thin web server (v1.6.2 codename Doc Brown)
1711
+ Debugging ON
1712
+ Maximum connections set to 1024
1713
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1714
+ Exiting!
1715
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1716
+ Using rack adapter
1717
+ Thin web server (v1.6.2 codename Doc Brown)
1718
+ Debugging ON
1719
+ Maximum connections set to 1024
1720
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1721
+ Exiting!
1722
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1723
+ Using rack adapter
1724
+ Thin web server (v1.6.2 codename Doc Brown)
1725
+ Debugging ON
1726
+ Maximum connections set to 1024
1727
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1728
+ Waiting for 1 connection(s) to finish, can take up to 30 sec, CTRL+C to stop now
1729
+ Exiting!
1730
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1731
+ Using rack adapter
1732
+ Thin web server (v1.6.2 codename Doc Brown)
1733
+ Debugging ON
1734
+ Maximum connections set to 1024
1735
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1736
+ {:content_type=>"json", :body=>{"age"=>"21", "category"=>"user", "text"=>"I have been created"}, :status_code=>200, :requested_with=>false, :sleep=>false, :persisted=>false}
1737
+ Exiting!
1738
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1739
+ Using rack adapter
1740
+ Thin web server (v1.6.2 codename Doc Brown)
1741
+ Debugging ON
1742
+ Maximum connections set to 1024
1743
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1744
+ {"age"=>"21", "category"=>"user", "text"=>"I have been created"}
1745
+ {:content_type=>"json", :body=>{"age"=>"21", "category"=>"user", "text"=>"I have been created"}, :status_code=>200, :requested_with=>false, :sleep=>false, :persisted=>false}
1746
+ Exiting!
1747
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1748
+ Using rack adapter
1749
+ Thin web server (v1.6.2 codename Doc Brown)
1750
+ Debugging ON
1751
+ Maximum connections set to 1024
1752
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1753
+ Exiting!
1754
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1755
+ Using rack adapter
1756
+ Thin web server (v1.6.2 codename Doc Brown)
1757
+ Debugging ON
1758
+ Maximum connections set to 1024
1759
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1760
+ Exiting!
1761
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1762
+ Using rack adapter
1763
+ Thin web server (v1.6.2 codename Doc Brown)
1764
+ Debugging ON
1765
+ Maximum connections set to 1024
1766
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1767
+ LoadError - cannot load such file -- pry:
1768
+ /Users/user/optimus_prime/lib/optimus_prime/server.rb:38:in `require'
1769
+ /Users/user/optimus_prime/lib/optimus_prime/server.rb:38:in `block in <class:Server>'
1770
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
1771
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
1772
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
1773
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
1774
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
1775
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
1776
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
1777
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
1778
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
1779
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
1780
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
1781
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
1782
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
1783
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
1784
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
1785
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
1786
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
1787
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
1788
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
1789
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
1790
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
1791
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
1792
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
1793
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
1794
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
1795
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
1796
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
1797
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
1798
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
1799
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
1800
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
1801
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
1802
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
1803
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
1804
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
1805
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
1806
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
1807
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
1808
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
1809
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
1810
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
1811
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
1812
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
1813
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
1814
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
1815
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
1816
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:87:in `start'
1817
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'
1818
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'
1819
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'
1820
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `load'
1821
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `<main>'
1822
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
1823
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
1824
+ Exiting!
1825
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1826
+ Using rack adapter
1827
+ Thin web server (v1.6.2 codename Doc Brown)
1828
+ Debugging ON
1829
+ Maximum connections set to 1024
1830
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1831
+
1832
+ From: /Users/user/optimus_prime/lib/optimus_prime/server.rb @ line 39 self.POST /get/*:
1833
+
1834
+ 34: if response[:requested_with]
1835
+ 35: return 404 unless eval("request.body.string.include?('#{response[:requested_with]}')")
1836
+ 36: end
1837
+ 37:
1838
+ 38: require "pry"
1839
+ => 39: binding.pry
1840
+ 40:
1841
+ 41: new_body = params.tap { |p| p.delete("splat"); p.delete("captures") }
1842
+ 42: @@responses[path][:body] = new_body
1843
+ 43:
1844
+ 44: content_type(response[:content_type])
1845
+
1846
+ [?1034h[1] pry(#<OptimusPrime::Server>)> Exiting!
1847
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1848
+ Using rack adapter
1849
+ Thin web server (v1.6.2 codename Doc Brown)
1850
+ Debugging ON
1851
+ Maximum connections set to 1024
1852
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1853
+ Exiting!
1854
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
1855
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_server'
1856
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/tcp_server.rb:16:in `connect'
1857
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/base.rb:63:in `block in start'
1858
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `call'
1859
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
1860
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
1861
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
1862
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
1863
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:87:in `start'
1864
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'
1865
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'
1866
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'
1867
+ from /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `load'
1868
+ from /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `<main>'
1869
+ from /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
1870
+ from /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
1871
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1872
+ Using rack adapter
1873
+ Thin web server (v1.6.2 codename Doc Brown)
1874
+ Debugging ON
1875
+ Maximum connections set to 1024
1876
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1877
+ Exiting!
1878
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
1879
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_server'
1880
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/tcp_server.rb:16:in `connect'
1881
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/base.rb:63:in `block in start'
1882
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `call'
1883
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
1884
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
1885
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
1886
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
1887
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:87:in `start'
1888
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'
1889
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'
1890
+ from /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'
1891
+ from /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `load'
1892
+ from /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `<main>'
1893
+ from /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
1894
+ from /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
1895
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1896
+ Using rack adapter
1897
+ Thin web server (v1.6.2 codename Doc Brown)
1898
+ Debugging ON
1899
+ Maximum connections set to 1024
1900
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1901
+ Exiting!
1902
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1903
+ Using rack adapter
1904
+ Thin web server (v1.6.2 codename Doc Brown)
1905
+ Debugging ON
1906
+ Maximum connections set to 1024
1907
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1908
+ Exiting!
1909
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1910
+ Using rack adapter
1911
+ Thin web server (v1.6.2 codename Doc Brown)
1912
+ Debugging ON
1913
+ Maximum connections set to 1024
1914
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1915
+ NoMethodError - undefined method `merge!' for "{\"text\":\"\"}":String:
1916
+ /Users/user/optimus_prime/lib/optimus_prime/server.rb:24:in `block in <class:Server>'
1917
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
1918
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
1919
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
1920
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
1921
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
1922
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
1923
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
1924
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
1925
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
1926
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
1927
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
1928
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
1929
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
1930
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
1931
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
1932
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
1933
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
1934
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
1935
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
1936
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
1937
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
1938
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
1939
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
1940
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
1941
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
1942
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
1943
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
1944
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
1945
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
1946
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
1947
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
1948
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
1949
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
1950
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
1951
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
1952
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
1953
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
1954
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
1955
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
1956
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
1957
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
1958
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
1959
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
1960
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
1961
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
1962
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
1963
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:87:in `start'
1964
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'
1965
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'
1966
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'
1967
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `load'
1968
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `<main>'
1969
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
1970
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
1971
+ Waiting for 1 connection(s) to finish, can take up to 30 sec, CTRL+C to stop now
1972
+ Exiting!
1973
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
1974
+ Using rack adapter
1975
+ Thin web server (v1.6.2 codename Doc Brown)
1976
+ Debugging ON
1977
+ Maximum connections set to 1024
1978
+ Listening on 0.0.0.0:7002, CTRL+C to stop
1979
+ Hash
1980
+ NoMethodError - undefined method `merge!' for "{\"text\":\"\"}":String:
1981
+ /Users/user/optimus_prime/lib/optimus_prime/server.rb:25:in `block in <class:Server>'
1982
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
1983
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
1984
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
1985
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
1986
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
1987
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
1988
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
1989
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
1990
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
1991
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
1992
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
1993
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
1994
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
1995
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
1996
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
1997
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
1998
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
1999
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
2000
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
2001
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
2002
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
2003
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
2004
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
2005
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
2006
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
2007
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
2008
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2009
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2010
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
2011
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
2012
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2013
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
2014
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
2015
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
2016
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
2017
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
2018
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
2019
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
2020
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
2021
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
2022
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
2023
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
2024
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
2025
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
2026
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
2027
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
2028
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:87:in `start'
2029
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'
2030
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'
2031
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'
2032
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `load'
2033
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `<main>'
2034
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
2035
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
2036
+ Exiting!
2037
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
2038
+ Using rack adapter
2039
+ Thin web server (v1.6.2 codename Doc Brown)
2040
+ Debugging ON
2041
+ Maximum connections set to 1024
2042
+ Listening on 0.0.0.0:7002, CTRL+C to stop
2043
+ Hash
2044
+ NoMethodError - undefined method `merge!' for "{\"text\":\"\"}":String:
2045
+ /Users/user/optimus_prime/lib/optimus_prime/server.rb:25:in `block in <class:Server>'
2046
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
2047
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
2048
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
2049
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
2050
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
2051
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
2052
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
2053
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
2054
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
2055
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
2056
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
2057
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
2058
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
2059
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
2060
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
2061
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
2062
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
2063
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
2064
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
2065
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
2066
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
2067
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
2068
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
2069
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
2070
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
2071
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
2072
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2073
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2074
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
2075
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
2076
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2077
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
2078
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
2079
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
2080
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
2081
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
2082
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
2083
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
2084
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
2085
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
2086
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
2087
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
2088
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
2089
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
2090
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
2091
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
2092
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:87:in `start'
2093
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'
2094
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'
2095
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'
2096
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `load'
2097
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `<main>'
2098
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
2099
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
2100
+ Exiting!
2101
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
2102
+ Using rack adapter
2103
+ Thin web server (v1.6.2 codename Doc Brown)
2104
+ Debugging ON
2105
+ Maximum connections set to 1024
2106
+ Listening on 0.0.0.0:7002, CTRL+C to stop
2107
+ TypeError - no implicit conversion of Hash into String:
2108
+ /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/json/common.rb:155:in `initialize'
2109
+ /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/json/common.rb:155:in `new'
2110
+ /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/json/common.rb:155:in `parse'
2111
+ /Users/user/optimus_prime/lib/optimus_prime/server.rb:24:in `block in <class:Server>'
2112
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
2113
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
2114
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
2115
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
2116
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
2117
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
2118
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
2119
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
2120
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
2121
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
2122
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
2123
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
2124
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
2125
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
2126
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
2127
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
2128
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
2129
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
2130
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
2131
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
2132
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
2133
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
2134
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
2135
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
2136
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
2137
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
2138
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2139
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2140
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
2141
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
2142
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2143
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
2144
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
2145
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
2146
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
2147
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
2148
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
2149
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
2150
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
2151
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
2152
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
2153
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
2154
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
2155
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
2156
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
2157
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
2158
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:87:in `start'
2159
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'
2160
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'
2161
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'
2162
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `load'
2163
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `<main>'
2164
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
2165
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
2166
+ Exiting!
2167
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
2168
+ Using rack adapter
2169
+ Thin web server (v1.6.2 codename Doc Brown)
2170
+ Debugging ON
2171
+ Maximum connections set to 1024
2172
+ Listening on 0.0.0.0:7002, CTRL+C to stop
2173
+ TypeError - no implicit conversion of Hash into String:
2174
+ /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/json/common.rb:155:in `initialize'
2175
+ /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/json/common.rb:155:in `new'
2176
+ /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/json/common.rb:155:in `parse'
2177
+ /Users/user/optimus_prime/lib/optimus_prime/server.rb:24:in `block in <class:Server>'
2178
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
2179
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
2180
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
2181
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
2182
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
2183
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
2184
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
2185
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
2186
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
2187
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
2188
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
2189
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
2190
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
2191
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
2192
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
2193
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
2194
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
2195
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
2196
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
2197
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
2198
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
2199
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
2200
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
2201
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
2202
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
2203
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
2204
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2205
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2206
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
2207
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
2208
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2209
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
2210
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
2211
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
2212
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
2213
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
2214
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
2215
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
2216
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
2217
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
2218
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
2219
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
2220
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
2221
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
2222
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
2223
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
2224
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:87:in `start'
2225
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'
2226
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'
2227
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'
2228
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `load'
2229
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `<main>'
2230
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
2231
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
2232
+ Exiting!
2233
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
2234
+ Using rack adapter
2235
+ Thin web server (v1.6.2 codename Doc Brown)
2236
+ Debugging ON
2237
+ Maximum connections set to 1024
2238
+ Listening on 0.0.0.0:7002, CTRL+C to stop
2239
+ Hash
2240
+ NoMethodError - undefined method `merge!' for "{\"text\":\"\"}":String:
2241
+ /Users/user/optimus_prime/lib/optimus_prime/server.rb:27:in `block in <class:Server>'
2242
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
2243
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
2244
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
2245
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
2246
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
2247
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
2248
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
2249
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
2250
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
2251
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
2252
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
2253
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
2254
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
2255
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
2256
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
2257
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
2258
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
2259
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
2260
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
2261
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
2262
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
2263
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
2264
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
2265
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
2266
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
2267
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
2268
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2269
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2270
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
2271
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
2272
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2273
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
2274
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
2275
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
2276
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
2277
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
2278
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
2279
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
2280
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
2281
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
2282
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
2283
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
2284
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
2285
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
2286
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
2287
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
2288
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/controllers/controller.rb:87:in `start'
2289
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:199:in `run_command'
2290
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/lib/thin/runner.rb:155:in `run!'
2291
+ /Users/user/.rvm/gems/ruby-2.1.1/gems/thin-1.6.2/bin/thin:6:in `<top (required)>'
2292
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `load'
2293
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/thin:23:in `<main>'
2294
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
2295
+ /Users/user/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
2296
+ Exiting!
2297
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
2298
+ Using rack adapter
2299
+ Thin web server (v1.6.2 codename Doc Brown)
2300
+ Debugging ON
2301
+ Maximum connections set to 1024
2302
+ Listening on 0.0.0.0:7002, CTRL+C to stop
2303
+ Exiting!
2304
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
2305
+ Using rack adapter
2306
+ Thin web server (v1.6.2 codename Doc Brown)
2307
+ Debugging ON
2308
+ Maximum connections set to 1024
2309
+ Listening on 0.0.0.0:7002, CTRL+C to stop
2310
+ Exiting!
2311
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
2312
+ Using rack adapter
2313
+ Thin web server (v1.6.2 codename Doc Brown)
2314
+ Debugging ON
2315
+ Maximum connections set to 1024
2316
+ Listening on 0.0.0.0:7002, CTRL+C to stop
2317
+ Exiting!
2318
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
2319
+ Using rack adapter
2320
+ Thin web server (v1.6.2 codename Doc Brown)
2321
+ Debugging ON
2322
+ Maximum connections set to 1024
2323
+ Listening on 0.0.0.0:7002, CTRL+C to stop
2324
+ Exiting!
2325
+ Writing PID to /Users/user/optimus_prime/tmp/pids/optimus_prime.pid
2326
+ Using rack adapter
2327
+ Thin web server (v1.6.2 codename Doc Brown)
2328
+ Debugging ON
2329
+ Maximum connections set to 1024
2330
+ Listening on 0.0.0.0:7002, CTRL+C to stop
@@ -62,13 +62,6 @@ describe OptimusPrime do
62
62
  expect( response.status ).to eq 200
63
63
  end
64
64
 
65
- it "handles POST requests" do
66
- op.prime("user", { username: "Test" }.to_json, content_type: :json)
67
- response = ::Faraday.post('http://localhost:7002/get/user')
68
-
69
- expect( JSON.parse(response.body) ).to eq({ "username" => "Test" })
70
- end
71
-
72
65
  context "Asserting on request content" do
73
66
 
74
67
  it "returns a 404 if the request body does not match the assertion" do
@@ -115,4 +108,25 @@ describe OptimusPrime do
115
108
 
116
109
  end
117
110
 
111
+ it "creates a record for with default params" do
112
+ op.prime("posts/1", {}, content_type: :json)
113
+
114
+ ::Faraday.post("http://localhost:7002/get/posts/1", { text: "I have been created", age: 21, category: "user" })
115
+
116
+ expect( JSON.parse(::Faraday.get("http://localhost:7002/get/posts/1").body, symbolize_names: true) ).to eq({:age=>"21", :category=>"user", :text=>"I have been created"})
117
+ end
118
+
119
+ context "#PUT" do
120
+ it "persists a request when told so" do
121
+ op.prime("persisted", { text: "" }.to_json, persisted: true, content_type: :json)
122
+
123
+ expect( JSON.parse(::Faraday.get("http://localhost:7002/get/persisted").body) ).to eq({ "text" => "" })
124
+
125
+ ::Faraday.put("http://localhost:7002/get/persisted", { id: 1 })
126
+
127
+ expect( JSON.parse(::Faraday.get("http://localhost:7002/get/persisted").body, symbolize_names: true) ).to eq({ text: "", id: "1"})
128
+ end
129
+
130
+ end
131
+
118
132
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optimus_prime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antonio Nalesso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-13 00:00:00.000000000 Z
11
+ date: 2014-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler