macadmin 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +2 -2
- data/Rakefile +53 -1
- data/lib/macadmin/version.rb +52 -2
- data/macadmin.gemspec +1 -1
- data/version.yaml +4 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a48ae5d56edef9dd6c136441321eef6b4907f78
|
4
|
+
data.tar.gz: c925b3370dfa6287eebd8f37525beec9657dfe5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe05741aef8121c7abd66e733fa6036af77b72cfd5d3b17180a295c6de5438f699bedc175af0713994d503c3fc8a1fa35c2bcaf6b93a28e9a9ba913a351d8f53
|
7
|
+
data.tar.gz: 71ffede8618654c50957542dff7e740018edb2af7a25fdb265a932ec5e6a1078f45b225db759cc7eaab378464290d18ea50efa2cffd1f72eb6f316d77a32b06b
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/macadmin.png)](http://badge.fury.io/rb/macadmin) [![Code Climate](https://codeclimate.com/github/dayglojesus/macadmin.png)](https://codeclimate.com/github/dayglojesus/macadmin)
|
2
|
+
|
1
3
|
# MacAdmin
|
2
4
|
|
3
5
|
Gem to assist in performing common systems administration tasks in OS X
|
4
6
|
|
5
|
-
## Version: 0.0.4
|
6
|
-
|
7
7
|
## About
|
8
8
|
|
9
9
|
MacAdmin endeavors to provide an OO programming interface for constituent OS X system resources. It's comprised of classes with the ability to parse Apple Property Lists (CFPropertyList) and manipulate them as native Ruby objects. The classes work directly with the Property Lists used to abstract OS X system resources -- users, groups, computers, computergroups, etc. -- bypassing the common utilities and APIs normally reserved for this kind of work.
|
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rspec/core/rake_task"
|
3
3
|
require "macadmin/common"
|
4
|
+
require "macadmin/version"
|
4
5
|
|
5
6
|
# Only build the extension for Mountian Lion or better
|
6
7
|
if MacAdmin::Common::MAC_OS_X_PRODUCT_VERSION > 10.7
|
@@ -20,4 +21,55 @@ end
|
|
20
21
|
RSpec::Core::RakeTask.new
|
21
22
|
|
22
23
|
task :default => :spec
|
23
|
-
task :test
|
24
|
+
task :test => :spec
|
25
|
+
|
26
|
+
# macadmin tasks
|
27
|
+
namespace :macadmin do
|
28
|
+
|
29
|
+
desc "Publish the macadmin gem"
|
30
|
+
task :publish => [:fix_perms, :release]
|
31
|
+
|
32
|
+
desc "Fix permissions on Gem"
|
33
|
+
task :fix_perms do
|
34
|
+
require 'find'
|
35
|
+
Find.find(File.expand_path("./")) do |path|
|
36
|
+
FileUtils.chmod(0755, path) if FileTest.directory?(path)
|
37
|
+
FileUtils.chmod(0644, path) if FileTest.file?(path)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
desc "Cleans out any elements of the gem build compile process"
|
42
|
+
task :clean do
|
43
|
+
require 'fileutils'
|
44
|
+
files = ["./lib/macadmin/password", "./tmp", "./pkg", "./vendor"]
|
45
|
+
files.each do |obj|
|
46
|
+
FileUtils.rm_rf(File.expand_path(obj))
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Version handling tasks
|
51
|
+
desc "Bump the patch version number"
|
52
|
+
task :bump_version_patch do
|
53
|
+
MacAdmin::VERSION.bump_patch
|
54
|
+
MacAdmin::VERSION.save
|
55
|
+
`git add ./version.yaml`
|
56
|
+
`git commit -m "bump patch version, #{MacAdmin::VERSION.to_s}"`
|
57
|
+
end
|
58
|
+
|
59
|
+
desc "Bump the minor version number"
|
60
|
+
task :bump_version_minor do
|
61
|
+
MacAdmin::VERSION.bump_minor
|
62
|
+
MacAdmin::VERSION.save
|
63
|
+
`git add ./version.yaml`
|
64
|
+
`git commit -m "bump minor version, #{MacAdmin::VERSION.to_s}"`
|
65
|
+
end
|
66
|
+
|
67
|
+
desc "Bump the major version number"
|
68
|
+
task :bump_version_major do
|
69
|
+
MacAdmin::VERSION.bump_major
|
70
|
+
MacAdmin::VERSION.save
|
71
|
+
`git add ./version.yaml`
|
72
|
+
`git commit -m "bump major version, #{MacAdmin::VERSION.to_s}"`
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
data/lib/macadmin/version.rb
CHANGED
@@ -1,8 +1,58 @@
|
|
1
1
|
module MacAdmin
|
2
|
-
VERSION = '0.0.4'
|
3
2
|
|
3
|
+
# Version
|
4
|
+
# - Class for working with the version number
|
5
|
+
class Version
|
6
|
+
|
7
|
+
require 'yaml'
|
8
|
+
|
9
|
+
FILE = File.expand_path('version.yaml')
|
10
|
+
|
11
|
+
attr_accessor :major, :minor, :patch
|
12
|
+
|
13
|
+
# Create from String
|
14
|
+
# - ie. "0.0.1"
|
15
|
+
def self.init_with_string(version)
|
16
|
+
@major, @minor, @patch = version.split(".").each(&:to_i)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Init from a YAML file
|
20
|
+
def self.load_yaml_file(file = FILE)
|
21
|
+
YAML.load_file FILE
|
22
|
+
end
|
23
|
+
|
24
|
+
# Returns a version String
|
25
|
+
def to_s
|
26
|
+
"#{@major}.#{@minor}.#{@patch}"
|
27
|
+
end
|
28
|
+
|
29
|
+
# Increment the major version number
|
30
|
+
def bump_major
|
31
|
+
@major += 1
|
32
|
+
end
|
33
|
+
|
34
|
+
# Increment the minor version number
|
35
|
+
def bump_minor
|
36
|
+
@minor += 1
|
37
|
+
end
|
38
|
+
|
39
|
+
# Increment the patch version number
|
40
|
+
def bump_patch
|
41
|
+
@patch += 1
|
42
|
+
end
|
43
|
+
|
44
|
+
# Serialize the object to YAML file
|
45
|
+
def save(file = FILE)
|
46
|
+
File.open(file, 'w') { |f| f.write self.to_yaml }
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
VERSION = Version.load_yaml_file
|
52
|
+
|
53
|
+
# Return a formatted string containing the Gem's name and version
|
4
54
|
def self.version_string
|
5
|
-
"macadmin version, #{MacAdmin::VERSION}"
|
55
|
+
"macadmin version, #{MacAdmin::VERSION.to_s}"
|
6
56
|
end
|
7
57
|
|
8
58
|
end
|
data/macadmin.gemspec
CHANGED
data/version.yaml
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: macadmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Warsing
|
@@ -178,6 +178,7 @@ files:
|
|
178
178
|
- spec/shadowhash_spec.rb
|
179
179
|
- spec/spec_helper.rb
|
180
180
|
- spec/user_spec.rb
|
181
|
+
- version.yaml
|
181
182
|
homepage: http://github.com/dayglojesus/macadmin
|
182
183
|
licenses:
|
183
184
|
- MIT
|