shopify_theme 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,10 @@
1
- # Useage
1
+ # Installation
2
+
3
+ ````
4
+ gem install shopify_theme
5
+ ````
6
+
7
+ # Usage
2
8
 
3
9
  Generate the config file
4
10
 
@@ -4,6 +4,7 @@ require 'abbrev'
4
4
  require 'base64'
5
5
  require 'ftools'
6
6
  require 'json'
7
+ require 'fssm'
7
8
 
8
9
  module ShopifyTheme
9
10
  class Cli < Thor
@@ -60,14 +61,14 @@ module ShopifyTheme
60
61
  desc "watch", "upload individual theme assets as they change"
61
62
  method_option :quiet, :type => :boolean, :default => false
62
63
  def watch
63
- loop do
64
- modified_files.each do |a|
65
- send_asset(a, options['quiet'])
64
+ FSSM.monitor '.' do |m|
65
+ m.update do |base, relative|
66
+ send_asset(relative, options['quiet']) if local_assets_list.include?(relative)
67
+ end
68
+ m.create do |base, relative|
69
+ send_asset(relative, options['quiet']) if local_assets_list.include?(relative)
66
70
  end
67
- sleep(1)
68
71
  end
69
- rescue Interrupt
70
- puts ""
71
72
  end
72
73
 
73
74
  private
@@ -103,16 +104,5 @@ module ShopifyTheme
103
104
  puts "Error: Could not upload #{asset} to #{@config['store']}"
104
105
  end
105
106
  end
106
-
107
- def modified_files
108
- @reference_time ||= Time.now
109
- checked = Time.now
110
-
111
- files = local_assets_list.select do |asset|
112
- File.mtime(asset) > @reference_time
113
- end
114
- @reference_time = checked unless files.empty?
115
- files
116
- end
117
107
  end
118
108
  end
@@ -1,3 +1,3 @@
1
1
  module ShopifyTheme
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.add_dependency("thor", [">= 0.14.4"])
17
17
  s.add_dependency("httparty")
18
18
  s.add_dependency("json")
19
+ s.add_dependency("fssm")
19
20
 
20
21
  s.files = `git ls-files`.split("\n")
21
22
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_theme
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Duff
@@ -62,6 +62,20 @@ dependencies:
62
62
  version: "0"
63
63
  type: :runtime
64
64
  version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: fssm
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ hash: 3
74
+ segments:
75
+ - 0
76
+ version: "0"
77
+ type: :runtime
78
+ version_requirements: *id004
65
79
  description: 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.
66
80
  email:
67
81
  - john.duff@shopify.com