bindep 0.0.2 → 0.0.3
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 +4 -4
- data/.travis.yml +4 -0
- data/README.md +28 -13
- data/lib/bindep/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee6ed55686db360e2a2a4a5c137b5f421b473388
|
4
|
+
data.tar.gz: 43a4ee0c2cfe047fda0391d82ed398ac7c449f0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15f6333eaba044bff9f5913ef9e0d8c42e7eca18815c746ab3ab48a8564c8a638a82d81e7230621753894a6d77b6d69bae63ec4cae610691ae8594483661c511
|
7
|
+
data.tar.gz: 2f54dc546eb7a19554a3459fd010cb45c8def9b1631180bf27b1bf169b5b8e756b4994ec5a899c17dfd449b5d2d48fdd1c6c49605a8b53ff5b8c1883b2669d90
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -2,22 +2,25 @@
|
|
2
2
|
|
3
3
|
A simple way to manage binary dependencies for multiple platforms.
|
4
4
|
|
5
|
-
[](http://badge.fury.io/rb/bindep)
|
6
|
+
[](https://travis-ci.org/dziemba/bindep)
|
7
|
+
[](https://codeclimate.com/github/dziemba/bindep)
|
6
8
|
|
7
9
|
## Example
|
8
10
|
|
9
11
|
To install git and complile some less code:
|
12
|
+
|
10
13
|
``` ruby
|
11
14
|
|
12
|
-
require
|
13
|
-
require
|
15
|
+
require "bindep"
|
16
|
+
require "bindep/library"
|
14
17
|
|
15
18
|
# prompt user to install git if it is not available, do nothing otherwise
|
16
|
-
Bindep.check
|
19
|
+
Bindep.check :git
|
17
20
|
|
18
21
|
# prompt to install less compiler if it is not available,
|
19
22
|
# then run it with given parameters
|
20
|
-
css_code, stderr = Bindep.run :less,
|
23
|
+
css_code, stderr = Bindep.run :less, "-x -", less_code
|
21
24
|
```
|
22
25
|
|
23
26
|
## Installation
|
@@ -31,36 +34,39 @@ gem install bindep
|
|
31
34
|
## Usage
|
32
35
|
|
33
36
|
Load the gem:
|
37
|
+
|
34
38
|
``` ruby
|
35
39
|
require "bindep" # core module
|
36
40
|
require "bindep/library" # predefined packages (optional)
|
37
41
|
```
|
38
42
|
|
39
43
|
Check if a package is available and prompt the user to install it otherwise:
|
44
|
+
|
40
45
|
``` ruby
|
41
|
-
Bindep.check
|
46
|
+
Bindep.check :git
|
42
47
|
```
|
43
48
|
|
44
49
|
Run commands (`run` calls `check` automatically):
|
50
|
+
|
45
51
|
``` ruby
|
46
52
|
# syntax
|
47
53
|
stdout, stderr, exitcode = Bindep.run :package, stdin, raise_on_error
|
48
54
|
|
49
55
|
# no exception on failure
|
50
|
-
css_code, stderr, exitcode = Bindep.run :less,
|
51
|
-
css_code =
|
56
|
+
css_code, stderr, exitcode = Bindep.run :less, "-x -", less_code, false
|
57
|
+
css_code = "" unless exitcode.zero?
|
52
58
|
|
53
59
|
# raise on failure
|
54
60
|
begin
|
55
|
-
output, stderr = Bindep.run :git,
|
61
|
+
output, stderr = Bindep.run :git, "status"
|
56
62
|
puts output
|
57
63
|
rescue RuntimeError
|
58
|
-
puts
|
64
|
+
puts "Git failed!"
|
59
65
|
end
|
60
|
-
|
61
66
|
```
|
62
67
|
|
63
68
|
Define new packages and check/install them:
|
69
|
+
|
64
70
|
``` ruby
|
65
71
|
Bindep.define(:npm) do |i|
|
66
72
|
i.command = "npm"
|
@@ -78,8 +84,8 @@ Bindep.check :lessc
|
|
78
84
|
```
|
79
85
|
|
80
86
|
Combine `define` and `check`:
|
81
|
-
``` ruby
|
82
87
|
|
88
|
+
``` ruby
|
83
89
|
Bindep.check(:git) do |i|
|
84
90
|
i.command = "npm"
|
85
91
|
i.apt = "git-core"
|
@@ -91,8 +97,9 @@ end
|
|
91
97
|
## Command Line Usage
|
92
98
|
|
93
99
|
Create a `Bindepfile` in your project root using the same syntax:
|
100
|
+
|
94
101
|
``` ruby
|
95
|
-
check
|
102
|
+
check :less
|
96
103
|
|
97
104
|
check(:git) do |i|
|
98
105
|
i.command = "npm"
|
@@ -105,6 +112,13 @@ end
|
|
105
112
|
and execute it by running `bindep` in your shell.
|
106
113
|
|
107
114
|
|
115
|
+
You can also parse a `Bindepfile` from your code using:
|
116
|
+
|
117
|
+
``` ruby
|
118
|
+
Bindep.load_file 'MyBindepfile'
|
119
|
+
```
|
120
|
+
|
121
|
+
|
108
122
|
## Configuration
|
109
123
|
Add any of the following lines to your code before running any bindep commands.
|
110
124
|
|
@@ -120,6 +134,7 @@ Bindep.silent_exceptions = true
|
|
120
134
|
```
|
121
135
|
|
122
136
|
You can also set these in your `Bindepfile` by adding any of the following before the commands:
|
137
|
+
|
123
138
|
``` ruby
|
124
139
|
@no_install = true
|
125
140
|
@no_confirm_before_install = true
|
data/lib/bindep/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bindep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Niko Dziemba
|
@@ -144,3 +144,4 @@ test_files:
|
|
144
144
|
- spec/bindep/library_spec.rb
|
145
145
|
- spec/bindep/os_spec.rb
|
146
146
|
- spec/spec_helper.rb
|
147
|
+
has_rdoc:
|