safe_shell 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -16,7 +16,9 @@ tmtags
16
16
  ## PROJECT::GENERAL
17
17
  coverage
18
18
  rdoc
19
- pkg
19
+ pkg/*
20
+ *.gem
21
+ .bundle
20
22
 
21
23
  ## PROJECT::SPECIFIC
22
24
  tmp/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in safe_shell.gemspec
4
+ gemspec
@@ -0,0 +1,24 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ safe_shell (1.0.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.1.2)
10
+ rspec (2.5.0)
11
+ rspec-core (~> 2.5.0)
12
+ rspec-expectations (~> 2.5.0)
13
+ rspec-mocks (~> 2.5.0)
14
+ rspec-core (2.5.1)
15
+ rspec-expectations (2.5.0)
16
+ diff-lcs (~> 1.1.2)
17
+ rspec-mocks (2.5.0)
18
+
19
+ PLATFORMS
20
+ ruby
21
+
22
+ DEPENDENCIES
23
+ rspec
24
+ safe_shell!
data/Rakefile CHANGED
@@ -1,39 +1,13 @@
1
- require 'rubygems'
2
- require 'rake'
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
3
 
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "safe_shell"
8
- gem.summary = %Q{Safely execute shell commands and get their output.}
9
- gem.description = %Q{Execute shell commands and get the resulting output, but without the security problems of Ruby’s backtick operator.}
10
- gem.email = "pete@notahat.com"
11
- gem.homepage = "http://github.com/envato/safe_shell"
12
- gem.authors = ["Envato", "Ian Leitch", "Pete Yandell"]
13
- gem.add_development_dependency "rspec", ">= 1.2.9"
14
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
- end
16
- Jeweler::GemcutterTasks.new
17
- rescue LoadError
18
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
19
- end
20
-
21
- require 'spec/rake/spectask'
22
- Spec::Rake::SpecTask.new(:spec) do |spec|
23
- spec.libs << 'lib' << 'spec'
24
- spec.spec_files = FileList['spec/**/*_spec.rb']
25
- end
4
+ require 'rspec/core/rake_task'
26
5
 
27
- Spec::Rake::SpecTask.new(:rcov) do |spec|
28
- spec.libs << 'lib' << 'spec'
29
- spec.pattern = 'spec/**/*_spec.rb'
30
- spec.rcov = true
31
- end
32
-
33
- task :spec => :check_dependencies
6
+ RSpec::Core::RakeTask.new(:spec)
34
7
 
35
8
  task :default => :spec
36
9
 
10
+
37
11
  require 'rake/rdoctask'
38
12
  Rake::RDocTask.new do |rdoc|
39
13
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
@@ -8,7 +8,7 @@ module SafeShell
8
8
  read_end.close
9
9
  STDOUT.reopen(new_stdout)
10
10
  STDERR.reopen(new_stderr)
11
- exec(command, *args)
11
+ exec(command, *(args.map { |a| a.to_s }))
12
12
  end
13
13
  write_end.close
14
14
  output = read_end.read
@@ -0,0 +1,3 @@
1
+ module SafeShell
2
+ VERSION = "1.0.1"
3
+ end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "safe_shell/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "safe_shell"
7
+ s.version = SafeShell::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Envato", "Ian Leitch", "Pete Yandell"]
10
+ s.email = ["pete@notahat.com"]
11
+ s.homepage = "http://github.com/envato/safe_shell"
12
+ s.summary = %q{Safely execute shell commands and get their output.}
13
+ s.description = %q{Execute shell commands and get the resulting output, but without the security problems of Ruby’s backtick operator.}
14
+
15
+ s.add_development_dependency "rspec"
16
+
17
+ s.rubyforge_project = "safe_shell"
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+ s.require_paths = ["lib"]
23
+ s.extra_rdoc_files = ["LICENSE", "README.rdoc"]
24
+ end
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ require 'safe_shell'
2
2
 
3
3
  describe "SafeShell" do
4
4
 
@@ -18,6 +18,10 @@ describe "SafeShell" do
18
18
  $?.exitstatus.should == 1
19
19
  end
20
20
 
21
+ it "should handle a Pathname object passed as an argument" do
22
+ expect { SafeShell.execute("ls", Pathname.new("/tmp")) }.should_not raise_error
23
+ end
24
+
21
25
  context "output redirection" do
22
26
  before do
23
27
  File.delete("tmp/output.txt") if File.exists?("tmp/output.txt")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safe_shell
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Envato
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-11-08 00:00:00 +11:00
20
+ date: 2011-02-07 00:00:00 +11:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -28,16 +28,15 @@ dependencies:
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
- hash: 13
31
+ hash: 3
32
32
  segments:
33
- - 1
34
- - 2
35
- - 9
36
- version: 1.2.9
33
+ - 0
34
+ version: "0"
37
35
  type: :development
38
36
  version_requirements: *id001
39
37
  description: "Execute shell commands and get the resulting output, but without the security problems of Ruby\xE2\x80\x99s backtick operator."
40
- email: pete@notahat.com
38
+ email:
39
+ - pete@notahat.com
41
40
  executables: []
42
41
 
43
42
  extensions: []
@@ -48,22 +47,24 @@ extra_rdoc_files:
48
47
  files:
49
48
  - .document
50
49
  - .gitignore
50
+ - Gemfile
51
+ - Gemfile.lock
51
52
  - LICENSE
52
53
  - README.rdoc
53
54
  - Rakefile
54
- - VERSION
55
55
  - lib/safe_shell.rb
56
+ - lib/safe_shell/version.rb
57
+ - safe_shell.gemspec
56
58
  - spec/safe_shell_spec.rb
57
59
  - spec/spec.opts
58
- - spec/spec_helper.rb
59
60
  - tmp/.gitkeep
60
61
  has_rdoc: true
61
62
  homepage: http://github.com/envato/safe_shell
62
63
  licenses: []
63
64
 
64
65
  post_install_message:
65
- rdoc_options:
66
- - --charset=UTF-8
66
+ rdoc_options: []
67
+
67
68
  require_paths:
68
69
  - lib
69
70
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -86,11 +87,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
87
  version: "0"
87
88
  requirements: []
88
89
 
89
- rubyforge_project:
90
+ rubyforge_project: safe_shell
90
91
  rubygems_version: 1.3.7
91
92
  signing_key:
92
93
  specification_version: 3
93
94
  summary: Safely execute shell commands and get their output.
94
95
  test_files:
95
96
  - spec/safe_shell_spec.rb
96
- - spec/spec_helper.rb
97
+ - spec/spec.opts
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.0.0
@@ -1,9 +0,0 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__))
2
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
- require 'safe_shell'
4
- require 'spec'
5
- require 'spec/autorun'
6
-
7
- Spec::Runner.configure do |config|
8
-
9
- end