dugway 0.10.2 → 0.10.3

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: edbd573f45d273fb7750817bf39cdd458a27f869
4
- data.tar.gz: 3fa990884467e68bd017b1d4dba5f88a4ebb3c92
3
+ metadata.gz: 826b2f5eb8927caa43d20178107cad6e51811bb4
4
+ data.tar.gz: 04baf16d2887144b19ae7664f7079df41f496577
5
5
  SHA512:
6
- metadata.gz: 34471b9191164aed5bbfef6f2c6b32c09eef14827f63f618b99d65db658a37803052e766157f7b6336d4cb4325465a14223d7f28010f5e312e95381617d88c41
7
- data.tar.gz: 7df031699ef5ac1d65d5e5972ba7ed434285c55f1d4090e4b7c6ee3c5f10ce3a40e78bdc32c31f60ec899b6682c8e2a5d41c9742550918c8d729650a7ad846ac
6
+ metadata.gz: 3c1e3f431703966b86aedb8e8291c0b8d315e28e6f60f54577d589704dc6214f0bed02eb125776816abe59c94149accae6e16a1dd189cef86216292434e95de3
7
+ data.tar.gz: f596dfb2520ea4f54e306c6b28ca94f676b6b1b789f1250b1676c417099c4e7593c19db3798e7b3775898cbf0b9a7f2d870c1be930d90ef42ae9371510b5b0e6
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
+ cache: bundler
3
+ sudo: false
2
4
  rvm:
3
5
  - 1.9.3
4
6
  - 2.0
@@ -1,16 +1,36 @@
1
1
  ## Version History
2
2
 
3
+ #### 0.10.3
4
+
5
+ * Added `.dugway.json` as a better way to [test your theme](https://github.com/bigcartel/dugway#testing-your-theme) without needing to modify `config.ru`
6
+
7
+ #### 0.10.2
8
+
9
+ * Misc bug fixes and improvements
10
+
11
+ #### 0.10.1
12
+
13
+ * Misc bug fixes and improvements
14
+
15
+ #### 0.10.0
16
+
17
+ * Added support for default images in `settings.json`
18
+
3
19
  #### 0.9.0
4
- * Added support for `theme_font_url` liquid filter
5
- * Added fonts directory, serve fonts from there
6
- * `dugway build` will include font files in the zip
20
+
21
+ * Added support for `theme_font_url` liquid filter
22
+ * Added fonts directory, serve fonts from there
23
+ * `dugway build` will include font files in the zip
7
24
 
8
25
  #### 0.8.4
9
- * Support `image_sets` in `settings.json`
10
- * Support the new [constrain](http://help.bigcartel.com/developers/themes/#constrainurl-width-height) filter
26
+
27
+ * Support `image_sets` in `settings.json`
28
+ * Support the new [constrain](http://help.bigcartel.com/developers/themes/#constrainurl-width-height) filter
11
29
 
12
30
  #### 0.7.0
13
- * Rename `scripts.js` and `styles.css` to `theme.js` and `theme.css`
31
+
32
+ * Rename `scripts.js` and `styles.css` to `theme.js` and `theme.css`
14
33
 
15
34
  #### Pre-0.7.0
16
- * Initial launch and bug fixes
35
+
36
+ * Initial launch and bug fixes
data/README.md CHANGED
@@ -20,41 +20,46 @@ Dugway allows you to run your Big Cartel theme on your computer, test it in any
20
20
 
21
21
  Dugway is Ruby gem so you'll need to have Ruby 1.9.3+ installed. Ruby is usually pre-installed on Mac OS X and Linux, and Windows users can install it using [RubyInstaller](http://rubyinstaller.org). From there, simply install the **dugway** gem from the terminal.
22
22
 
23
- gem install dugway
23
+ ```
24
+ gem install dugway
25
+ ```
24
26
 
25
27
  ## Creating a new theme
26
28
 
27
29
  With Dugway installed, you can now create a new theme, simply give it a name.
28
30
 
29
- dugway create mytheme
31
+ ```
32
+ dugway create mytheme
33
+ ```
30
34
 
31
35
  This will create a new directory named *mytheme* that contains a few configuration files and a starter theme to get you going.
32
36
 
33
- mytheme
34
- ├── source
35
- | ├── fonts
36
- │ └── all font files for your theme
37
- ├── images
38
- │ └── all image files for your theme
39
- ├── javascripts
40
- │ └── all JavaScript files for your theme
41
- ├── stylesheets
42
- │ └── all CSS files for your theme
43
- ├── cart.html
44
- │ ├── checkout.html
45
- │ ├── contact.html
46
- │ ├── home.html
47
- │ ├── layout.html
48
- │ ├── maintenance.html
49
- │ ├── product.html
50
- │ ├── products.html
51
- │ ├── screenshot.jpg
52
- │ ├── settings.json
53
- │ ├── success.html
54
- │ ├── theme.css
55
- └── theme.js
56
- └── config.ru
57
-
37
+ ```
38
+ mytheme
39
+ ├── source
40
+ | ├── fonts
41
+ │ └── all font files for your theme
42
+ ├── images
43
+ │ └── all image files for your theme
44
+ ├── javascripts
45
+ │ └── all JavaScript files for your theme
46
+ ├── stylesheets
47
+ │ └── all CSS files for your theme
48
+ │ ├── cart.html
49
+ │ ├── checkout.html
50
+ │ ├── contact.html
51
+ │ ├── home.html
52
+ │ ├── layout.html
53
+ │ ├── maintenance.html
54
+ │ ├── product.html
55
+ │ ├── products.html
56
+ │ ├── screenshot.jpg
57
+ │ ├── settings.json
58
+ │ ├── success.html
59
+ ├── theme.css
60
+ └── theme.js
61
+ └── config.ru
62
+ ```
58
63
 
59
64
  ## Developing your theme
60
65
 
@@ -74,15 +79,19 @@ All CSS for your theme is handled by the **theme.css** file, and all JavaScript
74
79
 
75
80
  ##### theme.css
76
81
 
77
- /*
78
- *= require stylesheets/example_1
79
- *= require stylesheets/example_2
80
- */
82
+ ```css
83
+ /*
84
+ *= require stylesheets/example_1
85
+ *= require stylesheets/example_2
86
+ */
87
+ ```
81
88
 
82
89
  ##### theme.js
83
90
 
84
- //= require javascripts/example_1
85
- //= require javascripts/example_2
91
+ ```js
92
+ //= require javascripts/example_1
93
+ //= require javascripts/example_2
94
+ ```
86
95
 
87
96
  #### Using Sass, Compass, LESS, and CoffeeScript
88
97
 
@@ -98,23 +107,31 @@ You can embed the CSS and JavaScript into your theme by passing the theme variab
98
107
 
99
108
  ##### CSS (theme.css)
100
109
 
101
- <link href="{{ theme | theme_css_url }}" media="screen" rel="stylesheet" type="text/css">
110
+ ```html
111
+ <link href="{{ theme | theme_css_url }}" media="screen" rel="stylesheet" type="text/css">
112
+ ```
102
113
 
103
114
  ##### JavaScript (theme.js)
104
115
 
105
- <script src="{{ theme | theme_js_url }}" type="text/javascript"></script>
116
+ ```html
117
+ <script src="{{ theme | theme_js_url }}" type="text/javascript"></script>
118
+ ```
106
119
 
107
120
  ### Images
108
121
 
109
122
  And as you've probably guessed by now, all images for your theme go in the **images** directory. You can reference an image in your code by passing its name to the [theme_image_url](http://help.bigcartel.com/developers/themes/#themeimageurlname) filter.
110
123
 
111
- {{ 'sample.png' | theme_image_url }}
124
+ ```
125
+ {{ 'sample.png' | theme_image_url }}
126
+ ```
112
127
 
113
128
  ### Fonts
114
129
 
115
130
  Fonts work more or less the same as images. Place font files (say if you have created a custom icon font) in the **fonts** directory. Reference them by passing its name to the `theme_font_url` filter. Please be aware of licensing restrictions. If you're using a font from a forge and don't have permission to host the files directly or have restrictions about only making them available to certain domains, you will need to use another mechanism for hosting your fonts. Any font uploaded as part of a Dugway bundle will essentialy be publicly available and not CORS-restricted to specific domains.
116
131
 
117
- {{ 'myfont.woff' | theme_font_url }}
132
+ ```
133
+ {{ 'myfont.woff' | theme_font_url }}
134
+ ```
118
135
 
119
136
  ### Settings
120
137
 
@@ -124,7 +141,9 @@ Set your theme's name, version, and customizable options in the **settings.json*
124
141
 
125
142
  Run your theme in any browser by starting the Dugway server:
126
143
 
127
- dugway server
144
+ ```
145
+ dugway server
146
+ ```
128
147
 
129
148
  By default this will serve your theme at http://0.0.0.0:9292. You can then stop the server by hitting CTRL+C.
130
149
 
@@ -134,37 +153,45 @@ Tired of all the manual starting and stopping? Good news, Dugway is built on top
134
153
 
135
154
  ## Testing your theme
136
155
 
137
- Part of building a great theme is making sure it works well in a variety of contexts and with a variety of content. Dugway makes it easy to test your theme's versatility by customizing the **options** in the **config.ru** file.
156
+ Part of building a great theme is making sure it works well in a variety of contexts and with a variety of content. Dugway makes it easy to test your theme's versatility by utilizing the **.dugway.json** file. This file will be specific to your computer for your own testing, and shouldn't be checked into source control.
138
157
 
139
- *Note:* changing the **config.ru** file will require you to restart the [server](#running-your-theme).
158
+ *Note:* changing **.dugway.json** will require you to restart the [server](#running-your-theme).
140
159
 
141
160
  ### Store content
142
161
 
143
- The best way to see your theme under a different light is by previewing it with a different store's products, categories, pages, currency, and other content. To do this, simply set the **:store** option to any Big Cartel store's subdomain, and Dugway will bring in their content using the standard [Big Cartel API](http://help.bigcartel.com/developers/api/). By default we use **dugway** for [dugway.bigcartel.com](http://dugway.bigcartel.com).
162
+ The best way to see your theme under a different light is by previewing it with a different store's products, categories, pages, currency, and other content. To do this, simply set the **store.subdomain** variable in **.dugway.json** to any Big Cartel store's subdomain, and Dugway will bring in their content using the standard [Big Cartel API](http://help.bigcartel.com/developers/api/). By default we use **dugway** for [dugway.bigcartel.com](http://dugway.bigcartel.com).
144
163
 
145
- options[:store] = 'beeteeth'
164
+ ```json
165
+ "store": {
166
+ "subdomain": "beeteeth"
167
+ }
168
+ ```
146
169
 
147
170
  *Note:* don't worry, any sensitive data like inventory levels and discount codes is faked by Dugway.
148
171
 
149
172
  ### Store customization
150
173
 
151
- Another important thing to consider is how store owners will customize your theme. You establish what can be customized in your [settings.json](#settings) file, and Dugway allows you to simulate potential values people could choose by setting them in the **:customization** option. By default we use the **default** values from your **[settings.json](#settings)** file.
152
-
153
- options[:customization] = {
154
- :logo => {
155
- :url => 'http://placehold.it/200x50/000000/ffffff&text=My+Logo',
156
- :width => 200,
157
- :height => 50
158
- },
159
- :background_color => '#CCCCCC',
160
- :show_search => true,
161
- :twitter_username => 'mytwitter'
162
- }
174
+ Another important thing to consider is how store owners will customize your theme. You establish what can be customized in your [settings.json](#settings) file, and Dugway allows you to simulate potential values people could choose by setting them in the **customization** variable in **.dugway.json**. By default we use the **default** values from your **[settings.json](#settings)** file.
175
+
176
+ ```json
177
+ "customization": {
178
+ "logo": {
179
+ "url": "http://placehold.it/200x50/000000/ffffff&text=My+Logo",
180
+ "width": 200,
181
+ "height": 50
182
+ },
183
+ "background_color": "#CCCCCC",
184
+ "show_search": true,
185
+ "twitter_username": "bigcartel"
186
+ }
187
+ ```
163
188
 
164
189
  ## Building your theme
165
190
 
166
191
  When you're finished with a new version of your theme, it's time to build it.
167
192
 
168
- dugway build
193
+ ```
194
+ dugway build
195
+ ```
169
196
 
170
197
  This will create a zip file for the current version in your **build** directory containing all HTML, images, fonts, and packaged JS and CSS.
@@ -48,7 +48,7 @@ module Dugway
48
48
  end
49
49
 
50
50
  def store
51
- @store ||= Store.new(options && options[:store] || 'dugway')
51
+ @store ||= Store.new(options && options[:store] && options[:store][:subdomain] || 'dugway')
52
52
  end
53
53
 
54
54
  def theme
@@ -26,6 +26,7 @@ module Dugway
26
26
 
27
27
  def core
28
28
  template('config.tt', "#{ @theme_dir }/config.ru")
29
+ template('dugway.tt', "#{ @theme_dir }/.dugway.json")
29
30
  template('source/settings.json', "#{ source_dir }/settings.json")
30
31
  end
31
32
 
@@ -1,22 +1,12 @@
1
1
  require 'dugway'
2
2
 
3
- options = {}
4
-
5
- # Use data from any store to make sure your theme looks great with all sorts of products, pages,
6
- # categories, and more. Just give us the subdomain. Default is "dugway" for dugway.bigcartel.com.
7
- # options[:store] = 'mystore'
8
-
9
- # Simulate the customization done by store owners by passing values to different variables.
10
- # Default values are based on the "default" for each setting in your settings.json.
11
- # options[:customization] = {
12
- # :logo => {
13
- # :url => 'http://placehold.it/200x50/000000/ffffff&text=My+Logo',
14
- # :width => 200,
15
- # :height => 50
16
- # },
17
- # :background_color => '#CCCCCC',
18
- # :show_search => true,
19
- # :twitter_username => 'mytwitter'
20
- # }
3
+ begin
4
+ file = File.read('.dugway.json')
5
+ json = JSON.parse(file)
6
+ options = HashWithIndifferentAccess.new(json)
7
+ rescue Exception => e
8
+ puts e
9
+ options = {}
10
+ end
21
11
 
22
12
  run Dugway.application(options)
@@ -0,0 +1,27 @@
1
+ // Use this file to test your theme with different stores and customization variations.
2
+ // Learn more at: // https://github.com/bigcartel/dugway#testing-your-theme
3
+ // DON'T CHECK THIS FILE INTO SOURCE CONTROL
4
+
5
+ {
6
+
7
+ // Use data from any store to make sure your theme looks great with all sorts of products, pages,
8
+ // categories, and more. Just give us the subdomain. Default is "dugway" for dugway.bigcartel.com.
9
+
10
+ // "store": {
11
+ // "subdomain": "mystore"
12
+ // },
13
+
14
+ // Simulate the customization done by store owners by passing values to different variables.
15
+ // Default values are based on the "default" for each setting in your settings.json.
16
+
17
+ // "customization": {
18
+ // "logo": {
19
+ // "url": "http://placehold.it/200x50/000000/ffffff&text=My+Logo",
20
+ // "width": 200,
21
+ // "height": 50
22
+ // },
23
+ // "background_color": "#CCCCCC",
24
+ // "show_search": true,
25
+ // "twitter_username": "bigcartel"
26
+ // }
27
+ }
@@ -1,6 +1,7 @@
1
1
  .bundle
2
2
  .DS_Store
3
3
  .sass-cache
4
+ .dugway.json
4
5
 
5
6
  build
6
7
  tmp
@@ -1,3 +1,3 @@
1
1
  module Dugway
2
- VERSION = "0.10.2"
2
+ VERSION = "0.10.3"
3
3
  end
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.10.2
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Big Cartel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-20 00:00:00.000000000 Z
11
+ date: 2015-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -415,6 +415,7 @@ files:
415
415
  - lib/dugway/cli/create.rb
416
416
  - lib/dugway/cli/server.rb
417
417
  - lib/dugway/cli/templates/config.tt
418
+ - lib/dugway/cli/templates/dugway.tt
418
419
  - lib/dugway/cli/templates/gitignore.tt
419
420
  - lib/dugway/cli/templates/source/cart.html
420
421
  - lib/dugway/cli/templates/source/checkout.html