mount 0.0.1 → 0.0.2

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: f8502f85f543fd0adfd7bcaed61e67f4d8a1fba4
4
- data.tar.gz: a872620aae889095d2c0d8873133fd1623a22084
3
+ metadata.gz: 7cdee59ab7d3253e00a36921a26341ee52b50b39
4
+ data.tar.gz: 04390e8cacbfb8b47def815b16742007e15acb14
5
5
  SHA512:
6
- metadata.gz: f0cb6cf6f7364fb1b54be9c101b4837273d11ff9fc2cf3795d8ea3f29a40bb775861a901cd1caea49a76ea724889e43c61ef27b0747c6420a716601b0e40dac4
7
- data.tar.gz: 7a20c0f3b703fc1a28429fffa18b2004b116bec669a84c85e3228a60b5a0b3e0cda2b12e7fa11c586da7cde1e6de5117de9cea3430315e26dfb402f6991b452d
6
+ metadata.gz: 017a8ec0192f4abb7080f6404aa97e505563eeae2aade6368d118471b5549eb14c64c68d2c1abc1b9559ff8186aea1c7ba95ebb2625fa30eb2b3f3c08b009e02
7
+ data.tar.gz: f22013b06d5a1a08331b8d10674ac2adca208fb4d3e2add840f41ab44db3a995a4ec48ee4b4233c83ed0abbaed20cb14e0f534ce6d09b9bb627f429e75c63a8d
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - ruby-head
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Mount
1
+ # Mount [![BuildStatus](https://travis-ci.org/serverspec/mount.png)](http://travis-ci.org/serverspec/mount)
2
2
 
3
3
  TODO: Write a gem description
4
4
 
data/Rakefile CHANGED
@@ -1 +1,11 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
+
3
+ require 'rspec/core'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec) do |spec|
7
+ spec.pattern = FileList['spec/**/*_spec.rb']
8
+ spec.ruby_opts = %w[-w]
9
+ end
10
+
11
+ task :default => :spec
@@ -1,5 +1,4 @@
1
- require "mount/version"
2
-
3
1
  module Mount
4
- # Your code goes here...
2
+ require 'mount/version'
3
+ require 'mount/command'
5
4
  end
@@ -0,0 +1,9 @@
1
+ module Mount
2
+ module Command
3
+ class NotImplementedError < Exception; end
4
+
5
+ require 'mount/command/base'
6
+ require 'mount/command/linux'
7
+ require 'mount/command/redhat'
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ require 'shellwords'
2
+
3
+ module Mount
4
+ module Command
5
+ class Base
6
+ def escape(target)
7
+ str = case target
8
+ when Regexp
9
+ target.source
10
+ else
11
+ target.to_s
12
+ end
13
+
14
+ Shellwords.shellescape(str)
15
+ end
16
+
17
+ def install(package, version=nil)
18
+ raise NotImplementedError.new
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,6 @@
1
+ module Mount
2
+ module Command
3
+ class Linux < Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ module Mount
2
+ module Command
3
+ class RedHat < Linux
4
+ def install(package)
5
+ cmd = "yum -y install #{package}"
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Mount
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.2'
3
3
  end
@@ -4,20 +4,21 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'mount/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "mount"
7
+ spec.name = 'mount'
8
8
  spec.version = Mount::VERSION
9
- spec.authors = ["Kentaro Kuribayashi"]
10
- spec.email = ["kentarok@gmail.com"]
9
+ spec.authors = ['Kentaro Kuribayashi']
10
+ spec.email = ['kentarok@gmail.com']
11
11
  spec.description = %q{Common foundation of DevOps tools}
12
12
  spec.summary = %q{Common foundation of DevOps tools}
13
- spec.homepage = ""
14
- spec.license = "MIT"
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
19
+ spec.require_paths = ['lib']
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake"
21
+ spec.add_development_dependency 'bundler', '~> 1.3'
22
+ spec.add_development_dependency 'rake'
23
+ spec.add_development_dependency 'rspec'
23
24
  end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe Mount::Command::Base do
4
+ subject { described_class.new }
5
+
6
+ describe '#escape' do
7
+ it { expect(subject.escape('foo|bar')).to be == 'foo\|bar' }
8
+ end
9
+
10
+ describe '#install' do
11
+ it {
12
+ expect { subject.install('httpd') }.to raise_error(Mount::Command::NotImplementedError)
13
+ }
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe Mount::Command::Linux do
4
+ subject { described_class.new }
5
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Mount::Command::RedHat do
4
+ subject { described_class.new }
5
+
6
+ describe '#install' do
7
+ it {
8
+ expect(subject.install('httpd')).to be == "yum -y install httpd"
9
+ }
10
+ end
11
+ end
@@ -0,0 +1 @@
1
+ require_relative '../lib/mount'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mount
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaro Kuribayashi
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: Common foundation of DevOps tools
42
56
  email:
43
57
  - kentarok@gmail.com
@@ -46,13 +60,22 @@ extensions: []
46
60
  extra_rdoc_files: []
47
61
  files:
48
62
  - .gitignore
63
+ - .travis.yml
49
64
  - Gemfile
50
65
  - LICENSE.txt
51
66
  - README.md
52
67
  - Rakefile
53
68
  - lib/mount.rb
69
+ - lib/mount/command.rb
70
+ - lib/mount/command/base.rb
71
+ - lib/mount/command/linux.rb
72
+ - lib/mount/command/redhat.rb
54
73
  - lib/mount/version.rb
55
74
  - mount.gemspec
75
+ - spec/lib/mount/command/base_spec.rb
76
+ - spec/lib/mount/command/linux_spec.rb
77
+ - spec/lib/mount/command/redhat_spec.rb
78
+ - spec/spec_helper.rb
56
79
  homepage: ''
57
80
  licenses:
58
81
  - MIT
@@ -77,4 +100,8 @@ rubygems_version: 2.0.3
77
100
  signing_key:
78
101
  specification_version: 4
79
102
  summary: Common foundation of DevOps tools
80
- test_files: []
103
+ test_files:
104
+ - spec/lib/mount/command/base_spec.rb
105
+ - spec/lib/mount/command/linux_spec.rb
106
+ - spec/lib/mount/command/redhat_spec.rb
107
+ - spec/spec_helper.rb