dugway 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. data/.gitignore +7 -0
  2. data/.travis.yml +3 -0
  3. data/Gemfile +2 -0
  4. data/README.md +151 -0
  5. data/Rakefile +12 -0
  6. data/bin/dugway +7 -0
  7. data/dugway.gemspec +43 -0
  8. data/lib/dugway.rb +66 -0
  9. data/lib/dugway/application.rb +147 -0
  10. data/lib/dugway/cart.rb +144 -0
  11. data/lib/dugway/cli.rb +22 -0
  12. data/lib/dugway/cli/build.rb +56 -0
  13. data/lib/dugway/cli/create.rb +71 -0
  14. data/lib/dugway/cli/server.rb +37 -0
  15. data/lib/dugway/cli/templates/Gemfile.tt +2 -0
  16. data/lib/dugway/cli/templates/config.tt +24 -0
  17. data/lib/dugway/cli/templates/gitignore.tt +9 -0
  18. data/lib/dugway/cli/templates/source/cart.html +40 -0
  19. data/lib/dugway/cli/templates/source/checkout.html +33 -0
  20. data/lib/dugway/cli/templates/source/contact.html +37 -0
  21. data/lib/dugway/cli/templates/source/home.html +25 -0
  22. data/lib/dugway/cli/templates/source/images/badge.png +0 -0
  23. data/lib/dugway/cli/templates/source/javascripts/cart.js.coffee +7 -0
  24. data/lib/dugway/cli/templates/source/javascripts/product.js.coffee +7 -0
  25. data/lib/dugway/cli/templates/source/layout.html +101 -0
  26. data/lib/dugway/cli/templates/source/maintenance.html +20 -0
  27. data/lib/dugway/cli/templates/source/product.html +65 -0
  28. data/lib/dugway/cli/templates/source/products.html +25 -0
  29. data/lib/dugway/cli/templates/source/screenshot.jpg +0 -0
  30. data/lib/dugway/cli/templates/source/scripts.js +19 -0
  31. data/lib/dugway/cli/templates/source/settings.json +71 -0
  32. data/lib/dugway/cli/templates/source/styles.css +27 -0
  33. data/lib/dugway/cli/templates/source/stylesheets/cart.css.sass +38 -0
  34. data/lib/dugway/cli/templates/source/stylesheets/layout.css.sass +103 -0
  35. data/lib/dugway/cli/templates/source/stylesheets/product.css.sass +19 -0
  36. data/lib/dugway/cli/templates/source/stylesheets/products.css.sass +20 -0
  37. data/lib/dugway/cli/templates/source/stylesheets/vendor/normalize.css +396 -0
  38. data/lib/dugway/cli/templates/source/success.html +5 -0
  39. data/lib/dugway/controller.rb +148 -0
  40. data/lib/dugway/data/locales/cs.yml +26 -0
  41. data/lib/dugway/data/locales/da.yml +26 -0
  42. data/lib/dugway/data/locales/en-AU.yml +26 -0
  43. data/lib/dugway/data/locales/en-GB.yml +26 -0
  44. data/lib/dugway/data/locales/en-PH.yml +27 -0
  45. data/lib/dugway/data/locales/en-US.yml +26 -0
  46. data/lib/dugway/data/locales/es-MX.yml +26 -0
  47. data/lib/dugway/data/locales/eu.yml +26 -0
  48. data/lib/dugway/data/locales/gsw-CH.yml +26 -0
  49. data/lib/dugway/data/locales/hu.yml +26 -0
  50. data/lib/dugway/data/locales/il.yml +26 -0
  51. data/lib/dugway/data/locales/ja.yml +30 -0
  52. data/lib/dugway/data/locales/ms-MY.yml +26 -0
  53. data/lib/dugway/data/locales/nb.yml +22 -0
  54. data/lib/dugway/data/locales/pl.yml +27 -0
  55. data/lib/dugway/data/locales/pt-BR.yml +26 -0
  56. data/lib/dugway/data/locales/sv-SE.yml +26 -0
  57. data/lib/dugway/data/locales/th.yml +26 -0
  58. data/lib/dugway/data/locales/tr.yml +29 -0
  59. data/lib/dugway/data/locales/zh-TW.yml +30 -0
  60. data/lib/dugway/data/theme_fonts.yml +151 -0
  61. data/lib/dugway/extensions/time.rb +15 -0
  62. data/lib/dugway/liquid/drops/account_drop.rb +17 -0
  63. data/lib/dugway/liquid/drops/artist_drop.rb +9 -0
  64. data/lib/dugway/liquid/drops/artists_drop.rb +13 -0
  65. data/lib/dugway/liquid/drops/base_drop.rb +59 -0
  66. data/lib/dugway/liquid/drops/cart_drop.rb +13 -0
  67. data/lib/dugway/liquid/drops/cart_item_drop.rb +21 -0
  68. data/lib/dugway/liquid/drops/categories_drop.rb +13 -0
  69. data/lib/dugway/liquid/drops/category_drop.rb +9 -0
  70. data/lib/dugway/liquid/drops/contact_drop.rb +29 -0
  71. data/lib/dugway/liquid/drops/country_drop.rb +6 -0
  72. data/lib/dugway/liquid/drops/currency_drop.rb +6 -0
  73. data/lib/dugway/liquid/drops/image_drop.rb +6 -0
  74. data/lib/dugway/liquid/drops/page_drop.rb +13 -0
  75. data/lib/dugway/liquid/drops/pages_drop.rb +9 -0
  76. data/lib/dugway/liquid/drops/product_drop.rb +101 -0
  77. data/lib/dugway/liquid/drops/product_option_drop.rb +27 -0
  78. data/lib/dugway/liquid/drops/products_drop.rb +75 -0
  79. data/lib/dugway/liquid/drops/shipping_option_drop.rb +13 -0
  80. data/lib/dugway/liquid/drops/theme_drop.rb +23 -0
  81. data/lib/dugway/liquid/filters/comparison_filters.rb +48 -0
  82. data/lib/dugway/liquid/filters/core_filters.rb +138 -0
  83. data/lib/dugway/liquid/filters/default_pagination.rb +35 -0
  84. data/lib/dugway/liquid/filters/font_filters.rb +9 -0
  85. data/lib/dugway/liquid/filters/url_filters.rb +66 -0
  86. data/lib/dugway/liquid/filters/util_filters.rb +119 -0
  87. data/lib/dugway/liquid/tags/checkout_form.rb +9 -0
  88. data/lib/dugway/liquid/tags/get.rb +58 -0
  89. data/lib/dugway/liquid/tags/paginate.rb +129 -0
  90. data/lib/dugway/liquifier.rb +122 -0
  91. data/lib/dugway/logger.rb +16 -0
  92. data/lib/dugway/request.rb +36 -0
  93. data/lib/dugway/store.rb +166 -0
  94. data/lib/dugway/template.rb +44 -0
  95. data/lib/dugway/theme.rb +145 -0
  96. data/lib/dugway/theme_font.rb +68 -0
  97. data/lib/dugway/version.rb +3 -0
  98. data/spec/fixtures/store/page/about-us.js +1 -0
  99. data/spec/fixtures/store/products.js +1 -0
  100. data/spec/fixtures/store/store.js +1 -0
  101. data/spec/fixtures/theme/cart.html +33 -0
  102. data/spec/fixtures/theme/checkout.html +31 -0
  103. data/spec/fixtures/theme/contact.html +37 -0
  104. data/spec/fixtures/theme/home.html +38 -0
  105. data/spec/fixtures/theme/images/bc_badge.png +0 -0
  106. data/spec/fixtures/theme/javascripts/one.js +3 -0
  107. data/spec/fixtures/theme/javascripts/two.js.coffee +2 -0
  108. data/spec/fixtures/theme/layout.html +77 -0
  109. data/spec/fixtures/theme/maintenance.html +17 -0
  110. data/spec/fixtures/theme/product.html +73 -0
  111. data/spec/fixtures/theme/products.html +41 -0
  112. data/spec/fixtures/theme/screenshot.jpg +0 -0
  113. data/spec/fixtures/theme/scripts.js +2 -0
  114. data/spec/fixtures/theme/settings.json +55 -0
  115. data/spec/fixtures/theme/styles.css +4 -0
  116. data/spec/fixtures/theme/stylesheets/one.css +3 -0
  117. data/spec/fixtures/theme/stylesheets/two.css.sass +4 -0
  118. data/spec/fixtures/theme/success.html +5 -0
  119. data/spec/spec_helper.rb +24 -0
  120. data/spec/units/dugway/request_spec.rb +206 -0
  121. data/spec/units/dugway/store_spec.rb +194 -0
  122. data/spec/units/dugway/template_spec.rb +145 -0
  123. data/spec/units/dugway/theme_font_spec.rb +136 -0
  124. data/spec/units/dugway_spec.rb +9 -0
  125. metadata +549 -0
@@ -0,0 +1,30 @@
1
+ ja:
2
+ number:
3
+ format:
4
+ separator: "."
5
+ delimiter: ","
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%u%n"
13
+ unit: "¥"
14
+ separator: "."
15
+ delimiter: ","
16
+ precision: 0
17
+ significant: false
18
+ strip_insignificant_zeros: false
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: ""
23
+
24
+ precision:
25
+ format:
26
+ delimiter: ","
27
+
28
+ paypal:
29
+ format:
30
+ precision: 0
@@ -0,0 +1,26 @@
1
+ "ms-MY":
2
+ number:
3
+ format:
4
+ separator: "."
5
+ delimiter: ","
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%u%n"
13
+ unit: "RM"
14
+ separator: "."
15
+ delimiter: ","
16
+ precision: 2
17
+ significant: false
18
+ strip_insignificant_zeros: false
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: ""
23
+
24
+ precision:
25
+ format:
26
+ delimiter: ","
@@ -0,0 +1,22 @@
1
+ nb:
2
+ number:
3
+ format: &number_format
4
+ precision: 2
5
+ separator: ","
6
+ delimiter: ""
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ unit: "kr"
13
+ format: "%n%u"
14
+ <<: *number_format
15
+
16
+ percentage:
17
+ format:
18
+ delimiter: ""
19
+
20
+ precision:
21
+ format:
22
+ delimiter: ""
@@ -0,0 +1,27 @@
1
+ pl:
2
+ number:
3
+ format:
4
+ separator: ","
5
+ delimiter: ""
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%n%u"
13
+ unit: "zł"
14
+ separator: ","
15
+ delimiter: ""
16
+ precision: 2
17
+ significant: false
18
+ strip_insignificant_zeros: true
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: ""
23
+
24
+ precision:
25
+ format:
26
+ delimiter: ""
27
+
@@ -0,0 +1,26 @@
1
+ "pt-BR":
2
+ number:
3
+ format:
4
+ separator: ","
5
+ delimiter: "."
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%u%n"
13
+ unit: "R$"
14
+ separator: ","
15
+ delimiter: "."
16
+ precision: 2
17
+ significant: false
18
+ strip_insignificant_zeros: false
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: ""
23
+
24
+ precision:
25
+ format:
26
+ delimiter: "."
@@ -0,0 +1,26 @@
1
+ "sv-SE":
2
+ number:
3
+ format:
4
+ separator: ","
5
+ delimiter: ""
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%n%u"
13
+ unit: "kr"
14
+ separator: ","
15
+ delimiter: ""
16
+ precision: 2
17
+ significant: false
18
+ strip_insignificant_zeros: false
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: ""
23
+
24
+ precision:
25
+ format:
26
+ delimiter: ""
@@ -0,0 +1,26 @@
1
+ th:
2
+ number:
3
+ format:
4
+ separator: "."
5
+ delimiter: ","
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%n%u"
13
+ unit: "฿"
14
+ separator: "."
15
+ delimiter: ","
16
+ precision: 2
17
+ significant: false
18
+ strip_insignificant_zeros: false
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: ""
23
+
24
+ precision:
25
+ format:
26
+ delimiter: ","
@@ -0,0 +1,29 @@
1
+ tr:
2
+ number:
3
+ format:
4
+ separator: ","
5
+ delimiter: "."
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%n %u"
13
+ unit: "TL"
14
+ separator: ","
15
+ delimiter: "."
16
+ precision: 2
17
+ significant: false
18
+ strip_insignificant_zeros: false
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: '.'
23
+ separator: ','
24
+ precision: 2
25
+
26
+ precision:
27
+ format:
28
+ delimiter: '.'
29
+ separator: ','
@@ -0,0 +1,30 @@
1
+ "zh-TW":
2
+ number:
3
+ format:
4
+ separator: "."
5
+ delimiter: ","
6
+ precision: 2
7
+ significant: false
8
+ strip_insignificant_zeros: false
9
+
10
+ currency:
11
+ format:
12
+ format: "%u%n"
13
+ unit: "NT$"
14
+ separator: "."
15
+ delimiter: ","
16
+ precision: 2
17
+ significant: false
18
+ strip_insignificant_zeros: false
19
+
20
+ percentage:
21
+ format:
22
+ delimiter: ""
23
+
24
+ precision:
25
+ format:
26
+ delimiter: ","
27
+
28
+ paypal:
29
+ format:
30
+ precision: 0
@@ -0,0 +1,151 @@
1
+ # Default browser fonts
2
+
3
+ default:
4
+ arial:
5
+ name: Arial
6
+ family: 'Arial, Helvetica, sans-serif'
7
+
8
+ arial_black:
9
+ name: Arial Black
10
+ family: 'Arial Black, Gadget, sans-serif'
11
+
12
+ courier_new:
13
+ name: Courier New
14
+ family: '"Courier New", Courier, monospace'
15
+
16
+ georgia:
17
+ name: Georgia
18
+ family: 'Georgia, "Times New Roman", Times, serif'
19
+
20
+ helvetica:
21
+ name: Helvetica
22
+ family: '"Helvetica Neue", Helvetica, Arial, sans-serif'
23
+
24
+ impact:
25
+ name: Impact
26
+ family: 'Impact, Charcoal, sans-serif'
27
+
28
+ lucida_grande:
29
+ name: Lucida Grande
30
+ family: '"Lucida Grande", Lucida, Verdana, sans-serif'
31
+
32
+ palatino_linotype:
33
+ name: Palatino Linotype
34
+ family: '"Palatino Linotype", "Book Antiqua", Palatino, serif'
35
+
36
+ tahoma:
37
+ name: Tahoma
38
+ family: 'Tahoma, Geneva, sans-serif'
39
+
40
+ times_new_roman:
41
+ name: Times New Roman
42
+ family: '"Times New Roman", Times, serif'
43
+
44
+ trebuchet_ms:
45
+ name: Trebuchet MS
46
+ family: '"Trebuchet MS", Arial, sans-serif'
47
+
48
+ verdana:
49
+ name: Verdana
50
+ family: 'Verdana, Arial, Helvetica, sans-serif'
51
+
52
+
53
+ # Google web fonts
54
+
55
+ google:
56
+ amaranth:
57
+ name: Amaranth
58
+ family: '"Amaranth", serif'
59
+
60
+ arvo:
61
+ name: Arvo
62
+ family: '"Arvo", serif'
63
+
64
+ asap:
65
+ name: Asap
66
+ family: '"Asap", sans-serif'
67
+
68
+ copse:
69
+ name: Copse
70
+ family: '"Copse", serif'
71
+
72
+ cutive_mono:
73
+ name: Cutive Mono
74
+ family: '"Cutive Mono", serif'
75
+
76
+ delius:
77
+ name: Delius
78
+ family: '"Delius", cursive'
79
+
80
+ dosis:
81
+ name: Dosis
82
+ family: '"Dosis", sans-serif'
83
+
84
+ enriqueta:
85
+ name: Enriqueta
86
+ family: '"Enriqueta", serif'
87
+
88
+ gentium_book_basic:
89
+ name: Gentium Book Basic
90
+ family: '"Gentium Book Basic", serif'
91
+
92
+ glegoo:
93
+ name: Glegoo
94
+ family: '"Glegoo", serif'
95
+
96
+ inconsolata:
97
+ name: Inconsolata
98
+ family: '"Inconsolata", sans-serif'
99
+
100
+ lekton:
101
+ name: Lekton
102
+ family: '"Lekton", sans-serif'
103
+
104
+ lobster_two:
105
+ name: Lobster Two
106
+ family: '"Lobster Two", cursive'
107
+
108
+ merriweather:
109
+ name: Merriweather
110
+ family: '"Merriweather", serif'
111
+
112
+ open_sans:
113
+ name: Open Sans
114
+ family: '"Open Sans", sans-serif'
115
+
116
+ overlock:
117
+ name: Overlock
118
+ family: '"Overlock", cursive'
119
+
120
+ noticia_text:
121
+ name: Noticia Text
122
+ family: '"Noticia Text", serif'
123
+
124
+ playfair_display:
125
+ name: Playfair Display
126
+ family: '"Playfair Display", serif'
127
+
128
+ raleway:
129
+ name: Raleway
130
+ family: '"Raleway", sans-serif'
131
+
132
+ rokkitt:
133
+ name: Rokkitt
134
+ family: '"Rokkitt", serif'
135
+
136
+ signika:
137
+ name: Signika
138
+ family: '"Signika", sans-serif'
139
+
140
+ source_sans_pro:
141
+ name: Source Sans Pro
142
+ family: '"Source Sans Pro", sans-serif'
143
+
144
+ titillium_web:
145
+ name: Titillium Web
146
+ family: '"Titillium Web", sans-serif'
147
+
148
+ varela_round:
149
+ name: Varela Round
150
+ family: '"Varela Round", sans-serif'
151
+
@@ -0,0 +1,15 @@
1
+ require 'time'
2
+
3
+ # Support Ruby 1.8.7's Time.parse('Today')
4
+
5
+ if RUBY_VERSION >= '1.9'
6
+ class Time
7
+ class << self
8
+ alias :old_parse :parse
9
+ def parse(date, now=self.now)
10
+ date = now.to_s if date =~ /today/i
11
+ old_parse(date, now)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ module Dugway
2
+ module Drops
3
+ class AccountDrop < BaseDrop
4
+ def logged_in
5
+ false
6
+ end
7
+
8
+ def currency
9
+ @currency ||= CurrencyDrop.new(source['currency'])
10
+ end
11
+
12
+ def country
13
+ @country ||= CountryDrop.new(source['country'])
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ module Dugway
2
+ module Drops
3
+ class ArtistDrop < BaseDrop
4
+ def products
5
+ store.artist_products(permalink).map { |p| ProductDrop.new(p) }
6
+ end
7
+ end
8
+ end
9
+ end