revenc 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ Feature: Reverse mount encrypted folder using encfs
16
16
  test
17
17
  """
18
18
  When I run "revenc mount unencrypted_source_folder encrypted_destination_folder"
19
- Then I should not see "For more information, see the man page encfs(1)"
19
+ Then the output should not contain "For more information, see the man page encfs(1)"
20
20
  And the exit status should be 0
21
21
 
22
22
  Scenario: Successful mount dry run
@@ -35,7 +35,7 @@ Feature: Reverse mount encrypted folder using encfs
35
35
  Scenario: Source folder not specified
36
36
  When I run "revenc mount"
37
37
  Then the exit status should be 1
38
- And I should see:
38
+ And the output should contain:
39
39
  """
40
40
  source folder not specified
41
41
  """
@@ -43,7 +43,7 @@ Feature: Reverse mount encrypted folder using encfs
43
43
  Scenario: Destination mount point not specified
44
44
  When I run "revenc mount unencrypted_source_folder"
45
45
  Then the exit status should be 1
46
- And I should see:
46
+ And the output should contain:
47
47
  """
48
48
  mountpoint not specified
49
49
  """
@@ -52,7 +52,7 @@ Feature: Reverse mount encrypted folder using encfs
52
52
  Given a directory named "encrypted_destination_folder"
53
53
  When I run "revenc mount unencrypted_source_folder encrypted_destination_folder"
54
54
  Then the exit status should be 1
55
- And I should see:
55
+ And the output should contain:
56
56
  """
57
57
  source folder not found
58
58
  """
@@ -62,7 +62,7 @@ Feature: Reverse mount encrypted folder using encfs
62
62
  Given an empty file named "unencrypted_source_folder/test_data.txt"
63
63
  When I run "revenc mount unencrypted_source_folder encrypted_destination_folder"
64
64
  Then the exit status should be 1
65
- And I should see:
65
+ And the output should contain:
66
66
  """
67
67
  mount point not found
68
68
  """
@@ -74,7 +74,7 @@ Feature: Reverse mount encrypted folder using encfs
74
74
  Given an empty file named "encrypted_destination_folder/should_not_be_here.txt"
75
75
  When I run "revenc mount unencrypted_source_folder encrypted_destination_folder"
76
76
  Then the exit status should be 1
77
- And I should see:
77
+ And the output should contain:
78
78
  """
79
79
  mount point is not empty
80
80
  """
@@ -85,7 +85,7 @@ Feature: Reverse mount encrypted folder using encfs
85
85
  Given a directory named "encrypted_destination_folder"
86
86
  When I run "revenc mount unencrypted_source_folder encrypted_destination_folder"
87
87
  Then the exit status should be 1
88
- And I should see:
88
+ And the output should contain:
89
89
  """
90
90
  mount point passphrase file not found
91
91
  """
@@ -97,7 +97,7 @@ Feature: Reverse mount encrypted folder using encfs
97
97
  Given an empty file named "passphrase"
98
98
  When I run "revenc mount unencrypted_source_folder encrypted_destination_folder"
99
99
  Then the exit status should be 1
100
- And I should see:
100
+ And the output should contain:
101
101
  """
102
102
  mount point passphrase file is empty
103
103
  """
@@ -105,7 +105,7 @@ Feature: Reverse mount encrypted folder using encfs
105
105
  Scenario: Key file not found
106
106
  When I run "revenc mount unencrypted_source_folder encrypted_destination_folder"
107
107
  Then the exit status should be 1
108
- And I should see:
108
+ And the output should contain:
109
109
  """
110
110
  key file not found
111
111
  """
@@ -114,7 +114,7 @@ Feature: Reverse mount encrypted folder using encfs
114
114
  Given an empty file named "encfs6.xml"
115
115
  When I run "revenc mount unencrypted_source_folder encrypted_destination_folder"
116
116
  Then the exit status should be 1
117
- And I should see:
117
+ And the output should contain:
118
118
  """
119
119
  key file is empty
120
120
  """
@@ -127,7 +127,7 @@ Feature: Reverse mount encrypted folder using encfs
127
127
  """
128
128
  When I run "revenc mount unencrypted_source_folder encrypted_destination_folder"
129
129
  Then the exit status should be 1
130
- And I should see:
130
+ And the output should contain:
131
131
  """
132
132
  executable not found
133
133
  """
@@ -1,3 +1,4 @@
1
+ require 'mutagem'
1
2
  require 'revenc/io'
2
3
 
3
4
  Given /^a valid encfs keyfile named "([^\"]*)"$/ do |filename|
@@ -45,8 +46,8 @@ end
45
46
 
46
47
  When /^I run with a lock file present "(.*)"$/ do |cmd|
47
48
  lockfile = File.join(current_dir, 'revenc.lck')
48
- Revenc::Mutex.new(lockfile).execute do
49
- run(unescape(cmd))
49
+ Mutagem::Mutex.new(lockfile).execute do
50
+ run(unescape(cmd), false)
50
51
  end
51
52
  end
52
53
 
@@ -9,13 +9,13 @@ module Aruba
9
9
  alias_method :old_run, :run
10
10
 
11
11
  # override aruba
12
- def run(cmd)
12
+ def run(cmd, fail_on_error=true)
13
13
 
14
14
  # run development version in verbose mode
15
15
  cmd = cmd.gsub(/^revenc/, "#{APP_BIN_PATH} --verbose")
16
16
 
17
17
  # run original aruba 'run'
18
- old_run(cmd)
18
+ old_run(cmd, fail_on_error)
19
19
  end
20
20
  end
21
21
  end
@@ -30,7 +30,7 @@ Feature: Unmounting a reverse mounted encrypted folder using encfs
30
30
  Scenario: Unmount folder not specified
31
31
  When I run "revenc unmount"
32
32
  Then the exit status should be 1
33
- And I should see:
33
+ And the output should contain:
34
34
  """
35
35
  mountpoint not specified
36
36
  """
@@ -39,7 +39,7 @@ Feature: Unmounting a reverse mounted encrypted folder using encfs
39
39
  Given a directory named "encrypted_destination_folder"
40
40
  When I run "revenc unmount unencrypted_source_folder"
41
41
  Then the exit status should be 1
42
- And I should see:
42
+ And the output should contain:
43
43
  """
44
44
  folder not found
45
45
  """
@@ -52,7 +52,7 @@ Feature: Unmounting a reverse mounted encrypted folder using encfs
52
52
  """
53
53
  When I run "revenc unmount unencrypted_source_folder"
54
54
  Then the exit status should be 1
55
- And I should see:
55
+ And the output should contain:
56
56
  """
57
57
  executable not found
58
58
  """
data/lib/revenc/io.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'mutagem'
2
+
1
3
  module Revenc
2
4
 
3
5
  class BasicAction
@@ -180,7 +182,7 @@ module Revenc
180
182
  result = false
181
183
 
182
184
  # protect command from recursion
183
- mutex = Revenc::Mutex.new
185
+ mutex = Mutagem::Mutex.new('revenc.lck')
184
186
  lock_sucessful = mutex.execute do
185
187
  result = system_cmd(cmd)
186
188
  end
data/lib/revenc.rb CHANGED
@@ -1,22 +1,24 @@
1
- $:.unshift File.dirname(__FILE__) # For use/testing when no gem is installed
2
-
1
+ # require all files here
3
2
  require 'rubygems'
3
+ require 'revenc/app'
4
+ require 'revenc/io'
5
+ require 'revenc/errors'
6
+ require 'revenc/encfs_wrapper'
4
7
 
8
+ # Master namespace
5
9
  module Revenc
6
10
 
7
- # return the contents of the VERSION file
8
- # VERSION format: 0.0.0
11
+ # Contents of the VERSION file
12
+ #
13
+ # Example format: 0.0.1
14
+ #
15
+ # @return [String] the contents of the version file in #.#.# format
9
16
  def self.version
10
17
  version_info_file = File.join(File.dirname(__FILE__), *%w[.. VERSION])
11
18
  File.open(version_info_file, "r") do |f|
12
19
  f.read
13
- end
20
+ end
14
21
  end
15
-
22
+
16
23
  end
17
24
 
18
- require 'revenc/app'
19
- require 'revenc/io'
20
- require 'revenc/errors'
21
- require 'revenc/lockfile'
22
- require 'revenc/encfs_wrapper'
data/revenc.gemspec ADDED
@@ -0,0 +1,42 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ #
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "revenc"
7
+ s.version = File.open(File.join(File.dirname(__FILE__), *%w[VERSION]), "r") { |f| f.read }
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Robert Wahler"]
10
+ s.email = ["robert@gearheadforhire.com"]
11
+ s.homepage = "http://rubygems.org/gems/revenc"
12
+ s.summary = "Wrapper for EncFS reverse mounting and folder syncing"
13
+ s.description = "Reverse Mount, unmount, and copy/synchronize encrypted files to untrusted destinations using EncFS and rsync"
14
+
15
+ s.required_rubygems_version = ">= 1.3.6"
16
+ s.rubyforge_project = "revenc"
17
+
18
+ s.add_dependency 'mutagem', '>= 0.1.3'
19
+ s.add_dependency 'term-ansicolor', '>= 1.0.4'
20
+ s.add_dependency 'configatron', '>= 2.5.1'
21
+
22
+ s.add_development_dependency "bundler", ">= 1.0.0"
23
+ s.add_development_dependency "rspec", ">= 1.2.9"
24
+ s.add_development_dependency "cucumber", ">= 0.6"
25
+ s.add_development_dependency "aruba", ">= 0.2.0"
26
+ s.add_development_dependency "rake", ">= 0.8.7"
27
+ s.add_development_dependency "yard", ">= 0.6.1"
28
+ s.add_development_dependency "rdiscount", ">= 1.6.5"
29
+
30
+ s.files = `git ls-files`.split("\n")
31
+ s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
32
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
33
+ s.require_path = 'lib'
34
+
35
+ s.has_rdoc = 'yard'
36
+ s.rdoc_options = [
37
+ '--title', 'Revenc Documentation',
38
+ '--main', 'README.markdown',
39
+ '--line-numbers',
40
+ '--inline-source'
41
+ ]
42
+ end
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe Revenc do
4
+
5
+ describe 'version' do
6
+
7
+ it "should return a string formatted '#.#.#'" do
8
+ Revenc::version.should match(/(^[\d]+\.[\d]+\.[\d]+$)/)
9
+ end
10
+
11
+ end
12
+
13
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,12 +1,15 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__))
2
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
1
+ $LOAD_PATH.unshift File.expand_path('..', __FILE__) unless
2
+ $LOAD_PATH.include? File.expand_path('..', __FILE__)
3
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) unless
4
+ $LOAD_PATH.include? File.expand_path('../../lib', __FILE__)
5
+
6
+ require 'rubygems'
3
7
  require 'revenc'
4
8
  require 'spec'
5
9
  require 'spec/autorun'
6
10
  require 'aruba/api'
7
11
 
8
- # aruba helper, returns to full path to files
9
- # in the aruba tmp folder
12
+ # aruba helper, returns full path to files in the aruba tmp folder
10
13
  def fullpath(filename)
11
14
  File.expand_path(File.join(current_dir, filename))
12
15
  end
data/spec/watchr.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # Watchr: Autotest like functionality
2
2
  #
3
+ # gem install watchr
4
+ #
3
5
  # Run me with:
4
6
  #
5
7
  # $ watchr spec/watchr.rb
@@ -26,7 +28,7 @@ def all_feature_files
26
28
  end
27
29
 
28
30
  def all_spec_files
29
- files = Dir['spec/revenc/*.rb']
31
+ files = Dir['spec/**/*_spec\.rb']
30
32
  end
31
33
 
32
34
  def run(cmd)
@@ -103,7 +105,6 @@ prompt
103
105
  # --------------------------------------------------
104
106
  # Watchr Rules
105
107
  # --------------------------------------------------
106
- #watch( '^features/(.*)\.feature' ) { |m| run_feature(m[0]) }
107
108
  watch( '^features/(.*)\.feature' ) { run_default_cucumber }
108
109
 
109
110
  watch( '^bin/(.*)' ) { run_default_cucumber }
@@ -113,9 +114,11 @@ watch( '^features/step_definitions/(.*)\.rb' ) { run_default_cucumber }
113
114
  watch( '^features/support/(.*)\.rb' ) { run_default_cucumber }
114
115
 
115
116
  watch( '^spec/(.*)_spec\.rb' ) { |m| run_spec(m[0]) }
116
- # watch( '^lib/revenc/io.rb' ) { run_default_spec }
117
- watch( '^lib/revenc/errors.rb' ) { run_default_spec }
118
- watch( '^lib/revenc/lockfile.rb' ) { run_default_spec }
117
+ # specify just the lib files that have specs
118
+ # TODO: This can be determined automatically from the spec file naming convention
119
+ watch( '^lib/revenc.rb' ) { run_default_spec }
120
+ watch( '^lib/errors.rb' ) { run_default_spec }
121
+ watch( '^lib/io.rb' ) { run_default_spec }
119
122
 
120
123
  # --------------------------------------------------
121
124
  # Signal Handling
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revenc
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 29
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 2
9
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
10
11
  platform: ruby
11
12
  authors:
12
13
  - Robert Wahler
@@ -14,97 +15,188 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-03-12 00:00:00 -05:00
18
- default_executable: revenc
18
+ date: 2010-10-05 00:00:00 -04:00
19
+ default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- name: term-ansicolor
22
- prerelease: false
23
22
  requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
+ hash: 29
28
+ segments:
29
+ - 0
30
+ - 1
31
+ - 3
32
+ version: 0.1.3
33
+ type: :runtime
34
+ name: mutagem
35
+ prerelease: false
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 31
27
44
  segments:
28
45
  - 1
29
46
  - 0
30
47
  - 4
31
48
  version: 1.0.4
32
49
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: configatron
50
+ name: term-ansicolor
36
51
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
38
56
  requirements:
39
57
  - - ">="
40
58
  - !ruby/object:Gem::Version
59
+ hash: 25
41
60
  segments:
42
61
  - 2
43
62
  - 5
44
63
  - 1
45
64
  version: 2.5.1
46
65
  type: :runtime
47
- version_requirements: *id002
66
+ name: configatron
67
+ prerelease: false
68
+ version_requirements: *id003
48
69
  - !ruby/object:Gem::Dependency
49
- name: rspec
70
+ requirement: &id004 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 23
76
+ segments:
77
+ - 1
78
+ - 0
79
+ - 0
80
+ version: 1.0.0
81
+ type: :development
82
+ name: bundler
50
83
  prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
84
+ version_requirements: *id004
85
+ - !ruby/object:Gem::Dependency
86
+ requirement: &id005 !ruby/object:Gem::Requirement
87
+ none: false
52
88
  requirements:
53
89
  - - ">="
54
90
  - !ruby/object:Gem::Version
91
+ hash: 13
55
92
  segments:
56
93
  - 1
57
94
  - 2
58
95
  - 9
59
96
  version: 1.2.9
60
97
  type: :development
61
- version_requirements: *id003
62
- - !ruby/object:Gem::Dependency
63
- name: cucumber
98
+ name: rspec
64
99
  prerelease: false
65
- requirement: &id004 !ruby/object:Gem::Requirement
100
+ version_requirements: *id005
101
+ - !ruby/object:Gem::Dependency
102
+ requirement: &id006 !ruby/object:Gem::Requirement
103
+ none: false
66
104
  requirements:
67
105
  - - ">="
68
106
  - !ruby/object:Gem::Version
107
+ hash: 7
69
108
  segments:
70
109
  - 0
71
110
  - 6
72
111
  version: "0.6"
73
112
  type: :development
74
- version_requirements: *id004
113
+ name: cucumber
114
+ prerelease: false
115
+ version_requirements: *id006
75
116
  - !ruby/object:Gem::Dependency
117
+ requirement: &id007 !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ hash: 23
123
+ segments:
124
+ - 0
125
+ - 2
126
+ - 0
127
+ version: 0.2.0
128
+ type: :development
76
129
  name: aruba
77
130
  prerelease: false
78
- requirement: &id005 !ruby/object:Gem::Requirement
131
+ version_requirements: *id007
132
+ - !ruby/object:Gem::Dependency
133
+ requirement: &id008 !ruby/object:Gem::Requirement
134
+ none: false
79
135
  requirements:
80
136
  - - ">="
81
137
  - !ruby/object:Gem::Version
138
+ hash: 49
82
139
  segments:
83
140
  - 0
84
- - 1
141
+ - 8
85
142
  - 7
86
- version: 0.1.7
143
+ version: 0.8.7
87
144
  type: :development
88
- version_requirements: *id005
89
- description: |-
90
- Mount, unmount, and copy/synchronize encrypted files to
91
- untrusted destinations using EncFS and rsync
92
- email: robert@gearheadforhire.com
145
+ name: rake
146
+ prerelease: false
147
+ version_requirements: *id008
148
+ - !ruby/object:Gem::Dependency
149
+ requirement: &id009 !ruby/object:Gem::Requirement
150
+ none: false
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ hash: 5
155
+ segments:
156
+ - 0
157
+ - 6
158
+ - 1
159
+ version: 0.6.1
160
+ type: :development
161
+ name: yard
162
+ prerelease: false
163
+ version_requirements: *id009
164
+ - !ruby/object:Gem::Dependency
165
+ requirement: &id010 !ruby/object:Gem::Requirement
166
+ none: false
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ hash: 5
171
+ segments:
172
+ - 1
173
+ - 6
174
+ - 5
175
+ version: 1.6.5
176
+ type: :development
177
+ name: rdiscount
178
+ prerelease: false
179
+ version_requirements: *id010
180
+ description: Reverse Mount, unmount, and copy/synchronize encrypted files to untrusted destinations using EncFS and rsync
181
+ email:
182
+ - robert@gearheadforhire.com
93
183
  executables:
94
184
  - revenc
95
185
  extensions: []
96
186
 
97
- extra_rdoc_files:
98
- - LICENSE
99
- - README.rdoc
187
+ extra_rdoc_files: []
188
+
100
189
  files:
101
- - .document
102
190
  - .gitattributes
103
191
  - .gitignore
104
- - CLONING.rdoc
192
+ - .yardopts
193
+ - Gemfile
194
+ - Gemfile.lock
195
+ - HISTORY.markdown
105
196
  - LICENSE
106
- - README.rdoc
197
+ - README.markdown
107
198
  - Rakefile
199
+ - TODO.markdown
108
200
  - VERSION
109
201
  - bin/revenc
110
202
  - config/cucumber.yml
@@ -134,46 +226,53 @@ files:
134
226
  - lib/revenc/encfs_wrapper.rb
135
227
  - lib/revenc/errors.rb
136
228
  - lib/revenc/io.rb
137
- - lib/revenc/lockfile.rb
229
+ - revenc.gemspec
230
+ - spec/basic_gem/basic_gem_spec.rb
138
231
  - spec/revenc/error_spec.rb
139
232
  - spec/revenc/io_spec.rb
140
- - spec/revenc/lockfile_spec.rb
141
233
  - spec/spec.opts
142
234
  - spec/spec_helper.rb
143
235
  - spec/watchr.rb
144
- has_rdoc: true
145
- homepage: http://github.com/robertwahler/revenc
236
+ has_rdoc: yard
237
+ homepage: http://rubygems.org/gems/revenc
146
238
  licenses: []
147
239
 
148
240
  post_install_message:
149
241
  rdoc_options:
150
- - --charset=UTF-8
242
+ - --title
243
+ - Revenc Documentation
244
+ - --main
245
+ - README.markdown
246
+ - --line-numbers
247
+ - --inline-source
151
248
  require_paths:
152
249
  - lib
153
250
  required_ruby_version: !ruby/object:Gem::Requirement
251
+ none: false
154
252
  requirements:
155
253
  - - ">="
156
254
  - !ruby/object:Gem::Version
255
+ hash: 3
157
256
  segments:
158
257
  - 0
159
258
  version: "0"
160
259
  required_rubygems_version: !ruby/object:Gem::Requirement
260
+ none: false
161
261
  requirements:
162
262
  - - ">="
163
263
  - !ruby/object:Gem::Version
264
+ hash: 23
164
265
  segments:
165
- - 0
166
- version: "0"
266
+ - 1
267
+ - 3
268
+ - 6
269
+ version: 1.3.6
167
270
  requirements: []
168
271
 
169
- rubyforge_project:
170
- rubygems_version: 1.3.6
272
+ rubyforge_project: revenc
273
+ rubygems_version: 1.3.7
171
274
  signing_key:
172
275
  specification_version: 3
173
- summary: Helper for reverse mounting encrypted file systems
174
- test_files:
175
- - spec/spec_helper.rb
176
- - spec/watchr.rb
177
- - spec/revenc/lockfile_spec.rb
178
- - spec/revenc/io_spec.rb
179
- - spec/revenc/error_spec.rb
276
+ summary: Wrapper for EncFS reverse mounting and folder syncing
277
+ test_files: []
278
+
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE