cafepress-alpha 0.0.1

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/CHANGELOG.txt ADDED
File without changes
data/Manifest.txt ADDED
@@ -0,0 +1,10 @@
1
+ Rakefile
2
+ README.txt
3
+ CHANGELOG.txt
4
+ Manifest.txt
5
+ setup.rb
6
+ lib/cafepress/version.rb
7
+ lib/cafepress.rb
8
+ lib/utils/string.rb
9
+ test/test_helper.rb
10
+ test/cafepress_search_test.rb
data/README.txt ADDED
@@ -0,0 +1,14 @@
1
+ README for cafepress
2
+
3
+ CafePress has exposed a set of Web APIs as various forms of SOAP and HTTP GETs and POSTs.
4
+
5
+ The goal of this library is to wrap those up in a Ruby-style API and make programatic interaction with CafePress
6
+ simpler and more intuitive.
7
+
8
+
9
+ If you have particualr use caes for the CafePres Web APIs, or ideas on what would make for a nice Ruby API,
10
+ please drop me note at james@neurogami.com
11
+
12
+
13
+ James Britt
14
+
data/Rakefile ADDED
@@ -0,0 +1,66 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rake/clean'
4
+ require 'rake/testtask'
5
+ require 'rake/packagetask'
6
+ require 'rake/gempackagetask'
7
+ require 'rake/rdoctask'
8
+ require 'rake/contrib/rubyforgepublisher'
9
+ require 'fileutils'
10
+ require 'hoe'
11
+
12
+ require 'drake'
13
+ require 'tracula'
14
+
15
+ include Neurogami::Drake
16
+
17
+ include FileUtils
18
+ require File.join(File.dirname(__FILE__), 'lib', 'cafepress', 'version')
19
+
20
+ AUTHOR = "James Britt" # can also be an array of Authors
21
+ EMAIL = "james@neurogami.com"
22
+ DESCRIPTION = "Makes the CafePress Web API easy to use!"
23
+ GEM_NAME = "cafepress-alpha" # what ppl will type to install your gem
24
+ RUBYFORGE_PROJECT = "cafepress" # The unix name for your project
25
+ HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
26
+
27
+
28
+ NAME = "cafepress-alpha"
29
+ REV = nil # UNCOMMENT IF REQUIRED: File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
30
+ VERS = ENV['VERSION'] || (CafePress::VERSION::STRING + (REV ? ".#{REV}" : ""))
31
+ VESION = VERS
32
+
33
+ CLEAN.include ['**/.*.sw?', '*.gem', '.config']
34
+ RDOC_OPTS = ['--quiet', '--title', "CafePress Library Documentation",
35
+ "--opname", "index.html",
36
+ "--line-numbers",
37
+ "--main", "README",
38
+ "--inline-source",
39
+ "--include lib",
40
+ "--include lib/cafepress",
41
+ "--include lib/utils"
42
+ ]
43
+
44
+ class Hoe
45
+ def extra_deps
46
+ @extra_deps.reject { |x| Array(x).first == 'hoe' }
47
+ end
48
+ end
49
+
50
+ # Generate all the Rake tasks
51
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
52
+ hoe = Hoe.new(GEM_NAME, VERS) do |p|
53
+ p.author = AUTHOR
54
+ p.description = DESCRIPTION
55
+ p.email = EMAIL
56
+ p.summary = DESCRIPTION
57
+ p.url = HOMEPATH
58
+ p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
59
+ p.test_globs = ["test/**/*_test.rb"]
60
+ p.clean_globs = CLEAN #An array of file patterns to delete on clean.
61
+
62
+ # == Optional
63
+ #p.changes - A description of the release's latest changes.
64
+ #p.extra_deps - An array of rubygem dependencies.
65
+ #p.spec_extras - A hash of extra values to set in the gemspec.
66
+ end
@@ -0,0 +1,9 @@
1
+ module CafePress #:nodoc:
2
+ module VERSION #:nodoc:
3
+ MAJOR = 0
4
+ MINOR = 0
5
+ TINY = 1
6
+
7
+ STRING = [MAJOR, MINOR, TINY].join('.')
8
+ end
9
+ end
data/lib/cafepress.rb ADDED
@@ -0,0 +1,4 @@
1
+ here = File.expand_path(File.dirname( __FILE__ ) )
2
+ $:.unshift(here)
3
+
4
+ Dir[File.join(File.dirname(__FILE__), 'cafepress/**/*.rb')].sort.each { |lib| require lib }
@@ -0,0 +1,14 @@
1
+
2
+
3
+ class String
4
+
5
+ # Reshape a string
6
+ def camelize
7
+ return self.strip unless self =~ /_/
8
+ x = self.strip.split( '_' )
9
+ s = x.shift
10
+ s << ( x.map{|seg| seg.capitalize }.join('') )
11
+ s
12
+ end
13
+ end
14
+