commons 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +78 -48
- data/commons.gemspec +1 -1
- data/lib/commons/client/content.rb +1 -1
- data/lib/commons/configuration.rb +1 -1
- data/lib/commons/version.rb +1 -1
- data/spec/helper.rb +1 -1
- metadata +25 -25
data/README.md
CHANGED
@@ -1,34 +1,28 @@
|
|
1
|
-
#Commons
|
2
|
-
|
3
|
-
A Ruby wrapper for the Civic Commons MarketPlace API at [http://marketplace.civiccommons.org/api](http://marketplace.civiccommons.org/api)
|
1
|
+
# Commons [][travis] [][gemnasium]
|
2
|
+
A Ruby Wrapper for the Civic Commons Marketplace API
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
Add it to the [apps](http://github.com/codeforamerica/commons/wiki/apps) wiki!
|
4
|
+
[travis]: http://travis-ci.org/codeforamerica/commons
|
5
|
+
[gemnasium]: https://gemnasium.com/codeforamerica/commons
|
8
6
|
|
9
|
-
Installation
|
10
|
-
|
11
|
-
$ gem install commons
|
7
|
+
## <a name="installation"></a>Installation
|
8
|
+
gem install commons
|
12
9
|
|
13
|
-
Documentation
|
14
|
-
-------------
|
10
|
+
## <a name="documentation"></a>Documentation
|
15
11
|
[http://rdoc.info/gems/commons](http://rdoc.info/gems/commons)
|
16
12
|
|
17
|
-
Continuous Integration
|
18
|
-
----------------------
|
19
|
-
[](http://travis-ci.org/codeforamerica/commons)
|
20
13
|
|
21
|
-
Usage Examples
|
22
|
-
--------------
|
14
|
+
## <a name="examples"><a/>Usage Examples
|
23
15
|
require 'commons'
|
24
16
|
|
25
|
-
|
26
|
-
|
27
|
-
|
17
|
+
@client = Commons.new
|
18
|
+
a = @client.content("13813")
|
19
|
+
a.title # => "YouTown"
|
28
20
|
|
29
|
-
Contributing
|
30
|
-
|
31
|
-
|
21
|
+
## <a name="contributing"></a>Contributing
|
22
|
+
In the spirit of [free software][free-sw], **everyone** is encouraged to help
|
23
|
+
improve this project.
|
24
|
+
|
25
|
+
[free-sw]: http://www.fsf.org/licensing/essays/free-sw.html
|
32
26
|
|
33
27
|
Here are some ways *you* can contribute:
|
34
28
|
|
@@ -37,36 +31,72 @@ Here are some ways *you* can contribute:
|
|
37
31
|
* by suggesting new features
|
38
32
|
* by writing or editing documentation
|
39
33
|
* by writing specifications
|
40
|
-
* by writing code (**no patch is too small**: fix typos, add comments, clean up
|
34
|
+
* by writing code (**no patch is too small**: fix typos, add comments, clean up
|
35
|
+
inconsistent whitespace)
|
41
36
|
* by refactoring code
|
42
|
-
* by
|
37
|
+
* by closing [issues][]
|
43
38
|
* by reviewing patches
|
39
|
+
* [financially][]
|
40
|
+
|
41
|
+
[issues]: https://github.com/codeforamerica/commons/issues
|
42
|
+
[financially]: https://secure.codeforamerica.org/page/contribute
|
43
|
+
|
44
|
+
## <a name="issues"></a>Submitting an Issue
|
45
|
+
We use the [GitHub issue tracker][issues] to track bugs and features. Before
|
46
|
+
submitting a bug report or feature request, check to make sure it hasn't
|
47
|
+
already been submitted. You can indicate support for an existing issue by
|
48
|
+
voting it up. When submitting a bug report, please include a [Gist][] that
|
49
|
+
includes a stack trace and any details that may be necessary to reproduce the
|
50
|
+
bug, including your gem version, Ruby version, and operating system. Ideally, a
|
51
|
+
bug report should include a pull request with failing specs.
|
52
|
+
|
53
|
+
[gist]: https://gist.github.com/
|
44
54
|
|
45
|
-
Submitting
|
46
|
-
-------------------
|
47
|
-
We use the [GitHub issue tracker](http://github.com/codeforamerica/commons/issues) to track bugs and
|
48
|
-
features. Before submitting a bug report or feature request, check to make sure it hasn't already
|
49
|
-
been submitted. You can indicate support for an existing issuse by voting it up. When submitting a
|
50
|
-
bug report, please include a [Gist](http://gist.github.com/) that includes a stack trace and any
|
51
|
-
details that may be necessary to reproduce the bug, including your gem version, Ruby version, and
|
52
|
-
operating system. Ideally, a bug report should include a pull request with failing specs.
|
53
|
-
|
54
|
-
Submitting a Pull Request
|
55
|
-
-------------------------
|
55
|
+
## <a name="pulls"></a>Submitting a Pull Request
|
56
56
|
1. Fork the project.
|
57
57
|
2. Create a topic branch.
|
58
58
|
3. Implement your feature or bug fix.
|
59
|
-
4. Add
|
60
|
-
5. Run
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
59
|
+
4. Add tests for your feature or bug fix.
|
60
|
+
5. Run `bundle exec rake spec`. If your changes are not 100% covered, go back
|
61
|
+
to step 4.
|
62
|
+
6. Commit and push your changes.
|
63
|
+
7. Submit a pull request. Please do not include changes to the gemspec or
|
64
|
+
version file. (If you want to create your own version for some reason,
|
65
|
+
please do so in a separate commit.)
|
66
|
+
|
67
|
+
## <a name="versions"></a>Supported Ruby Versions
|
68
|
+
This library aims to support and is [tested against][travis] the following Ruby
|
69
|
+
implementations:
|
70
|
+
|
71
|
+
* Ruby 1.8.7
|
72
|
+
* Ruby 1.9.2
|
73
|
+
* Ruby 1.9.3
|
74
|
+
|
75
|
+
If something doesn't work on one of these interpreters, it should be considered
|
76
|
+
a bug.
|
77
|
+
|
78
|
+
This library may inadvertently work (or seem to work) on other Ruby
|
79
|
+
implementations, however support will only be provided for the versions listed
|
80
|
+
above.
|
81
|
+
|
82
|
+
If you would like this library to support another Ruby version, you may
|
83
|
+
volunteer to be a maintainer. Being a maintainer entails making sure all tests
|
84
|
+
run and pass on that implementation. When something breaks on your
|
85
|
+
implementation, you will be personally responsible for providing patches in a
|
86
|
+
timely fashion. If critical issues for a particular implementation exist at the
|
87
|
+
time of a major release, support for that Ruby version may be dropped.
|
88
|
+
|
89
|
+
|
90
|
+
## Credits
|
91
|
+
Civic Commons Marketplace API - [API](http://marketplace.civiccommons.org/api)
|
92
|
+
|
93
|
+
|
94
|
+
## <a name="copyright"></a>Copyright
|
95
|
+
Copyright (c) 2012 Code for America. See [LICENSE][] for details.
|
96
|
+
|
97
|
+
[license]: https://github.com/codeforamerica/commons/blob/master/LICENSE.md
|
98
|
+
|
99
|
+
[][tracker]
|
100
|
+
|
101
|
+
[tracker]: http://stats.codeforamerica.org/projects/commons
|
72
102
|
|
data/commons.gemspec
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('../lib/commons/version', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.add_dependency 'faraday', '~> 0.7'
|
6
|
-
gem.add_dependency 'faraday_middleware', '~> 0.
|
6
|
+
gem.add_dependency 'faraday_middleware', '~> 0.8'
|
7
7
|
gem.add_dependency 'hashie', '~> 1.2'
|
8
8
|
gem.add_dependency 'multi_json', '~> 1.0'
|
9
9
|
gem.add_dependency 'rash', '~> 0.3.2'
|
@@ -6,7 +6,7 @@ module Commons
|
|
6
6
|
# @param id [String] The id for the product number
|
7
7
|
# @param options [Hash] A customizable set of options.
|
8
8
|
# @return [Array<Hashie::Mash>]
|
9
|
-
# @see http://
|
9
|
+
# @see http://www.civiccommons.org/api
|
10
10
|
# @example
|
11
11
|
# Comments.content("13351")
|
12
12
|
def content(id,options={})
|
@@ -16,7 +16,7 @@ module Commons
|
|
16
16
|
DEFAULT_ADAPTER = :net_http
|
17
17
|
|
18
18
|
# The endpoint that will be used to connect if none is set
|
19
|
-
DEFAULT_ENDPOINT = 'http://
|
19
|
+
DEFAULT_ENDPOINT = 'http://civiccommons.org/api/v1'.freeze
|
20
20
|
|
21
21
|
# The response format appended to the path and sent in the 'Accept' header if none is set
|
22
22
|
#
|
data/lib/commons/version.rb
CHANGED
data/spec/helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
16
|
-
requirement: &
|
16
|
+
requirement: &70246211989300 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,21 +21,21 @@ dependencies:
|
|
21
21
|
version: '0.7'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70246211989300
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: faraday_middleware
|
27
|
-
requirement: &
|
27
|
+
requirement: &70246211987820 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '0.
|
32
|
+
version: '0.8'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70246211987820
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: hashie
|
38
|
-
requirement: &
|
38
|
+
requirement: &70246211986760 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '1.2'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70246211986760
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: multi_json
|
49
|
-
requirement: &
|
49
|
+
requirement: &70246211985580 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '1.0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70246211985580
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rash
|
60
|
-
requirement: &
|
60
|
+
requirement: &70246211984860 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.3.2
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70246211984860
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
|
-
requirement: &
|
71
|
+
requirement: &70246211983740 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70246211983740
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rdiscount
|
82
|
-
requirement: &
|
82
|
+
requirement: &70246212897400 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70246212897400
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rspec
|
93
|
-
requirement: &
|
93
|
+
requirement: &70246212896980 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70246212896980
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: simplecov
|
104
|
-
requirement: &
|
104
|
+
requirement: &70246212896560 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70246212896560
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: webmock
|
115
|
-
requirement: &
|
115
|
+
requirement: &70246212896140 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70246212896140
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: yard
|
126
|
-
requirement: &
|
126
|
+
requirement: &70246212895720 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,7 +131,7 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *70246212895720
|
135
135
|
description: Ruby Wrapper for the Civic Commons MarketPlace API - http://marketplace.civiccommons.org/api
|
136
136
|
email: ryan@codeforamerica.org
|
137
137
|
executables: []
|