dev_osx_updater 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a98d0161a7791f0018f5361406bd774c95179081
4
- data.tar.gz: 2885ee8e8ad42703f382148a2e7efcdebd0f43ab
3
+ metadata.gz: 18545acb63f3a29f29a598482aa1db3528fddf1a
4
+ data.tar.gz: 90b5475c8e02572328d34d052bf4f3766da355cf
5
5
  SHA512:
6
- metadata.gz: f32cc61e0d4c93a48a69e697cbfdd26857b89cc79f13b9ba3d9127659c685861abe317aa8c8892f95f6d5c255209a77f73a2a30375a2684b804ffef55d3e8b28
7
- data.tar.gz: ee02c2ad62bf24363b2af22172c26b6c8b2b48f143d8bc35169b7e1d7b923629ae28415fac2a729b11ff6c258d4d8b97ef8c0d70cafbb1250b79aa7caa083ac7
6
+ metadata.gz: b35ecc0efa19b2c7acb287a87fa98c6705bce32f1721d13a690a7887594246e70295eec4d134c6a0eb478579f96a7751844f151689c8c5a0c2651ec7995cbbe5
7
+ data.tar.gz: d0ed3cb26ad1769f3724c366c681820b1c6e2dd56e9222c76a7956ba1658fdc25e1cc920e886237cebad358fc2d032274df389966ff4514e6f4dde22d793aa14
data/README.md CHANGED
@@ -1,38 +1,48 @@
1
- # DevOsxUpdater
1
+ Mac OSX Ruby / Rails development environment updater
2
+ ====================================================
2
3
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dev_osx_updater`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+ [![Join the chat at https://gitter.im/cbarratt/mac_system_update](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cbarratt/mac_system_update?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
+ ### Compatability
6
7
 
7
- ## Installation
8
+ * Ruby 2.1+ (this is due to Refinements changing a lot)
8
9
 
9
- Add this line to your application's Gemfile:
10
+ The script will check and update any of the following if installed:
10
11
 
11
- ```ruby
12
- gem 'dev_osx_updater'
13
- ```
12
+ * Rubygems gem
13
+ * Bundler gem
14
+ * OhMyZsh (performs git pull)
15
+ * Homebrew (performs brew update - NOT upgrade, there's a future feature in there to be done for upgrading)
16
+ * RVM (rvm get stable)
17
+ * rbenv (performs git pull)
18
+ * Mac App Store (Lists out all available MAS updates, currently doesn't have the functionality to install)
14
19
 
15
- And then execute:
20
+ It also has the ability to cleanup old versions of Homebrew installed software and RVM sources/gems.
16
21
 
17
- $ bundle
22
+ # Usage
18
23
 
19
- Or install it yourself as:
24
+ You can automatically run all checks and updates by passing `--auto`, for example:
20
25
 
21
- $ gem install dev_osx_updater
26
+ `dev_osx_update --auto`
22
27
 
23
- ## Usage
28
+ Install
29
+ -------
24
30
 
25
- TODO: Write usage instructions here
31
+ Simply:
26
32
 
27
- ## Development
33
+ `gem install dev_osx_updater`
28
34
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
35
+ **NOTE: Please restart your terminal to activate the bin!**
30
36
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
37
+ Then run:
38
+
39
+ `dev_osx_update`
40
+
41
+ ![ScreenShot](http://files.bolser.co.uk/files/Screen%20Shot%202014-10-23%20at%2016.40.25.png)
32
42
 
33
43
  ## Contributing
34
44
 
35
- 1. Fork it ( https://github.com/[my-github-username]/dev_osx_updater/fork )
45
+ 1. Fork it ( https://github.com/cbarratt/dev_osx_updater/fork )
36
46
  2. Create your feature branch (`git checkout -b my-new-feature`)
37
47
  3. Commit your changes (`git commit -am 'Add some feature'`)
38
48
  4. Push to the branch (`git push origin my-new-feature`)
data/lib/brew.rb CHANGED
@@ -5,7 +5,7 @@ class Brew
5
5
  end
6
6
 
7
7
  def cleanup
8
- puts 'Cleanup of Homebrew packages'.colorize(:light_white).bold
8
+ cleanup_message('Homebrew')
9
9
  if run?
10
10
  Open3.popen3('brew cleanup') do |stdin, stdout|
11
11
  output = stdout.read
@@ -1,3 +1,3 @@
1
1
  module DevOsxUpdater
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
data/lib/osx.rb CHANGED
@@ -1,12 +1,14 @@
1
+ require 'dev_osx_updater/version'
2
+
1
3
  class OSX
2
4
  using StringExtensions
3
5
 
4
6
  class << self
5
7
  def intro
6
- puts <<-EOS.undent.colorize(:light_white)
7
- ##################
8
- # Mac OSX checks #
9
- ##################
8
+ puts <<-EOS.undent
9
+ -------------------
10
+ # OSX Maintenance #
11
+ -------------------
10
12
  EOS
11
13
  break_output
12
14
  end
@@ -20,7 +22,10 @@ class OSX
20
22
 
21
23
  break_output
22
24
 
23
- puts <<-EOS.undent.colorize(:light_white).bold
25
+ puts <<-EOS.undent.bold
26
+ Mac OSX updater version: #{DevOsxUpdater::VERSION}
27
+ ------------------------------
28
+
24
29
  System information:
25
30
  - CPU: #{cpu}
26
31
  - OSX: #{osx}
@@ -52,7 +57,7 @@ class OSX
52
57
  end
53
58
 
54
59
  def repair_disk_permissions
55
- puts '# Repairing OSX disk permissions'
60
+ puts '| Repairing OSX disk permissions'.bold
56
61
  if run?
57
62
  Open3.popen2e('diskutil repairPermissions /') do |stdin, stdout_err, wait_thr|
58
63
  while line = stdout_err.gets
@@ -66,6 +71,7 @@ class OSX
66
71
  end
67
72
  else
68
73
  puts ' - Skipped.'.colorize(:red)
74
+ break_output
69
75
  end
70
76
  end
71
77
  end
data/lib/rvm.rb CHANGED
@@ -14,7 +14,7 @@ class RVM
14
14
  end
15
15
 
16
16
  def cleanup
17
- puts 'Cleanup of RVM data'.colorize(:light_white).bold
17
+ cleanup_message('RVM')
18
18
  if run?
19
19
  begin
20
20
  PTY.spawn('rvm cleanup all') do |stdin, stdout, stderr, thread|
data/lib/system.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  $LOAD_PATH << File.expand_path('..', __FILE__)
2
- # require_relative 'lib'
3
2
 
4
3
  # Gems
5
4
  require 'colorize'
data/lib/utility.rb CHANGED
@@ -28,7 +28,11 @@ def file_or_folder_exists?(file)
28
28
  end
29
29
 
30
30
  def check_update_message(app)
31
- puts "Checking #{app} for updates...".colorize(:light_white).bold
31
+ puts "| Checking #{app} for updates...".bold
32
+ end
33
+
34
+ def cleanup_message(app)
35
+ puts "| Cleaning up #{app}".bold
32
36
  end
33
37
 
34
38
  def break_output
@@ -36,14 +40,10 @@ def break_output
36
40
  end
37
41
 
38
42
  def yes_or_no
39
- begin
40
- system('stty raw -echo')
41
- str = STDIN.getc
42
- ensure
43
- system('stty -raw echo')
44
- end
43
+ str = gets.chomp
44
+
45
45
  if str == 'y'
46
- puts ' - Performing...'
46
+ puts ' - Performing...'.colorize(:light_cyan)
47
47
  return true
48
48
  elsif str == 'n'
49
49
  return false
@@ -53,10 +53,8 @@ def yes_or_no
53
53
  end
54
54
 
55
55
  def run?
56
- if System::Update::AUTO_RUN == '--auto'
57
- return true
58
- else
59
- puts ' - Do you want to perform this action? (y/n)'
60
- yes_or_no
61
- end
56
+ return true if System::Update::AUTO_RUN == '--auto'
57
+
58
+ print " - Do you want to perform this action? (y/n) "
59
+ yes_or_no
62
60
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_osx_updater
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
  - Callum Barratt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-20 00:00:00.000000000 Z
11
+ date: 2015-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.9'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '10.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '10.0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: pry
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,8 +52,8 @@ dependencies:
66
52
  - - ">="
67
53
  - !ruby/object:Gem::Version
68
54
  version: '0'
69
- description: Keep your development tools up to date like homebrew, zsh with an easy
70
- run all script.
55
+ description: Keep your development tools such as homebrew, zsh, rubygems etc up to
56
+ date with a simple informative script.
71
57
  email:
72
58
  - callum@bolser.co.uk
73
59
  executables:
@@ -109,5 +95,5 @@ rubyforge_project:
109
95
  rubygems_version: 2.4.7
110
96
  signing_key:
111
97
  specification_version: 4
112
- summary: Updates todays Ruby/Rails development tools used for developers.
98
+ summary: Updates Ruby/Rails development related tools and software.
113
99
  test_files: []