collecta_ruby 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/README.md +31 -3
- data/VERSION +1 -1
- data/collecta_ruby.gemspec +2 -1
- data/lib/collecta_ruby.rb +1 -0
- metadata +2 -1
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -7,13 +7,40 @@ A quick and rough Ruby/Rails library to query info from the [Collecta][1] API. C
|
|
7
7
|
[1]: http://collecta.com/
|
8
8
|
[2]: http://developer.collecta.com/
|
9
9
|
|
10
|
-
##
|
10
|
+
## Installation
|
11
11
|
|
12
12
|
### Ruby on Rails Plugin
|
13
13
|
|
14
14
|
script/plugin install git://github.com/jimeh/collecta_ruby.git
|
15
15
|
|
16
|
-
|
16
|
+
### RubyGem
|
17
|
+
|
18
|
+
The gem is hosted on [Gemcutter][1]. If you don't have Gemcutter setup already, I recommend you do so by following the instructions on their [documentation][2] page.
|
19
|
+
|
20
|
+
[1]: http://gemcutter.org/
|
21
|
+
[2]: http://gemcutter.org/pages/gem_docs
|
22
|
+
|
23
|
+
Install with Gemcutter:
|
24
|
+
|
25
|
+
sudo gem install collecta_ruby
|
26
|
+
|
27
|
+
If you would prefer to not get setup for Gemcutter, install with this command instead:
|
28
|
+
|
29
|
+
sudo gem install collecta_ruby --source http://gemcutter.org/
|
30
|
+
|
31
|
+
## Setup
|
32
|
+
|
33
|
+
### Ruby on Rails Plugin
|
34
|
+
|
35
|
+
Edit `config/collecta.yml` to supply your Collecta API key(s) for the each environment.
|
36
|
+
|
37
|
+
### Ruby on Rails with RubyGem
|
38
|
+
|
39
|
+
Add the following to your `environment.rb`:
|
40
|
+
|
41
|
+
config.gem "collecta_ruby", :source => "http://gemcutter.org/"
|
42
|
+
|
43
|
+
Then create a initializer called `collecta.rb` and specify your Collecta API key the same way as bellow for Plain Ruby.
|
17
44
|
|
18
45
|
### Plain Ruby
|
19
46
|
|
@@ -21,6 +48,7 @@ Supply your API to the Collecta class:
|
|
21
48
|
|
22
49
|
Collecta.set_key = "APIKEY"
|
23
50
|
|
51
|
+
|
24
52
|
## Usage
|
25
53
|
|
26
54
|
Search for iPhone:
|
@@ -33,7 +61,7 @@ Search with additional options/parameters:
|
|
33
61
|
|
34
62
|
Available parameter options are `:rpp`, `:page`, `:since_id`, `:format`, `:callback`, `:category`, and `:exclude`. The `:exclude` parameter simply excludes results from specified categories.
|
35
63
|
|
36
|
-
## Notes /
|
64
|
+
## Notes / Warnings
|
37
65
|
|
38
66
|
* Response data from Collecta is currently returned in it's raw JSON or Atom form. Parsing the JSON responses to a Hash fails cause it's more than 20 levels deep. And parsing the Atom data fails for some reason cause XPath doesn't like Atom, and I'm no XML expert. If you know better than me, please fork, fix, and pull request :)
|
39
67
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/collecta_ruby.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{collecta_ruby}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jim Myhrberg"]
|
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
"init.rb",
|
27
27
|
"install.rb",
|
28
28
|
"lib/collecta.rb",
|
29
|
+
"lib/collecta_ruby.rb",
|
29
30
|
"tasks/collecta_ruby_tasks.rake",
|
30
31
|
"templates/config/collecta.yml",
|
31
32
|
"test/collecta_ruby_test.rb",
|
@@ -0,0 +1 @@
|
|
1
|
+
require "collecta"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: collecta_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Myhrberg
|
@@ -32,6 +32,7 @@ files:
|
|
32
32
|
- init.rb
|
33
33
|
- install.rb
|
34
34
|
- lib/collecta.rb
|
35
|
+
- lib/collecta_ruby.rb
|
35
36
|
- tasks/collecta_ruby_tasks.rake
|
36
37
|
- templates/config/collecta.yml
|
37
38
|
- test/collecta_ruby_test.rb
|