itamae-plugin-recipe-homebrew 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 580992f46b0b7df149a92cc6c85a402cf49da679
4
+ data.tar.gz: 99f7ea680c1d00936a19c0f46a7fda32f14352ff
5
+ SHA512:
6
+ metadata.gz: 769bf81253449f1a8c8261d303d4333ad200b7e4daf9c47a4490f81ceaf4c103dfa3945692f54f7de7be8896413f93244b41481d2a3448d68d6c7401df263cf4
7
+ data.tar.gz: b89f5fda8516f1380248e65e301d9d9a88f9c82a74d19823f140c2235b64b5c47136e38f65d5bd3bf1a527aeac1ca9354bae82c9ad68be9708901b3bce6342ae
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ .idea
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in itamae-plugin-recipe-homebrew.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 fukuiretu
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,103 @@
1
+ # itamae-plugin-recipe-homebrew
2
+
3
+ Plugin to support the HomeBrew for [Itamae](https://github.com/itamae-kitchen/itamae)
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'itamae-plugin-recipe-homebrew'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install itamae-plugin-recipe-homebrew
20
+
21
+ ## Usage
22
+
23
+ ### Recipe
24
+
25
+ ##### your recipe example
26
+ ```ruby
27
+ include_recipe 'homebrew::package'
28
+ include_recipe 'homebrew::cask'
29
+ ```
30
+
31
+ ### Node
32
+ case was an example the yaml
33
+
34
+ ##### your node example
35
+ ```yaml
36
+ brew:
37
+ enable_update: false
38
+ enable_upgrade: false
39
+ add_repositories:
40
+ - homebrew/dupes
41
+ - homebrew/versions
42
+ - homebrew/binary
43
+ - peco/peco
44
+ - motemen/ghq
45
+ install_packages:
46
+ - brew-cask
47
+ - coreutils
48
+ - findutils
49
+ - zsh
50
+ - bash
51
+ - vim
52
+ - tmux
53
+ - git
54
+ - hub
55
+ - tig
56
+ - ghq
57
+ - imagemagick
58
+ - wget
59
+ - rsync
60
+ - curl
61
+ - tree
62
+ - openssl
63
+ - libyaml
64
+ - readline
65
+ - markdown
66
+ - jq
67
+ - peco
68
+ - ctags
69
+ - rbenv
70
+ - ruby-build
71
+ - mysql
72
+ - postgresql
73
+ - node
74
+ - redis
75
+ - rbenv
76
+ - ruby-build
77
+ install_apps:
78
+ - google-chrome
79
+ - iterm2
80
+ - virtualbox
81
+ - vagrant
82
+ - vagrant-manager
83
+ - google-japanese-ime
84
+ - dash
85
+ - github
86
+ - xtrafinder
87
+ - appcleaner
88
+ - bettertouchtool
89
+ ```
90
+ ##### Description of Option
91
+ * ** enable_update ** : run the `brew update` If true
92
+ * ** enable_upgrade ** : run the `brew upgrade` If true
93
+ * ** add_repositories ** : run the `brew tap XXXXX`. To specify the repositories you want to add an array
94
+ * ** install_packages ** : run the `brew install XXXXX`. To specify the packages you want to add an array
95
+ * ** install_apps ** : run the `brew cask instal`. To specify the applications you want to add an array
96
+
97
+ ## Contributing
98
+
99
+ 1. Fork it ( https://github.com/[my-github-username]/itamae-plugin-recipe-homebrew/fork )
100
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
101
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
102
+ 4. Push to the branch (`git push origin my-new-feature`)
103
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'itamae/plugin/recipe/homebrew/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "itamae-plugin-recipe-homebrew"
8
+ spec.version = Itamae::Plugin::Recipe::Homebrew::VERSION
9
+ spec.authors = ["fukuiretu"]
10
+ spec.email = ["s0232101@gmail.com"]
11
+ spec.summary = %q{Plugin to support the HomeBrew for Itamae}
12
+ spec.description = %q{Plugin to support the HomeBrew for Itamae}
13
+ spec.homepage = "https://github.com/fukuiretu/itamae-plugin-recipe-homebrew"
14
+ spec.files = `git ls-files -z`.split("\x0")
15
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
+ spec.require_paths = ["lib"]
18
+
19
+ spec.add_development_dependency "bundler", "~> 1.7"
20
+ spec.add_development_dependency "rake", "~> 10.0"
21
+ end
@@ -0,0 +1,9 @@
1
+ module Itamae
2
+ module Plugin
3
+ module Recipe
4
+ module Homebrew
5
+ # Your code goes here...
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ include_recipe 'common.rb'
2
+
3
+ execute 'Install brew-cask' do
4
+ command 'brew install caskroom/cask/brew-cask'
5
+ not_if 'brew list | grep -q brew-cask'
6
+ end
7
+
8
+ # Install apps
9
+ install_apps = node['brew']['install_apps']
10
+ install_apps.each do |app|
11
+ execute "Install application: #{app}" do
12
+ command "brew cask install #{app} --appdir=\'/Applications\'"
13
+ not_if "brew cask list | grep -q #{app}"
14
+ end
15
+ end
16
+
17
+ # Setup alfred
18
+ if install_apps.include?(:alfred)
19
+ execute 'Setup alfred' do
20
+ command 'brew cask alfred link'
21
+ end
22
+ end
@@ -0,0 +1,35 @@
1
+ BREW_INSTALL_URL = 'https://raw.githubusercontent.com/Homebrew/install/master/install'
2
+
3
+ # Install brew
4
+ execute "Install brew" do
5
+ command "ruby -e \"$(curl -fsSL #{BREW_INSTALL_URL})\""
6
+ not_if "test $(which brew)"
7
+ end
8
+
9
+ # Update brew
10
+ enable_update = node['brew']['enable_update'] ? node['brew']['enable_update'] : false
11
+ if enable_update
12
+ execute 'Update brew' do
13
+ command 'brew update'
14
+ end
15
+ else
16
+ Logger.info('Execution skipped Update brew because of not true enable_update')
17
+ end
18
+
19
+ # Upgrade brew
20
+ enable_upgrade = node['brew']['enable_upgrade'] ? node['brew']['enable_upgrade'] : false
21
+ if enable_upgrade
22
+ execute 'Upgrade brew' do
23
+ command 'brew upgrade'
24
+ end
25
+ else
26
+ Logger.info('Execution skipped Upgrade brew because of not true enable_upgrade')
27
+ end
28
+
29
+ # Add Repository
30
+ node['brew']['add_repositories'].each do |repo|
31
+ execute "Add Repository: #{repo}" do
32
+ command "brew tap #{repo}"
33
+ not_if "brew tap | grep -q #{repo}"
34
+ end
35
+ end
@@ -0,0 +1,9 @@
1
+ include_recipe 'common.rb'
2
+
3
+ # Install bin packages
4
+ node['brew']['install_packages'].each do |package|
5
+ execute "Install package: #{package}" do
6
+ command "brew install #{package}"
7
+ not_if "brew list | grep -q #{package}"
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Itamae
2
+ module Plugin
3
+ module Recipe
4
+ module Homebrew
5
+ VERSION = "0.0.1"
6
+ end
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-plugin-recipe-homebrew
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - fukuiretu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Plugin to support the HomeBrew for Itamae
42
+ email:
43
+ - s0232101@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - itamae-plugin-recipe-homebrew.gemspec
54
+ - lib/itamae/plugin/recipe/homebrew.rb
55
+ - lib/itamae/plugin/recipe/homebrew/cask.rb
56
+ - lib/itamae/plugin/recipe/homebrew/common.rb
57
+ - lib/itamae/plugin/recipe/homebrew/package.rb
58
+ - lib/itamae/plugin/recipe/homebrew/version.rb
59
+ homepage: https://github.com/fukuiretu/itamae-plugin-recipe-homebrew
60
+ licenses: []
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.4.5
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Plugin to support the HomeBrew for Itamae
82
+ test_files: []