mixlibrary-core 0.0.7 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29b7daf4dfe4ce619b65889d56f2c8051cb8f0f6
4
- data.tar.gz: fc25b1fc92bbec848ac840718b0fd86fb29fe15b
3
+ metadata.gz: e161abbbcca04d006e06559fbed443a5602d0d37
4
+ data.tar.gz: 1fe374424d663b81675a8114795e34e4ad8fdfbb
5
5
  SHA512:
6
- metadata.gz: e29c2c882bd14cf58717e32eebf3b4949961d3c051e61323661dff38a4ddab0ae49319d8a1b93cd895f8af8ca90db233df7b75bf01b36bb5eb6d66297555f0ed
7
- data.tar.gz: 438a865f30cf68cc405bcdefbf526aa52b897a1cf9b407cfe58ce664d598559b421571a513336bd9a81c560f1312beb3356e4a8d10ecc793f9fc286a0c7d0061
6
+ metadata.gz: 2c6f17e72e968658327bc3a5b8b5aa7cfdf14c00e51cda94c3efa45da40af18f2657153e0bde40e09594f13aa738f8e11de8d68b28423f7478e755c7f615bd8e
7
+ data.tar.gz: f2eb2b2779480bb4af88503dec0451bf2c2eba67908141e26be1ad7d09b8a988df433a2c7097d954a03bee782e92cea2271c1a27ba63538d3aad6bae3c01eba2
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Mixlibrary-Core
2
- [![Build Status Master](https://api.travis-ci.org/ebsco/mixlibrary-core.svg?branch=master)](https://travis-ci.org/ebsco/mixlibrary-core)
2
+ [![GitHub](http://img.shields.io/badge/github-ebsco/mixlibrary-blue.svg)](https://github.com/ebsco/mixlibrary-core)
3
+ [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/mixlibrary-core/frames)
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/mixlibrary-core.svg)](https://github.com/ebsco/mixlibrary-core/releases)
6
+ [![Build Status](https://api.travis-ci.org/ebsco/mixlibrary-core.svg?branch=master)](https://travis-ci.org/ebsco/mixlibrary-core)
7
+ [![License](http://img.shields.io/badge/license-Apache2-yellowgreen.svg)](https://github.com/ebsco/mixlibrary-core/blob/master/LICENSE.txt)
3
8
 
4
9
  Wraps some provider functionality from chef into easily consumable ruby classes that do not have the extra baggage of being dependent on Chef data objects. Node object, Environment etc.
5
10
 
@@ -17,6 +22,9 @@ Or install it yourself as:
17
22
 
18
23
  $ gem install mixlibrary-core
19
24
 
25
+ ## How to Install via Chef Recipe
26
+ * [Recipe Install Sample](https://github.com/ebsco/mixlibrary-core/blob/master/Samples/SampleRecipeDeployment.rb)
27
+
20
28
  ## Documentation
21
29
  * Uses yard to document classes and methods. Generate docs or automatic documentation: http://www.rubydoc.info
22
30
  * rake doc
@@ -40,10 +40,18 @@ module Mixlibrary
40
40
 
41
41
  private
42
42
 
43
+ EXIT_STATUS_EXITCONVERSION = <<-EOF
44
+ \#This function changes the exit code as desired back to ruby code.
45
+ function exit-mixlibpowershell([int] $exitcode){
46
+ [Environment]::Exit($exitcode)
47
+ }
48
+ EOF
49
+
43
50
  EXIT_STATUS_EXCEPTION_HANDLER= <<-EOF
44
51
  trap [Exception]{
52
+ write-error "Trapped in Trap Exception block" -erroraction continue;
45
53
  write-error -exception ($_.Exception.Message) -erroraction continue;
46
- exit 1
54
+ exit-mixlibpowershell 1
47
55
  }
48
56
  EOF
49
57
 
@@ -56,17 +64,19 @@ module Mixlibrary
56
64
  #Generally speaking this is the best way to handle this situation. We will need to determine if there are many dependent scripts
57
65
  #that depend on being able to set this setting.
58
66
  EXIT_STATUS_INTIALIZATION= <<-EOF
67
+
59
68
  Set-Variable -Name ERRORACTIONPREFERENCE -Value "STOP" -Scope Script -Option "ReadOnly" -force
60
69
  \#$ErrorActionPreference="STOP"
61
70
  try{
62
71
  EOF
63
72
 
64
73
  EXIT_STATUS_POST= <<-EOF
65
- exit $LASTEXITCODE
74
+ exit-mixlibpowershell $LASTEXITCODE
66
75
  }
67
76
  catch{
77
+ write-error "Trapped in Catch block" -erroraction continue;
68
78
  write-error -exception ($_.Exception) -erroraction continue;
69
- exit 1
79
+ exit-mixlibpowershell 1
70
80
  }
71
81
  EOF
72
82
 
@@ -85,6 +95,7 @@ module Mixlibrary
85
95
 
86
96
  def finalscript
87
97
  changed_script =
98
+ EXIT_STATUS_EXITCONVERSION +
88
99
  EXIT_STATUS_EXCEPTION_HANDLER +
89
100
  EXIT_STATUS_RESET_SCRIPT +
90
101
  EXIT_STATUS_INTIALIZATION +
@@ -5,6 +5,14 @@ module Mixlibrary
5
5
  module Utilities
6
6
  class RubyInfo
7
7
 
8
+ def self.windows?
9
+ if RUBY_PLATFORM =~ /mswin|mingw|windows/
10
+ true
11
+ else
12
+ false
13
+ end
14
+ end
15
+
8
16
  def self.architecture
9
17
  #x64-mingw32
10
18
  #i386-mingw32
@@ -1,4 +1,5 @@
1
- require 'win32/api' if Chef::Platform.windows?
1
+ require 'mixlibrary/core/utilities/ruby_info'
2
+ require 'win32/api' if Mixlibrary::Core::Utilities::RubyInfo.windows?
2
3
 
3
4
  module Mixlibrary
4
5
  module Core
@@ -1,6 +1,6 @@
1
1
  module Mixlibrary
2
2
  module Core
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.12"
4
4
  NAME = "mixlibrary-core"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixlibrary-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Carpenter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-17 00:00:00.000000000 Z
11
+ date: 2015-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,44 +70,36 @@ dependencies:
70
70
  name: minitest-reporters
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '1.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '1.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: chef
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
88
- - !ruby/object:Gem::Version
89
- version: '11.16'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ~>
87
+ - - '>='
95
88
  - !ruby/object:Gem::Version
96
89
  version: '11.16'
97
- - !ruby/object:Gem::Dependency
98
- name: win32-api
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - '>='
90
+ - - <
102
91
  - !ruby/object:Gem::Version
103
- version: 1.5.1
92
+ version: '13'
104
93
  type: :runtime
105
94
  prerelease: false
106
95
  version_requirements: !ruby/object:Gem::Requirement
107
96
  requirements:
108
97
  - - '>='
109
98
  - !ruby/object:Gem::Version
110
- version: 1.5.1
99
+ version: '11.16'
100
+ - - <
101
+ - !ruby/object:Gem::Version
102
+ version: '13'
111
103
  description: 'MixLib for creating Core libraries in ruby for automating machines. This
112
104
  is an abstraction away from using Chef Providers directly to give us access to the
113
105
  lower layers of Chef implementation to meet additional use cases. '
@@ -132,7 +124,7 @@ files:
132
124
  - lib/mixlibrary/core/utilities/windows_architecture_helper.rb
133
125
  - lib/mixlibrary/core/version.rb
134
126
  - lib/mixlibrary/core/windows/features.rb
135
- homepage: ''
127
+ homepage: https://www.ebsco.com/
136
128
  licenses:
137
129
  - Apache2
138
130
  metadata: {}
@@ -149,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
141
  requirements:
150
142
  - - '>='
151
143
  - !ruby/object:Gem::Version
152
- version: '0'
144
+ version: '2.4'
153
145
  requirements: []
154
146
  rubyforge_project:
155
147
  rubygems_version: 2.4.1
@@ -157,4 +149,3 @@ signing_key:
157
149
  specification_version: 4
158
150
  summary: MixLib for creating Core libraries in ruby for automating machines.
159
151
  test_files: []
160
- has_rdoc: