myosx 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e7bfbabdbf0e86b9ee43c186991b062f4965ad9b
4
+ data.tar.gz: 725d89a4345da3bc7d0104f48456d998a7f0683e
5
+ SHA512:
6
+ metadata.gz: 47c7a795f5f301b9dc75e52d5d44e8f701d6fc009cf44eb88ec1f13c0ea9a909935896e4e202801bfbd0019bd51cbb75e1bcf21a5c3a4ddb592428a46c4b0e3e
7
+ data.tar.gz: b4971e248a9773b595c132bad23be5d06d73554c96eafc51f6b31b323a2d80a1570e8c168cbc9336ebbbcc37dc916f362018e9a414322f16132041398bb51f98
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.3
5
+ before_install: gem install bundler -v 1.13.6
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at surminus@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'git'
4
+ gem 'rake'
5
+ gem 'rspec'
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Laura Martin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Myosx
2
+
3
+ myosx configures osx how I like it.
4
+
5
+ ## Setup
6
+
7
+ 1. Install XCode
8
+ 2. [Install homebrew](http://brew.sh/)
9
+ 3. `bundle install`
10
+
11
+ ## Usage
12
+
13
+ Notes on how to test before it's a gem. Clone repo and from inside:
14
+
15
+ `RUBYLIB=$(pwd)/lib bin/myosx`
16
+
17
+ ## Config
18
+
19
+ You can set two key configs from environment variables:
20
+
21
+ ### Config file
22
+ `MYOSX_CONFIG`
23
+
24
+ If this isn't set then it defaults to `~/.myosx.cnf`
25
+
26
+ Use the example config file to set some things (`example.myosx.cnf`)
27
+
28
+ ### Workspace directory
29
+ `MYOSX_WORKSPACE`
30
+
31
+ This is where everything is stored such as Brewfiles and any other repositories
32
+ that it may pull.
33
+
34
+
35
+ ## Contributing
36
+
37
+ Bug reports and pull requests are welcome on GitHub at https://github.com/surminus/myosx. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
38
+
39
+
40
+ ## License
41
+
42
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
43
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "myosx"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/myosx ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "myosx"
4
+
5
+ Myosx::Bootstrap.new
6
+
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/example.myosx.cnf ADDED
@@ -0,0 +1,95 @@
1
+ ---
2
+ # Manage your dotfiles
3
+ dotfiles:
4
+ manage: true
5
+ repo: 'https://github.com/surminus/dotfiles.git'
6
+ files:
7
+ ackrc: '~/.ackrc'
8
+ gitconfig: '~/.gitconfig'
9
+ vimrc: '~/.vimrc'
10
+ zshrc: '~/.zshrc'
11
+
12
+ # Manage homebrew packages
13
+ homebrew:
14
+ manage: true
15
+ packages:
16
+ brew:
17
+ - 'ack'
18
+ - 'autoconf'
19
+ - 'awscli'
20
+ - 'coreutils'
21
+ - 'libgpg-error'
22
+ - 'libassuan'
23
+ - 'libgcrypt'
24
+ - 'libksba'
25
+ - 'pth'
26
+ - 'dirmngr'
27
+ - 'libpng'
28
+ - 'freetype'
29
+ - 'gmp'
30
+ - 'isl'
31
+ - 'mpfr'
32
+ - 'libmpc'
33
+ - 'gcc'
34
+ - 'gdbm'
35
+ - 'gettext'
36
+ - 'git'
37
+ - 'gnu-getopt'
38
+ - 'gnu-tar'
39
+ - 'pinentry'
40
+ - 'gpg-agent'
41
+ - 'libusb'
42
+ - 'libusb-compat'
43
+ - 'gnupg2'
44
+ - 'go'
45
+ - 'hub'
46
+ - 'jpeg'
47
+ - 'libtiff'
48
+ - 'libtool'
49
+ - 'perl'
50
+ - 'xz'
51
+ - 'imagemagick'
52
+ - 'oniguruma'
53
+ - 'jq'
54
+ - 'libyaml'
55
+ - 'node'
56
+ - 'openssl'
57
+ - 'pwgen'
58
+ - 'tree'
59
+ - 'pass'
60
+ - 'pcre'
61
+ - 'pkg-config'
62
+ - 'readline'
63
+ - 'sqlite'
64
+ - 'python'
65
+ - 'ruby-build'
66
+ - 'ruby'
67
+ - 'vim'
68
+ - 'wget'
69
+ - 'zsh'
70
+ cask:
71
+ - 'alfred'
72
+ - 'bittorrent'
73
+ - 'Caskroom'
74
+ - 'facter'
75
+ - 'google-cloud-sdk'
76
+ - 'gpgtools'
77
+ - 'osxfuse'
78
+ - 'puppet'
79
+ - 'tuntap'
80
+ - 'virtualbox'
81
+ - 'vmware-fusion'
82
+ - 'xscreensaver'
83
+ tap:
84
+ - 'caskroom/cask'
85
+
86
+ rbenv:
87
+ manage: true
88
+ versions:
89
+ - '1.9.3'
90
+ - '1.9.3-p550'
91
+ - '2.0.0'
92
+ - '2.0.0-p648'
93
+ - '2.2.2'
94
+ - '2.3.0'
95
+ - '2.3.1'
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # Config class
3
+ #
4
+ require 'yaml'
5
+ require 'git'
6
+
7
+ class Config
8
+ def initialize
9
+ config_location = ENV['MYOSX_CONFIG'] || '~/.myosx.cnf'
10
+ config_file = File.expand_path(config_location)
11
+ raise "Cannot find config file: #{config_file}" unless File.exist?(config_file)
12
+ $global_config = YAML.load_file(config_file)
13
+ $workspace = workspace_directory
14
+ end
15
+
16
+ def workspace_directory
17
+ workspace_dir_name = ENV['MYOSX_WORKSPACE'] || '~/.myosx/'
18
+ return File.expand_path(workspace_dir_name)
19
+ end
20
+
21
+ def create_workspace
22
+ unless Dir.exists?($workspace)
23
+ puts "Creating workspace: #{workspace_directory}"
24
+ Dir.mkdir("#{workspace_directory}", 0750)
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'yaml'
4
+ require 'git'
5
+ require_relative 'config'
6
+
7
+ class Dotfiles < Config
8
+ def initialize
9
+ @config = $global_config['dotfiles']
10
+ end
11
+
12
+ def dotfiledir
13
+ File.join($workspace, 'dotfiles')
14
+ end
15
+
16
+ def repo(repo)
17
+ if Git.ls_remote(repo)
18
+ unless File.exist?(dotfiledir)
19
+ puts "Cloning #{dotfile_repo}"
20
+ Git.clone(repo, 'dotfiles', :path => $workspace)
21
+ else
22
+ g = Git.init(dotfiledir)
23
+ puts "Pulling latest #{repo}"
24
+ g.pull
25
+ end
26
+ end
27
+ end
28
+
29
+ def link(file, dest)
30
+ source_file = "#{dotfiledir}/#{file}"
31
+
32
+ dest = File.expand_path(dest)
33
+ raise "#{source_file} doesn't exist! Check your config or repo" unless File.exist?(source_file)
34
+
35
+ if File.exist?(dest)
36
+ File.delete(dest)
37
+ end
38
+
39
+ puts "Linking #{source_file} to #{dest}"
40
+ File.symlink(source_file, dest)
41
+ end
42
+
43
+ def exec
44
+ if @config['manage']
45
+ if repo(@config['repo'])
46
+ @config['files'].each do |k, v|
47
+ link(k, v)
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Class which configures homebrew and brew bundle
4
+ #
5
+ require 'yaml'
6
+ require 'git'
7
+ require_relative 'config'
8
+
9
+ class Homebrew < Config
10
+ def initialize
11
+ @config = $global_config['homebrew']
12
+ end
13
+
14
+ def bundle
15
+ system("brew tap Homebrew/bundle")
16
+ puts "Updating Brewfile"
17
+ packages = @config['packages']
18
+ brew_packages = packages['brew']
19
+ tap_packages = packages['tap']
20
+ cask_packages = packages['cask']
21
+
22
+ File.open(File.join($workspace, 'Brewfile'), "w+") do |f|
23
+ brew_packages.each { |p| f.puts "brew '#{p}'" }
24
+ tap_packages.each { |p| f.puts "tap '#{p}'" }
25
+ cask_packages.each { |p| f.puts "cask '#{p}'" }
26
+ end
27
+ brewfile = File.join($workspace, 'Brewfile')
28
+
29
+ puts "Installing packages from #{brewfile}"
30
+ system("brew bundle --file=#{brewfile}")
31
+ end
32
+
33
+ def exec
34
+ if @config['manage']
35
+ bundle
36
+ end
37
+ end
38
+ end
data/lib/myosx/hub.rb ADDED
File without changes
data/lib/myosx/pass.rb ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env ruby
2
+ # Configures my password store
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Class which installs rbenv packages, and installs ruby versions
4
+ #
5
+ # This class does not add the shims path to your shell or manage any aliases
6
+ #
7
+ require 'yaml'
8
+ require_relative 'config'
9
+
10
+ class Rbenv < Config
11
+ def initialize
12
+ @config = $global_config['rbenv']
13
+ end
14
+
15
+ def install
16
+ packages = ['rbenv', 'rbenv-aliases', 'rbenv-bundler']
17
+ packages.each do |pkg|
18
+ unless system("brew list #{pkg} >/dev/null 2>&1")
19
+ puts "Installing #{pkg}"
20
+ system("brew install #{pkg}")
21
+ end
22
+ end
23
+
24
+ versions = @config['versions']
25
+ puts "Checking Ruby version:"
26
+ versions.each do |version|
27
+ puts " #{version}"
28
+ system("rbenv install #{version} --skip-existing")
29
+ end
30
+ end
31
+
32
+ def exec
33
+ if @config['manage']
34
+ install
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env ruby
2
+ # Class which configures oh-my-zsh
@@ -0,0 +1,3 @@
1
+ module Myosx
2
+ VERSION = "0.1.0"
3
+ end
data/lib/myosx.rb ADDED
@@ -0,0 +1,16 @@
1
+ require "myosx/version"
2
+ require "myosx/config"
3
+ require "myosx/dotfiles"
4
+ require "myosx/homebrew"
5
+ require "myosx/rbenv"
6
+
7
+ module Myosx
8
+ class Bootstrap
9
+ def initialize
10
+ Config.new.create_workspace
11
+ Dotfiles.new.exec
12
+ Homebrew.new.exec
13
+ Rbenv.new.exec
14
+ end
15
+ end
16
+ end
data/myosx.gemspec ADDED
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'myosx/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "myosx"
8
+ spec.version = Myosx::VERSION
9
+ spec.authors = ["Laura Martin"]
10
+ spec.email = ["surminus@gmail.com"]
11
+
12
+ spec.summary = %q{myosx configures OSX how I like it}
13
+ spec.homepage = "https://github.com/surminus/myosx."
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
+ f.match(%r{^(test|spec|features)/})
18
+ end
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.13"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rspec", "~> 3.0"
26
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: myosx
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Laura Martin
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-03-18 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.13'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.13'
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
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description:
56
+ email:
57
+ - surminus@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".travis.yml"
64
+ - CODE_OF_CONDUCT.md
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - bin/console
70
+ - bin/myosx
71
+ - bin/setup
72
+ - example.myosx.cnf
73
+ - lib/myosx.rb
74
+ - lib/myosx/config.rb
75
+ - lib/myosx/dotfiles.rb
76
+ - lib/myosx/homebrew.rb
77
+ - lib/myosx/hub.rb
78
+ - lib/myosx/pass.rb
79
+ - lib/myosx/rbenv.rb
80
+ - lib/myosx/shell.rb
81
+ - lib/myosx/version.rb
82
+ - myosx.gemspec
83
+ homepage: https://github.com/surminus/myosx.
84
+ licenses:
85
+ - MIT
86
+ metadata: {}
87
+ post_install_message:
88
+ rdoc_options: []
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ requirements: []
102
+ rubyforge_project:
103
+ rubygems_version: 2.5.1
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: myosx configures OSX how I like it
107
+ test_files: []