dugway 0.5.4 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -4
- data/dugway.gemspec +7 -6
- data/lib/dugway/cli/create.rb +10 -24
- data/lib/dugway/cli/templates/config.tt +0 -2
- data/lib/dugway/theme.rb +21 -21
- data/lib/dugway/version.rb +1 -1
- data/spec/units/dugway/theme_spec.rb +2 -2
- metadata +13 -11
- data/lib/dugway/cli/templates/Gemfile.tt +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ed926065a679498f6e6d6841359c4ac9627ca1c
|
4
|
+
data.tar.gz: a5a20be0cd16b4d0df45120c18962631131aee66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc021513dba30e38387c33cdc7d343b4ab268a01bfef8c815557b961c903e7fd9a41ab0d4488fb726fd845238eb528d0a31dfbe48fa9a62d28de10ca48ab248d
|
7
|
+
data.tar.gz: a6865685ee6abaeb8d7da249a406ea9ffc76e379530905231c0a6aff81f18c5341528bb84250a64d67859a4fedbe4fe516a2094b3ec1f5ecb9e3ea6c795d2d57
|
data/README.md
CHANGED
@@ -43,8 +43,7 @@ This will create a new directory named *mytheme* that contains a few configurati
|
|
43
43
|
│ ├── settings.json
|
44
44
|
│ ├── styles.css
|
45
45
|
│ └── success.html
|
46
|
-
|
47
|
-
└── Gemfile
|
46
|
+
└── config.ru
|
48
47
|
|
49
48
|
|
50
49
|
## Developing your theme
|
@@ -99,7 +98,7 @@ And as you've probably guessed by now, all images for your theme go in the **ima
|
|
99
98
|
|
100
99
|
### Settings
|
101
100
|
|
102
|
-
Set your theme's name, version, and customizable options in the **settings.json** file. We'll be documenting more about this soon, but for now see the starter file generated for you.
|
101
|
+
Set your theme's name, version, and customizable options in the **settings.json** file. We'll be documenting more about this soon, but for now see the starter file generated for you, and check out our [default themes](https://github.com/bigcartel-themes).
|
103
102
|
|
104
103
|
## Running your theme
|
105
104
|
|
@@ -115,7 +114,7 @@ Tired of all the manual starting and stopping? Good news, Dugway is built on top
|
|
115
114
|
|
116
115
|
## Testing your theme
|
117
116
|
|
118
|
-
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.
|
117
|
+
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.
|
119
118
|
|
120
119
|
*Note:* changing the **config.ru** file will require you to restart the [server](#running-your-theme).
|
121
120
|
|
data/dugway.gemspec
CHANGED
@@ -8,19 +8,20 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.authors = ['Big Cartel']
|
9
9
|
s.email = 'dev@bigcartel.com'
|
10
10
|
s.homepage = 'https://github.com/bigcartel/dugway'
|
11
|
-
s.summary =
|
12
|
-
s.description =
|
11
|
+
s.summary = %{Easily build and test Big Cartel themes.}
|
12
|
+
s.description = %{Dugway allows you to run your Big Cartel theme on your computer, test it in any browser, write code in your favorite editor, and use fancy new tools like CoffeeScript, Sass, and LESS. It's awesome.}
|
13
|
+
s.license = 'MIT'
|
13
14
|
|
14
15
|
s.files = `git ls-files`.split($\)
|
15
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
17
|
s.platform = Gem::Platform::RUBY
|
17
18
|
s.require_path = 'lib'
|
18
19
|
s.executable = 'dugway'
|
19
|
-
|
20
|
+
|
20
21
|
s.add_dependency('bundler', '~> 1.1')
|
21
22
|
s.add_dependency('rack', '~> 1.4.1')
|
22
23
|
s.add_dependency('rack-mount', '~> 0.8.3')
|
23
|
-
s.add_dependency('activesupport', '~> 3.2.
|
24
|
+
s.add_dependency('activesupport', '~> 3.2.13')
|
24
25
|
s.add_dependency('liquid', '~> 2.4.1')
|
25
26
|
s.add_dependency('therubyracer', '~> 0.11.3')
|
26
27
|
s.add_dependency('coffee-script', '~> 2.2.0')
|
@@ -35,9 +36,9 @@ Gem::Specification.new do |s|
|
|
35
36
|
s.add_dependency('htmlentities', '~> 4.3.1')
|
36
37
|
s.add_dependency('thor', '~> 0.17.0')
|
37
38
|
s.add_dependency('rubyzip', '~> 0.9.9')
|
38
|
-
s.add_dependency('
|
39
|
+
s.add_dependency('uglifier', '~> 1.3.0')
|
39
40
|
s.add_dependency('thin', '~> 1.5.0')
|
40
|
-
|
41
|
+
|
41
42
|
s.add_development_dependency('rake', '~> 10.0.3')
|
42
43
|
s.add_development_dependency('rspec', '~> 2.12.0')
|
43
44
|
s.add_development_dependency('webmock', '~> 1.9.3')
|
data/lib/dugway/cli/create.rb
CHANGED
@@ -2,34 +2,28 @@ module Dugway
|
|
2
2
|
module Cli
|
3
3
|
class Create < Thor::Group
|
4
4
|
include Thor::Actions
|
5
|
-
|
5
|
+
|
6
6
|
argument :name
|
7
|
-
|
7
|
+
|
8
8
|
class_option 'skip-source',
|
9
9
|
:type => :boolean,
|
10
10
|
:default => false,
|
11
11
|
:desc => "Don't create a starter theme"
|
12
|
-
|
12
|
+
|
13
13
|
class_option 'skip-git',
|
14
14
|
:type => :boolean,
|
15
15
|
:default => false,
|
16
16
|
:desc => "Don't create a .gitignore file"
|
17
|
-
|
18
|
-
class_option 'skip-bundle',
|
19
|
-
:type => :boolean,
|
20
|
-
:default => false,
|
21
|
-
:desc => "Don't run bundle install"
|
22
|
-
|
17
|
+
|
23
18
|
def self.source_root
|
24
19
|
File.join(File.dirname(__FILE__), 'templates')
|
25
20
|
end
|
26
|
-
|
21
|
+
|
27
22
|
def core
|
28
|
-
template('Gemfile.tt', "#{ theme_dir }/Gemfile")
|
29
23
|
template('config.tt', "#{ theme_dir }/config.ru")
|
30
24
|
template('source/settings.json', "#{ source_dir }/settings.json")
|
31
25
|
end
|
32
|
-
|
26
|
+
|
33
27
|
def source
|
34
28
|
unless options['skip-source']
|
35
29
|
Dir.glob("#{ self.class.source_root }/source/**/*.{html,jpg,png,js,coffee,css,sass}") do |file|
|
@@ -38,31 +32,23 @@ module Dugway
|
|
38
32
|
end
|
39
33
|
end
|
40
34
|
end
|
41
|
-
|
35
|
+
|
42
36
|
def git
|
43
37
|
unless options['skip-git']
|
44
38
|
copy_file('gitignore.tt', "#{ theme_dir }/.gitignore")
|
45
39
|
end
|
46
40
|
end
|
47
|
-
|
48
|
-
def bundle
|
49
|
-
unless options['skip-bundle']
|
50
|
-
inside theme_dir, {} do
|
51
|
-
run('bundle install --without development test')
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
41
|
|
56
42
|
def done
|
57
43
|
say("#{ name } is ready!", :blue)
|
58
44
|
end
|
59
|
-
|
45
|
+
|
60
46
|
private
|
61
|
-
|
47
|
+
|
62
48
|
def theme_dir
|
63
49
|
name.parameterize
|
64
50
|
end
|
65
|
-
|
51
|
+
|
66
52
|
def source_dir
|
67
53
|
"#{ theme_dir }/source"
|
68
54
|
end
|
data/lib/dugway/theme.rb
CHANGED
@@ -2,44 +2,44 @@ require 'coffee-script'
|
|
2
2
|
require 'sass'
|
3
3
|
require 'less'
|
4
4
|
require 'sprockets'
|
5
|
-
require '
|
5
|
+
require 'uglifier'
|
6
6
|
|
7
7
|
module Dugway
|
8
8
|
class Theme
|
9
9
|
REQUIRED_FILES = %w( layout.html home.html products.html product.html cart.html checkout.html success.html contact.html maintenance.html scripts.js styles.css settings.json screenshot.jpg )
|
10
|
-
|
10
|
+
|
11
11
|
attr_reader :errors
|
12
12
|
|
13
13
|
def initialize(overridden_customization={})
|
14
14
|
@overridden_customization = overridden_customization.stringify_keys
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def layout
|
18
18
|
read_source_file('layout.html')
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def settings
|
22
22
|
JSON.parse(read_source_file('settings.json'))
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def fonts
|
26
26
|
customization_for_type('fonts')
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def customization
|
30
30
|
Hash.new.tap { |customization|
|
31
31
|
%w( fonts colors options ).each { |type|
|
32
32
|
customization.update(customization_for_type(type))
|
33
33
|
}
|
34
|
-
|
34
|
+
|
35
35
|
customization.update(@overridden_customization)
|
36
36
|
}
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
def name
|
40
40
|
settings['name']
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
def version
|
44
44
|
settings['version']
|
45
45
|
end
|
@@ -48,7 +48,7 @@ module Dugway
|
|
48
48
|
case name
|
49
49
|
when 'scripts.js'
|
50
50
|
if @building
|
51
|
-
|
51
|
+
Uglifier.new.compile(sprockets[name].to_s)
|
52
52
|
else
|
53
53
|
sprockets[name].to_s
|
54
54
|
end
|
@@ -69,7 +69,7 @@ module Dugway
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def image_files
|
72
|
-
Dir.glob(File.join(source_dir, 'images', '**', '*.{png,jpg,jpeg,gif}')).map { |i|
|
72
|
+
Dir.glob(File.join(source_dir, 'images', '**', '*.{png,jpg,jpeg,gif}')).map { |i|
|
73
73
|
i.gsub(source_dir, '')[1..-1]
|
74
74
|
}
|
75
75
|
end
|
@@ -87,21 +87,21 @@ module Dugway
|
|
87
87
|
|
88
88
|
@errors.empty?
|
89
89
|
end
|
90
|
-
|
90
|
+
|
91
91
|
private
|
92
92
|
|
93
93
|
def source_dir
|
94
94
|
Dugway.source_dir
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
def sprockets
|
98
98
|
@sprockets ||= begin
|
99
99
|
sprockets = Sprockets::Environment.new
|
100
100
|
sprockets.append_path source_dir
|
101
|
-
|
102
|
-
# CSS engines like Sass and LESS choke on Liquid variables, so here we render the Liquid
|
101
|
+
|
102
|
+
# CSS engines like Sass and LESS choke on Liquid variables, so here we render the Liquid
|
103
103
|
# if we're viewing the file, or escape and unescape it if we're building the file.
|
104
|
-
|
104
|
+
|
105
105
|
sprockets.register_preprocessor 'text/css', :liquifier do |context, data|
|
106
106
|
if @building
|
107
107
|
Liquifier.escape_styles(data)
|
@@ -109,7 +109,7 @@ module Dugway
|
|
109
109
|
Liquifier.render_styles(data)
|
110
110
|
end
|
111
111
|
end
|
112
|
-
|
112
|
+
|
113
113
|
sprockets.register_postprocessor 'text/css', :liquifier do |context, data|
|
114
114
|
if @building
|
115
115
|
Liquifier.unescape_styles(data)
|
@@ -117,21 +117,21 @@ module Dugway
|
|
117
117
|
data
|
118
118
|
end
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
sprockets
|
122
122
|
end
|
123
123
|
end
|
124
|
-
|
124
|
+
|
125
125
|
def read_source_file(file_name)
|
126
126
|
file_path = File.join(source_dir, file_name)
|
127
|
-
|
127
|
+
|
128
128
|
if File.exist?(file_path)
|
129
129
|
File.read(file_path)
|
130
130
|
else
|
131
131
|
nil
|
132
132
|
end
|
133
133
|
end
|
134
|
-
|
134
|
+
|
135
135
|
def customization_for_type(type)
|
136
136
|
Hash.new.tap { |hash|
|
137
137
|
if settings.has_key?(type)
|
data/lib/dugway/version.rb
CHANGED
@@ -38,7 +38,7 @@ describe Dugway::Theme do
|
|
38
38
|
|
39
39
|
describe "when there are overridden customization" do
|
40
40
|
before(:each) do
|
41
|
-
Dugway.stub(:theme) {
|
41
|
+
Dugway.stub(:theme) {
|
42
42
|
Dugway::Theme.new(:fixed_sidebar => false, :link_color => 'blue')
|
43
43
|
}
|
44
44
|
end
|
@@ -92,7 +92,7 @@ describe Dugway::Theme do
|
|
92
92
|
end
|
93
93
|
|
94
94
|
it "should sprocketize and compress scripts.js" do
|
95
|
-
theme.build_file('scripts.js').should == %{$(function(){console.log(\"One\")})
|
95
|
+
theme.build_file('scripts.js').should == %{$(function(){console.log(\"One\")}),function(){$(function(){return console.log(\"Two\")})}.call(this);}
|
96
96
|
end
|
97
97
|
|
98
98
|
it "should sprocketize and not liquify styles.css" 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.5.
|
4
|
+
version: 0.5.6
|
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-03-
|
11
|
+
date: 2013-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.2.
|
61
|
+
version: 3.2.13
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.2.
|
68
|
+
version: 3.2.13
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: liquid
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -263,19 +263,19 @@ dependencies:
|
|
263
263
|
- !ruby/object:Gem::Version
|
264
264
|
version: 0.9.9
|
265
265
|
- !ruby/object:Gem::Dependency
|
266
|
-
name:
|
266
|
+
name: uglifier
|
267
267
|
requirement: !ruby/object:Gem::Requirement
|
268
268
|
requirements:
|
269
269
|
- - ~>
|
270
270
|
- !ruby/object:Gem::Version
|
271
|
-
version:
|
271
|
+
version: 1.3.0
|
272
272
|
type: :runtime
|
273
273
|
prerelease: false
|
274
274
|
version_requirements: !ruby/object:Gem::Requirement
|
275
275
|
requirements:
|
276
276
|
- - ~>
|
277
277
|
- !ruby/object:Gem::Version
|
278
|
-
version:
|
278
|
+
version: 1.3.0
|
279
279
|
- !ruby/object:Gem::Dependency
|
280
280
|
name: thin
|
281
281
|
requirement: !ruby/object:Gem::Requirement
|
@@ -374,7 +374,9 @@ dependencies:
|
|
374
374
|
- - ~>
|
375
375
|
- !ruby/object:Gem::Version
|
376
376
|
version: 0.7.1
|
377
|
-
description:
|
377
|
+
description: Dugway allows you to run your Big Cartel theme on your computer, test
|
378
|
+
it in any browser, write code in your favorite editor, and use fancy new tools like
|
379
|
+
CoffeeScript, Sass, and LESS. It's awesome.
|
378
380
|
email: dev@bigcartel.com
|
379
381
|
executables:
|
380
382
|
- dugway
|
@@ -398,7 +400,6 @@ files:
|
|
398
400
|
- lib/dugway/cli/build.rb
|
399
401
|
- lib/dugway/cli/create.rb
|
400
402
|
- lib/dugway/cli/server.rb
|
401
|
-
- lib/dugway/cli/templates/Gemfile.tt
|
402
403
|
- lib/dugway/cli/templates/config.tt
|
403
404
|
- lib/dugway/cli/templates/gitignore.tt
|
404
405
|
- lib/dugway/cli/templates/source/cart.html
|
@@ -530,7 +531,8 @@ files:
|
|
530
531
|
- spec/units/dugway/theme_font_spec.rb
|
531
532
|
- spec/units/dugway/theme_spec.rb
|
532
533
|
homepage: https://github.com/bigcartel/dugway
|
533
|
-
licenses:
|
534
|
+
licenses:
|
535
|
+
- MIT
|
534
536
|
metadata: {}
|
535
537
|
post_install_message:
|
536
538
|
rdoc_options: []
|
@@ -551,7 +553,7 @@ rubyforge_project:
|
|
551
553
|
rubygems_version: 2.0.0
|
552
554
|
signing_key:
|
553
555
|
specification_version: 4
|
554
|
-
summary: Easily build and test Big Cartel themes
|
556
|
+
summary: Easily build and test Big Cartel themes.
|
555
557
|
test_files:
|
556
558
|
- spec/features/contact_form_spec.rb
|
557
559
|
- spec/features/page_rendering_spec.rb
|