zsh_dots 0.5.9 → 0.6.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.
@@ -62,9 +62,6 @@ alias gts='git reset --soft'
62
62
  compdef _get gt=git-reset
63
63
  alias gthh='git reset --hard HEAD'
64
64
  compdef _get gt=git-reset
65
- alias garc='ga . && grc'
66
- compdef _get garc=git-add
67
- compdef _get garc=git-rebase
68
65
 
69
66
  # Stash
70
67
  alias gs='git stash save'
@@ -87,6 +84,9 @@ alias gmt='git mergetool'
87
84
  compdef _get gmt=git-mergetool
88
85
  alias gcf='git clean -f'
89
86
  compdef _get gcf=git-clean
87
+ alias garc='gcf && ga . && grc' # a big one..., clean the repo, add everything, rebase --continue
88
+ compdef _get garc=git-add
89
+ compdef _get garc=git-rebase
90
90
 
91
91
  # Super useful alias aliases
92
92
  alias s='gst'
@@ -0,0 +1,12 @@
1
+ # Heroku plugin
2
+ #
3
+ # A tool for managing continuous deployment from Travis to Heroku.
4
+
5
+ # Load Heroku config
6
+ source ~/.dots/config/heroku.zsh
7
+
8
+ # Secure your API key on Travis, so it can be uploaded to CI and
9
+ # used to deploy your Heroku app.
10
+ function secure_api_key() {
11
+ travis encrypt $1 HEROKU_API_KEY=$HEROKU_API_KEY
12
+ }
@@ -1,36 +1,34 @@
1
+ require 'dots/packages'
2
+
1
3
  module Dots
2
4
  module Bootstrap
3
5
  include Thor::Actions
4
6
 
5
- # These are the programs we are going to download from Homebrew.
6
- PROGRAMS = %w(git ruby python vim pip hub)
7
- PACKAGES = %w(httpie aws)
8
-
9
7
  # Install C binaries, Python programs, and other useful tools
10
- # from Homebrew.
8
+ # from Homebrew. Install Homebrew if it isn't already installed,
9
+ # then recursively call this method to install packages.
11
10
  def install_programs
12
11
  if installed? "brew"
13
- programs_to_install = PROGRAMS.reduce([]) { |programs, program|
14
- programs << program unless installed? program
15
- }.join " "
16
-
17
- system "brew install #{programs_to_install}" \
18
- unless programs_to_install.empty?
19
- install_packages
12
+ install_packages and install_configuration
13
+ elsif @homebrew.present? # make sure we're not in an infinite loop
14
+ puts "WARNING: Homebrew can not install. Exiting.." and exit(1)
20
15
  else
16
+ @homebrew = true # used when the if statement fails twice
21
17
  install_homebrew and install_programs
22
18
  end
23
19
  end
24
20
 
25
- # Install the latest version of all gems to the global gemset. These
26
- # gems are configured in +~/.Gemfile+.
27
- def install_bundle
28
- system "cd && #{install_bundler} && #{install_global_gemset}"
21
+ # When Homebrew is installed, use it to install Python and Ruby, then
22
+ # install necessary packages for Python and Ruby.
23
+ def install_packages
24
+ %w(system python ruby).each { |l| send "install_#{l}_packages" }
29
25
  end
30
26
 
31
- # Install Python packages from pip. Pip!
32
- def install_packages
33
- system "pip install #{PACKAGES.join(' ')}"
27
+ # Install configuration file templates that for one reason or another
28
+ # we can't include in the repo directly. Usually due to exposed passwords
29
+ # or API keys.
30
+ def install_configuration
31
+ system "mkdir -p ~/.irssi && cp -R ~/.dots/etc/irssi/** ~/.irssi"
34
32
  end
35
33
 
36
34
  private
@@ -38,17 +36,39 @@ module Dots
38
36
  `which #{command}` != ""
39
37
  end
40
38
 
41
- def install_bundler
42
- "gem install bundler"
39
+ def installed_and_not_ruby? command
40
+ installed?(command) && command != 'ruby'
43
41
  end
44
42
 
45
- def install_global_gemset
46
- "gem install #{Dots.gems}"
47
- end
48
-
49
- # Install the latest version of the Homebrew package manager.
50
43
  def install_homebrew
51
44
  %x[ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"]
52
45
  end
46
+
47
+ def install_system_packages
48
+ programs_to_install = system_packages.reduce([]) { |programs, program|
49
+ programs << program unless installed_and_not_ruby? program
50
+ }.join " "
51
+
52
+ system "brew install #{programs_to_install}" \
53
+ unless programs_to_install.empty?
54
+ end
55
+
56
+ def install_ruby_packages
57
+ "gem install #{ruby_packages}"
58
+ end
59
+
60
+ def install_python_packages
61
+ system "pip install #{python_packages}"
62
+ end
63
+
64
+ %w(system python ruby).each do |language|
65
+ define_method "#{language}_packages" do
66
+ packages.for language
67
+ end
68
+ end
69
+
70
+ def packages
71
+ @packages ||= Packages.new
72
+ end
53
73
  end
54
74
  end
@@ -0,0 +1,19 @@
1
+ require 'yaml'
2
+
3
+ module Dots
4
+ # Represents the config/packages.yml file.
5
+ class Packages
6
+ def initialize
7
+ @config = YAML::load_file from_yaml_file_path
8
+ end
9
+
10
+ def for language
11
+ @config[language]
12
+ end
13
+
14
+ private
15
+ def from_yaml_file_path
16
+ File.expand_path("~/.dots/config/packages.yml")
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module Dots
2
- VERSION = "0.5.9"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: zsh_dots
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.9
5
+ version: 0.6.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tom Scott
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-07 00:00:00.000000000 Z
12
+ date: 2013-01-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  type: :runtime
@@ -82,6 +82,7 @@ files:
82
82
  - config/gemrc
83
83
  - config/gitconfig
84
84
  - config/gitignore
85
+ - config/heroku.zsh.example
85
86
  - config/muttrc.example
86
87
  - config/osx.zsh
87
88
  - config/railsrc
@@ -91,6 +92,16 @@ files:
91
92
  - config/vimrc
92
93
  - config/zshenv
93
94
  - config/zshrc
95
+ - etc/irssi/config
96
+ - etc/irssi/config.example
97
+ - etc/irssi/default.theme
98
+ - etc/irssi/nickserv.networks
99
+ - etc/irssi/scripts/autorun/freenode_filter.pl
100
+ - etc/irssi/scripts/autorun/nickserv.pl
101
+ - etc/irssi/scripts/autorun/trigger.pl
102
+ - etc/irssi/scripts/autorun/vim_mode.pl
103
+ - etc/irssi/solarized-universal.theme
104
+ - etc/irssi/triggers
94
105
  - etc/mandlebrot.c
95
106
  - etc/rails/composer.yml
96
107
  - etc/rails/ember_template.rb
@@ -110,6 +121,7 @@ files:
110
121
  - lib/plugins/git-flow/git-flow.plugin.zsh
111
122
  - lib/plugins/git-process/git-process.plugin.zsh
112
123
  - lib/plugins/git/git.plugin.zsh
124
+ - lib/plugins/heroku/heroku.plugin.zsh
113
125
  - lib/plugins/knife/_knife
114
126
  - lib/plugins/knife/knife.plugin.zsh
115
127
  - lib/plugins/macvim/macvim.plugin.zsh
@@ -124,6 +136,7 @@ files:
124
136
  - lib/ruby/dots/dot_file.rb
125
137
  - lib/ruby/dots/installation.rb
126
138
  - lib/ruby/dots/installer.rb
139
+ - lib/ruby/dots/packages.rb
127
140
  - lib/ruby/dots/persistence.rb
128
141
  - lib/ruby/dots/sanity.rb
129
142
  - lib/ruby/dots/version.rb
@@ -152,16 +165,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
152
165
  - !ruby/object:Gem::Version
153
166
  segments:
154
167
  - 0
155
- hash: -2237897093631442027
168
+ hash: -4117296198963250433
156
169
  version: '0'
157
170
  required_rubygems_version: !ruby/object:Gem::Requirement
158
171
  none: false
159
172
  requirements:
160
173
  - - ! '>='
161
174
  - !ruby/object:Gem::Version
162
- segments:
163
- - 0
164
- hash: -2237897093631442027
165
175
  version: '0'
166
176
  requirements: []
167
177
  rubyforge_project: