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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a3e04625ac77678c260c682d46caea2666a1f09
4
- data.tar.gz: 34960254b38cfdfb25277687ac0abb02ea8774d9
3
+ metadata.gz: 9d04c0c0da3e2fb5df67c8e0802d37839fc0b1df
4
+ data.tar.gz: a760a4ce5e57084ec8a6fc3c931d7a0ca9cb774f
5
5
  SHA512:
6
- metadata.gz: 6f0129952e567782cd4dc5377ade33f65e36785671d94200c506402719437f0d73ef03f891806ca3a87b08ceeca48081341d1cc4b763a9b7176a9e030ded99d2
7
- data.tar.gz: 2bbac1f4f6d2fe5426d3844a0ef6a4608c7938634fac6e303771b32c1fa53bf749aeffa6ec32fc9082e5e8af50995fd110ea23b33cb99199c6a6b57a3f645daa
6
+ metadata.gz: 065d52339792d93e27b7af4df8f3d8f3c3aab3b3e7d08b7dc0a1dae00b7483fc2dc874b6ecc7818ea7227e9ffc874862452cc6b2456144af07cfb1837caf4098
7
+ data.tar.gz: 78605631ca76c7310d301721fb841fbbcfbe48fb7846b3d19ec36ce0a3b5ff7159460de4aaaa7c00f8292216e691d9252680f8fe9ec5d0ebba6d0c9763d2fcb1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- piggybak (0.7.5)
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
- active_utils (2.0.2)
13
- activesupport (>= 2.3.11)
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 (~> 0.5)
20
- json (~> 1.7)
21
- money (< 7.0.0)
15
+ i18n (>= 0.6.9)
22
16
  nokogiri (~> 1.4)
23
- activesupport (4.0.4)
24
- i18n (~> 0.6, >= 0.6.9)
25
- minitest (~> 4.2)
26
- multi_json (~> 1.3)
27
- thread_safe (~> 0.1)
28
- tzinfo (~> 0.3.37)
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.9.3)
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.6.9)
35
- json (1.8.1)
36
- mini_portile (0.5.3)
37
- minitest (4.7.5)
38
- money (6.1.1)
39
- i18n (~> 0.6.4)
40
- multi_json (1.9.2)
41
- nokogiri (1.6.1)
42
- mini_portile (~> 0.5.0)
43
- rack-ssl-enforcer (0.2.6)
44
- thread_safe (0.3.1)
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
@@ -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
- jit_code_block = <<-eos
57
- \n <% if "\#{params[:controller]}#\#\{params[:action]\}" == "piggybak/orders#submit" -%>
58
- <%= javascript_include_tag "piggybak/piggybak-application" %>\n <% end -%>
59
- eos
60
-
61
- insert_into_file 'app/views/layouts/application.html.erb', jit_code_block, :after => "<%= javascript_include_tag \"application\" %>"
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"
@@ -1,3 +1,3 @@
1
1
  module Piggybak
2
- VERSION = "0.7.5"
2
+ VERSION = "0.7.6"
3
3
  end
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.5
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: 2014-09-10 00:00:00.000000000 Z
13
+ date: 2015-03-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: countries