brewdler 1.0.1 → 1.1.0

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: 967b3a6268e8f67a23b985f4a6269836e578a824
4
- data.tar.gz: 7053cb13c56593ca327b6669218927b34d83f1ce
3
+ metadata.gz: 106ab55ce4b0e92b47fe011bb840813cbb0f1fd3
4
+ data.tar.gz: 47833bd685835fb9a30be438b704a6734ef09bf7
5
5
  SHA512:
6
- metadata.gz: bbc63150f1bdc2024e754bd4fba76e57f64f2e9b74857a41e3589e1252eca07881e9b3bcc4d960dd624c8a319924e6e9fa23d597ffeb585fcf9fdf2c9dc496a2
7
- data.tar.gz: 1ed3edcd6bc54e449c37f3dd18bc82ceb4669de3d004c77faac5490ef04660c739989317174d2a1406dfea879f2ade245936e78769f63a952145d47ff8bbb264
6
+ metadata.gz: b95d60ec0147ed1dddf577f5c02a702c20d87e0c79cb63d379a52631dc6361e6fe37edd40a0d01f1b276acdfb045d065f2cc408a2a3370e05fe67fd2c87b2615
7
+ data.tar.gz: 5e7dcb94eef69decd88af31966daad7efb9efe67eb2add6af9c41f0fdceba62b06c5e5f814c9113d143ffb3163ce3c82a189b85722157141f4f39189adda6782
data/.travis.yml CHANGED
@@ -1,13 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
3
  - 1.9.3
5
4
  - 2.0.0
6
- - ruby-head
7
- - jruby-19mode
8
- - jruby-head
9
- - rbx-18mode
10
- - rbx-19mode
11
- matrix:
12
- allow_failures:
13
- - rvm: ruby-head
5
+ - 2.2.0
6
+ sudo: false
7
+ cache: bundler
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Andrew Nesbitt
1
+ Copyright (c) 2014 Andrew Nesbitt
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
17
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
19
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Readme.mdown CHANGED
@@ -29,6 +29,7 @@ then create a `Brewfile` in the root of your project:
29
29
  Then list your homebrew based dependencies in your `Brewfile`:
30
30
 
31
31
  tap 'phinze/cask'
32
+ brew 'emacs', args: ['cocoa', 'srgb', 'with-gnutls']
32
33
  brew 'redis'
33
34
  brew 'mongodb'
34
35
  brew 'sphinx'
@@ -1,8 +1,15 @@
1
1
  module Brewdler
2
2
  class BrewInstaller
3
- def self.install(name)
3
+ def self.install(name, options = {})
4
4
  if system 'brew info'
5
- `brew install #{name}`
5
+ command = "brew install #{name}"
6
+ unless options[:args].nil?
7
+ options[:args].each do |arg|
8
+ command << " --#{arg}"
9
+ end
10
+ end
11
+
12
+ `#{command}`
6
13
  else
7
14
  raise "Unable to install #{name}. Homebrew is not currently installed on your system"
8
15
  end
@@ -6,7 +6,7 @@ module Brewdler::Commands
6
6
  rescue Errno::ENOENT => e
7
7
  raise "No Brewfile found"
8
8
  rescue NameError
9
- brewfile.find_all do |name|
9
+ brewfile.split("\n").each do |name|
10
10
  name.chomp!
11
11
  Brewdler::BrewInstaller.install(name) if name.length > 0 && name !~ /^ *#/
12
12
  end
data/lib/brewdler/dsl.rb CHANGED
@@ -5,11 +5,11 @@ module Brewdler
5
5
  end
6
6
 
7
7
  def process
8
- instance_eval(@input)
8
+ eval(@input)
9
9
  end
10
10
 
11
- def brew(name)
12
- Brewdler::BrewInstaller.install(name)
11
+ def brew(name, options={})
12
+ Brewdler::BrewInstaller.install(name, options)
13
13
  end
14
14
 
15
15
  def cask(name)
@@ -1,3 +1,3 @@
1
1
  module Brewdler
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
data/spec/dsl_spec.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Brewdler::Dsl do
4
- let(:dsl) { Brewdler::Dsl.new("tap 'phinze/cask'\nbrew 'git'\ncask 'google-chrome'") }
4
+ let(:dsl) { Brewdler::Dsl.new("tap 'phinze/cask'\nbrew 'git'\ncask 'google-chrome'\nbrew 'emacs', args: ['cocoa', 'srgb', 'with-gnutls']") }
5
5
 
6
6
  it "processes input" do
7
7
  dsl.should_receive(:tap).with('phinze/cask')
8
- dsl.should_receive(:brew).with('git')
8
+ dsl.should_receive(:brew).twice
9
9
  dsl.should_receive(:cask).with('google-chrome')
10
10
  dsl.process
11
11
  end
@@ -9,11 +9,15 @@ describe Brewdler::Commands::Install do
9
9
 
10
10
  context "when a Brewfile is found" do
11
11
  it "does not raise an error" do
12
+ Brewdler::BrewInstaller.stub(:install).and_return(true)
13
+ Brewdler::CaskInstaller.stub(:install).and_return(true)
14
+ Brewdler::RepoInstaller.stub(:install).and_return(true)
15
+
12
16
  File.stub(:read).and_return("tap 'phinze/cask'\nbrew 'git'\ncask 'google-chrome'")
13
- expect { Brewdler::Commands::Install.run }.to_not raise_error('No Brewfile found')
17
+ expect { Brewdler::Commands::Install.run }.to_not raise_error
14
18
 
15
19
  File.stub(:read => 'git', :open => ['git'])
16
- expect { Brewdler::Commands::Install.run }.to_not raise_error('No Brewfile found')
20
+ expect { Brewdler::Commands::Install.run }.to_not raise_error
17
21
  end
18
22
  end
19
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brewdler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
@@ -10,20 +10,20 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-08 00:00:00.000000000 Z
13
+ date: 2014-12-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: commander
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
19
+ - - '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ">="
26
+ - - '>='
27
27
  - !ruby/object:Gem::Version
28
28
  version: '0'
29
29
  - !ruby/object:Gem::Dependency
@@ -44,56 +44,56 @@ dependencies:
44
44
  name: rspec
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
47
+ - - ~>
48
48
  - !ruby/object:Gem::Version
49
49
  version: 2.99.0
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - "~>"
54
+ - - ~>
55
55
  - !ruby/object:Gem::Version
56
56
  version: 2.99.0
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: rake
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ">="
61
+ - - '>='
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ">="
68
+ - - '>='
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: simplecov
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - ">="
75
+ - - '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ">="
82
+ - - '>='
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: coveralls
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ">="
89
+ - - '>='
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - ">="
96
+ - - '>='
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  description:
@@ -106,9 +106,9 @@ executables:
106
106
  extensions: []
107
107
  extra_rdoc_files: []
108
108
  files:
109
- - ".gitignore"
110
- - ".rspec"
111
- - ".travis.yml"
109
+ - .gitignore
110
+ - .rspec
111
+ - .travis.yml
112
112
  - CONTRIBUTING.md
113
113
  - Gemfile
114
114
  - LICENSE
@@ -136,17 +136,17 @@ require_paths:
136
136
  - lib
137
137
  required_ruby_version: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - ">="
139
+ - - '>='
140
140
  - !ruby/object:Gem::Version
141
141
  version: 1.9.2
142
142
  required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - ">="
144
+ - - '>='
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
148
  rubyforge_project:
149
- rubygems_version: 2.2.2
149
+ rubygems_version: 2.0.14
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: Bundler for non-ruby dependencies from homebrew