dugway 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ed926065a679498f6e6d6841359c4ac9627ca1c
4
- data.tar.gz: a5a20be0cd16b4d0df45120c18962631131aee66
3
+ metadata.gz: c231b405dd8a4bf6580a5e7c09027feb22774b7a
4
+ data.tar.gz: e55aa9df136334d78341b1ae45f029960ba83638
5
5
  SHA512:
6
- metadata.gz: bc021513dba30e38387c33cdc7d343b4ab268a01bfef8c815557b961c903e7fd9a41ab0d4488fb726fd845238eb528d0a31dfbe48fa9a62d28de10ca48ab248d
7
- data.tar.gz: a6865685ee6abaeb8d7da249a406ea9ffc76e379530905231c0a6aff81f18c5341528bb84250a64d67859a4fedbe4fe516a2094b3ec1f5ecb9e3ea6c795d2d57
6
+ metadata.gz: be73796ce8b53718029ac4fdb24ddf52a638b1ab7864ebc96c1d2587c6a4e68842a58ae0b63b3eb58f3abb4850ac6a1a47f3c6a3cdc568d741701bddbc6c5788
7
+ data.tar.gz: 31c14d6d11316c39eaaf88b3b20421b33f8d595ddd76c2afc6411d8cd327dd445b4984c071d68a0cf304a06980d4a341d993bee122f775b0cd9ebe0860bdc5d3
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Dugway [![Build Status](https://travis-ci.org/bigcartel/dugway.png)](https://travis-ci.org/bigcartel/dugway)
1
+ # Dugway [![Build Status](https://travis-ci.org/bigcartel/dugway.png)](https://travis-ci.org/bigcartel/dugway) [![Gem Version](https://badge.fury.io/rb/dugway.png)](http://badge.fury.io/rb/dugway)
2
2
 
3
3
  **_The easy way to build Big Cartel themes._**
4
4
 
@@ -19,8 +19,13 @@ module Dugway
19
19
  File.join(File.dirname(__FILE__), 'templates')
20
20
  end
21
21
 
22
+ def variables
23
+ @name = name.titleize
24
+ @theme_dir = name.parameterize
25
+ end
26
+
22
27
  def core
23
- template('config.tt', "#{ theme_dir }/config.ru")
28
+ template('config.tt', "#{ @theme_dir }/config.ru")
24
29
  template('source/settings.json', "#{ source_dir }/settings.json")
25
30
  end
26
31
 
@@ -35,7 +40,7 @@ module Dugway
35
40
 
36
41
  def git
37
42
  unless options['skip-git']
38
- copy_file('gitignore.tt', "#{ theme_dir }/.gitignore")
43
+ copy_file('gitignore.tt', "#{ @theme_dir }/.gitignore")
39
44
  end
40
45
  end
41
46
 
@@ -45,12 +50,8 @@ module Dugway
45
50
 
46
51
  private
47
52
 
48
- def theme_dir
49
- name.parameterize
50
- end
51
-
52
53
  def source_dir
53
- "#{ theme_dir }/source"
54
+ "#{ @theme_dir }/source"
54
55
  end
55
56
  end
56
57
  end
@@ -2,13 +2,13 @@ require 'rack'
2
2
 
3
3
  module Dugway
4
4
  module Cli
5
- class Server < Thor::Group
5
+ class Server < Thor::Group
6
6
  class_option :host,
7
7
  :type => :string,
8
8
  :aliases => '-h',
9
- :default => '0.0.0.0',
9
+ :default => '127.0.0.1',
10
10
  :desc => 'The host address to bind to'
11
-
11
+
12
12
  class_option :port,
13
13
  :type => :numeric,
14
14
  :aliases => '-p',
@@ -19,8 +19,8 @@ module Dugway
19
19
  :type => :string,
20
20
  :aliases => '-s',
21
21
  :default => 'thin',
22
- :desc => "Which server to run"
23
-
22
+ :desc => "The server to run"
23
+
24
24
  def start
25
25
  Rack::Server.start({
26
26
  :config => File.join(Dir.pwd, 'config.ru'),
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "Sample",
2
+ "name": "<%= @name %>",
3
3
  "version": "0.0.1",
4
4
  "images": [
5
5
  {
@@ -18,7 +18,7 @@
18
18
  "variable": "header_font",
19
19
  "label": "Header Font",
20
20
  "default": "Inconsolata"
21
- },
21
+ },
22
22
  {
23
23
  "variable": "text_font",
24
24
  "label": "Text Font",
@@ -10,6 +10,8 @@ module Dugway
10
10
  singular
11
11
  elsif plural
12
12
  plural
13
+ elsif ActiveSupport.const_defined?(:Inflector)
14
+ ActiveSupport::Inflector.pluralize(singular)
13
15
  else
14
16
  singular + "s"
15
17
  end
@@ -1,3 +1,3 @@
1
1
  module Dugway
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.7"
3
3
  end
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ describe Dugway::Filters::CoreFilters do
4
+ describe "#pluralize" do
5
+ it "should pluralize with a count of 2 using the inflector" do
6
+ ActiveSupport.const_defined?(:Inflector).should == true
7
+ rendered_template("{{ 2 | pluralize: 'foo' }}").should == '2 foos'
8
+ rendered_template("{{ 2 | pluralize: 'box' }}").should == '2 boxes'
9
+ end
10
+
11
+ it "should pluralize using a custom plural with a count of 2" do
12
+ rendered_template("{{ 2 | pluralize: 'foo', 'fooies' }}").should == '2 fooies'
13
+ end
14
+
15
+ it "should not pluralize with a count of 1" do
16
+ rendered_template("{{ 1 | pluralize: 'foo' }}").should == '1 foo'
17
+ end
18
+
19
+ it "should add an s with no plural or Inflector defined" do
20
+ ActiveSupport.stub(:const_defined?).with(:Inflector) { false }
21
+ rendered_template("{{ 2 | pluralize: 'foo' }}").should == '2 foos'
22
+ ActiveSupport.stub(:const_defined?).with(:Inflector) { false }
23
+ rendered_template("{{ 2 | pluralize: 'box' }}").should == '2 boxs'
24
+ end
25
+ end
26
+
27
+ private
28
+
29
+ def rendered_template(template, assigns={})
30
+ Liquid::Template.parse(template).render(assigns)
31
+ end
32
+ 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.5.6
4
+ version: 0.5.7
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-26 00:00:00.000000000 Z
11
+ date: 2013-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -525,6 +525,7 @@ files:
525
525
  - spec/units/dugway/liquid/drops/products_drop_spec.rb
526
526
  - spec/units/dugway/liquid/drops/shipping_option_drop_spec.rb
527
527
  - spec/units/dugway/liquid/drops/theme_drop_spec.rb
528
+ - spec/units/dugway/liquid/filters/core_filters_spec.rb
528
529
  - spec/units/dugway/request_spec.rb
529
530
  - spec/units/dugway/store_spec.rb
530
531
  - spec/units/dugway/template_spec.rb
@@ -598,6 +599,7 @@ test_files:
598
599
  - spec/units/dugway/liquid/drops/products_drop_spec.rb
599
600
  - spec/units/dugway/liquid/drops/shipping_option_drop_spec.rb
600
601
  - spec/units/dugway/liquid/drops/theme_drop_spec.rb
602
+ - spec/units/dugway/liquid/filters/core_filters_spec.rb
601
603
  - spec/units/dugway/request_spec.rb
602
604
  - spec/units/dugway/store_spec.rb
603
605
  - spec/units/dugway/template_spec.rb