oode 0.2.3 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
1
  require 'rake/testtask'
2
- require 'metric_fu'
2
+ # require 'metric_fu'
3
3
 
4
- MetricFu::Configuration.run do |config|
5
- config.metrics = [:churn, :flog, :roodi, :flay, :reek]
6
- config.graphs = [:flog, :flay, :reek]
7
- end
4
+ # MetricFu::Configuration.run do |config|
5
+ # config.metrics = [:churn, :flog, :roodi, :flay, :reek]
6
+ # config.graphs = [:flog, :flay, :reek]
7
+ # end
8
8
 
9
9
  task :default => [:test]
10
10
 
data/bin/oode CHANGED
@@ -113,4 +113,29 @@ pre do |global_options,command,options,args|
113
113
  true
114
114
  end
115
115
 
116
+ PW_WARNING = <<WARNING
117
+ Woah there! Looks like you're saving your password in a plain text config file.
118
+
119
+ I'd advise against this! If someone gets access to your computer then they
120
+ will, with no effort whatsoever, be able to read your password and use it. Some
121
+ people are so inclined (@oliland) that they may in fact use your password to
122
+ look up some mule pornography.
123
+
124
+ You don't want this. I don't want this.
125
+
126
+ If you know the risks then ignore this message and carry on. If you have
127
+ changed your mind then run the command you just ran again but take out the
128
+ password flag.
129
+ WARNING
130
+
131
+ post do |global_options,command,options,args|
132
+ case command.name
133
+ when :initconfig
134
+ config = File.expand_path("~/.ooderc")
135
+ if File.exists?(config)
136
+ puts PW_WARNING.redish if File.open(config, 'r').read.match /:password: \w/
137
+ end
138
+ end
139
+ end
140
+
116
141
  GLI.run(ARGV)
@@ -38,7 +38,8 @@ module Oode
38
38
 
39
39
  def exec!(command, options = {})
40
40
  host = options[:machine] || @machine
41
- @session.exec!("ssh #{host} #{command}").chomp
41
+ out = @session.exec!("ssh #{host} #{command}")
42
+ out.chomp unless out.nil?
42
43
  end
43
44
  end
44
45
  end
data/lib/oode/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Oode
2
- Version = VERSION = '0.2.3'
2
+ Version = VERSION = '0.2.5'
3
3
  end
data/man/oode.1 CHANGED
@@ -23,14 +23,19 @@ Print the file \fIfile\.pdf\fR to the printer \fIat3\fR\.
23
23
  Print \fI3\fR copies of the file \fIfile\.pdf\fR to the printer \fIat3\fR in the \fItwo\-up\fR page layout\.
24
24
  .
25
25
  .SH "CONFIGURATION"
26
- \fBoode\fR can read SSH authentication usernames and passwords from a configuration file so you don\'t have to type them in every time\.
26
+ \fBoode\fR can read SSH authentication usernames and passwords from a configuration file so you don\'t have to type them in every time\. Beware though, this will store your password in plain text inside \fB~/\.ooderc\fR\.
27
27
  .
28
28
  .P
29
29
  The following command will create the file \fB~/\.ooderc\fR that contains global options so that you don\'t have to type them each time\.
30
30
  .
31
- .P
31
+ .TP
32
+ Store both username and password in the configuration file
32
33
  \fBoode \-u s0xxxxxx \-p passw0rd initconfig\fR
33
34
  .
35
+ .TP
36
+ Just store the username in the confiuration file
37
+ \fBoode \-u s0xxxxxx initconfig\fR
38
+ .
34
39
  .P
35
40
  Either of these can be omitted if you would rather enter them yourself each time or you can specify them at the command line like above for individual commands\.
36
41
  .
data/man/oode.1.html CHANGED
@@ -109,13 +109,18 @@ in the near future.</p>
109
109
 
110
110
  <h2 id="CONFIGURATION">CONFIGURATION</h2>
111
111
 
112
- <p><code>oode</code> can read SSH authentication usernames and passwords from a
113
- configuration file so you don't have to type them in every time.</p>
112
+ <p><code>oode</code> can read SSH authentication usernames and passwords from a configuration
113
+ file so you don't have to type them in every time. Beware though, this will
114
+ store your password in plain text inside <code>~/.ooderc</code>.</p>
114
115
 
115
116
  <p>The following command will create the file <code>~/.ooderc</code> that contains
116
117
  global options so that you don't have to type them each time.</p>
117
118
 
118
- <p> <code>oode -u s0xxxxxx -p passw0rd initconfig</code></p>
119
+ <dl>
120
+ <dt>Store both username and password in the configuration file</dt><dd><p><code>oode -u s0xxxxxx -p passw0rd initconfig</code></p></dd>
121
+ <dt>Just store the username in the confiuration file</dt><dd><p><code>oode -u s0xxxxxx initconfig</code></p></dd>
122
+ </dl>
123
+
119
124
 
120
125
  <p>Either of these can be omitted if you would rather enter them yourself
121
126
  each time or you can specify them at the command line like above for
data/man/oode.1.ronn CHANGED
@@ -23,14 +23,19 @@ in the near future.
23
23
 
24
24
  ## CONFIGURATION
25
25
 
26
- `oode` can read SSH authentication usernames and passwords from a
27
- configuration file so you don't have to type them in every time.
26
+ `oode` can read SSH authentication usernames and passwords from a configuration
27
+ file so you don't have to type them in every time. Beware though, this will
28
+ store your password in plain text inside `~/.ooderc`.
28
29
 
29
30
  The following command will create the file `~/.ooderc` that contains
30
31
  global options so that you don't have to type them each time.
31
32
 
33
+ * Store both username and password in the configuration file:
32
34
  `oode -u s0xxxxxx -p passw0rd initconfig`
33
35
 
36
+ * Just store the username in the confiuration file:
37
+ `oode -u s0xxxxxx initconfig`
38
+
34
39
  Either of these can be omitted if you would rather enter them yourself
35
40
  each time or you can specify them at the command line like above for
36
41
  individual commands.
@@ -11,7 +11,7 @@ class OodeDownloaderTest < Test::Unit::TestCase
11
11
  @downloader.download!("/home/#{config 'u'}/.bashrc")
12
12
 
13
13
  expected = @downloader.exec!("sha1sum ~/.bashrc",
14
- :machine => 'raycroft').split.first
14
+ :machine => 'charlotte').split.first
15
15
  actual = `shasum ./.bashrc`.split.first
16
16
  assert_equal expected, actual
17
17
 
@@ -13,9 +13,9 @@ class OodeSessionTest < Test::Unit::TestCase
13
13
  assert_equal expected, actual
14
14
  end
15
15
 
16
- def test_exec_machine_raycroft
17
- expected = 'raycroft.inf.ed.ac.uk'
18
- actual = @session.exec!("hostname", :machine => 'raycroft')
16
+ def test_exec_machine_charlotte
17
+ expected = 'charlotte.inf.ed.ac.uk'
18
+ actual = @session.exec!("hostname", :machine => 'charlotte')
19
19
  assert_equal expected, actual
20
20
  end
21
21
  end
@@ -15,7 +15,7 @@ class OodeUploaderTest < Test::Unit::TestCase
15
15
 
16
16
  expected = `shasum #{__FILE__}`.split.first
17
17
  actual = @uploader.exec!("sha1sum ~/.oode/#{@file.basename}",
18
- :machine => 'raycroft').split.first
18
+ :machine => 'charlotte').split.first
19
19
  assert_equal expected, actual
20
20
 
21
21
  @uploader.clean!
metadata CHANGED
@@ -1,70 +1,68 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: oode
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.5
4
5
  prerelease:
5
- version: 0.2.3
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Chris Brown
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-04-24 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-25 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: net-ssh
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70131662042260 !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
24
22
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: net-sftp
28
23
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70131662042260
25
+ - !ruby/object:Gem::Dependency
26
+ name: net-sftp
27
+ requirement: &70131662041640 !ruby/object:Gem::Requirement
30
28
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
35
33
  type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: highline
39
34
  prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70131662041640
36
+ - !ruby/object:Gem::Dependency
37
+ name: highline
38
+ requirement: &70131662041020 !ruby/object:Gem::Requirement
41
39
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
46
44
  type: :runtime
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
49
- name: gli
50
45
  prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70131662041020
47
+ - !ruby/object:Gem::Dependency
48
+ name: gli
49
+ requirement: &70131662040320 !ruby/object:Gem::Requirement
52
50
  none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
57
55
  type: :runtime
58
- version_requirements: *id004
59
- description: " `oode` makes working in Appleton Tower much easier from laptops\n by automating some of the tediousness from the sequence of tasks\n required.\n"
56
+ prerelease: false
57
+ version_requirements: *70131662040320
58
+ description: ! " `oode` makes working in Appleton Tower much easier from laptops\n
59
+ \ by automating some of the tediousness from the sequence of tasks\n required.\n"
60
60
  email: cb@tardis.ed.ac.uk
61
- executables:
61
+ executables:
62
62
  - oode
63
63
  extensions: []
64
-
65
64
  extra_rdoc_files: []
66
-
67
- files:
65
+ files:
68
66
  - README.md
69
67
  - Rakefile
70
68
  - LICENSE
@@ -94,30 +92,26 @@ files:
94
92
  - test/print/oodeprinter_test.rb
95
93
  homepage: http://github.com/xoebus/oode
96
94
  licenses: []
97
-
98
95
  post_install_message:
99
96
  rdoc_options: []
100
-
101
- require_paths:
97
+ require_paths:
102
98
  - lib
103
- required_ruby_version: !ruby/object:Gem::Requirement
99
+ required_ruby_version: !ruby/object:Gem::Requirement
104
100
  none: false
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: "0"
109
- required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ! '>='
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
110
106
  none: false
111
- requirements:
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: "0"
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
115
111
  requirements: []
116
-
117
112
  rubyforge_project:
118
- rubygems_version: 1.7.2
113
+ rubygems_version: 1.8.10
119
114
  signing_key:
120
115
  specification_version: 3
121
116
  summary: oode makes working with a laptop in AT less soul-crushing
122
117
  test_files: []
123
-