coin_rack 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/coin_rack.rb +6 -3
- data/lib/coin_rack/version.rb +1 -1
- data/test/coin_rack_test.rb +1 -2
- metadata +69 -8
- data/Gemfile +0 -15
- data/Gemfile.lock +0 -49
- data/LICENSE.txt +0 -22
- data/README.md +0 -128
data/lib/coin_rack.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
require "
|
2
|
-
|
3
|
-
require
|
1
|
+
require "coin"
|
2
|
+
require "footing"
|
3
|
+
require "rack/abstract_format"
|
4
|
+
require "rack/accept_media_types"
|
5
|
+
require "active_support/all"
|
6
|
+
require_relative "coin_rack/version"
|
4
7
|
|
5
8
|
Footing.patch! String, Footing::String
|
6
9
|
Footing.patch! Array, Footing::Array
|
data/lib/coin_rack/version.rb
CHANGED
data/test/coin_rack_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coin_rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-05-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -123,6 +123,70 @@ dependencies:
|
|
123
123
|
- - ! '>='
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rake
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: pry
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: pry-stack_explorer
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ! '>='
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
name: micro_test
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
178
|
+
requirements:
|
179
|
+
- - ! '>='
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
type: :development
|
183
|
+
prerelease: false
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ! '>='
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '0'
|
126
190
|
description:
|
127
191
|
email:
|
128
192
|
- natehop@gmail.com
|
@@ -134,12 +198,8 @@ files:
|
|
134
198
|
- lib/coin_rack/version.rb
|
135
199
|
- lib/coin_rack.rb
|
136
200
|
- bin/coin_rack
|
137
|
-
- test/coin_rack_test.rb
|
138
201
|
- config.ru
|
139
|
-
-
|
140
|
-
- Gemfile.lock
|
141
|
-
- LICENSE.txt
|
142
|
-
- README.md
|
202
|
+
- test/coin_rack_test.rb
|
143
203
|
homepage: https://github.com/hopsoft/coin_rack
|
144
204
|
licenses: []
|
145
205
|
post_install_message:
|
@@ -164,5 +224,6 @@ rubygems_version: 1.8.23
|
|
164
224
|
signing_key:
|
165
225
|
specification_version: 3
|
166
226
|
summary: A Simple Rack application that provides a REST interface for Coin.
|
167
|
-
test_files:
|
227
|
+
test_files:
|
228
|
+
- test/coin_rack_test.rb
|
168
229
|
has_rdoc:
|
data/Gemfile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
gem "rack"
|
4
|
-
gem "coin"
|
5
|
-
gem "footing", ">=0.1.5"
|
6
|
-
gem "rack-abstract-format", :require => "rack/abstract_format"
|
7
|
-
gem "rack-accept-media-types", :require => "rack/accept_media_types"
|
8
|
-
gem "builder"
|
9
|
-
gem "activesupport", :require => "active_support/all"
|
10
|
-
|
11
|
-
group :development do
|
12
|
-
gem "pry"
|
13
|
-
gem "pry-stack_explorer"
|
14
|
-
gem "micro_test"
|
15
|
-
end
|
data/Gemfile.lock
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
activesupport (3.2.9)
|
5
|
-
i18n (~> 0.6)
|
6
|
-
multi_json (~> 1.0)
|
7
|
-
binding_of_caller (0.6.8)
|
8
|
-
builder (3.1.4)
|
9
|
-
coderay (1.0.8)
|
10
|
-
coin (0.1.2)
|
11
|
-
footing (0.1.5)
|
12
|
-
i18n (0.6.1)
|
13
|
-
method_source (0.8.1)
|
14
|
-
micro_test (0.3.1)
|
15
|
-
os
|
16
|
-
multi_json (1.4.0)
|
17
|
-
os (0.9.6)
|
18
|
-
pry (0.9.10)
|
19
|
-
coderay (~> 1.0.5)
|
20
|
-
method_source (~> 0.8)
|
21
|
-
slop (~> 3.3.1)
|
22
|
-
pry (0.9.10-java)
|
23
|
-
coderay (~> 1.0.5)
|
24
|
-
method_source (~> 0.8)
|
25
|
-
slop (~> 3.3.1)
|
26
|
-
spoon (~> 0.0)
|
27
|
-
pry-stack_explorer (0.4.7)
|
28
|
-
binding_of_caller (~> 0.6.8)
|
29
|
-
rack (1.4.1)
|
30
|
-
rack-abstract-format (0.9.9)
|
31
|
-
rack-accept-media-types (0.9)
|
32
|
-
slop (3.3.3)
|
33
|
-
spoon (0.0.1)
|
34
|
-
|
35
|
-
PLATFORMS
|
36
|
-
java
|
37
|
-
ruby
|
38
|
-
|
39
|
-
DEPENDENCIES
|
40
|
-
activesupport
|
41
|
-
builder
|
42
|
-
coin
|
43
|
-
footing (>= 0.1.5)
|
44
|
-
micro_test
|
45
|
-
pry
|
46
|
-
pry-stack_explorer
|
47
|
-
rack
|
48
|
-
rack-abstract-format
|
49
|
-
rack-accept-media-types
|
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2012 Nathan Hopkins
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,128 +0,0 @@
|
|
1
|
-
# CoinRack
|
2
|
-
|
3
|
-
A simple [Rack](http://rack.github.com/) application that provides a
|
4
|
-
REST interface to [Coin's API](https://github.com/hopsoft/coin).
|
5
|
-
|
6
|
-
## Quick Start
|
7
|
-
|
8
|
-
### Run the server
|
9
|
-
|
10
|
-
```bash
|
11
|
-
$ gem install coin_rack
|
12
|
-
$ coin_rack --run
|
13
|
-
```
|
14
|
-
|
15
|
-
### Make some client requests
|
16
|
-
|
17
|
-
```bash
|
18
|
-
$ curl --data "value=true" http://localhost:9292/example.json
|
19
|
-
{"example":true}
|
20
|
-
|
21
|
-
$ curl http://localhost:9292/example.json
|
22
|
-
{"example":true}
|
23
|
-
|
24
|
-
$ curl -X DELETE http://localhost:9292/example.json
|
25
|
-
{"example":true}
|
26
|
-
|
27
|
-
$ curl http://localhost:9292/example.json
|
28
|
-
{"example":null}
|
29
|
-
```
|
30
|
-
|
31
|
-
#### Prefer XML?
|
32
|
-
```bash
|
33
|
-
$ curl --data "value=true" http://localhost:9292/example.xml
|
34
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
35
|
-
<hash>
|
36
|
-
<example type="boolean">true</example>
|
37
|
-
</hash>
|
38
|
-
|
39
|
-
$ curl http://localhost:9292/example.xml
|
40
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
41
|
-
<hash>
|
42
|
-
<example type="boolean">true</example>
|
43
|
-
</hash>
|
44
|
-
|
45
|
-
$ curl -X DELETE http://localhost:9292/example.xml
|
46
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
47
|
-
<hash>
|
48
|
-
<example type="boolean">true</example>
|
49
|
-
</hash>
|
50
|
-
|
51
|
-
$ curl http://localhost:9292/example.xml
|
52
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
53
|
-
<hash>
|
54
|
-
<example nil="true"/>
|
55
|
-
</hash>
|
56
|
-
```
|
57
|
-
|
58
|
-
## URL Definition
|
59
|
-
|
60
|
-
```
|
61
|
-
cache key
|
62
|
-
|
|
63
|
-
http://localhost:9292/KEY.FORMAT
|
64
|
-
|
|
65
|
-
response format
|
66
|
-
```
|
67
|
-
|
68
|
-
*Note: The XML format is also supported but XML examples have been omitted for brevity.*
|
69
|
-
|
70
|
-
## POST/PUT
|
71
|
-
|
72
|
-
Create and/or update the key to a new value.
|
73
|
-
|
74
|
-
#### Params
|
75
|
-
|
76
|
-
* **value** - the value to assign
|
77
|
-
|
78
|
-
#### Request URI
|
79
|
-
|
80
|
-
```
|
81
|
-
http://localhost:9292/example.json
|
82
|
-
```
|
83
|
-
|
84
|
-
#### Request Body
|
85
|
-
|
86
|
-
```
|
87
|
-
value=true
|
88
|
-
```
|
89
|
-
|
90
|
-
#### Response
|
91
|
-
|
92
|
-
```
|
93
|
-
"{\"example\":\"true\"}"
|
94
|
-
```
|
95
|
-
|
96
|
-
## GET
|
97
|
-
|
98
|
-
Get the current value for the specified key.
|
99
|
-
|
100
|
-
#### Request URI
|
101
|
-
|
102
|
-
```
|
103
|
-
http://localhost:9292/example.json
|
104
|
-
```
|
105
|
-
|
106
|
-
#### Response
|
107
|
-
|
108
|
-
```
|
109
|
-
"{\"example\":\"true\"}"
|
110
|
-
```
|
111
|
-
|
112
|
-
## DELETE
|
113
|
-
|
114
|
-
Deletes the key.
|
115
|
-
|
116
|
-
#### Request URI
|
117
|
-
|
118
|
-
```
|
119
|
-
http://localhost:9292/example.json
|
120
|
-
```
|
121
|
-
|
122
|
-
#### Response
|
123
|
-
|
124
|
-
Note the value returned is the value that was deleted.
|
125
|
-
|
126
|
-
```
|
127
|
-
"{\"example\":true}"
|
128
|
-
```
|