dugway 0.6.4 → 0.6.5

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: b1aa12fb39a67763153f27a24610e6067391a131
4
- data.tar.gz: 18173de41d740d9117a3e89a8cc2af0104253c6f
3
+ metadata.gz: 96cd642f5dfc3f4fc791bdb1c5e7e6591bcb467f
4
+ data.tar.gz: 6b1430c144535430bc2ab22f20855d48a3ea7f7c
5
5
  SHA512:
6
- metadata.gz: c2ed16dccb52146d63b62120a83e0aeb981855b064b0a3a64fc360ba264463afcf640d87450e8c9e3931c0d8f84d29cb5d9c7e9f8b6b164846fa1d16dffe26d2
7
- data.tar.gz: 8c3362910f834ef6a6597392de024e98eccb295d685cae011d86a16297828e5bc28238378d81bae268d23ddf44484acaf61193dade498d794f3b98c734191406
6
+ metadata.gz: ba655323b11b803351998d6eefdbe4dc56ea303dbb9de481a2109bbac567ca90a4b6e653922384638130ecae112ef21dcdf369f42796e5a6d997392bfcff7543
7
+ data.tar.gz: 61e9f04b7048839e82325cc4e62de23ea530ca9e2fd06603fa6de99f4f9459ba143b161d318747f4dde749d1a59dfddbf502afdd2c7e88aa267bcea86cddc7fb
data/README.md CHANGED
@@ -78,11 +78,11 @@ All CSS for your theme is handled by the **styles.css** file, and all JavaScript
78
78
 
79
79
  #### Using Sass, Compass, LESS, and CoffeeScript
80
80
 
81
- Sprockets also allows you to use [Sass](http://sass-lang.com) in your separate files by appending the **.sass** or **.scss** extension after **.css**. You can even use [Compass](http://compass-style.org/) right out of the box to help author your stylesheets by utilizing its mixins for CSS3, typography, and its utilities.
81
+ Dugway also allows you to use [Sass](http://sass-lang.com) in your separate files by appending the **.sass** or **.scss** extension after **.css**. You can even use [Compass](http://compass-style.org/) right out of the box to help author your stylesheets by utilizing its mixins for CSS3, typography, and its utilities.
82
82
 
83
83
  Prefer [LESS](http://lesscss.org)? No problem, you'll just need to create a [Gemfile like this one](https://gist.github.com/ihearithurts/5569898) in the root directory of your theme, run ```bundle install```, and append the **.less** extension to your CSS files.
84
84
 
85
- For you JavaScript folks, we've backed [CoffeeScript](http://coffeescript.org) support right in. Just append the **.coffee** extension after **.js** to your separate files.
85
+ And finally, for you JavaScript folks, we've baked [CoffeeScript](http://coffeescript.org) support right in. Just append the **.coffee** extension after **.js** to your separate JS files.
86
86
 
87
87
  #### Embedding CSS & JavaScript
88
88
 
data/lib/dugway/store.rb CHANGED
@@ -13,9 +13,9 @@ module Dugway
13
13
  end
14
14
 
15
15
  def account
16
- @account ||= get('/store.js')
16
+ @account ||= get('/store.json')
17
17
  end
18
-
18
+
19
19
  def theme_pages
20
20
  [
21
21
  { 'name' => 'Home', 'permalink' => 'home', 'url' => '/', 'category' => 'theme' },
@@ -28,50 +28,50 @@ module Dugway
28
28
  { 'name' => 'Maintenance', 'permalink' => 'maintenance', 'url' => '/maintenance', 'category' => 'theme' }
29
29
  ]
30
30
  end
31
-
31
+
32
32
  def custom_pages
33
33
  @custom_pages ||= begin
34
34
  custom_pages = account.has_key?('pages') ? account['pages'] : []
35
- custom_pages = custom_pages.map { |page| get("/page/#{ page['permalink'] }.js") }
35
+ custom_pages = custom_pages.map { |page| get("/page/#{ page['permalink'] }.json") }
36
36
  end
37
37
  end
38
38
 
39
39
  def pages
40
40
  @pages ||= theme_pages + custom_pages
41
41
  end
42
-
42
+
43
43
  def page(permalink)
44
44
  lookup(permalink, pages)
45
45
  end
46
-
46
+
47
47
  def categories
48
48
  account.has_key?('categories') ? account['categories'] : []
49
49
  end
50
-
50
+
51
51
  def category(permalink)
52
52
  lookup(permalink, categories)
53
53
  end
54
-
54
+
55
55
  def category_products(permalink)
56
56
  lookup_products(permalink, 'categories')
57
57
  end
58
-
58
+
59
59
  def artists
60
60
  account.has_key?('artists') ? account['artists'] : []
61
61
  end
62
-
62
+
63
63
  def artist(permalink)
64
64
  lookup(permalink, artists)
65
65
  end
66
-
66
+
67
67
  def artist_products(permalink)
68
68
  lookup_products(permalink, 'artists')
69
69
  end
70
-
70
+
71
71
  def products
72
- @products ||= get('/products.js')
72
+ @products ||= get('/products.json')
73
73
  end
74
-
74
+
75
75
  def product(permalink)
76
76
  lookup(permalink, products)
77
77
  end
@@ -107,19 +107,19 @@ module Dugway
107
107
 
108
108
  nil
109
109
  end
110
-
110
+
111
111
  def search_products(search_terms)
112
112
  products.select { |p| p['name'].downcase.include?(search_terms.downcase) || p['description'].downcase.include?(search_terms.downcase) }
113
113
  end
114
-
114
+
115
115
  def country
116
116
  account['country']
117
117
  end
118
-
118
+
119
119
  def currency
120
120
  account['currency']
121
121
  end
122
-
122
+
123
123
  def locale
124
124
  case currency['code']
125
125
  when 'AUD' then 'en-AU'
@@ -148,17 +148,17 @@ module Dugway
148
148
  else 'en-US'
149
149
  end
150
150
  end
151
-
151
+
152
152
  private
153
-
153
+
154
154
  def get(path)
155
155
  self.class.get(path).parsed_response
156
156
  end
157
-
157
+
158
158
  def lookup(permalink, array)
159
159
  array.find { |item| item['permalink'] == permalink }.try(:dup)
160
160
  end
161
-
161
+
162
162
  def lookup_products(permalink, type)
163
163
  products.select { |p| p[type].any? { |c| c['permalink'] == permalink }}
164
164
  end
data/lib/dugway/theme.rb CHANGED
@@ -114,7 +114,7 @@ module Dugway
114
114
  file_path = File.join(source_dir, file_name)
115
115
 
116
116
  if File.exist?(file_path)
117
- File.read(file_path)
117
+ File.read(file_path).encode('utf-8')
118
118
  else
119
119
  nil
120
120
  end
@@ -1,3 +1,3 @@
1
1
  module Dugway
2
- VERSION = "0.6.4"
2
+ VERSION = "0.6.5"
3
3
  end
File without changes
File without changes
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.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Big Cartel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-13 00:00:00.000000000 Z
11
+ date: 2013-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -486,9 +486,9 @@ files:
486
486
  - spec/features/contact_form_spec.rb
487
487
  - spec/features/page_rendering_spec.rb
488
488
  - spec/features/shopping_spec.rb
489
- - spec/fixtures/store/page/about-us.js
490
- - spec/fixtures/store/products.js
491
- - spec/fixtures/store/store.js
489
+ - spec/fixtures/store/page/about-us.json
490
+ - spec/fixtures/store/products.json
491
+ - spec/fixtures/store/store.json
492
492
  - spec/fixtures/theme/cart.html
493
493
  - spec/fixtures/theme/checkout.html
494
494
  - spec/fixtures/theme/contact.html
@@ -561,9 +561,9 @@ test_files:
561
561
  - spec/features/contact_form_spec.rb
562
562
  - spec/features/page_rendering_spec.rb
563
563
  - spec/features/shopping_spec.rb
564
- - spec/fixtures/store/page/about-us.js
565
- - spec/fixtures/store/products.js
566
- - spec/fixtures/store/store.js
564
+ - spec/fixtures/store/page/about-us.json
565
+ - spec/fixtures/store/products.json
566
+ - spec/fixtures/store/store.json
567
567
  - spec/fixtures/theme/cart.html
568
568
  - spec/fixtures/theme/checkout.html
569
569
  - spec/fixtures/theme/contact.html