revenc 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,30 +1,10 @@
1
- ## mac os
2
- .DS_Store
3
-
4
- ## textmate
5
- *.tmproj
6
- tmtags
7
-
8
- ## emacs
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## vim
14
- *.swp
15
-
16
- ## project::general
1
+ pkg/*
2
+ *.gem
3
+ .bundle
17
4
  coverage
18
5
  rdoc
19
- pkg
20
- *.gemspec
21
-
22
- ## cucumber
6
+ .yardoc
23
7
  rerun.txt
24
-
25
- ## ctags
26
8
  tags
27
-
28
- ## project::specific
29
9
  tmp/fixtures
30
10
  tmp/aruba
data/.yardopts ADDED
@@ -0,0 +1,6 @@
1
+ --verbose
2
+ --list-undoc
3
+ -
4
+ LICENSE
5
+ HISTORY.markdown
6
+ VERSION
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in the .gemspec file
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,54 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ revenc (0.1.3)
5
+ configatron (>= 2.5.1)
6
+ mutagem (>= 0.1.3)
7
+ term-ansicolor (>= 1.0.4)
8
+
9
+ GEM
10
+ remote: http://rubygems.org/
11
+ specs:
12
+ aruba (0.2.3)
13
+ background_process
14
+ cucumber (~> 0.9.0)
15
+ background_process (1.2)
16
+ builder (2.1.2)
17
+ configatron (2.6.3)
18
+ yamler (>= 0.1.0)
19
+ cucumber (0.9.0)
20
+ builder (~> 2.1.2)
21
+ diff-lcs (~> 1.1.2)
22
+ gherkin (~> 2.2.2)
23
+ json (~> 1.4.6)
24
+ term-ansicolor (~> 1.0.5)
25
+ diff-lcs (1.1.2)
26
+ gherkin (2.2.4)
27
+ json (~> 1.4.6)
28
+ term-ansicolor (~> 1.0.5)
29
+ trollop (~> 1.16.2)
30
+ json (1.4.6)
31
+ mutagem (0.1.3)
32
+ rake (0.8.7)
33
+ rdiscount (1.6.5)
34
+ rspec (1.3.0)
35
+ term-ansicolor (1.0.5)
36
+ trollop (1.16.2)
37
+ yamler (0.1.0)
38
+ yard (0.6.1)
39
+
40
+ PLATFORMS
41
+ ruby
42
+
43
+ DEPENDENCIES
44
+ aruba (>= 0.2.0)
45
+ bundler (>= 1.0.0)
46
+ configatron (>= 2.5.1)
47
+ cucumber (>= 0.6)
48
+ mutagem (>= 0.1.3)
49
+ rake (>= 0.8.7)
50
+ rdiscount (>= 1.6.5)
51
+ revenc!
52
+ rspec (>= 1.2.9)
53
+ term-ansicolor (>= 1.0.4)
54
+ yard (>= 0.6.1)
data/HISTORY.markdown ADDED
@@ -0,0 +1,16 @@
1
+ History
2
+ =======
3
+ Most recent changes are at the top
4
+
5
+
6
+ Changes
7
+ -------
8
+
9
+ ### 0.1.3 - 10/05/2010 ###
10
+
11
+ * Using [mutagem](http://github.com/robertwahler/mutagem) for file locking based mutexes
12
+
13
+
14
+ ### 0.1.2 - 03/12/2010 ###
15
+
16
+ * Initial release
@@ -1,22 +1,26 @@
1
- = Revenc
1
+ Revenc
2
+ ======
2
3
 
3
4
  Mount an unencrypted folder as encrypted using EncFS and copy/synchronize the
4
5
  encrypted files to untrusted destinations using rsync/cp
5
6
 
6
- == Background
7
+ Background
8
+ ----------
7
9
 
8
10
  EncFS in reverse mode facilitates mounting an encrypted file system
9
11
  from an unencrypted source folder. This allows keeping your files unencrypted
10
12
  in a trusted environment while gaining the ability to encrypt on demand
11
13
  i.e. when you want to rsync encrypted files off-site to an untrusted system.
12
14
 
13
- == Why Revenc?
15
+ Why Revenc?
16
+ -----------
14
17
 
15
18
  Revenc facilitates scripting EncFS reverse mounting and synchronizing by
16
19
  providing a configuration framework and validating mounts before running tools
17
20
  like rsync.
18
21
 
19
- === Benefits
22
+ Benefits
23
+ --------
20
24
 
21
25
  * Provides conventions for EncFS reverse mounting
22
26
  * Validates mountpoints before copying to prevent "rsync --delete" commands
@@ -27,17 +31,20 @@ like rsync.
27
31
  * Allow short, easy to remember command lines when used with configuration files.
28
32
  i.e. revenc mount, revenc unmount, revenc copy
29
33
 
30
- == Installation
34
+ Installation
35
+ ------------
31
36
 
32
- sudo gem install revenc
37
+ gem install revenc
33
38
 
34
- == Usage
39
+
40
+ Usage
41
+ -----
35
42
 
36
43
  revenc action [options]
37
44
 
38
- === Actions
45
+ ### Actions ###
39
46
 
40
- ==== Mount
47
+ #### Mount ####
41
48
 
42
49
  Reverse mount using EncFS. Source and mountpoint are not required when
43
50
  using a configuration file.
@@ -50,7 +57,7 @@ This calls the executable "encfs" with the following by default:
50
57
  <%= executable %> --stdinpass --reverse <%= source.name %> \
51
58
  <%= mountpoint.name %> -- -o ro
52
59
 
53
- ==== Unmount
60
+ #### Unmount ####
54
61
 
55
62
  Unmount using EncFS. Mountpoint is required when specified by revenc.conf.
56
63
 
@@ -60,7 +67,7 @@ This calls the executable "fusermount" with the following by default:
60
67
 
61
68
  <%= executable %> -u <%= mountpoint.name %>
62
69
 
63
- ==== Copy
70
+ #### Copy ####
64
71
 
65
72
  Recursive copy with "cp -r", for rsync copy, see examples. Source and destination
66
73
  are not required when specified by revenc.conf.
@@ -71,7 +78,7 @@ This calls the executable "cp" with the following by default:
71
78
 
72
79
  <%= executable %> -r <%= source.name %> <%= destination.name %>
73
80
 
74
- === Setup
81
+ ### Setup ###
75
82
 
76
83
  The following is a walk through of the steps used to create the example project
77
84
  "simple" in the examples folder.
@@ -85,7 +92,7 @@ The following is a walk through of the steps used to create the example project
85
92
  echo "some stuff" > unencrypted_data/test_file1.txt
86
93
  echo "some more stuff" > unencrypted_data/test_file2.txt
87
94
 
88
- === Create the EncFS passphrase file
95
+ ### Create the EncFS passphrase file ###
89
96
 
90
97
  You must supply EncFS with a passphrase in plain text. The passphrase is piped in on the command line
91
98
  to EncFS. This file can be stored anywhere on your trusted system. Revenc expects it in the
@@ -94,7 +101,7 @@ current folder, use revenc.conf to supply a different location.
94
101
  echo "my_super_secret_PassPHRase" > passphrase
95
102
  chmod 600 passphrase
96
103
 
97
- === Generate the EncFS key file
104
+ ### Generate the EncFS key file ###
98
105
 
99
106
  Generation of your key file is done once. The same key is used for each mount action on the same
100
107
  unencrypted source folder. You need to keep a copy of your key available in order to restore encrypted files.
@@ -145,7 +152,7 @@ now work with your encrypted files.
145
152
  test_file1.txt test_file2.txt
146
153
 
147
154
 
148
- === Configuration files
155
+ ### Configuration files ###
149
156
 
150
157
  Revenc expects a passphrase file and the key file "encfs6.xml" to exist in the
151
158
  current folder. You can override these locations using the revenc.conf file. Revenc
@@ -166,33 +173,32 @@ See the example configuration file examples/rsync/revenc.conf.
166
173
  The file features/configuration.feature has more details.
167
174
 
168
175
 
169
- == System Requirements
176
+ System Requirements
177
+ -------------------
170
178
 
171
179
  * POSIX system
172
180
  * EncFS http://www.arg0.net/encfs
173
181
 
174
- == Runtime Dependencies
175
182
 
176
- * term-ansicolor
177
- * configatron
183
+ Run-time dependencies
184
+ ---------------------
185
+ The following gems are required by default in applications cloned from BasicApp.
186
+
187
+ * Term-ansicolor for optional color output <http://github.com/flori/term-ansicolor>
188
+ * Configatron for configuration support <http://github.com/markbates/configatron>
189
+
178
190
 
179
- == Development Dependencies
191
+ Development dependencies
192
+ ------------------------
180
193
 
181
- * rspec for unit testing http://github.com/dchelimsky/rspec
182
- * cucumber for functional testing http://github.com/tpope/vim-cucumber
183
- * aruba for CLI testing http://github.com/aslakhellesoy/aruba
194
+ * Bundler for dependency management <http://github.com/carlhuda/bundler>
195
+ * Rspec for unit testing <http://github.com/dchelimsky/rspec>
196
+ * Cucumber for functional testing <http://github.com/aslakhellesoy/cucumber>
197
+ * Aruba for CLI testing <http://github.com/aslakhellesoy/aruba>
198
+ * YARD for documentation generation <http://github.com/lsegal/yard>
184
199
 
185
- == Note on Patches/Pull Requests
186
-
187
- * Fork the project.
188
- * Make your feature addition or bug fix.
189
- * Add tests for it. This is important so I don't break it in a
190
- future version unintentionally.
191
- * Commit, do not mess with rakefile, version, or history.
192
- (if you want to have your own version, that is fine but bump version
193
- in a commit by itself I can ignore when I pull)
194
- * Send me a pull request. Bonus points for topic branches.
195
200
 
196
- == Copyright
201
+ Copyright
202
+ ---------
197
203
 
198
- Copyright (c) 2010 GearheadForHire, LLC. See LICENSE for details.
204
+ Copyright (c) 2010 GearheadForHire, LLC. See [LICENSE](LICENSE) for details.
data/Rakefile CHANGED
@@ -1,64 +1,55 @@
1
- require 'rubygems'
2
- require 'rake'
1
+ # encoding: utf-8
3
2
 
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "revenc"
8
- gem.summary = %Q{Helper for reverse mounting encrypted file systems}
9
- gem.description = %Q{Mount, unmount, and copy/synchronize encrypted files to
10
- untrusted destinations using EncFS and rsync}
11
- gem.email = "robert@gearheadforhire.com"
12
- gem.homepage = "http://github.com/robertwahler/revenc"
13
- gem.authors = ["Robert Wahler"]
3
+ # bundler/setup is managing $LOAD_PATH, any gem needed by this Rakefile must
4
+ # be listed as a development dependency in the gemspec
14
5
 
15
- gem.add_dependency 'term-ansicolor', '>= 1.0.4'
16
- gem.add_dependency 'configatron', '>= 2.5.1'
6
+ require 'rubygems'
7
+ require 'bundler/setup'
17
8
 
18
- gem.add_development_dependency "rspec", ">= 1.2.9"
19
- gem.add_development_dependency "cucumber", ">= 0.6"
20
- gem.add_development_dependency "aruba", ">= 0.1.7"
9
+ Bundler::GemHelper.install_tasks
21
10
 
22
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
11
+ def gemspec
12
+ @gemspec ||= begin
13
+ file = File.expand_path('../revenc.gemspec', __FILE__)
14
+ eval(File.read(file), binding, file)
23
15
  end
24
- Jeweler::GemcutterTasks.new
25
- rescue LoadError
26
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
27
16
  end
28
17
 
18
+ require 'spec'
29
19
  require 'spec/rake/spectask'
30
20
  Spec::Rake::SpecTask.new(:spec) do |spec|
31
21
  spec.libs << 'lib' << 'spec'
32
22
  spec.spec_files = FileList['spec/**/*_spec.rb']
33
23
  end
34
24
 
35
- Spec::Rake::SpecTask.new(:rcov) do |spec|
36
- spec.libs << 'lib' << 'spec'
37
- spec.pattern = 'spec/**/*_spec.rb'
38
- spec.rcov = true
25
+ require 'cucumber'
26
+ require 'cucumber/rake/task'
27
+ Cucumber::Rake::Task.new(:features) do |task|
28
+ task.cucumber_opts = ["features"]
39
29
  end
40
30
 
41
- task :spec => :check_dependencies
31
+ desc "Run specs and features"
32
+ task :test => [:spec, :features]
42
33
 
43
- begin
44
- require 'cucumber/rake/task'
45
- Cucumber::Rake::Task.new(:features)
34
+ task :default => :test
46
35
 
47
- task :features => :check_dependencies
48
- rescue LoadError
49
- task :features do
50
- abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
51
- end
52
- end
36
+ namespace :doc do
37
+ project_root = File.expand_path(File.dirname(__FILE__))
38
+ doc_destination = File.join(project_root, 'rdoc')
39
+
40
+ require 'yard'
41
+ require 'yard/rake/yardoc_task'
53
42
 
54
- task :default => :spec
43
+ YARD::Rake::YardocTask.new(:generate) do |yt|
44
+ yt.options = ['--markup-provider', 'rdiscount',
45
+ '--output-dir', doc_destination
46
+ ] +
47
+ gemspec.rdoc_options - ['--line-numbers', '--inline-source']
48
+ end
55
49
 
56
- require 'rake/rdoctask'
57
- Rake::RDocTask.new do |rdoc|
58
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
50
+ desc "Remove generated documenation"
51
+ task :clean do
52
+ rm_r doc_destination if File.exists?(doc_destination)
53
+ end
59
54
 
60
- rdoc.rdoc_dir = 'rdoc'
61
- rdoc.title = "Revenc #{version}"
62
- rdoc.rdoc_files.include('README*')
63
- rdoc.rdoc_files.include('lib/**/*.rb')
64
55
  end
data/TODO.markdown ADDED
@@ -0,0 +1,3 @@
1
+ TODO
2
+ ====
3
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
data/bin/revenc CHANGED
@@ -9,7 +9,7 @@ require 'term/ansicolor'
9
9
  available_actions = Revenc::AVAILABLE_ACTIONS
10
10
 
11
11
  banner = <<BANNER
12
- Revenc is an encfs helper
12
+ Revenc is an EncFS helper
13
13
 
14
14
  Usage: revenc action [options]
15
15
  BANNER
data/config/cucumber.yml CHANGED
@@ -3,5 +3,5 @@ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
3
  rerun_opts = rerun.to_s.strip.empty? ? "--format pretty features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
4
  std_opts = "#{rerun_opts} --format rerun --out rerun.txt --strict --tags ~@wip"
5
5
  %>
6
- default: <%= std_opts %> --no-diff
6
+ default: <%= std_opts %>
7
7
  wip: --tags @wip:3 --wip features
data/features/app.feature CHANGED
@@ -7,7 +7,7 @@ Feature: Application actions, configuration and error handling
7
7
  Scenario: No command line action
8
8
  When I run "revenc"
9
9
  Then the exit status should be 1
10
- And I should see matching:
10
+ And the output should match:
11
11
  """
12
12
  ^.* action required
13
13
  ^.* --help for more information
@@ -16,7 +16,7 @@ Feature: Application actions, configuration and error handling
16
16
  Scenario: Invalid action
17
17
  When I run "revenc non-existing-action"
18
18
  Then the exit status should be 1
19
- And I should see matching:
19
+ And the output should match:
20
20
  """
21
21
  ^.* invalid action: non-existing-action
22
22
  ^.* --help for more information
@@ -26,18 +26,18 @@ Feature: Application actions, configuration and error handling
26
26
  Scenario: --config FILE (exists)
27
27
  Given an empty file named "config.conf"
28
28
  When I run "revenc mount --verbose --config config.conf"
29
- Then I should see:
29
+ Then the output should contain:
30
30
  """
31
31
  loading config file: config.conf
32
32
  """
33
33
 
34
34
  Scenario: --config FILE (not found)
35
35
  When I run "revenc mount --verbose --config config.conf"
36
- Then I should not see:
36
+ Then the output should not contain:
37
37
  """
38
38
  loading config file: config.conf
39
39
  """
40
- And I should see:
40
+ And the output should contain:
41
41
  """
42
42
  config file not found
43
43
  """
@@ -45,7 +45,7 @@ Feature: Application actions, configuration and error handling
45
45
  Scenario: Backtrace with --verbose option
46
46
  When I run "revenc --verbose mount bad_source bad_dest"
47
47
  Then the exit status should be 1
48
- And I should see matching:
48
+ And the output should match:
49
49
  """
50
50
  lib/(.*)/app.rb
51
51
  """
@@ -53,7 +53,7 @@ Feature: Application actions, configuration and error handling
53
53
  Scenario: No backtrace without --verbose option
54
54
  When I run "revenc mount bad_source bad_dest --no-verbose"
55
55
  Then the exit status should be 1
56
- And I should not see:
56
+ And the output should not contain:
57
57
  """
58
58
  /app.rb:
59
59
  """
data/features/bin.feature CHANGED
@@ -9,12 +9,12 @@ Feature: Options via a command line interface (CLI)
9
9
  Scenario: Version info
10
10
  When I run "revenc --version"
11
11
  Then the exit status should be 0
12
- And I should see matching "revenc, version ([\d]+\.[\d]+\.[\d]+$)"
12
+ And the output should match /revenc, version ([\d]+\.[\d]+\.[\d]+$)/
13
13
 
14
14
  Scenario: Help
15
15
  When I run "revenc --help"
16
16
  Then the exit status should be 0
17
- And I should see matching:
17
+ And the output should match:
18
18
  """
19
19
  .*
20
20
  Usage: .*
@@ -27,7 +27,7 @@ Feature: Options via a command line interface (CLI)
27
27
  Scenario: Invalid option
28
28
  When I run "revenc --non-existing-option"
29
29
  Then the exit status should be 1
30
- And I should see matching:
30
+ And the output should match:
31
31
  """
32
32
  ^.* invalid option: --non-existing-option
33
33
  ^.* --help for more information
@@ -36,7 +36,7 @@ Feature: Configuration via yaml file
36
36
 
37
37
  Scenario: Mount with a config file
38
38
  When I run "revenc --verbose --dry-run mount"
39
- Then I should see:
39
+ Then the output should contain:
40
40
  """
41
41
  mount: source=source_folder_name
42
42
  mount: mountpoint=destination_folder_name
@@ -48,7 +48,7 @@ Feature: Configuration via yaml file
48
48
 
49
49
  Scenario: Unmount with a config file
50
50
  When I run "revenc unmount --verbose --dry-run"
51
- Then I should see:
51
+ Then the output should contain:
52
52
  """
53
53
  unmount: mountpoint=defaults_to_mount_mountpoint
54
54
  unmount: cmd=/bin/echo -u defaults_to_mount_mountpoint
@@ -63,14 +63,14 @@ Feature: Configuration via yaml file
63
63
  name: unmount_mountpoint_defaults_to_me
64
64
  """
65
65
  When I run "revenc unmount --verbose --dry-run"
66
- Then I should see:
66
+ Then the output should contain:
67
67
  """
68
68
  unmount: mountpoint=unmount_mountpoint_defaults_to_me
69
69
  """
70
70
 
71
71
  Scenario: Copy with a config file
72
72
  When I run "revenc copy --verbose --dry-run"
73
- Then I should see:
73
+ Then the output should contain:
74
74
  """
75
75
  copy: source=copy_source_defaults_to_mount_mountpoint
76
76
  copy: destination=copy_to_destination
@@ -89,7 +89,7 @@ Feature: Configuration via yaml file
89
89
  name: copy_to_destination
90
90
  """
91
91
  When I run "revenc copy --verbose --dry-run"
92
- Then I should see:
92
+ Then the output should contain:
93
93
  """
94
94
  copy: source=copy_source_defaults_to_me
95
95
  copy: destination=copy_to_destination
@@ -52,7 +52,7 @@ Feature: Copy encrypted data to another location via rsync
52
52
  """
53
53
  When I run with a lock file present "revenc copy encrypted_source_folder encrypted_destination"
54
54
  Then the exit status should be 1
55
- And I should see:
55
+ And the output should contain:
56
56
  """
57
57
  action failed, lock file present
58
58
  """
@@ -60,7 +60,7 @@ Feature: Copy encrypted data to another location via rsync
60
60
  Scenario: Source folder not specified
61
61
  When I run "revenc copy"
62
62
  Then the exit status should be 1
63
- And I should see:
63
+ And the output should contain:
64
64
  """
65
65
  source folder not specified
66
66
  """
@@ -68,7 +68,7 @@ Feature: Copy encrypted data to another location via rsync
68
68
  Scenario: Destination not specified
69
69
  When I run "revenc copy encrypted_source_folder"
70
70
  Then the exit status should be 1
71
- And I should see:
71
+ And the output should contain:
72
72
  """
73
73
  destination not specified
74
74
  """
@@ -76,7 +76,7 @@ Feature: Copy encrypted data to another location via rsync
76
76
  Scenario: Source folder doesn't exist
77
77
  When I run "revenc copy encrypted_source_folder encrypted_destination"
78
78
  Then the exit status should be 1
79
- And I should see:
79
+ And the output should contain:
80
80
  """
81
81
  source folder not found
82
82
  """
@@ -85,7 +85,7 @@ Feature: Copy encrypted data to another location via rsync
85
85
  Given a directory named "encrypted_source_folder"
86
86
  When I run "revenc copy encrypted_source_folder encrypted_destination"
87
87
  Then the exit status should be 1
88
- And I should see:
88
+ And the output should contain:
89
89
  """
90
90
  source folder is empty
91
91
  """
@@ -107,7 +107,7 @@ Feature: Copy encrypted data to another location via rsync
107
107
  name: copy_to_destination
108
108
  """
109
109
  When I run "revenc copy --verbose --dry-run"
110
- Then I should see:
110
+ Then the output should contain:
111
111
  """
112
112
  mountpoint is empty
113
113
  """
@@ -128,7 +128,7 @@ Feature: Copy encrypted data to another location via rsync
128
128
  name: copy_to_destination
129
129
  """
130
130
  When I run "revenc copy --verbose --dry-run"
131
- Then I should see:
131
+ Then the output should contain:
132
132
  """
133
133
  mountpoint not found
134
134
  """
@@ -146,11 +146,11 @@ Feature: Copy encrypted data to another location via rsync
146
146
  name: copy_to_destination
147
147
  """
148
148
  When I run "revenc copy --verbose --dry-run"
149
- Then I should not see:
149
+ Then the output should not contain:
150
150
  """
151
151
  mountpoint not found
152
152
  """
153
- And I should not see:
153
+ And the output should not contain:
154
154
  """
155
155
  mountpoint is empty
156
156
  """
@@ -163,7 +163,7 @@ Feature: Copy encrypted data to another location via rsync
163
163
  """
164
164
  When I run "revenc copy encrypted_source_folder encrypted_destination"
165
165
  Then the exit status should be 1
166
- And I should see:
166
+ And the output should contain:
167
167
  """
168
168
  executable not found
169
169
  """