boutique 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/LICENSE.md ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2011 by Hugh Bien
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,58 @@
1
+ Description
2
+ ===========
3
+
4
+ Boutique is a Sinatra module for selling digital goods. Still under development.
5
+
6
+ Installation
7
+ ============
8
+
9
+ % gem install boutique
10
+
11
+ Setup a `config.ru` file and run it like any other Sinatra application. You
12
+ can configure what products you sell here:
13
+
14
+ require 'rubygems'
15
+ require 'boutique'
16
+
17
+ Boutique.configure do |c|
18
+ c.store_path 'boutique'
19
+ c.download_path 'download'
20
+ c.paypal_key 'paypalapikey'
21
+ c.db_username 'username'
22
+ c.db_password 'password'
23
+ end
24
+
25
+ Boutique.add('Icon Set') do |p|
26
+ p.id 'icon-set'
27
+ p.file '/home/hugh/icon-set.tgz'
28
+ p.price 10.5
29
+ p.return_url 'http://zincmade.com/'
30
+ p.description '50 different icons in three sizes and four colors'
31
+ end
32
+
33
+ # start purchase at /boutique/icon-set/
34
+ # download page at /boutique/long-random-hex-hash/
35
+ # actual file at /download/long-random-hex-hash/icon-set.tgz
36
+ run Boutique::App
37
+
38
+ Usage
39
+ =====
40
+
41
+ The web application is for customers, to get information about your products use
42
+ the included command line application.
43
+
44
+ % boutique --list
45
+ % boutique --stats id --after date --before date
46
+
47
+ Development
48
+ ===========
49
+
50
+ The `config.ru` is for local development. Start the server via `shotgun`
51
+ command. Tests are setup to run individually via `ruby test/*_test.rb` or
52
+ run them all via `rake`.
53
+
54
+ License
55
+ =======
56
+
57
+ Copyright 2011 Hugh Bien - http://hughbien.com.
58
+ Released under MIT License, see LICENSE.md for more info.
data/boutique ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../lib/boutique', File.dirname(__FILE__))
3
+
4
+ Boutique.run!
data/config.ru ADDED
@@ -0,0 +1,3 @@
1
+ require File.expand_path('lib/boutique', File.dirname(__FILE__))
2
+
3
+ run Boutique::App
data/lib/boutique.rb ADDED
@@ -0,0 +1,12 @@
1
+ require 'rubygems'
2
+ require 'sinatra/base'
3
+
4
+ module Boutique
5
+ VERSION = '0.0.1'
6
+
7
+ class App < Sinatra::Base
8
+ get '/' do
9
+ 'test'
10
+ end
11
+ end
12
+ end
data/test/app_test.rb ADDED
@@ -0,0 +1,20 @@
1
+ require 'rubygems'
2
+ require 'minitest/autorun'
3
+ require 'rack'
4
+ require 'rack/test'
5
+ require 'rack/server'
6
+
7
+ class BoutiqueTest < MiniTest::Unit::TestCase
8
+ include Rack::Test::Methods
9
+
10
+ def test_ok
11
+ get '/'
12
+ assert last_response.ok?
13
+ assert_equal 'test', last_response.body
14
+ end
15
+
16
+ private
17
+ def app
18
+ @app ||= Rack::Server.new.app
19
+ end
20
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: boutique
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Hugh Bien
9
+ autorequire:
10
+ bindir: .
11
+ cert_chain: []
12
+ date: 2012-01-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sinatra
16
+ requirement: &70112066891200 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70112066891200
25
+ - !ruby/object:Gem::Dependency
26
+ name: minitest
27
+ requirement: &70112066876420 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70112066876420
36
+ - !ruby/object:Gem::Dependency
37
+ name: shotgun
38
+ requirement: &70112066875860 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70112066875860
47
+ description: A Sinatra module which accepts payments via PayPal and gives customers
48
+ a secret URL to download your product.
49
+ email:
50
+ - hugh@hughbien.com
51
+ executables:
52
+ - boutique
53
+ extensions: []
54
+ extra_rdoc_files: []
55
+ files:
56
+ - LICENSE.md
57
+ - README.md
58
+ - config.ru
59
+ - boutique
60
+ - lib/boutique.rb
61
+ - test/app_test.rb
62
+ - ./boutique
63
+ homepage: https://github.com/hughbien/boutique
64
+ licenses: []
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths: lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: 1.3.6
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 1.8.11
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: Sinatra module for selling digital goods
86
+ test_files: []