shopify_theme 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -81,4 +81,19 @@ problem by creating a Gemfile in your theme folder as follows:
81
81
  source 'https://rubygems.org'
82
82
 
83
83
  gem 'shopify_theme'
84
- ```
84
+ ```
85
+
86
+ Write `bundle install` and then `bundle exex` to allow the newly created Gemfile to sort out the JSON discrepancy.
87
+
88
+ ### When trying to run `theme watch` on Windows the application crashes with a gross stack trace
89
+
90
+ The gem doesn't install one of the dependencies you need in order to use this gem correctly on Windows. You
91
+ can get around this by either executing `gem install wdm` or by creating a Gemfile in your theme project such
92
+ as the following:
93
+
94
+ ```ruby
95
+ source "http://rubygems.org" # I could not validate the rubygems SSL certificate on Windows
96
+
97
+ gem "wdm"
98
+ gem "shopify_theme"
99
+ ```
@@ -100,22 +100,26 @@ module ShopifyTheme
100
100
  method_option :keep_files, :type => :boolean, :default => false
101
101
  def watch
102
102
  puts "Watching current folder: #{Dir.pwd}"
103
- Listen.to!(Dir.pwd, :relative_paths => true) do |modified, added, removed|
103
+ listener = Listen.to(Dir.pwd) do |modified, added, removed|
104
104
  modified.each do |filePath|
105
+ filePath.slice!(Dir.pwd + "/")
105
106
  send_asset(filePath, options['quiet']) if local_assets_list.include?(filePath)
106
107
  end
107
108
  added.each do |filePath|
109
+ filePath.slice!(Dir.pwd + "/")
108
110
  send_asset(filePath, options['quiet']) if local_assets_list.include?(filePath)
109
111
  end
110
- if !options['keep_files']
112
+ unless options['keep_files']
111
113
  removed.each do |filePath|
112
- delete_asset(filePath, options['quiet']) if local_assets_list.include?(relative)
114
+ filePath.slice!(Dir.pwd + "/")
115
+ delete_asset(filePath, options['quiet']) if !local_assets_list.include?(filePath)
113
116
  end
114
117
  end
115
118
  end
116
-
119
+ listener.start
120
+ sleep
117
121
  rescue Interrupt
118
- puts "exiting..."
122
+ puts "exiting...."
119
123
  end
120
124
 
121
125
  private
@@ -154,7 +158,7 @@ module ShopifyTheme
154
158
  data = {:key => asset}
155
159
  content = File.read(asset)
156
160
  if BINARY_EXTENSIONS.include?(File.extname(asset).gsub('.','')) || ShopifyTheme.is_binary_data?(content)
157
- content = IO.read asset
161
+ content = File.open(asset, "rb") { |io| io.read }
158
162
  data.merge!(:attachment => Base64.encode64(content))
159
163
  else
160
164
  data.merge!(:value => content)
@@ -1,3 +1,3 @@
1
1
  module ShopifyTheme
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -11,12 +11,13 @@ Gem::Specification.new do |s|
11
11
  s.homepage = "https://github.com/Shopify/shopify_theme"
12
12
  s.summary = %q{Command line tool for developing themes}
13
13
  s.description = %q{Command line tool to help with developing Shopify themes. Provides simple commands to download, upload and delete files from a theme. Also includes the watch command to watch a directory and upload files as they change.}
14
+ s.license = 'MIT'
14
15
 
15
16
  s.rubyforge_project = "shopify_theme"
16
17
  s.add_dependency("thor", [">= 0.14.4"])
17
18
  s.add_dependency("httparty", "~> 0.11")
18
19
  s.add_dependency("json", "~> 1.5.4")
19
- s.add_dependency("listen", "~>1.0")
20
+ s.add_dependency("listen", "~>2.0")
20
21
  s.add_dependency("launchy")
21
22
 
22
23
  s.add_development_dependency 'rake'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-07 00:00:00.000000000 Z
12
+ date: 2013-11-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: '1.0'
69
+ version: '2.0'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '1.0'
77
+ version: '2.0'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: launchy
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +148,8 @@ files:
148
148
  - spec/spec_helper.rb
149
149
  - spec/unit/cli_spec.rb
150
150
  homepage: https://github.com/Shopify/shopify_theme
151
- licenses: []
151
+ licenses:
152
+ - MIT
152
153
  post_install_message:
153
154
  rdoc_options: []
154
155
  require_paths:
@@ -161,7 +162,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
162
  version: '0'
162
163
  segments:
163
164
  - 0
164
- hash: -2229823443211554641
165
+ hash: -1246601995125621217
165
166
  required_rubygems_version: !ruby/object:Gem::Requirement
166
167
  none: false
167
168
  requirements:
@@ -170,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
171
  version: '0'
171
172
  segments:
172
173
  - 0
173
- hash: -2229823443211554641
174
+ hash: -1246601995125621217
174
175
  requirements: []
175
176
  rubyforge_project: shopify_theme
176
177
  rubygems_version: 1.8.23