piggybak 0.7.5 → 0.7.6
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +23 -31
- data/app/controllers/piggybak/orders_controller.rb +2 -2
- data/app/models/piggybak/order.rb +11 -11
- data/lib/piggybak/cli.rb +15 -7
- data/lib/piggybak/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d04c0c0da3e2fb5df67c8e0802d37839fc0b1df
|
4
|
+
data.tar.gz: a760a4ce5e57084ec8a6fc3c931d7a0ca9cb774f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 065d52339792d93e27b7af4df8f3d8f3c3aab3b3e7d08b7dc0a1dae00b7483fc2dc874b6ecc7818ea7227e9ffc874862452cc6b2456144af07cfb1837caf4098
|
7
|
+
data.tar.gz: 78605631ca76c7310d301721fb841fbbcfbe48fb7846b3d19ec36ce0a3b5ff7159460de4aaaa7c00f8292216e691d9252680f8fe9ec5d0ebba6d0c9763d2fcb1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
piggybak (0.7.
|
4
|
+
piggybak (0.7.6)
|
5
5
|
activemerchant
|
6
6
|
countries
|
7
7
|
rack-ssl-enforcer
|
@@ -9,41 +9,33 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
-
|
13
|
-
activesupport (>= 2.
|
14
|
-
i18n
|
15
|
-
activemerchant (1.42.7)
|
16
|
-
active_utils (~> 2.0, >= 2.0.1)
|
17
|
-
activesupport (>= 2.3.14, < 5.0.0)
|
12
|
+
activemerchant (1.47.0)
|
13
|
+
activesupport (>= 3.2.14, < 5.0.0)
|
18
14
|
builder (>= 2.1.2, < 4.0.0)
|
19
|
-
i18n (
|
20
|
-
json (~> 1.7)
|
21
|
-
money (< 7.0.0)
|
15
|
+
i18n (>= 0.6.9)
|
22
16
|
nokogiri (~> 1.4)
|
23
|
-
activesupport (4.
|
24
|
-
i18n (~> 0.
|
25
|
-
|
26
|
-
|
27
|
-
thread_safe (~> 0.
|
28
|
-
tzinfo (~>
|
29
|
-
atomic (1.1.16)
|
17
|
+
activesupport (4.2.1)
|
18
|
+
i18n (~> 0.7)
|
19
|
+
json (~> 1.7, >= 1.7.7)
|
20
|
+
minitest (~> 5.1)
|
21
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
22
|
+
tzinfo (~> 1.1)
|
30
23
|
builder (3.2.2)
|
31
|
-
countries (0.
|
24
|
+
countries (0.11.3)
|
32
25
|
currencies (~> 0.4.2)
|
26
|
+
i18n_data (~> 0.6.0)
|
33
27
|
currencies (0.4.2)
|
34
|
-
i18n (0.
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
atomic (>= 1.1.7, < 2)
|
46
|
-
tzinfo (0.3.39)
|
28
|
+
i18n (0.7.0)
|
29
|
+
i18n_data (0.6.3)
|
30
|
+
json (1.8.2)
|
31
|
+
mini_portile (0.6.2)
|
32
|
+
minitest (5.5.1)
|
33
|
+
nokogiri (1.6.6.2)
|
34
|
+
mini_portile (~> 0.6.0)
|
35
|
+
rack-ssl-enforcer (0.2.8)
|
36
|
+
thread_safe (0.3.5)
|
37
|
+
tzinfo (1.2.2)
|
38
|
+
thread_safe (~> 0.1)
|
47
39
|
|
48
40
|
PLATFORMS
|
49
41
|
ruby
|
@@ -70,7 +70,7 @@ module Piggybak
|
|
70
70
|
response.headers['Cache-Control'] = 'no-cache'
|
71
71
|
|
72
72
|
if !session.has_key?(:last_order)
|
73
|
-
redirect_to root_url
|
73
|
+
redirect_to main_app.root_url
|
74
74
|
return
|
75
75
|
end
|
76
76
|
|
@@ -78,7 +78,7 @@ module Piggybak
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def list
|
81
|
-
redirect_to root_url if current_user.nil?
|
81
|
+
redirect_to main_app.root_url if current_user.nil?
|
82
82
|
end
|
83
83
|
|
84
84
|
def download
|
@@ -81,6 +81,17 @@ module Piggybak
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
+
# Postprocess everything but payments first
|
85
|
+
self.line_items.each do |line_item|
|
86
|
+
next if line_item.line_item_type == "payment"
|
87
|
+
method = "postprocess_#{line_item.line_item_type}"
|
88
|
+
if line_item.respond_to?(method)
|
89
|
+
if !line_item.send(method)
|
90
|
+
return false
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
84
95
|
# Recalculate and create line item for tax
|
85
96
|
# If a tax line item already exists, reset price
|
86
97
|
# If a tax line item doesn't, create
|
@@ -96,17 +107,6 @@ module Piggybak
|
|
96
107
|
elsif tax_line_item.any?
|
97
108
|
tax_line_item.first.mark_for_destruction
|
98
109
|
end
|
99
|
-
|
100
|
-
# Postprocess everything but payments first
|
101
|
-
self.line_items.each do |line_item|
|
102
|
-
next if line_item.line_item_type == "payment"
|
103
|
-
method = "postprocess_#{line_item.line_item_type}"
|
104
|
-
if line_item.respond_to?(method)
|
105
|
-
if !line_item.send(method)
|
106
|
-
return false
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
110
110
|
|
111
111
|
# Recalculating total and total due, in case post process changed totals
|
112
112
|
self.total_due = 0
|
data/lib/piggybak/cli.rb
CHANGED
@@ -53,13 +53,21 @@ module Piggybak
|
|
53
53
|
|
54
54
|
desc "add_javascript_include_tag", "add javascript include tag to application layout"
|
55
55
|
def add_javascript_include_tag
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
56
|
+
if File.exist?('app/views/layouts/application.html.haml')
|
57
|
+
jit_code_block = <<-eos
|
58
|
+
\n - if "\#{params[:controller]}#\#\{params[:action]\}" == "piggybak/orders#submit"
|
59
|
+
= javascript_include_tag "piggybak/piggybak-application"
|
60
|
+
eos
|
61
|
+
|
62
|
+
insert_into_file 'app/views/layouts/application.html.haml', jit_code_block, :after => '= javascript_include_tag "application"'
|
63
|
+
else
|
64
|
+
jit_code_block = <<-eos
|
65
|
+
\n <% if "\#{params[:controller]}#\#\{params[:action]\}" == "piggybak/orders#submit" -%>
|
66
|
+
<%= javascript_include_tag "piggybak/piggybak-application" %>\n <% end -%>
|
67
|
+
eos
|
68
|
+
|
69
|
+
insert_into_file 'app/views/layouts/application.html.erb', jit_code_block, :after => "<%= javascript_include_tag \"application\" %>"
|
70
|
+
end
|
63
71
|
end
|
64
72
|
|
65
73
|
desc "create user class", "Create a user class"
|
data/lib/piggybak/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piggybak
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steph Skardal
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: countries
|