hardcode 0.1.0 → 0.1.1

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: 40c0f39fc533c3f27a074f8a323959dda66b91f1
4
- data.tar.gz: f26b0c0e1a7f1e7fdc859c148b8f85525a1c1ad7
3
+ metadata.gz: 6b1497ae5b8a4b28c4a50507e2686f49520ab41d
4
+ data.tar.gz: 08d25649e9543b9d728089c785c395e1bebaac9b
5
5
  SHA512:
6
- metadata.gz: 84453481f1704267de1aca0a02a3be89536518ecd2e1add79f02de5d1ade64442f1b04de2a4aafa67272e2c2add28ec9deb72e39b5c1ac59fd3f71b74e262381
7
- data.tar.gz: b71b8eea7ec1517f8ce4c8d46856b359b92294058e8691c4d474cb7cc23d1ac3b3c981e42f46eac86597a769692534bea5c348e34da56e20cb9c0b3f20ffd29f
6
+ metadata.gz: 9044f1c141dbc03f3e092f873e4c8e26eb219adfccaa7cfe981ae5df46273efbc85de7e940fe6ea351ecd8de5d7b0f390182334bbf9d5b22567db0a9aa9562d5
7
+ data.tar.gz: dee8d5bf23d8bcea741163676d8f8c15d1f1bfa57de8c5d8f925ffc00b16b7f0b71ca27fddc4caa517998be9f6e71b6f23635a930b51df2dc1c2f6bbc48cfba9
data/lib/hardcode/cli.rb CHANGED
@@ -103,32 +103,31 @@ module Hardcode
103
103
  aliases: '-t',
104
104
  default: '/tmp'
105
105
  def watch(source_dir)
106
- FileUtils.touch LOCK_FILE
107
- conn = Bunny.new
108
- conn.start
109
- ch = conn.create_channel
110
- q = ch.queue('stack_encode', durable: true)
111
- listener = Listen.to(source_dir) do |modified, added, removed|
112
- unless added.empty?
113
- source_file = added.first
114
- # wait until the file is fully written and not uploaded anymore
115
- while system %Q[lsof '#{source_file}']
116
- sleep 1
117
- end
118
- FileUtils.mv(source_file, options[:tmp_dir], verbose: true)
119
- ch.default_exchange.publish(
120
- {
121
- source: File.join(options[:tmp_dir], File.basename(source_file)),
122
- dest_dir: options[:destination]
123
- }.to_json,
124
- routing_key: q.name,
125
- persistent: true
126
- )
106
+ FileUtils.touch LOCK_FILE
107
+ conn = Bunny.new
108
+ conn.start
109
+ ch = conn.create_channel
110
+ q = ch.queue('stack_encode', durable: true)
111
+ listener = Listen.to(source_dir) do |modified, added, removed|
112
+ unless added.empty?
113
+ source_file = added.first
114
+ # wait until the file is fully written and not uploaded anymore
115
+ while system %Q[lsof '#{source_file}']
116
+ sleep 1
127
117
  end
118
+ FileUtils.mv(source_file, options[:tmp_dir], verbose: true)
119
+ ch.default_exchange.publish(
120
+ {
121
+ source: File.join(options[:tmp_dir], File.basename(source_file)),
122
+ dest_dir: options[:destination]
123
+ }.to_json,
124
+ routing_key: q.name,
125
+ persistent: true
126
+ )
128
127
  end
129
- listener.start
130
- sleep
131
128
  end
129
+ listener.start
130
+ sleep
132
131
  end
133
132
 
134
133
  end # class
@@ -1,3 +1,3 @@
1
1
  module Hardcode
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hardcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - niwo