dep 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.1 +115 -0
- data/bin/dep +2 -2
- metadata +5 -5
- data/README +0 -89
data/README.1
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "DEP" "1" "April 2012" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBDEP\fR \- basic dependency tracking
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
.
|
11
|
+
.nf
|
12
|
+
|
13
|
+
dep check
|
14
|
+
dep add libname [\-\-pre]
|
15
|
+
dep rm libname
|
16
|
+
dep install
|
17
|
+
.
|
18
|
+
.fi
|
19
|
+
.
|
20
|
+
.SH "DESCRIPTION"
|
21
|
+
.
|
22
|
+
.TP
|
23
|
+
check
|
24
|
+
Checks that all dependencies are met\.
|
25
|
+
.
|
26
|
+
.TP
|
27
|
+
add
|
28
|
+
Fetches the latest version of the library in question and automatically adds it to your \.gems file\.
|
29
|
+
.
|
30
|
+
.TP
|
31
|
+
rm
|
32
|
+
Simply removes the corresponding entry in your \.gems file\.
|
33
|
+
.
|
34
|
+
.TP
|
35
|
+
install
|
36
|
+
Installs all the missing dependencies for you\. An important point here is that it simply does a \fBgem install\fR for each dependency you have\. Dep assumes that you use some form of sandboxing like gs, RVM or rbenv\-gemset\.
|
37
|
+
.
|
38
|
+
.SH "INSTALLATION"
|
39
|
+
.
|
40
|
+
.nf
|
41
|
+
|
42
|
+
$ gem install dep
|
43
|
+
.
|
44
|
+
.fi
|
45
|
+
.
|
46
|
+
.SH "HISTORY"
|
47
|
+
dep is actually more of a workflow than a tool\. If you think about package managers and the problem of dependencies, you can summarize what you absolutely need from them in just two points:
|
48
|
+
.
|
49
|
+
.IP "1." 4
|
50
|
+
When you build an application which relies on 3rd party libraries, it\'s best to explicitly declare the version numbers of these libraries\.
|
51
|
+
.
|
52
|
+
.IP "2." 4
|
53
|
+
You can either bundle the specific library version together with your application, or you can have a list of versions\.
|
54
|
+
.
|
55
|
+
.IP "" 0
|
56
|
+
.
|
57
|
+
.P
|
58
|
+
The first approach is handled by vendoring the library\. The second approach typically is done using Bundler\. But why do you need such a complicated tool when all you need is simply listing version numbers?
|
59
|
+
.
|
60
|
+
.P
|
61
|
+
We dissected what we were doing and eventually reached the following workflow:
|
62
|
+
.
|
63
|
+
.IP "1." 4
|
64
|
+
We maintain a \.gems file for every application which lists the libraries and the version numbers\.
|
65
|
+
.
|
66
|
+
.IP "2." 4
|
67
|
+
We omit dependencies of dependencies in that file, the reason being is that that should already be handled by the package manager (typically rubygems)\.
|
68
|
+
.
|
69
|
+
.IP "3." 4
|
70
|
+
Whenever we add a new library, we add the latest version\.
|
71
|
+
.
|
72
|
+
.IP "4." 4
|
73
|
+
When we pull the latest changes, we want to be able to rapidly check if the dependencies we have is up to date and matches what we just pulled\.
|
74
|
+
.
|
75
|
+
.IP "" 0
|
76
|
+
.
|
77
|
+
.P
|
78
|
+
So after doing this workflow manually for a while, we decided to build the simplest tool to aid us with our workflow\.
|
79
|
+
.
|
80
|
+
.IP "\(bu" 4
|
81
|
+
The first point is handled implicitly by dep\. You can also specify a different file by doing dep \-f\.
|
82
|
+
.
|
83
|
+
.IP "\(bu" 4
|
84
|
+
The second point is more of an implementation detail\. We thought about doing dependencies, but then, why re\-implement something that\'s already done for you by rubygems?
|
85
|
+
.
|
86
|
+
.IP "\(bu" 4
|
87
|
+
The third point (and also the one which is most inconvenient), is handled by dep add\.
|
88
|
+
.
|
89
|
+
.IP "" 0
|
90
|
+
.
|
91
|
+
.P
|
92
|
+
The manual workflow for \fBdep add\fR would be:
|
93
|
+
.
|
94
|
+
.IP "" 4
|
95
|
+
.
|
96
|
+
.nf
|
97
|
+
|
98
|
+
gem search \-r "^ohm$" [\-\-pre] # check and remember the version number
|
99
|
+
echo "ohm \-v X\.x\.x" >> \.gems
|
100
|
+
.
|
101
|
+
.fi
|
102
|
+
.
|
103
|
+
.IP "" 0
|
104
|
+
.
|
105
|
+
.P
|
106
|
+
If you try doing that repeatedly, it will quickly become cumbersome\.
|
107
|
+
.
|
108
|
+
.P
|
109
|
+
The fourth and final point is handled by typing dep check or simply dep\. Practically speaking it\'s just:
|
110
|
+
.
|
111
|
+
.P
|
112
|
+
\fBgit pull dep\fR
|
113
|
+
.
|
114
|
+
.P
|
115
|
+
And that\'s it\. The dep command typically happens in 0\.2 seconds which is something we LOVE\.
|
data/bin/dep
CHANGED
@@ -5,7 +5,7 @@ require_relative "../lib/dep"
|
|
5
5
|
require "fileutils"
|
6
6
|
require "clap"
|
7
7
|
|
8
|
-
help = File.expand_path("../README", File.dirname(__FILE__))
|
8
|
+
help = File.expand_path("../README.1", File.dirname(__FILE__))
|
9
9
|
file = nil
|
10
10
|
|
11
11
|
commands = Clap.run ARGV,
|
@@ -72,7 +72,7 @@ end
|
|
72
72
|
|
73
73
|
commands = Clap.run commands,
|
74
74
|
"--pre" => lambda { @prerelease = true },
|
75
|
-
"--help" => lambda { exec "
|
75
|
+
"--help" => lambda { exec "man #{help}" }
|
76
76
|
|
77
77
|
Clap.run commands,
|
78
78
|
"add" => method(:add),
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-03
|
13
|
+
date: 2012-04-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: clap
|
17
|
-
requirement: &
|
17
|
+
requirement: &70133804725260 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: 0.0.2
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70133804725260
|
26
26
|
description: Specify your project's dependencies in one file.
|
27
27
|
email:
|
28
28
|
- cyx.ucron@gmail.com
|
@@ -32,7 +32,7 @@ executables:
|
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
|
-
- README
|
35
|
+
- README.1
|
36
36
|
- bin/dep
|
37
37
|
- lib/dep.rb
|
38
38
|
- test/dep.rb
|
data/README
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
DEP(1)
|
2
|
-
|
3
|
-
NAME
|
4
|
-
dep -- Basic dependency tracking
|
5
|
-
|
6
|
-
SYNOPSIS
|
7
|
-
dep check
|
8
|
-
dep add libname [--pre]
|
9
|
-
dep rm libname
|
10
|
-
dep install
|
11
|
-
|
12
|
-
DESCRIPTION
|
13
|
-
check
|
14
|
-
Checks that all dependencies are met.
|
15
|
-
|
16
|
-
add
|
17
|
-
Fetches the latest version of the library in question
|
18
|
-
and automatically adds it to your .gems file.
|
19
|
-
|
20
|
-
rm
|
21
|
-
Simply removes the corresponding entry in your .gems file.
|
22
|
-
|
23
|
-
install
|
24
|
-
Installs all the missing dependencies for you. An important
|
25
|
-
point here is that it simply does a `gem install` for each
|
26
|
-
dependency you have. Dep assumes that you use some form of
|
27
|
-
sandboxing like RVM or rbenv-gemset.
|
28
|
-
|
29
|
-
|
30
|
-
INSTALLATION
|
31
|
-
$ gem install dep
|
32
|
-
|
33
|
-
HISTORY
|
34
|
-
dep is actually more of a workflow than a tool. If you think about
|
35
|
-
package managers and the problem of dependencies, you can summarize
|
36
|
-
what you absolutely need from them in just two points:
|
37
|
-
|
38
|
-
1. When you build an application which relies on 3rd party libraries,
|
39
|
-
it's best to explicitly declare the version numbers of these
|
40
|
-
libraries.
|
41
|
-
|
42
|
-
2. You can either bundle the specific library version together with
|
43
|
-
your application, or you can have a list of versions.
|
44
|
-
|
45
|
-
The first approach is handled by vendoring the library. The second
|
46
|
-
approach typically is done using Bundler. But why do you need such
|
47
|
-
a complicated tool when all you need is simply listing version numbers?
|
48
|
-
|
49
|
-
We dissected what we were doing and eventually reached the following
|
50
|
-
workflow:
|
51
|
-
|
52
|
-
1. We maintain a .gems file for every application which lists the
|
53
|
-
libraries and the version numbers.
|
54
|
-
2. We omit dependencies of dependencies in that file, the reason being
|
55
|
-
is that that should already be handled by the package manager
|
56
|
-
(typically rubygems).
|
57
|
-
3. Whenever we add a new library, we add the latest version.
|
58
|
-
4. When we pull the latest changes, we want to be able to rapidly
|
59
|
-
check if the dependencies we have is up to date and matches what
|
60
|
-
we just pulled.
|
61
|
-
|
62
|
-
So after doing this workflow manually for a while, we decided to
|
63
|
-
build the simplest tool to aid us with our workflow.
|
64
|
-
|
65
|
-
The first point is handled implicitly by dep. You can also specify
|
66
|
-
a different file by doing dep -f.
|
67
|
-
|
68
|
-
The second point is more of an implementation detail. We thought about
|
69
|
-
doing dependencies, but then, why re-implement something that's already
|
70
|
-
done for you by rubygems?
|
71
|
-
|
72
|
-
The third point (and also the one which is most inconvenient), is
|
73
|
-
handled by dep add.
|
74
|
-
|
75
|
-
The manual workflow for that would be:
|
76
|
-
|
77
|
-
gem search -r "^ohm$" [--pre] # check and remember the version number
|
78
|
-
echo "ohm -v X.x.x" >> .gems
|
79
|
-
|
80
|
-
If you try doing that repeatedly, it will quickly become cumbersome.
|
81
|
-
|
82
|
-
The fourth and final point is handled by typing dep check or simply dep.
|
83
|
-
Practically speaking it's just:
|
84
|
-
|
85
|
-
git pull
|
86
|
-
dep
|
87
|
-
|
88
|
-
And that's it. The dep command typcially happens in 0.2 seconds which
|
89
|
-
is something we LOVE.
|