dugway 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5c008e9180cfe77e584620f91957c811eed52b0
4
- data.tar.gz: 3d595dd9538b504395e0f86b6c39be10d6c1f543
3
+ metadata.gz: 53facb1d71a392d772e0573fb90f1c70cd19fbdb
4
+ data.tar.gz: 87cee87c858183414daa73f591ae30c7034eb559
5
5
  SHA512:
6
- metadata.gz: e59f19da8341c9ca531158b7c2e559de9d8636daae3bc013ac64f7555c2d04fab51e5c3ddd5b4fefb5c9a64e9e4e66f41e097ab80e6850f6e808b4de8058c25c
7
- data.tar.gz: 2da291f1cef7a99b27f156a39a454ae67be91f8b8cc1fd4c9dda787912a8689e3387c64cfc2b748793e25c41b63d8dad5578ba9e5563cdc73569a2fb1d1f72e4
6
+ metadata.gz: 72cbbc5a4d3c3a704ca4dbdeffe9142adcf928e346bf19caea2bb9d4b5f3f908336e726644c1ff1e10c0b1c2fdd86acb03249bd24472396f7446bea60ea9c940
7
+ data.tar.gz: 990df07f4e0a45f1a6fba652b5622cded96466b1ad3efe2097a6127c20fe32f89d59484d40d8f16f6bb35ca60d9b270329087f04c4208728e0fc6e6a61ff8823
data/README.md CHANGED
@@ -223,10 +223,10 @@ default we use **dugway** for
223
223
  ### Store customization
224
224
 
225
225
  Another important thing to consider is how store owners will customize your
226
- theme. You establish what can be customized in your [settings.json](#settings)
227
- file, and Dugway allows you to simulate potential values people could choose by
226
+ theme. You establish what can be customized in your settings.json file, and
227
+ Dugway allows you to simulate potential values people could choose by
228
228
  setting them in the **customization** variable in **.dugway.json**. By default
229
- we use the **default** values from your **[settings.json](#settings)** file.
229
+ we use the **default** values from your **settings.json** file.
230
230
 
231
231
  ```json
232
232
  "customization": {
@@ -240,14 +240,3 @@ we use the **default** values from your **[settings.json](#settings)** file.
240
240
  "twitter_username": "bigcartel"
241
241
  }
242
242
  ```
243
-
244
- ## Building your theme
245
-
246
- When you're finished with a new version of your theme, it's time to build it.
247
-
248
- ```
249
- dugway build
250
- ```
251
-
252
- This will create a zip file for the current version in your **build** directory
253
- containing all HTML, images, fonts, and packaged JS and CSS.
@@ -35,8 +35,13 @@ module Dugway
35
35
 
36
36
  # Money Filters
37
37
 
38
- def money(amount)
39
- number_to_currency(amount, :unit => '').strip
38
+ def money(amount, format = nil)
39
+ case format
40
+ when 'sign' then money_with_sign(amount)
41
+ when 'code' then money_with_code(amount)
42
+ when 'sign_and_code' then money_with_sign_and_code(amount)
43
+ else number_to_currency(amount, :unit => '').strip
44
+ end
40
45
  end
41
46
 
42
47
  def money_with_sign(amount)
@@ -1,3 +1,3 @@
1
1
  module Dugway
2
- VERSION = "0.11.0"
2
+ VERSION = "0.11.1"
3
3
  end
@@ -28,6 +28,18 @@ describe Dugway::Filters::CoreFilters do
28
28
  it "should convert a number to currency format" do
29
29
  rendered_template("{{ 1234.56 | money }}").should == '1,234.56'
30
30
  end
31
+
32
+ it "should support the 'sign' format argument" do
33
+ rendered_template("{{ 1234.56 | money: 'sign' }}").should == '<span class="currency_sign">$</span>1,234.56'
34
+ end
35
+
36
+ it "should support the 'code' format argument" do
37
+ rendered_template("{{ 1234.56 | money: 'code' }}").should == '1,234.56 <span class="currency_code">USD</span>'
38
+ end
39
+
40
+ it "should support the 'sign_and_code' format argument" do
41
+ rendered_template("{{ 1234.56 | money: 'sign_and_code' }}").should == '<span class="currency_sign">$</span>1,234.56 <span class="currency_code">USD</span>'
42
+ end
31
43
  end
32
44
 
33
45
  describe "#money_with_sign" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dugway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Big Cartel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-23 00:00:00.000000000 Z
11
+ date: 2018-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler