bigcartel 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +12 -0
- data/Gemfile +4 -0
- data/README.mkd +27 -0
- data/Rakefile +2 -0
- data/bigcartel.gemspec +24 -0
- data/lib/bigcartel.rb +27 -0
- data/lib/bigcartel/version.rb +3 -0
- metadata +100 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.mkd
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
The Big Cartel Ruby Gem
|
2
|
+
====================
|
3
|
+
A Ruby wrapper for the Big Cartel External REST API.
|
4
|
+
|
5
|
+
Installation
|
6
|
+
------------
|
7
|
+
gem install bigcartel
|
8
|
+
|
9
|
+
Usage
|
10
|
+
------
|
11
|
+
require 'rubygems'
|
12
|
+
require 'bigcartel'
|
13
|
+
require 'pp'
|
14
|
+
|
15
|
+
s = BigCartel::Base.new("tonkapark")
|
16
|
+
pp s.store
|
17
|
+
|
18
|
+
|
19
|
+
Copyright
|
20
|
+
---------
|
21
|
+
Copyright (c) 2011 Matt Anderson
|
22
|
+
|
23
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
24
|
+
|
25
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
26
|
+
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
data/bigcartel.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "bigcartel/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "bigcartel"
|
7
|
+
s.version = BigCartel::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Matt Anderson"]
|
10
|
+
s.email = ["matt@tonkapark.com"]
|
11
|
+
s.homepage = ""
|
12
|
+
s.summary = %q{Ruby wrapper for the Big Cartel API}
|
13
|
+
s.description = %q{A Ruby wrapper for the Big Cartel External REST API}
|
14
|
+
|
15
|
+
s.add_runtime_dependency('crack', '~> 0.1.8')
|
16
|
+
s.add_runtime_dependency('httparty', '~> 0.7.3')
|
17
|
+
|
18
|
+
s.rubyforge_project = s.name
|
19
|
+
|
20
|
+
s.files = `git ls-files`.split("\n")
|
21
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
22
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
|
+
s.require_paths = ["lib"]
|
24
|
+
end
|
data/lib/bigcartel.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
|
3
|
+
module BigCartel
|
4
|
+
|
5
|
+
class Base
|
6
|
+
include HTTParty
|
7
|
+
base_uri "http://api.bigcartel.com"
|
8
|
+
headers 'Content-Type' => 'application/json'
|
9
|
+
|
10
|
+
attr_reader :subdomain
|
11
|
+
|
12
|
+
def initialize(subdomain)
|
13
|
+
@subdomain = subdomain
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
def store
|
18
|
+
self.class.get("/#{@subdomain}/store.js")
|
19
|
+
end
|
20
|
+
|
21
|
+
def products(limit=10)
|
22
|
+
self.class.get("/#{@subdomain}/products.js?limit=#{limit}")
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bigcartel
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Matt Anderson
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-01-26 00:00:00 -06:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: crack
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 1
|
31
|
+
- 8
|
32
|
+
version: 0.1.8
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: httparty
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
- 7
|
46
|
+
- 3
|
47
|
+
version: 0.7.3
|
48
|
+
type: :runtime
|
49
|
+
version_requirements: *id002
|
50
|
+
description: A Ruby wrapper for the Big Cartel External REST API
|
51
|
+
email:
|
52
|
+
- matt@tonkapark.com
|
53
|
+
executables: []
|
54
|
+
|
55
|
+
extensions: []
|
56
|
+
|
57
|
+
extra_rdoc_files: []
|
58
|
+
|
59
|
+
files:
|
60
|
+
- .gitignore
|
61
|
+
- Gemfile
|
62
|
+
- README.mkd
|
63
|
+
- Rakefile
|
64
|
+
- bigcartel.gemspec
|
65
|
+
- lib/bigcartel.rb
|
66
|
+
- lib/bigcartel/version.rb
|
67
|
+
has_rdoc: true
|
68
|
+
homepage: ""
|
69
|
+
licenses: []
|
70
|
+
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
|
74
|
+
require_paths:
|
75
|
+
- lib
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
version: "0"
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
segments:
|
90
|
+
- 0
|
91
|
+
version: "0"
|
92
|
+
requirements: []
|
93
|
+
|
94
|
+
rubyforge_project: bigcartel
|
95
|
+
rubygems_version: 1.3.7
|
96
|
+
signing_key:
|
97
|
+
specification_version: 3
|
98
|
+
summary: Ruby wrapper for the Big Cartel API
|
99
|
+
test_files: []
|
100
|
+
|