sr-couchy 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{README.textile → README.markdown} +32 -32
- data/bin/couchy +4 -2
- data/couchy.gemspec +2 -2
- metadata +2 -2
@@ -1,56 +1,56 @@
|
|
1
|
-
|
1
|
+
Couchy: There Are Many Like It but This One is Mine
|
2
|
+
===================================================
|
2
3
|
|
3
|
-
Couchy is a simple, no-frills, Ruby wrapper around
|
4
|
-
"CouchDB HTTP API":http://wiki.apache.org/couchdb/HttpRestApt.
|
4
|
+
Couchy is a simple, no-frills, Ruby wrapper around [CouchDB][]'s RESTFul API.
|
5
5
|
|
6
|
-
|
6
|
+
Quick overview
|
7
|
+
--------------
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
puts document.inspect
|
15
|
-
</pre>
|
9
|
+
server = CouchRest.new
|
10
|
+
database = server.database('articles')
|
11
|
+
response = database.save(:title => 'Atom-Powered Robots Run Amok', :content => 'Some text.')
|
12
|
+
document = database.get(response['id'])
|
13
|
+
database.delete(document)
|
14
|
+
puts document.inspect
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
Requirements
|
17
|
+
------------
|
19
18
|
|
20
19
|
The fellowing gems are required:
|
21
20
|
|
22
|
-
|
23
|
-
* @addressable@
|
21
|
+
- `rest-client`
|
24
22
|
|
25
23
|
To run the test and generate the code coverage report, you also need :
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
- `test/spec`
|
26
|
+
- `mocha`
|
27
|
+
- `rcov`
|
28
|
+
- `rspec`, for the legacy tests
|
31
29
|
|
32
|
-
and
|
30
|
+
and `yard` to generate the documentation.
|
33
31
|
|
34
|
-
|
32
|
+
Acknowledgement
|
33
|
+
---------------
|
35
34
|
|
36
|
-
It started as an Hardcore Forking Action of
|
35
|
+
It started as an Hardcore Forking Action of [jchris's CouchRest][original]
|
37
36
|
I ended up:
|
38
37
|
|
39
|
-
|
38
|
+
- Writing more tests. The legacy tests are rather integration tests while those
|
40
39
|
I wrote are unit tests.
|
41
|
-
|
42
|
-
|
40
|
+
- DRY-ing it up
|
41
|
+
- Writing some documentation using [YARD][]
|
43
42
|
|
44
43
|
Unfortunately, jchris didn't merge the changes for some reasons.
|
45
44
|
|
46
45
|
Thank a lot to him for having written CouchRest in the first place and having
|
47
46
|
allowed me to relicense my fork under another license.
|
48
47
|
|
49
|
-
|
48
|
+
License
|
49
|
+
-------
|
50
50
|
|
51
51
|
(The MIT License)
|
52
52
|
|
53
|
-
Copyright (c) 2008
|
53
|
+
Copyright (c) 2008 [Simon Rozet][sr], <simon@rozet.name>
|
54
54
|
|
55
55
|
Permission is hereby granted, free of charge, to any person obtaining
|
56
56
|
a copy of this software and associated documentation files (the
|
@@ -71,7 +71,7 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
71
71
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
72
72
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
73
73
|
|
74
|
-
[
|
75
|
-
[
|
76
|
-
[
|
77
|
-
[sr]http://purl.org/net/sr/
|
74
|
+
[CouchDB]: http://couchdb.org
|
75
|
+
[original]: http://github.com/jchris/couchrest
|
76
|
+
[YARD]: http://yard.soen.ca/
|
77
|
+
[sr]: http://purl.org/net/sr/
|
data/bin/couchy
CHANGED
@@ -40,11 +40,13 @@ module Couchy
|
|
40
40
|
parts = path.split
|
41
41
|
design = parts.first.split.last.to_s
|
42
42
|
view = parts.last.to_s
|
43
|
-
|
43
|
+
view_name = view.split('-').first
|
44
|
+
view_type = view.split('-').last.sub('.js', '')
|
44
45
|
view_body = File.read(path)
|
45
46
|
memo.tap do |memo|
|
46
47
|
memo[design] = {} unless memo[design]
|
47
|
-
memo[design][
|
48
|
+
memo[design][view_name] = {} unless memo[design][view_name]
|
49
|
+
memo[design][view_name][view_type] = view_body
|
48
50
|
end
|
49
51
|
end
|
50
52
|
end
|
data/couchy.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'couchy'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.3'
|
4
4
|
s.date = '2008-10-07'
|
5
5
|
s.summary = 'Simple, no-frills, Ruby wrapper around the nice CouchDB HTTP API'
|
6
6
|
s.description = 'Simple, no-frills, Ruby wrapper around the nice CouchDB HTTP API'
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.executables = ['couchy']
|
12
12
|
|
13
13
|
s.files = %w(
|
14
|
-
README.
|
14
|
+
README.markdown
|
15
15
|
Rakefile
|
16
16
|
bin/couchy
|
17
17
|
couchy.gemspec
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sr-couchy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Rozet
|
@@ -30,7 +30,7 @@ extensions: []
|
|
30
30
|
extra_rdoc_files: []
|
31
31
|
|
32
32
|
files:
|
33
|
-
- README.
|
33
|
+
- README.markdown
|
34
34
|
- Rakefile
|
35
35
|
- bin/couchy
|
36
36
|
- couchy.gemspec
|