sps-ftpd-driver 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 839fc535dc70960964a38de30b0942979d8ef322
4
- data.tar.gz: cad2e0d3343558deec49fdd4daf3f5e210869b5c
3
+ metadata.gz: 17418beb69f4bbc9878d0e7a7c0cc50e0e7b7402
4
+ data.tar.gz: e40f419926ab4bc5121ea019cfa796b95573a6f7
5
5
  SHA512:
6
- metadata.gz: 115bd4805ece26ba63272c5164623b6d21be3a7593212ba8c49b3477b32aeed024ca581178cb21eab977a5c164494e89ed820a402d8bb25d4adfa6620dcfa52d
7
- data.tar.gz: 46a831b6f3b77334e3dd9c7cd7728b5722614a1124374bf2b92d49668ed2e39dc5a87eac67408f5f6096df8b04bacdc558e61d4c17a2d029476e04bef83f7f27
6
+ metadata.gz: e17f787816f072751033132bf5fa8425193518915ccc7155a88258f76ccb2568ff4e2dc8ea1df1d7e8f40582038d1f31baf950c21171bbc3e1f42f94cc843501
7
+ data.tar.gz: 2a54cd986662ede9e3270b5f9da141461d3ab977e2d47bef75e6e68597a62e3a6842a2c967b49cddaf2b696b832bdb8d5bf1fa0eeca2fbd3f292f9c7cfd052bc
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- x��^��b��^��\����~> %�tL�T��ݨ4�ULu^k2r��j��=g.�lOr���VF�}�����3����+C���hf��<���&ֱB�� \I:w���S_�p��M��wՑO�Vt
2
- �aL�n%�G��yyS����zW��w���-�s�fǭ�9`��i�At~�c�KCp�吩O�1<��oQ�ex���(�X��
3
1
  ִ'yLmFG�)��DN���N��:m��/罇k:�
2
+ ��#�A�
3
+ fO��!��1 ��h�`ҳ�-�
4
+ �L�9��7�/�πY��Q'��X�D��]O�9� �|qoFi��!��es�����F�v�ݱ��
@@ -4,11 +4,12 @@
4
4
 
5
5
  require 'ftpd'
6
6
  require 'sps-pub'
7
+ require 'chronic_between'
7
8
 
8
9
 
9
10
  class SpsFtpdDriver
10
11
 
11
- def initialize(dir, sps: {})
12
+ def initialize(dir, sps: {}, between_times: '')
12
13
 
13
14
  @dir = dir
14
15
 
@@ -17,6 +18,7 @@ class SpsFtpdDriver
17
18
  @sps_topic = opt[:topic]
18
19
  @sps_host = opt[:host]
19
20
  @sps_port = opt[:port]
21
+ @times = between_times
20
22
  end
21
23
 
22
24
  def authenticate(user, password)
@@ -25,19 +27,21 @@ class SpsFtpdDriver
25
27
 
26
28
  def file_system(user)
27
29
 
28
- topic, host, port = @sps_topic, @sps_host, @sps_port
29
-
30
30
  fs = Ftpd::DiskFileSystem.new(@dir)
31
31
 
32
32
  fs.instance_eval("
33
33
  @sps_topic = '#{@sps_topic}'
34
34
  @sps_host = '#{@sps_host}'
35
35
  @sps_port = '#{@sps_port}'
36
+ @times = '#{@times}'
36
37
  ")
37
38
 
38
39
  def fs.write(ftp_path, contents)
39
- message = "%s: uploaded file %s" % [@sps_topic, ftp_path]
40
- SPSPub.notice message, address: @sps_host, port: @sps_port
40
+
41
+ if @times.empty? or ChronicBetween.new(@times).within?(Time.now) then
42
+ message = "%s: uploaded file %s" % [@sps_topic, ftp_path]
43
+ SPSPub.notice message, address: @sps_host, port: @sps_port
44
+ end
41
45
  super(ftp_path, contents)
42
46
  end
43
47
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sps-ftpd-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  L5SoXP1OGK+13Vzbp3QpVqbsqp8+9wP8njUUl5tBQ9I85WDOp1gBRmN7fsErk2Pc
32
32
  8me5hqJrn3ECIQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-02-17 00:00:00.000000000 Z
34
+ date: 2015-02-18 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ftpd
@@ -73,6 +73,26 @@ dependencies:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.4.0
76
+ - !ruby/object:Gem::Dependency
77
+ name: chronic_between
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.2'
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: 0.2.21
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - "~>"
91
+ - !ruby/object:Gem::Version
92
+ version: '0.2'
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: 0.2.21
76
96
  description:
77
97
  email: james@r0bertson.co.uk
78
98
  executables: []
@@ -103,5 +123,5 @@ rubyforge_project:
103
123
  rubygems_version: 2.2.2
104
124
  signing_key:
105
125
  specification_version: 4
106
- summary: Uses the ftpd gem to publish an SimplePubSub notice whenever a file is uploaded.
126
+ summary: Uses the ftpd gem to publish a SimplePubSub notice whenever a file is uploaded.
107
127
  test_files: []
metadata.gz.sig CHANGED
Binary file