piggybak 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +14 -17
- data/Gemfile.lock +134 -68
- data/Rakefile +35 -38
- data/app/assets/javascripts/{jquery.ajaxq.js → piggybak/jquery.ajaxq.js} +0 -0
- data/app/assets/javascripts/{piggybak-application.js → piggybak/piggybak-application.js} +3 -3
- data/app/assets/javascripts/{piggybak.js → piggybak/piggybak.js} +0 -0
- data/app/assets/javascripts/{piggybak.states.js → piggybak/piggybak.states.js} +0 -0
- data/app/views/rails_admin/main/_location_select.html.haml +1 -1
- data/lib/piggybak.rb +4 -1
- data/lib/piggybak/cli.rb +3 -9
- data/lib/piggybak/version.rb +3 -0
- metadata +89 -437
- data/.document +0 -5
- data/VERSION +0 -1
- data/piggybak.gemspec +0 -249
- data/spec/TODO +0 -5
- data/spec/database_helpers.rb +0 -15
- data/spec/dummy_app/.gitignore +0 -15
- data/spec/dummy_app/Gemfile +0 -17
- data/spec/dummy_app/Gemfile.lock +0 -190
- data/spec/dummy_app/Rakefile +0 -7
- data/spec/dummy_app/app/assets/images/rails.png +0 -0
- data/spec/dummy_app/app/assets/javascripts/application.js +0 -9
- data/spec/dummy_app/app/assets/javascripts/images.js.coffee +0 -3
- data/spec/dummy_app/app/assets/stylesheets/application.css +0 -7
- data/spec/dummy_app/app/assets/stylesheets/images.css.scss +0 -3
- data/spec/dummy_app/app/controllers/application_controller.rb +0 -3
- data/spec/dummy_app/app/controllers/images_controller.rb +0 -9
- data/spec/dummy_app/app/helpers/application_helper.rb +0 -2
- data/spec/dummy_app/app/helpers/images_helper.rb +0 -2
- data/spec/dummy_app/app/mailers/.gitkeep +0 -0
- data/spec/dummy_app/app/models/.gitkeep +0 -0
- data/spec/dummy_app/app/models/image.rb +0 -3
- data/spec/dummy_app/app/models/user.rb +0 -9
- data/spec/dummy_app/app/views/images/index.html +0 -3
- data/spec/dummy_app/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy_app/config.ru +0 -4
- data/spec/dummy_app/config/application.rb +0 -49
- data/spec/dummy_app/config/boot.rb +0 -6
- data/spec/dummy_app/config/database.yml +0 -25
- data/spec/dummy_app/config/environment.rb +0 -5
- data/spec/dummy_app/config/environments/development.rb +0 -30
- data/spec/dummy_app/config/environments/production.rb +0 -60
- data/spec/dummy_app/config/environments/test.rb +0 -39
- data/spec/dummy_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy_app/config/initializers/devise.rb +0 -209
- data/spec/dummy_app/config/initializers/inflections.rb +0 -10
- data/spec/dummy_app/config/initializers/mime_types.rb +0 -5
- data/spec/dummy_app/config/initializers/quiet_assets.rb +0 -10
- data/spec/dummy_app/config/initializers/secret_token.rb +0 -7
- data/spec/dummy_app/config/initializers/session_store.rb +0 -8
- data/spec/dummy_app/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy_app/config/locales/devise.en.yml +0 -58
- data/spec/dummy_app/config/locales/en.yml +0 -5
- data/spec/dummy_app/config/routes.rb +0 -9
- data/spec/dummy_app/db/migrate/20120119002503_create_images.rb +0 -9
- data/spec/dummy_app/db/migrate/20120119003643_devise_create_users.rb +0 -25
- data/spec/dummy_app/db/schema.rb +0 -40
- data/spec/dummy_app/db/seeds.rb +0 -7
- data/spec/dummy_app/lib/assets/.gitkeep +0 -0
- data/spec/dummy_app/lib/tasks/.gitkeep +0 -0
- data/spec/dummy_app/public/404.html +0 -26
- data/spec/dummy_app/public/422.html +0 -26
- data/spec/dummy_app/public/500.html +0 -26
- data/spec/dummy_app/public/favicon.ico +0 -0
- data/spec/dummy_app/public/robots.txt +0 -5
- data/spec/dummy_app/script/rails +0 -6
- data/spec/factories.rb +0 -16
- data/spec/models/line_item_spec.rb +0 -5
- data/spec/models/order_spec.rb +0 -8
- data/spec/spec_helper.rb +0 -48
@@ -1,10 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Add new inflection rules using the following format
|
4
|
-
# (all these examples are active by default):
|
5
|
-
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
-
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
-
# inflect.singular /^(ox)en/i, '\1'
|
8
|
-
# inflect.irregular 'person', 'people'
|
9
|
-
# inflect.uncountable %w( fish sheep )
|
10
|
-
# end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# https://github.com/rails/rails/issues/3164
|
2
|
-
# http://stackoverflow.com/questions/6312448/how-to-disable-logging-of-asset-pipeline-sprockets-messages-in-rails-3-1
|
3
|
-
|
4
|
-
Rails.application.assets.logger = Logger.new('/dev/null')
|
5
|
-
Rails::Rack::Logger.class_eval do
|
6
|
-
def before_dispatch_with_quiet_assets(env)
|
7
|
-
before_dispatch_without_quiet_assets(env) unless env['PATH_INFO'].index("/assets/") == 0
|
8
|
-
end
|
9
|
-
alias_method_chain :before_dispatch, :quiet_assets
|
10
|
-
end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Your secret key for verifying the integrity of signed cookies.
|
4
|
-
# If you change this key, all old signed cookies will become invalid!
|
5
|
-
# Make sure the secret is at least 30 characters and all random,
|
6
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
DummyApp::Application.config.secret_token = '8a5dc5152c875573e5658d206fe662b3653d06116aa8f81a2cb21d5116e796b6dd60fe4109fc7cba50ca5966eb2b308dc26baea169874009dc5b20150d180540'
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
DummyApp::Application.config.session_store :cookie_store, :key => '_dummy_app_session'
|
4
|
-
|
5
|
-
# Use the database for sessions instead of the cookie-based default,
|
6
|
-
# which shouldn't be used to store highly confidential information
|
7
|
-
# (create the session table with "rails generate session_migration")
|
8
|
-
# DummyApp::Application.config.session_store :active_record_store
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
#
|
3
|
-
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
-
# is enabled by default.
|
5
|
-
|
6
|
-
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
-
ActiveSupport.on_load(:action_controller) do
|
8
|
-
wrap_parameters :format => [:json]
|
9
|
-
end
|
10
|
-
|
11
|
-
# Disable root element in JSON by default.
|
12
|
-
ActiveSupport.on_load(:active_record) do
|
13
|
-
self.include_root_in_json = false
|
14
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
2
|
-
|
3
|
-
en:
|
4
|
-
errors:
|
5
|
-
messages:
|
6
|
-
expired: "has expired, please request a new one"
|
7
|
-
not_found: "not found"
|
8
|
-
already_confirmed: "was already confirmed, please try signing in"
|
9
|
-
not_locked: "was not locked"
|
10
|
-
not_saved:
|
11
|
-
one: "1 error prohibited this %{resource} from being saved:"
|
12
|
-
other: "%{count} errors prohibited this %{resource} from being saved:"
|
13
|
-
|
14
|
-
devise:
|
15
|
-
failure:
|
16
|
-
already_authenticated: 'You are already signed in.'
|
17
|
-
unauthenticated: 'You need to sign in or sign up before continuing.'
|
18
|
-
unconfirmed: 'You have to confirm your account before continuing.'
|
19
|
-
locked: 'Your account is locked.'
|
20
|
-
invalid: 'Invalid email or password.'
|
21
|
-
invalid_token: 'Invalid authentication token.'
|
22
|
-
timeout: 'Your session expired, please sign in again to continue.'
|
23
|
-
inactive: 'Your account was not activated yet.'
|
24
|
-
sessions:
|
25
|
-
signed_in: 'Signed in successfully.'
|
26
|
-
signed_out: 'Signed out successfully.'
|
27
|
-
passwords:
|
28
|
-
send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
|
29
|
-
updated: 'Your password was changed successfully. You are now signed in.'
|
30
|
-
updated_not_active: 'Your password was changed successfully.'
|
31
|
-
send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
|
32
|
-
confirmations:
|
33
|
-
send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
|
34
|
-
send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
|
35
|
-
confirmed: 'Your account was successfully confirmed. You are now signed in.'
|
36
|
-
registrations:
|
37
|
-
signed_up: 'Welcome! You have signed up successfully.'
|
38
|
-
inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
|
39
|
-
updated: 'You updated your account successfully.'
|
40
|
-
destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
|
41
|
-
reasons:
|
42
|
-
inactive: 'inactive'
|
43
|
-
unconfirmed: 'unconfirmed'
|
44
|
-
locked: 'locked'
|
45
|
-
unlocks:
|
46
|
-
send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
|
47
|
-
unlocked: 'Your account was successfully unlocked. You are now signed in.'
|
48
|
-
send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
|
49
|
-
omniauth_callbacks:
|
50
|
-
success: 'Successfully authorized from %{kind} account.'
|
51
|
-
failure: 'Could not authorize you from %{kind} because "%{reason}".'
|
52
|
-
mailer:
|
53
|
-
confirmation_instructions:
|
54
|
-
subject: 'Confirmation instructions'
|
55
|
-
reset_password_instructions:
|
56
|
-
subject: 'Reset password instructions'
|
57
|
-
unlock_instructions:
|
58
|
-
subject: 'Unlock Instructions'
|
@@ -1,9 +0,0 @@
|
|
1
|
-
DummyApp::Application.routes.draw do
|
2
|
-
devise_for :users
|
3
|
-
|
4
|
-
root :to => "images#index"
|
5
|
-
match 'image/:id' => "images#show", :as => :image
|
6
|
-
|
7
|
-
mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
|
8
|
-
mount Piggybak::Engine => "/checkout", :as => 'piggybak'
|
9
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
class DeviseCreateUsers < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table(:users) do |t|
|
4
|
-
t.database_authenticatable :null => false
|
5
|
-
t.recoverable
|
6
|
-
t.rememberable
|
7
|
-
t.trackable
|
8
|
-
|
9
|
-
# t.encryptable
|
10
|
-
# t.confirmable
|
11
|
-
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
|
12
|
-
# t.token_authenticatable
|
13
|
-
|
14
|
-
|
15
|
-
t.timestamps
|
16
|
-
end
|
17
|
-
|
18
|
-
add_index :users, :email, :unique => true
|
19
|
-
add_index :users, :reset_password_token, :unique => true
|
20
|
-
# add_index :users, :confirmation_token, :unique => true
|
21
|
-
# add_index :users, :unlock_token, :unique => true
|
22
|
-
# add_index :users, :authentication_token, :unique => true
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
data/spec/dummy_app/db/schema.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
# This file is auto-generated from the current state of the database. Instead
|
3
|
-
# of editing this file, please use the migrations feature of Active Record to
|
4
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
-
#
|
6
|
-
# Note that this schema.rb definition is the authoritative source for your
|
7
|
-
# database schema. If you need to create the application database on another
|
8
|
-
# system, you should be using db:schema:load, not running all the migrations
|
9
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
-
#
|
12
|
-
# It's strongly recommended to check this file into your version control system.
|
13
|
-
|
14
|
-
ActiveRecord::Schema.define(:version => 20120119003643) do
|
15
|
-
|
16
|
-
create_table "images", :force => true do |t|
|
17
|
-
t.string "title"
|
18
|
-
t.datetime "created_at"
|
19
|
-
t.datetime "updated_at"
|
20
|
-
end
|
21
|
-
|
22
|
-
create_table "users", :force => true do |t|
|
23
|
-
t.string "email", :default => "", :null => false
|
24
|
-
t.string "encrypted_password", :limit => 128, :default => "", :null => false
|
25
|
-
t.string "reset_password_token"
|
26
|
-
t.datetime "reset_password_sent_at"
|
27
|
-
t.datetime "remember_created_at"
|
28
|
-
t.integer "sign_in_count", :default => 0
|
29
|
-
t.datetime "current_sign_in_at"
|
30
|
-
t.datetime "last_sign_in_at"
|
31
|
-
t.string "current_sign_in_ip"
|
32
|
-
t.string "last_sign_in_ip"
|
33
|
-
t.datetime "created_at"
|
34
|
-
t.datetime "updated_at"
|
35
|
-
end
|
36
|
-
|
37
|
-
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
|
38
|
-
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
|
39
|
-
|
40
|
-
end
|
data/spec/dummy_app/db/seeds.rb
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
-
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
-
#
|
4
|
-
# Examples:
|
5
|
-
#
|
6
|
-
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
7
|
-
# Mayor.create(:name => 'Emanuel', :city => cities.first)
|
File without changes
|
File without changes
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
-
<style type="text/css">
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
-
div.dialog {
|
8
|
-
width: 25em;
|
9
|
-
padding: 0 4em;
|
10
|
-
margin: 4em auto 0 auto;
|
11
|
-
border: 1px solid #ccc;
|
12
|
-
border-right-color: #999;
|
13
|
-
border-bottom-color: #999;
|
14
|
-
}
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
-
</style>
|
17
|
-
</head>
|
18
|
-
|
19
|
-
<body>
|
20
|
-
<!-- This file lives in public/404.html -->
|
21
|
-
<div class="dialog">
|
22
|
-
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
-
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
-
</div>
|
25
|
-
</body>
|
26
|
-
</html>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The change you wanted was rejected (422)</title>
|
5
|
-
<style type="text/css">
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
-
div.dialog {
|
8
|
-
width: 25em;
|
9
|
-
padding: 0 4em;
|
10
|
-
margin: 4em auto 0 auto;
|
11
|
-
border: 1px solid #ccc;
|
12
|
-
border-right-color: #999;
|
13
|
-
border-bottom-color: #999;
|
14
|
-
}
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
-
</style>
|
17
|
-
</head>
|
18
|
-
|
19
|
-
<body>
|
20
|
-
<!-- This file lives in public/422.html -->
|
21
|
-
<div class="dialog">
|
22
|
-
<h1>The change you wanted was rejected.</h1>
|
23
|
-
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
-
</div>
|
25
|
-
</body>
|
26
|
-
</html>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>We're sorry, but something went wrong (500)</title>
|
5
|
-
<style type="text/css">
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
-
div.dialog {
|
8
|
-
width: 25em;
|
9
|
-
padding: 0 4em;
|
10
|
-
margin: 4em auto 0 auto;
|
11
|
-
border: 1px solid #ccc;
|
12
|
-
border-right-color: #999;
|
13
|
-
border-bottom-color: #999;
|
14
|
-
}
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
-
</style>
|
17
|
-
</head>
|
18
|
-
|
19
|
-
<body>
|
20
|
-
<!-- This file lives in public/500.html -->
|
21
|
-
<div class="dialog">
|
22
|
-
<h1>We're sorry, but something went wrong.</h1>
|
23
|
-
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
|
24
|
-
</div>
|
25
|
-
</body>
|
26
|
-
</html>
|
File without changes
|
data/spec/dummy_app/script/rails
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
-
|
4
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
-
require File.expand_path('../../config/boot', __FILE__)
|
6
|
-
require 'rails/commands'
|
data/spec/factories.rb
DELETED
data/spec/models/order_spec.rb
DELETED
data/spec/spec_helper.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# Configure Rails Envinronment
|
2
|
-
ENV["RAILS_ENV"] = "test"
|
3
|
-
|
4
|
-
require 'simplecov'
|
5
|
-
require 'rails/all'
|
6
|
-
SimpleCov.start 'rails'
|
7
|
-
|
8
|
-
ENV['SKIP_RAILS_ADMIN_INITIALIZER'] = 'true'
|
9
|
-
require File.expand_path('../dummy_app/config/environment', __FILE__)
|
10
|
-
|
11
|
-
require 'rspec/rails'
|
12
|
-
require 'factory_girl'
|
13
|
-
require 'factories'
|
14
|
-
require 'database_helpers'
|
15
|
-
|
16
|
-
ActionMailer::Base.delivery_method = :test
|
17
|
-
ActionMailer::Base.perform_deliveries = true
|
18
|
-
ActionMailer::Base.default_url_options[:host] = "example.com"
|
19
|
-
|
20
|
-
Rails.backtrace_cleaner.remove_silencers!
|
21
|
-
|
22
|
-
include DatabaseHelpers
|
23
|
-
# Run any available migration
|
24
|
-
puts 'Setting up database...'
|
25
|
-
drop_all_tables
|
26
|
-
migrate_database
|
27
|
-
ENV['SKIP_RAILS_ADMIN_INITIALIZER'] = 'false'
|
28
|
-
# Load support files
|
29
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each{|f| require f}
|
30
|
-
|
31
|
-
RSpec.configure do |config|
|
32
|
-
require 'rspec/expectations'
|
33
|
-
|
34
|
-
config.include RSpec::Matchers
|
35
|
-
config.include DatabaseHelpers
|
36
|
-
config.include Piggybak::Engine.routes.url_helpers
|
37
|
-
|
38
|
-
config.before(:each) do
|
39
|
-
RailsAdmin::AbstractModel.all_models = nil
|
40
|
-
RailsAdmin::AbstractModel.all_abstract_models = nil
|
41
|
-
RailsAdmin::AbstractModel.new("User").destroy_all!
|
42
|
-
RailsAdmin::AbstractModel.new("Image").destroy_all!
|
43
|
-
end
|
44
|
-
|
45
|
-
config.after(:each) do
|
46
|
-
Piggybak.reset
|
47
|
-
end
|
48
|
-
end
|